/ Check-in [65754dc3]
Login

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

Overview
Comment:Correctly invalidate a column cache line when it is overwritten with NULL. Fix for ticket [123c9ba32130a6c9d432].
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 65754dc3b830ef9482655d2e93c2cd4acaa7a8715a58d8309955d04378541f89
User & Date: drh 2017-12-13 18:01:52
Context
2017-12-13
20:02
New result code SQLITE_READONLY_DIRECTORY is returned when an attempt is made to write on a database file that is in a read-only directory and hence the journal file could not be created. This situation formerly returned SQLITE_CANTOPEN, which less helpful. check-in: 3ec73c38 user: drh tags: trunk
18:01
Correctly invalidate a column cache line when it is overwritten with NULL. Fix for ticket [123c9ba32130a6c9d432]. check-in: 65754dc3 user: drh tags: trunk
15:32
Change some LSM code internal typenames from "Blob" and "Pgno" to "LsmBlob" and "LsmPgno". This allows the LSM code to be compiled as a single unit with sqlite3.c. check-in: 30bf38d5 user: dan tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/wherecode.c.

  1686   1686         if( sqlite3ExprIsVector(pRight)==0 ){
  1687   1687           disableTerm(pLevel, pRangeEnd);
  1688   1688         }else{
  1689   1689           endEq = 1;
  1690   1690         }
  1691   1691       }else if( bStopAtNull ){
  1692   1692         sqlite3VdbeAddOp2(v, OP_Null, 0, regBase+nEq);
         1693  +      sqlite3ExprCacheRemove(pParse, regBase+nEq, 1);
  1693   1694         endEq = 0;
  1694   1695         nConstraint++;
  1695   1696       }
  1696   1697       sqlite3DbFree(db, zStartAff);
  1697   1698       sqlite3DbFree(db, zEndAff);
  1698   1699   
  1699   1700       /* Top of the loop body */

Changes to test/limit2.test.

   145    145     INSERT INTO t502 VALUES(1, 5);
   146    146     INSERT INTO t502 VALUES(2, 4);
   147    147     INSERT INTO t502 VALUES(3, 3);
   148    148     INSERT INTO t502 VALUES(4, 6);
   149    149     INSERT INTO t502 VALUES(5, 1);
   150    150     SELECT j FROM t502 WHERE i IN (1,2,3,4,5) ORDER BY j LIMIT 3;
   151    151   } {1 3 4}
          152  +
          153  +# Ticket https://www.sqlite.org/src/info/123c9ba32130a6c9 2017-12-13
          154  +# Incorrect result when an idnex is used for an ordered join.
          155  +#
          156  +# This test case is in the limit2.test module because the problem was first
          157  +# exposed by check-in https://www.sqlite.org/src/info/559733b09e which 
          158  +# implemented the ORDER BY LIMIT optimization that limit2.test strives to
          159  +# test.
          160  +#
          161  +do_execsql_test 600 {
          162  +  DROP TABLE IF EXISTS t1;
          163  +  CREATE TABLE t1(a, b);  INSERT INTO t1 VALUES(1,2);
          164  +  DROP TABLE IF EXISTS t2;
          165  +  CREATE TABLE t2(x, y);  INSERT INTO t2 VALUES(1,3);
          166  +  CREATE INDEX t1ab ON t1(a,b);
          167  +  SELECT y FROM t1, t2 WHERE a=x AND b<=y ORDER BY b DESC;
          168  +} {3}
   152    169   
   153    170   finish_test