SQLite

View Ticket
Login
2019-12-23
02:33 Ticket [5ad2aa6921] Debug assertion sqlite3VdbeMemAboutToChange: Assertion `(mFlags&MEM_Str)==0 || (pMem->n==pX->n && pMem->z==pX->z)' failed status still Fixed with 3 other changes (artifact: 915996400f user: drh)
02:30 Fixed ticket [c62c5e5852]: Debug assertion sqlite3VdbeMemAboutToChange: Assertion `(mFlags&MEM_Str)==0 || (pMem->n==pX->n && pMem->z==pX->z)' failed (2) plus 5 other changes (artifact: 415adc126e user: drh)
02:18
Enhance the sqlite3VdbeMemAboutToChange() shallow-copy validation mechanism by adding the new OP_ReleaseReg opcode to tell MemAboutToChange() that a range of registers is no longer needed so that the source register can be freely changed. This is a change to debugging and test builds only and does not impact release builds. Fix for ticket [c62c5e58524b204d] and [5ad2aa6921faa1ee]. The previous fix to ticket [5ad2aa6921faa1ee] is backed out by this change since this change is a better fix. (check-in: 36fdeb4f0a user: drh tags: trunk)
2019-12-22
23:05 New ticket [c62c5e5852] Debug assertionsqlite3VdbeMemAboutToChange: Assertion `(mFlags&MEM_Str)==0 || (pMem->n==pX->n && pMem->z==pX->z)' failed (2). (artifact: f2e35331b3 user: mrigger)
20:29 Fixed ticket [5ad2aa6921]: Debug assertion sqlite3VdbeMemAboutToChange: Assertion `(mFlags&MEM_Str)==0 || (pMem->n==pX->n && pMem->z==pX->z)' failed plus 6 other changes (artifact: ba99796101 user: drh)
20:29
Make a hard copy of strings in constraint checks prior to applying OP_RealAffinity, to avoid problems with a pointer accounting assert. This change is not strictly necessary - the correct answer is obtained without it and no UB occurs - however the pointer accounting asserts are useful to prevent other problems so it is a simple matter to bring this piece into compliance. Ticket [5ad2aa6921faa1ee] (check-in: 89a9dad633 user: drh tags: trunk)
10:26 New ticket [5ad2aa6921] Debug assertion sqlite3VdbeMemAboutToChange: Assertion `(mFlags&MEM_Str)==0 || (pMem->n==pX->n && pMem->z==pX->z)' failed. (artifact: e3743aaf0e user: mrigger)

Ticket Hash: 5ad2aa6921faa1ee5f18911261e0d92d90f2b472
Title: Debug assertion sqlite3VdbeMemAboutToChange: Assertion `(mFlags&MEM_Str)==0 || (pMem->n==pX->n && pMem->z==pX->z)' failed
Status: Fixed Type: Code_Defect
Severity: Minor Priority: Immediate
Subsystem: Unknown Resolution: Fixed
Last Modified: 2019-12-23 02:33:16
5.36 years ago
Created: 2019-12-22 10:26:54
5.36 years ago
Version Found In: 3.30.0
User Comments:
mrigger added on 2019-12-22 10:26:54:

Consider the following test case:

PRAGMA encoding = 'UTF16';
CREATE TABLE t0(c0 REAL, c1);
INSERT INTO t0(c0) VALUES (''), (0);
CREATE INDEX i0 ON t0(c1) WHERE c0 GLOB 3;
UPDATE t0 SET c1=0; -- sqlite3.c:75871: sqlite3VdbeMemAboutToChange: Assertion `(mFlags&MEM_Str)==0 || (pMem->n==pX->n && pMem->z==pX->z)' failed.

When compiling with -DSQLITE_DEBUG, the UPDATE triggers an assertion error.


drh added on 2019-12-23 02:33:16:

See also ticket [c62c5e58524b204d]. Both this ticket and that ticket are false-positives in the sqlite3VdbeMemAboutToChange() assert mechanism that is used to help verify that shallow-copies of register values are not misused.