Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
Comment: | Make sure a multi-row VALUES clause works correctly in a compound SELECT. |
---|---|
Downloads: | Tarball | ZIP archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA1: |
85b355cfb40e8dbeb171980204ffad89 |
User & Date: | drh 2014-02-19 01:31:02.841 |
Context
2014-02-19
| ||
14:20 | Add the SQLITE_NOTNULL P5 code for comparison operations - really a composite of SQLITE_NULLEQ and SQLITE_JUMPIFNULL. This flag indicates that NULL operands are not possible and raises and assert() if NULL operands are seen. Also omit an unnecessary scan of the sqlite_sequence table when writing into an AUTOINCREMENT table. (check-in: d2c047f304 user: drh tags: trunk) | |
01:31 | Make sure a multi-row VALUES clause works correctly in a compound SELECT. (check-in: 85b355cfb4 user: drh tags: trunk) | |
00:53 | Tweaks in support of VDBE branch test coverage. (check-in: b978256469 user: drh tags: trunk) | |
Changes
Changes to src/parse.y.
︙ | |||
433 434 435 436 437 438 439 | 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 | + + + + + + + + - - - + + + - + | } A = p; } selectnowith(A) ::= oneselect(X). {A = X;} %ifndef SQLITE_OMIT_COMPOUND_SELECT selectnowith(A) ::= selectnowith(X) multiselect_op(Y) oneselect(Z). { Select *pRhs = Z; if( pRhs && pRhs->pPrior ){ SrcList *pFrom; Token x; x.n = 0; pFrom = sqlite3SrcListAppendFromTerm(pParse,0,0,0,&x,pRhs,0,0); pRhs = sqlite3SelectNew(pParse,0,pFrom,0,0,0,0,0,0,0); } |
︙ |
Changes to test/select4.test.
︙ | |||
819 820 821 822 823 824 825 826 827 | 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 | + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + | INSERT INTO t13 VALUES(2,2); INSERT INTO t13 VALUES(3,2); INSERT INTO t13 VALUES(4,2); CREATE INDEX t13ab ON t13(a,b); SELECT DISTINCT b from t13 WHERE a IN (1,2,3); } } {1 2} # 2014-02-18: Make sure compound SELECTs work with VALUES clauses # do_execsql_test select4-14.1 { CREATE TABLE t14(a,b,c); INSERT INTO t14 VALUES(1,2,3),(4,5,6); SELECT * FROM t14 INTERSECT VALUES(3,2,1),(2,3,1),(1,2,3),(2,1,3); } {1 2 3} do_execsql_test select4-14.2 { SELECT * FROM t14 INTERSECT VALUES(1,2,3); } {1 2 3} do_execsql_test select4-14.3 { SELECT * FROM t14 UNION VALUES(3,2,1),(2,3,1),(1,2,3),(7,8,9),(4,5,6) UNION SELECT * FROM t14 ORDER BY 1, 2, 3 } {1 2 3 2 3 1 3 2 1 4 5 6 7 8 9} do_execsql_test select4-14.4 { SELECT * FROM t14 UNION VALUES(3,2,1) UNION SELECT * FROM t14 ORDER BY 1, 2, 3 } {1 2 3 3 2 1 4 5 6} do_execsql_test select4-14.5 { SELECT * FROM t14 EXCEPT VALUES(3,2,1),(2,3,1),(1,2,3),(2,1,3); } {4 5 6} do_execsql_test select4-14.6 { SELECT * FROM t14 EXCEPT VALUES(1,2,3) } {4 5 6} do_execsql_test select4-14.7 { SELECT * FROM t14 EXCEPT VALUES(1,2,3) EXCEPT VALUES(4,5,6) } {} do_execsql_test select4-14.8 { SELECT * FROM t14 EXCEPT VALUES('a','b','c') EXCEPT VALUES(4,5,6) } {1 2 3} do_execsql_test select4-14.9 { SELECT * FROM t14 UNION ALL VALUES(3,2,1),(2,3,1),(1,2,3),(2,1,3); } {1 2 3 4 5 6 3 2 1 2 3 1 1 2 3 2 1 3} finish_test |