1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-07-29 08:01:23 +03:00

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]

FossilOrigin-Name: 89a9dad6330270a4c3b962f86a208088d2ea9883c7d291351a77f058e0ed8b0c
This commit is contained in:
drh
2019-12-22 20:29:25 +00:00
parent 6e827fa27d
commit 5d762b2d1d
4 changed files with 24 additions and 10 deletions

View File

@ -656,6 +656,20 @@ do_execsql_test update-17.10 {
SELECT * FROM t1;
} {2 3}
# 2019-12-22 ticket 5ad2aa6921faa1ee
# Make a hard-copy of values that need to be run through OP_RealAffinity
# rather than a soft-copy. This is not strictly necessary, but it avoids
# a memory-accounting assert().
#
reset_db
do_execsql_test update-18.10 {
PRAGMA encoding = 'UTF16';
CREATE TABLE t0(c0 REAL, c1);
INSERT INTO t0(c0,c1) VALUES('xyz',11),('uvw',22);
CREATE INDEX i0 ON t0(c1) WHERE c0 GLOB 3;
CREATE INDEX i1 ON t0(c0,c1) WHERE typeof(c0)='text' AND typeof(c1)='integer';
UPDATE t0 SET c1=345;
SELECT * FROM t0;
} {xyz 345 uvw 345}
finish_test