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

Unified Diff: third_party/sqlite/src/test/alter4.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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/sqlite/src/test/alter3.test ('k') | third_party/sqlite/src/test/analyze9.test » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/sqlite/src/test/alter4.test
diff --git a/third_party/sqlite/src/test/alter4.test b/third_party/sqlite/src/test/alter4.test
index ac39d614a540b16fe3bbf2c98bdab6f4c4410117..5155110cf58d00f1366600b279535125c9a32b6a 100644
--- a/third_party/sqlite/src/test/alter4.test
+++ b/third_party/sqlite/src/test/alter4.test
@@ -45,18 +45,33 @@ do_test alter4-1.1 {
SELECT sql FROM sqlite_temp_master;
}
} {{CREATE TABLE abc(a, b, c)}}
+do_test alter4-1.1b {
+ execsql {
+ SELECT sql FROM temp.sqlite_master;
+ }
+} {{CREATE TABLE abc(a, b, c)}}
do_test alter4-1.2 {
execsql {ALTER TABLE abc ADD d INTEGER;}
execsql {
SELECT sql FROM sqlite_temp_master;
}
} {{CREATE TABLE abc(a, b, c, d INTEGER)}}
+do_test alter4-1.2b {
+ execsql {
+ SELECT sql FROM temp.sqlite_master;
+ }
+} {{CREATE TABLE abc(a, b, c, d INTEGER)}}
do_test alter4-1.3 {
execsql {ALTER TABLE abc ADD e}
execsql {
SELECT sql FROM sqlite_temp_master;
}
} {{CREATE TABLE abc(a, b, c, d INTEGER, e)}}
+do_test alter4-1.3b {
+ execsql {
+ SELECT sql FROM temp.sqlite_master;
+ }
+} {{CREATE TABLE abc(a, b, c, d INTEGER, e)}}
do_test alter4-1.4 {
execsql {
CREATE TABLE temp.t1(a, b);
@@ -64,6 +79,11 @@ do_test alter4-1.4 {
SELECT sql FROM sqlite_temp_master WHERE tbl_name = 't1';
}
} {{CREATE TABLE t1(a, b, c)}}
+do_test alter4-1.4b {
+ execsql {
+ SELECT sql FROM temp.sqlite_master WHERE tbl_name = 't1';
+ }
+} {{CREATE TABLE t1(a, b, c)}}
do_test alter4-1.5 {
execsql {
ALTER TABLE t1 ADD d CHECK (a>d);
@@ -355,4 +375,23 @@ do_execsql_test alter4-9.3 {
SELECT typeof(c), c FROM t5;
} {real 9.22337203685478e+18}
+# Confirm that doing an ALTER TABLE on a legacy format database
+# does not corrupt DESC indexes.
+#
+# Ticket https://www.sqlite.org/src/tktview/f68bf68513a1c
+#
+do_test alter4-10.1 {
+ db close
+ sqlite3 db :memory:
+ db eval {
+ PRAGMA legacy_file_format=on;
+ CREATE TABLE t1(a,b,c);
+ CREATE INDEX t1a ON t1(a DESC);
+ INSERT INTO t1 VALUES(1,2,3);
+ INSERT INTO t1 VALUES(2,3,4);
+ ALTER TABLE t1 ADD COLUMN d;
+ PRAGMA integrity_check;
+ }
+} {ok}
+
finish_test
« no previous file with comments | « third_party/sqlite/src/test/alter3.test ('k') | third_party/sqlite/src/test/analyze9.test » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698