You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit b4d6edf
Browse filesBrowse the repository at this point in the historyBrowse files
Patch Doltlite to preserve pIdxKey->eqSeen across mutmap lookup
Root cause of the ALTER TABLE failures: in prollyBtCursorIndexMoveto,
when the cursor has a non-empty mutmap, findMatchingMutMapEntry gets
called after the tree scan. Its internal sqlite3VdbeRecordCompare
probes reset pIdxKey->eqSeen to 0 on each call, clobbering the flag
that the tree scan loop set to 1 for a prefix match. OP_SeekGE with
BTREE_SEEK_EQ then sees eqSeen=0 and bails to seek_not_found,
silently skipping the DELETE. The fix saves eqSeen before
findMatchingMutMapEntry and restores it whenever the mutmap branch
isn't taken.
Reproduced and traced to this exact line via source-level printf in a
local Doltlite build; the fix makes the cross-check in the verify
step (two sequential DELETEs inside a SAVEPOINT on a composite
NOCASE PK) return the expected single remaining row.
Drop the previous test exclusions; run the full PHPUnit suite.
$db->exec("CREATE TABLE t (a INT, b INT, PRIMARY KEY(a, b))");
@@ -115,6 +166,27 @@ jobs:
115
166
echo "::error::rowid-preservation patch did not take effect: ${ROWID}"
116
167
exit 1
117
168
fi
169
+
# 2) prolly_btree.c patch: two sequential DELETEs inside a
170
+
# SAVEPOINT on a composite NOCASE PK no longer silently lose
171
+
# the second DELETE.
172
+
REMAINING=$(php -r '
173
+
$db = new PDO("sqlite::memory:");
174
+
$db->exec("CREATE TABLE t (ts TEXT NOT NULL COLLATE NOCASE, tn TEXT NOT NULL COLLATE NOCASE, cn TEXT NOT NULL COLLATE NOCASE, PRIMARY KEY (ts, tn, cn))");
175
+
$db->exec("INSERT INTO t VALUES (\"s\", \"t\", \"id\")");
176
+
$db->exec("INSERT INTO t VALUES (\"s\", \"t\", \"alpha\")");
177
+
$db->exec("INSERT INTO t VALUES (\"s\", \"t\", \"beta\")");
178
+
$db->exec("SAVEPOINT sp");
179
+
$db->exec("DELETE FROM t WHERE ts = \"s\" AND tn = \"t\" AND cn = \"alpha\"");
180
+
$db->exec("DELETE FROM t WHERE ts = \"s\" AND tn = \"t\" AND cn = \"beta\"");
181
+
$db->exec("RELEASE SAVEPOINT sp");
182
+
$rows = $db->query("SELECT cn FROM t ORDER BY cn")->fetchAll(PDO::FETCH_COLUMN);
0 commit comments