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

Side by Side Diff: third_party/sqlite/src/test/alter2.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 # 2005 February 18 1 # 2005 February 18
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 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
130 } 130 }
131 } {1 2 10} 131 } {1 2 10}
132 do_test alter2-1.8 { 132 do_test alter2-1.8 {
133 execsql { 133 execsql {
134 SELECT sum(a), c FROM abc GROUP BY c; 134 SELECT sum(a), c FROM abc GROUP BY c;
135 } 135 }
136 } {8 {} 1 10} 136 } {8 {} 1 10}
137 do_test alter2-1.9 { 137 do_test alter2-1.9 {
138 # ALTER TABLE abc ADD COLUMN d; 138 # ALTER TABLE abc ADD COLUMN d;
139 alter_table abc {CREATE TABLE abc(a, b, c, d);} 139 alter_table abc {CREATE TABLE abc(a, b, c, d);}
140 if {[permutation] == "prepare"} { db cache flush }
140 execsql { SELECT * FROM abc; } 141 execsql { SELECT * FROM abc; }
141 execsql { 142 execsql {
142 UPDATE abc SET d = 11 WHERE c IS NULL AND a<4; 143 UPDATE abc SET d = 11 WHERE c IS NULL AND a<4;
143 SELECT * FROM abc; 144 SELECT * FROM abc;
144 } 145 }
145 } {1 2 10 {} 3 4 {} 11 5 6 {} {}} 146 } {1 2 10 {} 3 4 {} 11 5 6 {} {}}
146 do_test alter2-1.10 { 147 do_test alter2-1.10 {
147 execsql { 148 execsql {
148 SELECT typeof(d) FROM abc; 149 SELECT typeof(d) FROM abc;
149 } 150 }
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after
307 # databases are still created with file-format 1. 308 # databases are still created with file-format 1.
308 # 309 #
309 do_test alter2-6.1 { 310 do_test alter2-6.1 {
310 db close 311 db close
311 set_file_format 2 312 set_file_format 2
312 sqlite3 db test.db 313 sqlite3 db test.db
313 get_file_format 314 get_file_format
314 } {2} 315 } {2}
315 ifcapable attach { 316 ifcapable attach {
316 do_test alter2-6.2 { 317 do_test alter2-6.2 {
317 file delete -force test2.db-journal 318 forcedelete test2.db-journal
318 file delete -force test2.db 319 forcedelete test2.db
319 execsql { 320 execsql {
320 ATTACH 'test2.db' AS aux; 321 ATTACH 'test2.db' AS aux;
321 CREATE TABLE aux.t1(a, b); 322 CREATE TABLE aux.t1(a, b);
322 } 323 }
323 get_file_format test2.db 324 get_file_format test2.db
324 } $default_file_format 325 } $default_file_format
325 } 326 }
326 do_test alter2-6.3 { 327 do_test alter2-6.3 {
327 execsql { 328 execsql {
328 CREATE TABLE t1(a, b); 329 CREATE TABLE t1(a, b);
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
458 } 459 }
459 } {a b d} 460 } {a b d}
460 do_test alter2-10.4 { 461 do_test alter2-10.4 {
461 execsql { 462 execsql {
462 SELECT count(b) FROM t2 WHERE b = X'ABCD'; 463 SELECT count(b) FROM t2 WHERE b = X'ABCD';
463 } 464 }
464 } {3} 465 } {3}
465 } 466 }
466 467
467 finish_test 468 finish_test
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698