]> git.ipfire.org Git - thirdparty/sqlite.git/commitdiff
Cancel column-cache entries that are involved in a comparison operator since tkt-a8a0d2996a
authordrh <drh@noemail.net>
Mon, 24 Mar 2014 12:33:23 +0000 (12:33 +0000)
committerdrh <drh@noemail.net>
Mon, 24 Mar 2014 12:33:23 +0000 (12:33 +0000)
the comparison might have forced an affinity change.
Fix for ticket [a8a0d2996a].

FossilOrigin-Name: 0b95b7a8748df19a24491c814462a9f21e43dbda

manifest
manifest.uuid
src/expr.c
test/affinity01.test [new file with mode: 0644]

index 3c6309f95b4452ebba597dc0baf9e77ec0a674fa..3e9bc1c61d9fb6ae3cbb15dfff9543f604ce2367 100644 (file)
--- a/manifest
+++ b/manifest
@@ -1,5 +1,5 @@
-C Avoid\sattempting\sto\smmap\smemory\sfrom\san\soffset\sthat\sis\snot\sa\smultiple\sof\sthe\ssystem\spage\ssize\son\ssystems\swith\spage\ssizes\slarger\sthan\s32KB.
-D 2014-03-24T11:23:17.736
+C Cancel\scolumn-cache\sentries\sthat\sare\sinvolved\sin\sa\scomparison\soperator\ssince\nthe\scomparison\smight\shave\sforced\san\saffinity\schange.\nFix\sfor\sticket\s[a8a0d2996a].
+D 2014-03-24T12:33:23.935
 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f
 F Makefile.in 2ef13430cd359f7b361bb863504e227b25cc7f81
 F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23
@@ -173,7 +173,7 @@ F src/complete.c dc1d136c0feee03c2f7550bafc0d29075e36deac
 F src/ctime.c 0231df905e2c4abba4483ee18ffc05adc321df2a
 F src/date.c 593c744b2623971e45affd0bde347631bdfa4625
 F src/delete.c cdd57149543bb28304d8f717c243f2a86b1fc280
-F src/expr.c da2b3cb41081af6b56e95e7c9e95949564ce2e21
+F src/expr.c 671a2a43c17a0cfe4bc2c762e56d0f8b0cffb058
 F src/fault.c 160a0c015b6c2629d3899ed2daf63d75754a32bb
 F src/fkey.c 5269ef07b100763134f71b889327c333bd0989cf
 F src/func.c 2945bb2c4cdc0ac43733046285a4434310be1811
@@ -294,6 +294,7 @@ F src/walker.c 11edb74d587bc87b33ca96a5173e3ec1b8389e45
 F src/where.c da8ec216f14af617505799b0b4e52c73dda7a5ca
 F src/whereInt.h 2564055b440e44ebec8b47f237bbccae6719b7af
 F test/8_3_names.test ebbb5cd36741350040fd28b432ceadf495be25b2
+F test/affinity01.test 3a843e95b958e25a2e52e2a212c8f9564843beac
 F test/aggerror.test a867e273ef9e3d7919f03ef4f0e8c0d2767944f2
 F test/aggnested.test 45c0201e28045ad38a530b5a144b73cd4aa2cfd6
 F test/alias.test 4529fbc152f190268a15f9384a5651bbbabc9d87
@@ -1158,7 +1159,7 @@ F tool/vdbe_profile.tcl 67746953071a9f8f2f668b73fe899074e2c6d8c1
 F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4
 F tool/warnings.sh d1a6de74685f360ab718efda6265994b99bbea01
 F tool/win/sqlite.vsix 030f3eeaf2cb811a3692ab9c14d021a75ce41fff
-P 641408a1395bfc911ca619ef9e5f073b913d856b e3d2be3ba47cdaafd26347620ae3bc2813203f16
-R aadeef09c98319ee1e1acbdf39605080
-U dan
-Z a7c50b19ab534dd04ee960894cca4791
+P db7d62c8d58eb1e8654a762c9b199ae4e2759038
+R 2003e46e292bd0cd1a415a45223aecb4
+U drh
+Z b8d19870788550507c35c44977ea8cb7
index 3a417781637269cb4221fddd7f1f5c0d6e55f54a..577b5ae0214ade39dab31c43f3051db901da4bb3 100644 (file)
@@ -1 +1 @@
-db7d62c8d58eb1e8654a762c9b199ae4e2759038
\ No newline at end of file
+0b95b7a8748df19a24491c814462a9f21e43dbda
\ No newline at end of file
index b070621ebd9fc948227f2587920d3c2170d0fce4..0e1b5d74eed897e34cf142319f5be2522a77a21f 100644 (file)
@@ -291,6 +291,10 @@ static int codeCompare(
   addr = sqlite3VdbeAddOp4(pParse->pVdbe, opcode, in2, dest, in1,
                            (void*)p4, P4_COLLSEQ);
   sqlite3VdbeChangeP5(pParse->pVdbe, (u8)p5);
+  if( p5!=SQLITE_AFF_NONE ){
+    sqlite3ExprCacheAffinityChange(pParse, in1, 1);
+    sqlite3ExprCacheAffinityChange(pParse, in2, 1);
+  }
   return addr;
 }
 
diff --git a/test/affinity01.test b/test/affinity01.test
new file mode 100644 (file)
index 0000000..c0a36c9
--- /dev/null
@@ -0,0 +1,25 @@
+# 2014-03-24
+#
+# The author disclaims copyright to this source code.  In place of
+# a legal notice, here is a blessing:
+#
+#    May you do good and not evil.
+#    May you find forgiveness for yourself and forgive others.
+#    May you share freely, never taking more than you give.
+#
+#***********************************************************************
+# 
+# Various tests for register affinity conversions.
+#
+
+set testdir [file dirname $argv0]
+source $testdir/tester.tcl
+set testprefix affinity01
+
+do_execsql_test 1.0 {
+  CREATE TABLE t(x);
+  INSERT INTO t VALUES('1');
+  SELECT typeof(x) FROM t WHERE x=x+0;
+} {text}
+
+finish_test