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

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

Issue 6990047: Import SQLite 3.7.6.3. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 7 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/fts3an.test ('k') | third_party/sqlite/src/test/fts3aux1.test » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/sqlite/src/test/fts3ao.test
diff --git a/third_party/sqlite/src/test/fts3ao.test b/third_party/sqlite/src/test/fts3ao.test
index c3d356e8fde76c59713d710ac2e0e10718194877..cd9df01eb44cd7309ebc2b015d6a99d8ad56a408 100644
--- a/third_party/sqlite/src/test/fts3ao.test
+++ b/third_party/sqlite/src/test/fts3ao.test
@@ -23,6 +23,8 @@ ifcapable !fts3 {
return
}
+set ::testprefix fts3ao
+
#---------------------------------------------------------------------
# These tests, fts3ao-1.*, test that ticket #2429 is fixed.
#
@@ -166,4 +168,53 @@ do_test fts3ao-3.3 {
execsql { SELECT a, b, c FROM t1 WHERE c MATCH 'two'; }
} {{one three four} {one four} {one two}}
+#---------------------------------------------------------------------
+# Test that it is possible to rename an fts3 table within a
+# transaction.
+#
+do_test fts3ao-4.1 {
+ execsql {
+ CREATE VIRTUAL TABLE t4 USING fts3;
+ INSERT INTO t4 VALUES('the quick brown fox');
+ }
+} {}
+do_test fts3ao-4.2 {
+ execsql {
+ BEGIN;
+ INSERT INTO t4 VALUES('jumped over the');
+ }
+} {}
+do_test fts3ao-4.3 { execsql { ALTER TABLE t4 RENAME TO t5; } } {}
+do_test fts3ao-4.4 { execsql { INSERT INTO t5 VALUES('lazy dog'); } } {}
+do_test fts3ao-4.5 { execsql COMMIT } {}
+do_test fts3ao-4.6 {
+ execsql { SELECT * FROM t5 }
+} {{the quick brown fox} {jumped over the} {lazy dog}}
+do_test fts3ao-4.7 {
+ execsql {
+ BEGIN;
+ INSERT INTO t5 VALUES('Down came a jumbuck to drink at that billabong');
+ ALTER TABLE t5 RENAME TO t6;
+ INSERT INTO t6 VALUES('Down came the troopers, one, two, three');
+ ROLLBACK;
+ SELECT * FROM t5;
+ }
+} {{the quick brown fox} {jumped over the} {lazy dog}}
+
+# Test that it is possible to rename an FTS4 table. Renaming an FTS4 table
+# involves renaming the extra %_docsize and %_stat tables.
+#
+do_execsql_test 5.1 {
+ CREATE VIRTUAL TABLE t7 USING FTS4;
+ INSERT INTO t7 VALUES('coined by a German clinician');
+ SELECT count(*) FROM sqlite_master WHERE name LIKE 't7%';
+ SELECT count(*) FROM sqlite_master WHERE name LIKE 't8%';
+} {6 0}
+do_execsql_test 5.2 {
+ ALTER TABLE t7 RENAME TO t8;
+ SELECT count(*) FROM sqlite_master WHERE name LIKE 't7%';
+ SELECT count(*) FROM sqlite_master WHERE name LIKE 't8%';
+} {0 6}
+
finish_test
+
« no previous file with comments | « third_party/sqlite/src/test/fts3an.test ('k') | third_party/sqlite/src/test/fts3aux1.test » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698