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

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

Issue 901033002: Import SQLite 3.8.7.4. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Chromium changes to support SQLite 3.8.7.4. 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 unified diff | Download patch
OLDNEW
1 # 2001 October 7 1 # 2001 October 7
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 132 matching lines...) Expand 10 before | Expand all | Expand 10 after
143 execsql { 143 execsql {
144 CREATE INDEX i2 ON t2(x); 144 CREATE INDEX i2 ON t2(x);
145 DROP TABLE t2; 145 DROP TABLE t2;
146 } 146 }
147 catchsql {DROP INDEX i2} 147 catchsql {DROP INDEX i2}
148 } {1 {no such index: i2}} 148 } {1 {no such index: i2}}
149 149
150 # Check for correct name collision processing. A name collision can 150 # Check for correct name collision processing. A name collision can
151 # occur when process A creates a temporary table T then process B 151 # occur when process A creates a temporary table T then process B
152 # creates a permanent table also named T. The temp table in process A 152 # creates a permanent table also named T. The temp table in process A
153 # hides the existance of the permanent table. 153 # hides the existence of the permanent table.
154 # 154 #
155 do_test temptable-4.1 { 155 do_test temptable-4.1 {
156 execsql { 156 execsql {
157 CREATE TEMP TABLE t2(x,y); 157 CREATE TEMP TABLE t2(x,y);
158 INSERT INTO t2 VALUES(10,20); 158 INSERT INTO t2 VALUES(10,20);
159 SELECT * FROM t2; 159 SELECT * FROM t2;
160 } db2 160 } db2
161 } {10 20} 161 } {10 20}
162 do_test temptable-4.2 { 162 do_test temptable-4.2 {
163 execsql { 163 execsql {
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
285 285
286 # Now create a temporary table in db2 and a permanent index in db. The 286 # Now create a temporary table in db2 and a permanent index in db. The
287 # temporary table in db2 should mask the name of the permanent index, 287 # temporary table in db2 should mask the name of the permanent index,
288 # but the permanent index should still be accessible and should still 288 # but the permanent index should still be accessible and should still
289 # be updated when its corresponding table changes. 289 # be updated when its corresponding table changes.
290 # 290 #
291 do_test temptable-5.1 { 291 do_test temptable-5.1 {
292 execsql { 292 execsql {
293 CREATE TEMP TABLE mask(a,b,c) 293 CREATE TEMP TABLE mask(a,b,c)
294 } db2 294 } db2
295 if {[permutation]=="prepare"} { db2 cache flush }
295 execsql { 296 execsql {
296 CREATE INDEX mask ON t2(x); 297 CREATE INDEX mask ON t2(x);
297 SELECT * FROM t2; 298 SELECT * FROM t2;
298 } 299 }
299 } {3 4} 300 } {3 4}
300 #do_test temptable-5.2 { 301 #do_test temptable-5.2 {
301 # catchsql { 302 # catchsql {
302 # SELECT * FROM t2; 303 # SELECT * FROM t2;
303 # } db2 304 # } db2
304 #} {1 {database schema has changed}} 305 #} {1 {database schema has changed}}
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
396 } 397 }
397 } {0 {xyzzy 1 2}} 398 } {0 {xyzzy 1 2}}
398 do_test temptable-6.8 { 399 do_test temptable-6.8 {
399 db close 400 db close
400 sqlite3 db test.db 401 sqlite3 db test.db
401 catchsql { 402 catchsql {
402 SELECT * FROM t8,t9; 403 SELECT * FROM t8,t9;
403 } 404 }
404 } {1 {no such table: t9}} 405 } {1 {no such table: t9}}
405 406
406 file delete -force test2.db test2.db-journal 407 forcedelete test2.db test2.db-journal
407 ifcapable attach { 408 ifcapable attach {
408 do_test temptable-7.1 { 409 do_test temptable-7.1 {
409 catchsql { 410 catchsql {
410 ATTACH 'test2.db' AS two; 411 ATTACH 'test2.db' AS two;
411 CREATE TEMP TABLE two.abc(x,y); 412 CREATE TEMP TABLE two.abc(x,y);
412 } 413 }
413 } {1 {temporary table name must be unqualified}} 414 } {1 {temporary table name must be unqualified}}
414 } 415 }
415 416
416 # Need to do the following for tcl 8.5 on mac. On that configuration, the 417 # Need to do the following for tcl 8.5 on mac. On that configuration, the
417 # -readonly flag is taken so seriously that a subsequent [file delete -force] 418 # -readonly flag is taken so seriously that a subsequent [forcedelete]
418 # (required before the next test file can be executed) will fail. 419 # (required before the next test file can be executed) will fail.
419 # 420 #
420 catch {file attributes test.db -readonly 0} 421 catch {file attributes test.db -readonly 0}
421 422
422 do_test temptable-8.0 { 423 do_test temptable-8.0 {
423 db close 424 db close
424 catch {file delete -force test.db} 425 catch {forcedelete test.db}
425 sqlite3 db test.db 426 sqlite3 db test.db
426 } {} 427 } {}
427 do_test temptable-8.1 { 428 do_test temptable-8.1 {
428 execsql { CREATE TEMP TABLE tbl2(a, b); } 429 execsql { CREATE TEMP TABLE tbl2(a, b); }
429 execsql { 430 execsql {
430 CREATE TABLE tbl(a, b); 431 CREATE TABLE tbl(a, b);
431 INSERT INTO tbl VALUES(1, 2); 432 INSERT INTO tbl VALUES(1, 2);
432 } 433 }
433 execsql {SELECT * FROM tbl} 434 execsql {SELECT * FROM tbl}
434 } {1 2} 435 } {1 2}
435 do_test temptable-8.2 { 436 do_test temptable-8.2 {
436 execsql { CREATE TEMP TABLE tbl(a, b); } 437 execsql { CREATE TEMP TABLE tbl(a, b); }
437 execsql {SELECT * FROM tbl} 438 execsql {SELECT * FROM tbl}
438 } {} 439 } {}
439 440
440 finish_test 441 finish_test
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698