Critical issue: a function description is missing a word
(1) By Michael Matloka (MatlokaM) on 2021-10-05 22:18:22 updated by 1.1 [link] [source]
Hey! I was reading SQLite's code just to get a feel for its B-tree implementation, when I noticed a weirdly worded piece of a comment. I presume it's simply missing a single word: "This can if" → "This can happen if". Here's the diff to fix it: ``` --- src/btree.c +++ src/btree.c @@ -8498,11 +8498,11 @@ /* ** Return SQLITE_CORRUPT if any cursor other than pCur is currently valid ** on the same B-tree as pCur. ** -** This can if a database is corrupt with two or more SQL tables +** This can happen if a database is corrupt with two or more SQL tables ** pointing to the same b-tree. If an insert occurs on one SQL table ** and causes a BEFORE TRIGGER to do a secondary insert on the other SQL ** table linked to the same b-tree. If the secondary insert causes a ** rebalance, that can change content out from under the cursor on the ** first SQL table, violating invariants on the first insert. ```
a function description is missing a word
(1.1) Originally by Michael Matloka (MatlokaM) with edits by Stephan Beal (stephan) on 2021-10-05 22:20:06 from 1.0 [source]
Hey! I was reading SQLite's code just to get a feel for its B-tree implementation, when I noticed a weirdly worded piece of a comment. I presume it's simply missing a single word: "This can if" → "This can happen if". Here's the diff to fix it:
--- src/btree.c
+++ src/btree.c
@@ -8498,11 +8498,11 @@
/*
** Return SQLITE_CORRUPT if any cursor other than pCur is currently valid
** on the same B-tree as pCur.
**
-** This can if a database is corrupt with two or more SQL tables
+** This can happen if a database is corrupt with two or more SQL tables
** pointing to the same b-tree. If an insert occurs on one SQL table
** and causes a BEFORE TRIGGER to do a secondary insert on the other SQL
** table linked to the same b-tree. If the secondary insert causes a
** rebalance, that can change content out from under the cursor on the
** first SQL table, violating invariants on the first insert.