Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1166)

Side by Side Diff: third_party/sqlite/src/test/with1.test

Issue 1610963002: Import SQLite 3.10.2. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « third_party/sqlite/src/test/win32lock.test ('k') | third_party/sqlite/src/test/with2.test » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # 2014 January 11 1 # 2014 January 11
2 # 2 #
3 # The author disclaims copyright to this source code. In place of 3 # The author disclaims copyright to this source code. In place of
4 # a legal notice, here is a blessing: 4 # a legal notice, here is a blessing:
5 # 5 #
6 # May you do good and not evil. 6 # May you do good and not evil.
7 # May you find forgiveness for yourself and forgive others. 7 # May you find forgiveness for yourself and forgive others.
8 # May you share freely, never taking more than you give. 8 # May you share freely, never taking more than you give.
9 # 9 #
10 #*********************************************************************** 10 #***********************************************************************
(...skipping 809 matching lines...) Expand 10 before | Expand all | Expand 10 after
820 # Ticket [31a19d11b97088296ac104aaff113a9790394927] (2014-02-09) 820 # Ticket [31a19d11b97088296ac104aaff113a9790394927] (2014-02-09)
821 # Name resolution issue with compound SELECTs and Common Table Expressions 821 # Name resolution issue with compound SELECTs and Common Table Expressions
822 # 822 #
823 do_execsql_test 12.1 { 823 do_execsql_test 12.1 {
824 WITH RECURSIVE 824 WITH RECURSIVE
825 t1(x) AS (VALUES(2) UNION ALL SELECT x+2 FROM t1 WHERE x<20), 825 t1(x) AS (VALUES(2) UNION ALL SELECT x+2 FROM t1 WHERE x<20),
826 t2(y) AS (VALUES(3) UNION ALL SELECT y+3 FROM t2 WHERE y<20) 826 t2(y) AS (VALUES(3) UNION ALL SELECT y+3 FROM t2 WHERE y<20)
827 SELECT x FROM t1 EXCEPT SELECT y FROM t2 ORDER BY 1; 827 SELECT x FROM t1 EXCEPT SELECT y FROM t2 ORDER BY 1;
828 } {2 4 8 10 14 16 20} 828 } {2 4 8 10 14 16 20}
829 829
830 # 2015-03-21
831 # Column wildcards on the LHS of a recursive table expression
832 #
833 do_catchsql_test 13.1 {
834 WITH RECURSIVE c(i) AS (SELECT * UNION ALL SELECT i+1 FROM c WHERE i<10)
835 SELECT i FROM c;
836 } {1 {no tables specified}}
837 do_catchsql_test 13.2 {
838 WITH RECURSIVE c(i) AS (SELECT 5,* UNION ALL SELECT i+1 FROM c WHERE i<10)
839 SELECT i FROM c;
840 } {1 {no tables specified}}
841 do_catchsql_test 13.3 {
842 WITH RECURSIVE c(i,j) AS (SELECT 5,* UNION ALL SELECT i+1,11 FROM c WHERE i<10 )
843 SELECT i FROM c;
844 } {1 {table c has 1 values for 2 columns}}
845
846 # 2015-04-12
847 #
848 do_execsql_test 14.1 {
849 WITH x AS (SELECT * FROM t) SELECT 0 EXCEPT SELECT 0 ORDER BY 1 COLLATE binary ;
850 } {}
851
852 # 2015-05-27: Do not allow rowid usage within a CTE
853 #
854 do_catchsql_test 15.1 {
855 WITH RECURSIVE
856 d(x) AS (VALUES(1) UNION ALL SELECT rowid+1 FROM d WHERE rowid<10)
857 SELECT x FROM d;
858 } {1 {no such column: rowid}}
859
860 # 2015-07-05: Do not allow aggregate recursive queries
861 #
862 do_catchsql_test 16.1 {
863 WITH RECURSIVE
864 i(x) AS (VALUES(1) UNION SELECT count(*) FROM i)
865 SELECT * FROM i;
866 } {1 {recursive aggregate queries not supported}}
867
868 #-------------------------------------------------------------------------
869 do_execsql_test 17.1 {
870 WITH x(a) AS (
871 WITH y(b) AS (SELECT 10)
872 SELECT 9 UNION ALL SELECT * FROM y
873 )
874 SELECT * FROM x
875 } {9 10}
876
877 do_execsql_test 17.2 {
878 WITH x AS (
879 WITH y(b) AS (SELECT 10)
880 SELECT * FROM y UNION ALL SELECT * FROM y
881 )
882 SELECT * FROM x
883 } {10 10}
884
885 do_test 17.2 {
886 db eval {
887 WITH x AS (
888 WITH y(b) AS (SELECT 10)
889 SELECT * FROM y UNION ALL SELECT * FROM y
890 )
891 SELECT * FROM x
892 } A {
893 # no op
894 }
895 set A(*)
896 } {b}
897
898 do_catchsql_test 17.3 {
899 WITH i AS (
900 WITH j AS (SELECT 5)
901 SELECT 5 FROM i UNION SELECT 8 FROM i
902 )
903 SELECT * FROM i;
904 } {1 {circular reference: i}}
905
906 do_catchsql_test 17.4 {
907 WITH i AS (
908 WITH j AS (SELECT 5)
909 SELECT 5 FROM t1 UNION SELECT 8 FROM t11
910 )
911 SELECT * FROM i;
912 } {1 {no such table: t11}}
913
914 do_execsql_test 17.5 {
915 WITH
916 x1 AS (SELECT 10),
917 x2 AS (SELECT * FROM x1),
918 x3 AS (
919 WITH x1 AS (SELECT 11)
920 SELECT * FROM x2 UNION ALL SELECT * FROM x2
921 )
922 SELECT * FROM x3;
923 } {10 10}
924
925 do_execsql_test 17.6 {
926 WITH
927 x1 AS (SELECT 10),
928 x2 AS (SELECT * FROM x1),
929 x3 AS (
930 WITH x1 AS (SELECT 11)
931 SELECT * FROM x2 UNION ALL SELECT * FROM x1
932 )
933 SELECT * FROM x3;
934 } {10 11}
935
936 do_execsql_test 17.7 {
937 WITH
938 x1 AS (SELECT 10),
939 x2 AS (SELECT * FROM x1),
940 x3 AS (
941 WITH
942 x1 AS ( SELECT 11 ),
943 x4 AS ( SELECT * FROM x2 )
944 SELECT * FROM x4 UNION ALL SELECT * FROM x1
945 )
946 SELECT * FROM x3;
947 } {10 11}
948
949 do_execsql_test 17.8 {
950 WITH
951 x1 AS (SELECT 10),
952 x2 AS (SELECT * FROM x1),
953 x3 AS (
954 WITH
955 x1 AS ( SELECT 11 ),
956 x4 AS ( SELECT * FROM x2 )
957 SELECT * FROM x4 UNION ALL SELECT * FROM x1
958 )
959 SELECT * FROM x3;
960 } {10 11}
961
962 do_execsql_test 17.9 {
963 WITH
964 x1 AS (SELECT 10),
965 x2 AS (SELECT 11),
966 x3 AS (
967 SELECT * FROM x1 UNION ALL SELECT * FROM x2
968 ),
969 x4 AS (
970 WITH
971 x1 AS (SELECT 12),
972 x2 AS (SELECT 13)
973 SELECT * FROM x3
974 )
975 SELECT * FROM x4;
976 } {10 11}
977
978 # Added to test a fix to a faulty assert() discovered by libFuzzer.
979 #
980 do_execsql_test 18.1 {
981 WITH xyz(x) AS (VALUES(NULL) UNION SELECT round(1<x) FROM xyz ORDER BY 1)
982 SELECT quote(x) FROM xyz;
983 } {NULL}
984 do_execsql_test 18.2 {
985 WITH xyz(x) AS (
986 SELECT printf('%d', 5) * NULL
987 UNION SELECT round(1<1+x)
988 FROM xyz ORDER BY 1
989 )
990 SELECT 1 FROM xyz;
991 } 1
992
830 993
831 finish_test 994 finish_test
OLDNEW
« no previous file with comments | « third_party/sqlite/src/test/win32lock.test ('k') | third_party/sqlite/src/test/with2.test » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698