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

Unified Diff: third_party/sqlite/src/test/alter.test

Issue 949043002: Add //third_party/sqlite to dirs_to_snapshot, remove net_sql.patch (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/sqlite/src/test/all.test ('k') | third_party/sqlite/src/test/alter2.test » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/sqlite/src/test/alter.test
diff --git a/third_party/sqlite/src/test/alter.test b/third_party/sqlite/src/test/alter.test
index d4b72a6ae8c49d25f00f966b57bfaca7b2cd2996..ddf16988246dd5a242ffbf31df742889a0a52930 100644
--- a/third_party/sqlite/src/test/alter.test
+++ b/third_party/sqlite/src/test/alter.test
@@ -221,8 +221,8 @@ do_test alter-1.7 {
#
ifcapable attach {
do_test alter-1.8.1 {
- file delete -force test2.db
- file delete -force test2.db-journal
+ forcedelete test2.db
+ forcedelete test2.db-journal
execsql {
ATTACH 'test2.db' AS aux;
}
@@ -349,7 +349,8 @@ db func trigfunc trigfunc
do_test alter-3.1.0 {
execsql {
CREATE TABLE t6(a, b, c);
- CREATE TRIGGER trig1 AFTER INSERT ON t6 BEGIN
+ -- Different case for the table name in the trigger.
+ CREATE TRIGGER trig1 AFTER INSERT ON T6 BEGIN
SELECT trigfunc('trig1', new.a, new.b, new.c);
END;
}
@@ -412,8 +413,8 @@ do_test alter-3.1.8 {
# Make sure "ON" cannot be used as a database, table or column name without
# quoting. Otherwise the sqlite_alter_trigger() function might not work.
-file delete -force test3.db
-file delete -force test3.db-journal
+forcedelete test3.db
+forcedelete test3.db-journal
ifcapable attach {
do_test alter-3.2.1 {
catchsql {
@@ -650,7 +651,7 @@ do_test alter-6.7 {
# Ticket #1665: Make sure ALTER TABLE ADD COLUMN works on a table
# that includes a COLLATE clause.
#
-do_test alter-7.1 {
+do_realnum_test alter-7.1 {
execsql {
CREATE TABLE t1(a TEXT COLLATE BINARY);
ALTER TABLE t1 ADD COLUMN b INTEGER COLLATE NOCASE;
@@ -846,7 +847,8 @@ do_test alter-14.2 {
set system_table_list {1 sqlite_master}
catchsql ANALYZE
ifcapable analyze { lappend system_table_list 2 sqlite_stat1 }
-ifcapable stat2 { lappend system_table_list 3 sqlite_stat2 }
+ifcapable stat3 { lappend system_table_list 3 sqlite_stat3 }
+ifcapable stat4 { lappend system_table_list 4 sqlite_stat4 }
foreach {tn tbl} $system_table_list {
do_test alter-15.$tn.1 {
@@ -858,5 +860,57 @@ foreach {tn tbl} $system_table_list {
} [list 1 "table $tbl may not be altered"]
}
+#------------------------------------------------------------------------
+# Verify that ALTER TABLE works on tables with the WITHOUT rowid option.
+#
+do_execsql_test alter-16.1 {
+ CREATE TABLE t16a(a TEXT, b REAL, c INT, PRIMARY KEY(a,b)) WITHOUT rowid;
+ INSERT INTO t16a VALUES('abc',1.25,99);
+ ALTER TABLE t16a ADD COLUMN d TEXT DEFAULT 'xyzzy';
+ INSERT INTO t16a VALUES('cba',5.5,98,'fizzle');
+ SELECT * FROM t16a ORDER BY a;
+} {abc 1.25 99 xyzzy cba 5.5 98 fizzle}
+do_execsql_test alter-16.2 {
+ ALTER TABLE t16a RENAME TO t16a_rn;
+ SELECT * FROM t16a_rn ORDER BY a;
+} {abc 1.25 99 xyzzy cba 5.5 98 fizzle}
+
+#-------------------------------------------------------------------------
+# Verify that NULL values into the internal-use-only sqlite_rename_*()
+# functions do not cause problems.
+#
+do_execsql_test alter-17.1 {
+ SELECT sqlite_rename_table('CREATE TABLE xyz(a,b,c)','abc');
+} {{CREATE TABLE "abc"(a,b,c)}}
+do_execsql_test alter-17.2 {
+ SELECT sqlite_rename_table('CREATE TABLE xyz(a,b,c)',NULL);
+} {{CREATE TABLE "(NULL)"(a,b,c)}}
+do_execsql_test alter-17.3 {
+ SELECT sqlite_rename_table(NULL,'abc');
+} {{}}
+do_execsql_test alter-17.4 {
+ SELECT sqlite_rename_trigger('CREATE TRIGGER r1 ON xyz WHEN','abc');
+} {{CREATE TRIGGER r1 ON "abc" WHEN}}
+do_execsql_test alter-17.5 {
+ SELECT sqlite_rename_trigger('CREATE TRIGGER r1 ON xyz WHEN',NULL);
+} {{CREATE TRIGGER r1 ON "(NULL)" WHEN}}
+do_execsql_test alter-17.6 {
+ SELECT sqlite_rename_trigger(NULL,'abc');
+} {{}}
+do_execsql_test alter-17.7 {
+ SELECT sqlite_rename_parent('CREATE TABLE t1(a REFERENCES "xyzzy")',
+ 'xyzzy','lmnop');
+} {{CREATE TABLE t1(a REFERENCES "lmnop")}}
+do_execsql_test alter-17.8 {
+ SELECT sqlite_rename_parent('CREATE TABLE t1(a REFERENCES "xyzzy")',
+ 'xyzzy',NULL);
+} {{CREATE TABLE t1(a REFERENCES "(NULL)")}}
+do_execsql_test alter-17.9 {
+ SELECT sqlite_rename_parent('CREATE TABLE t1(a REFERENCES "xyzzy")',
+ NULL, 'lmnop');
+} {{}}
+do_execsql_test alter-17.10 {
+ SELECT sqlite_rename_parent(NULL,'abc','xyz');
+} {{}}
finish_test
« no previous file with comments | « third_party/sqlite/src/test/all.test ('k') | third_party/sqlite/src/test/alter2.test » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698