-C The\ssqlite3_set_authorizer()\sinterface\sshould\sonly\sexpire\sprepared\sstatements\nwhen\sit\sis\ssetting\sa\snew\sauthorizer,\snot\swhen\sclearing\sthe\sauthorizer.\s\sAnd\nstatements\sthat\sare\srunning\swhen\ssqlite3_set_authorizer()\sis\sinvoked\sshould\sbe\nallowed\sto\scontinue\srunning\sto\scompletion.
-D 2019-08-01T22:48:45.195
+C If\sa\squery\slike\s"SELECT\smin(a),\sb\sFROM\st1"\svisits\sno\srows\swhere\s"a"\sis\snot\snull,\sextract\sa\svalue\sfor\s"b"\sfrom\sone\sof\sthe\srows\swhere\s"a"\sis\snull.\sPossible\sfix\sfor\sticket\s[41866dc37].
+D 2019-08-02T18:43:59.348
F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1
F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea
F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724
F src/walker.c d5a94907dcac990e31976be9dc769d17f6a806782593d6aec9d760ee01ec22cd
F src/where.c 01b68cfc7f8a6eba6a0a10b24b7ab3ec11f7244830791560119e14680c756078
F src/whereInt.h 6fab4b6f7e4ae716f112ee09cd1343fc6dde3d4a1831feabc6b3ed3b54b8eef3
-F src/wherecode.c 37a1004237d630d785c47bba2290eac652a7a8b0047518eba3cb7c808b604c4a
+F src/wherecode.c 52451ce3673e1d737b2d9f0a05ff336038e9dd2dcfba221d43e06b51c1fe514e
F src/whereexpr.c 5e559bdd24b06e3bc2e68f258bf751302954dc1e432daf71fdd8098a71462326
F src/window.c 7728ba7a3d44084a44eefb60464a88fb2ff035eb20cdeb1160ae65ac3c0be6b9
F test/8_3_names.test ebbb5cd36741350040fd28b432ceadf495be25b2
F test/minmax.test 6751e87b409fe11b02e70a306d846fa544e25a41
F test/minmax2.test dae92964ac87c1d2ef978c582e81a95e11c00f1cbef68980bfb2abaf10315063
F test/minmax3.test cc1e8b010136db0d01a6f2a29ba5a9f321034354
-F test/minmax4.test 936941484ebdceb8adec7c86b6cd9b6e5e897c1f
+F test/minmax4.test be0b227f574a20871bdd4258d4a26620f263e4cd231d2eec0259b8980e7408b4
F test/misc1.test 7ce84b25df9872e7d7878613a96815d2ba5bc974ac4e15a50118dde8f3917599
F test/misc2.test 00d7de54eda90e237fc9a38b9e5ccc769ebf6d4d
F test/misc3.test cf3dda47d5dda3e53fc5804a100d3c82be736c9d
F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc
F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e
F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0
-P 1b330ec24c350c59f6d3779f6c0819fe95b89f4dfca5a1f2c22f22b5fe9cd087
-R 23b8e4dd44ae93c74678bbe4b9f9949a
-U drh
-Z ae2bdc1746bd01e035fa2c38a9fb31b7
+P 961e2f08c35238bcb1d32430d16451a96807b2c4bbb194ee621128dd09cd3981
+R 967b7339813b309eb9b996030fc19505
+T *branch * tkt-41866dc37
+T *sym-tkt-41866dc37 *
+T -sym-trunk *
+U dan
+Z 5a050a5929e904750046b34f5a015f7b
-961e2f08c35238bcb1d32430d16451a96807b2c4bbb194ee621128dd09cd3981
\ No newline at end of file
+a7277ed0623dccdbf775ae6127611d6bc6e150f6942a048ab4281e5136c0e98d
\ No newline at end of file
VdbeCoverageIf(v, op==OP_SeekGE); testcase( op==OP_SeekGE );
VdbeCoverageIf(v, op==OP_SeekLE); testcase( op==OP_SeekLE );
VdbeCoverageIf(v, op==OP_SeekLT); testcase( op==OP_SeekLT );
+
+ if( bSeekPastNull && (pLoop->wsFlags & WHERE_TOP_LIMIT)==0 ){
+ /* If bSeekPastNull is set only to skip past the NULL values for
+ ** a query like "SELECT min(a), b FROM t1", then add code so that
+ ** if there are no rows with (a IS NOT NULL), then do the seek
+ ** without jumping past NULLs instead. This allows the code in
+ ** select.c to pick a value for "b" in the above query. */
+ assert( startEq==0 && (op==OP_SeekGT || op==OP_SeekLT) );
+ assert( (pWInfo->wctrlFlags&WHERE_ORDERBY_MIN)!=0 && pWInfo->nOBSat>0 );
+ sqlite3VdbeChangeP2(v, -1, sqlite3VdbeCurrentAddr(v)+1);
+ sqlite3VdbeAddOp2(v, OP_Goto, 0, sqlite3VdbeCurrentAddr(v)+2);
+
+ op = aStartOp[(start_constraints<<2) + (1<<1) + bRev];
+ assert( op!=0 );
+ sqlite3VdbeAddOp4Int(v, op, iIdxCur, addrNxt, regBase, nConstraint);
+ VdbeCoverage(v);
+ VdbeCoverageIf(v, op==OP_SeekGE); testcase( op==OP_SeekGE );
+ VdbeCoverageIf(v, op==OP_SeekLE); testcase( op==OP_SeekLE );
+ }
}
/* Load the value for the inequality constraint at the end of the
set testdir [file dirname $argv0]
source $testdir/tester.tcl
+set testprefix minmax4
ifcapable !compound {
finish_test
}
} {1 1 {} 2 2 2 3 3 5 5}
-
+#-------------------------------------------------------------------------
+foreach {tn sql} {
+ 1 { CREATE INDEX i1 ON t1(a) }
+ 2 { CREATE INDEX i1 ON t1(a DESC) }
+ 3 { }
+} {
+ reset_db
+ do_execsql_test 3.$tn.0 {
+ CREATE TABLE t1(a, b);
+ INSERT INTO t1 VALUES(NULL, 1);
+ }
+ execsql $sql
+ do_execsql_test 3.$tn.1 {
+ SELECT min(a), b FROM t1;
+ } {{} 1}
+ do_execsql_test 3.$tn.2 {
+ SELECT min(a), b FROM t1 WHERE a<50;
+ } {{} {}}
+ do_execsql_test 3.$tn.3 {
+ INSERT INTO t1 VALUES(2, 2);
+ }
+ do_execsql_test 3.$tn.4 {
+ SELECT min(a), b FROM t1;
+ } {2 2}
+ do_execsql_test 3.$tn.5 {
+ SELECT min(a), b FROM t1 WHERE a<50;
+ } {2 2}
+}
finish_test