/ Check-in [0b95b7a8]
Login
SQLite training in Houston TX on 2019-11-05 (details)
Part of the 2019 Tcl Conference

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Cancel column-cache entries that are involved in a comparison operator since the comparison might have forced an affinity change. Originally proposed as a fix for ticket [a8a0d2996a], but later determined to be incorrect.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | tkt-a8a0d2996a
Files: files | file ages | folders
SHA1: 0b95b7a8748df19a24491c814462a9f21e43dbda
User & Date: drh 2014-03-24 12:33:23
Original Comment: Cancel column-cache entries that are involved in a comparison operator since the comparison might have forced an affinity change. Fix for ticket [a8a0d2996a].
Context
2014-03-24
12:33
Cancel column-cache entries that are involved in a comparison operator since the comparison might have forced an affinity change. Originally proposed as a fix for ticket [a8a0d2996a], but later determined to be incorrect. Closed-Leaf check-in: 0b95b7a8 user: drh tags: tkt-a8a0d2996a
11:23
Avoid attempting to mmap memory from an offset that is not a multiple of the system page size on systems with page sizes larger than 32KB. check-in: db7d62c8 user: dan tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/expr.c.

   287    287     CollSeq *p4;
   288    288   
   289    289     p4 = sqlite3BinaryCompareCollSeq(pParse, pLeft, pRight);
   290    290     p5 = binaryCompareP5(pLeft, pRight, jumpIfNull);
   291    291     addr = sqlite3VdbeAddOp4(pParse->pVdbe, opcode, in2, dest, in1,
   292    292                              (void*)p4, P4_COLLSEQ);
   293    293     sqlite3VdbeChangeP5(pParse->pVdbe, (u8)p5);
          294  +  if( p5!=SQLITE_AFF_NONE ){
          295  +    sqlite3ExprCacheAffinityChange(pParse, in1, 1);
          296  +    sqlite3ExprCacheAffinityChange(pParse, in2, 1);
          297  +  }
   294    298     return addr;
   295    299   }
   296    300   
   297    301   #if SQLITE_MAX_EXPR_DEPTH>0
   298    302   /*
   299    303   ** Check that argument nHeight is less than or equal to the maximum
   300    304   ** expression depth allowed. If it is not, leave an error message in

Added test/affinity01.test.

            1  +# 2014-03-24
            2  +#
            3  +# The author disclaims copyright to this source code.  In place of
            4  +# a legal notice, here is a blessing:
            5  +#
            6  +#    May you do good and not evil.
            7  +#    May you find forgiveness for yourself and forgive others.
            8  +#    May you share freely, never taking more than you give.
            9  +#
           10  +#***********************************************************************
           11  +# 
           12  +# Various tests for register affinity conversions.
           13  +#
           14  +
           15  +set testdir [file dirname $argv0]
           16  +source $testdir/tester.tcl
           17  +set testprefix affinity01
           18  +
           19  +do_execsql_test 1.0 {
           20  +  CREATE TABLE t(x);
           21  +  INSERT INTO t VALUES('1');
           22  +  SELECT typeof(x) FROM t WHERE x=x+0;
           23  +} {text}
           24  +
           25  +finish_test