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

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

Issue 2751253002: [sql] Import SQLite 3.17.0. (Closed)
Patch Set: also clang on Linux i386 Created 3 years, 9 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/fkey1.test ('k') | third_party/sqlite/src/test/fkey6.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 # 2009 September 15 1 # 2009 September 15
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 1044 matching lines...) Expand 10 before | Expand all | Expand 10 after
1055 catchsql { ALTER TABLE t2 ADD COLUMN f REFERENCES t1 DEFAULT 'text'} 1055 catchsql { ALTER TABLE t2 ADD COLUMN f REFERENCES t1 DEFAULT 'text'}
1056 } {1 {Cannot add a REFERENCES column with non-NULL default value}} 1056 } {1 {Cannot add a REFERENCES column with non-NULL default value}}
1057 do_test fkey2-14.1tmp.5 { 1057 do_test fkey2-14.1tmp.5 {
1058 catchsql { ALTER TABLE t2 ADD COLUMN g DEFAULT CURRENT_TIME REFERENCES t1 } 1058 catchsql { ALTER TABLE t2 ADD COLUMN g DEFAULT CURRENT_TIME REFERENCES t1 }
1059 } {1 {Cannot add a REFERENCES column with non-NULL default value}} 1059 } {1 {Cannot add a REFERENCES column with non-NULL default value}}
1060 do_test fkey2-14.1tmp.6 { 1060 do_test fkey2-14.1tmp.6 {
1061 execsql { 1061 execsql {
1062 PRAGMA foreign_keys = off; 1062 PRAGMA foreign_keys = off;
1063 ALTER TABLE t2 ADD COLUMN h DEFAULT 'text' REFERENCES t1; 1063 ALTER TABLE t2 ADD COLUMN h DEFAULT 'text' REFERENCES t1;
1064 PRAGMA foreign_keys = on; 1064 PRAGMA foreign_keys = on;
1065 SELECT sql FROM sqlite_temp_master WHERE name='t2'; 1065 SELECT sql FROM temp.sqlite_master WHERE name='t2';
1066 } 1066 }
1067 } {{CREATE TABLE t2(a, b, c REFERENCES t1, d DEFAULT NULL REFERENCES t1, e REF ERENCES t1 DEFAULT NULL, h DEFAULT 'text' REFERENCES t1)}} 1067 } {{CREATE TABLE t2(a, b, c REFERENCES t1, d DEFAULT NULL REFERENCES t1, e REF ERENCES t1 DEFAULT NULL, h DEFAULT 'text' REFERENCES t1)}}
1068 1068
1069 do_test fkey2-14.2tmp.1.1 { 1069 do_test fkey2-14.2tmp.1.1 {
1070 test_rename_parent {CREATE TABLE t1(a REFERENCES t2)} t2 t3 1070 test_rename_parent {CREATE TABLE t1(a REFERENCES t2)} t2 t3
1071 } {{CREATE TABLE t1(a REFERENCES "t3")}} 1071 } {{CREATE TABLE t1(a REFERENCES "t3")}}
1072 do_test fkey2-14.2tmp.1.2 { 1072 do_test fkey2-14.2tmp.1.2 {
1073 test_rename_parent {CREATE TABLE t1(a REFERENCES t2)} t4 t3 1073 test_rename_parent {CREATE TABLE t1(a REFERENCES t2)} t4 t3
1074 } {{CREATE TABLE t1(a REFERENCES t2)}} 1074 } {{CREATE TABLE t1(a REFERENCES t2)}}
1075 do_test fkey2-14.2tmp.1.3 { 1075 do_test fkey2-14.2tmp.1.3 {
(...skipping 10 matching lines...) Expand all
1086 CREATE TEMP TABLE t3(a REFERENCES t1, b REFERENCES t2, c REFERENCES t1); 1086 CREATE TEMP TABLE t3(a REFERENCES t1, b REFERENCES t2, c REFERENCES t1);
1087 } 1087 }
1088 execsql { SELECT sql FROM sqlite_temp_master WHERE type = 'table'} 1088 execsql { SELECT sql FROM sqlite_temp_master WHERE type = 'table'}
1089 } [list \ 1089 } [list \
1090 {CREATE TABLE t1(a PRIMARY KEY, b REFERENCES t1)} \ 1090 {CREATE TABLE t1(a PRIMARY KEY, b REFERENCES t1)} \
1091 {CREATE TABLE t2(a PRIMARY KEY, b REFERENCES t1, c REFERENCES t2)} \ 1091 {CREATE TABLE t2(a PRIMARY KEY, b REFERENCES t1, c REFERENCES t2)} \
1092 {CREATE TABLE t3(a REFERENCES t1, b REFERENCES t2, c REFERENCES t1)} \ 1092 {CREATE TABLE t3(a REFERENCES t1, b REFERENCES t2, c REFERENCES t1)} \
1093 ] 1093 ]
1094 do_test fkey2-14.2tmp.2.2 { 1094 do_test fkey2-14.2tmp.2.2 {
1095 execsql { ALTER TABLE t1 RENAME TO t4 } 1095 execsql { ALTER TABLE t1 RENAME TO t4 }
1096 execsql { SELECT sql FROM sqlite_temp_master WHERE type = 'table'} 1096 execsql { SELECT sql FROM temp.sqlite_master WHERE type = 'table'}
1097 } [list \ 1097 } [list \
1098 {CREATE TABLE "t4"(a PRIMARY KEY, b REFERENCES "t4")} \ 1098 {CREATE TABLE "t4"(a PRIMARY KEY, b REFERENCES "t4")} \
1099 {CREATE TABLE t2(a PRIMARY KEY, b REFERENCES "t4", c REFERENCES t2)} \ 1099 {CREATE TABLE t2(a PRIMARY KEY, b REFERENCES "t4", c REFERENCES t2)} \
1100 {CREATE TABLE t3(a REFERENCES "t4", b REFERENCES t2, c REFERENCES "t4")} \ 1100 {CREATE TABLE t3(a REFERENCES "t4", b REFERENCES t2, c REFERENCES "t4")} \
1101 ] 1101 ]
1102 do_test fkey2-14.2tmp.2.3 { 1102 do_test fkey2-14.2tmp.2.3 {
1103 catchsql { INSERT INTO t3 VALUES(1, 2, 3) } 1103 catchsql { INSERT INTO t3 VALUES(1, 2, 3) }
1104 } {1 {FOREIGN KEY constraint failed}} 1104 } {1 {FOREIGN KEY constraint failed}}
1105 do_test fkey2-14.2tmp.2.4 { 1105 do_test fkey2-14.2tmp.2.4 {
1106 execsql { INSERT INTO t4 VALUES(1, NULL) } 1106 execsql { INSERT INTO t4 VALUES(1, NULL) }
(...skipping 920 matching lines...) Expand 10 before | Expand all | Expand 10 after
2027 catchsql { 2027 catchsql {
2028 PRAGMA foreign_keys=1; 2028 PRAGMA foreign_keys=1;
2029 CREATE TABLE t1(x PRIMARY KEY); 2029 CREATE TABLE t1(x PRIMARY KEY);
2030 CREATE TABLE t(y REFERENCES t0(x)ON DELETE SET DEFAULT); 2030 CREATE TABLE t(y REFERENCES t0(x)ON DELETE SET DEFAULT);
2031 CREATE TABLE t0(y REFERENCES t1 ON DELETE SET NULL); 2031 CREATE TABLE t0(y REFERENCES t1 ON DELETE SET NULL);
2032 REPLACE INTO t1 SELECT(0);CREATE TABLE t2(x);CREATE TABLE t3; 2032 REPLACE INTO t1 SELECT(0);CREATE TABLE t2(x);CREATE TABLE t3;
2033 } 2033 }
2034 } {1 {foreign key mismatch - "t" referencing "t0"}} 2034 } {1 {foreign key mismatch - "t" referencing "t0"}}
2035 2035
2036 finish_test 2036 finish_test
OLDNEW
« no previous file with comments | « third_party/sqlite/src/test/fkey1.test ('k') | third_party/sqlite/src/test/fkey6.test » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698