File tree Expand file tree Collapse file tree 2 files changed +14
-1
lines changed
Expand file tree Collapse file tree 2 files changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -2106,7 +2106,7 @@ Bitmask sqlite3WhereCodeOneLoopStart(
21062106
21072107 /* Record the instruction used to terminate the loop. */
21082108 if ( (pLoop -> wsFlags & WHERE_ONEROW )
2109- || (pLevel -> u .in .nIn && whereLoopIsOneRow (pLoop ))
2109+ || (pLevel -> u .in .nIn && regBignull == 0 && whereLoopIsOneRow (pLoop ))
21102110 ){
21112111 pLevel -> op = OP_Noop ;
21122112 }else if ( bRev ){
Original file line number Diff line number Diff line change @@ -103,5 +103,18 @@ foreach {tn nNext idx sql} {
103103 } $nNext
104104}
105105
106+ #-------------------------------------------------------------------------
107+ reset_db
108+ do_execsql_test 2.0 {
109+ CREATE TABLE t1(a TEXT PRIMARY KEY, b TEXT) WITHOUT ROWID;
110+ INSERT INTO t1 VALUES('1', 'one');
111+ INSERT INTO t1 VALUES('2', NULL);
112+ INSERT INTO t1 VALUES('3', 'three');
113+ }
114+
115+ do_execsql_test 2.1 {
116+ SELECT b FROM t1 WHERE a IN (1,2,3) ORDER BY b ASC NULLS LAST;
117+ } {one three {}}
118+
106119
107120finish_test
You can’t perform that action at this time.
0 commit comments