OLD | NEW |
1 # 2004 November 12 | 1 # 2004 November 12 |
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 326 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
337 SELECT name FROM sqlite_sequence; | 337 SELECT name FROM sqlite_sequence; |
338 } | 338 } |
339 } {} | 339 } {} |
340 | 340 |
341 # AUTOINCREMENT on TEMP tables. | 341 # AUTOINCREMENT on TEMP tables. |
342 # | 342 # |
343 ifcapable tempdb { | 343 ifcapable tempdb { |
344 do_test autoinc-4.1 { | 344 do_test autoinc-4.1 { |
345 execsql { | 345 execsql { |
346 SELECT 1, name FROM sqlite_master WHERE type='table'; | 346 SELECT 1, name FROM sqlite_master WHERE type='table'; |
347 SELECT 2, name FROM sqlite_temp_master WHERE type='table'; | 347 SELECT 2, name FROM temp.sqlite_master WHERE type='table'; |
348 } | 348 } |
349 } {1 sqlite_sequence} | 349 } {1 sqlite_sequence} |
350 do_test autoinc-4.2 { | 350 do_test autoinc-4.2 { |
351 execsql { | 351 execsql { |
352 CREATE TABLE t1(x INTEGER PRIMARY KEY AUTOINCREMENT, y); | 352 CREATE TABLE t1(x INTEGER PRIMARY KEY AUTOINCREMENT, y); |
353 CREATE TEMP TABLE t3(a INTEGER PRIMARY KEY AUTOINCREMENT, b); | 353 CREATE TEMP TABLE t3(a INTEGER PRIMARY KEY AUTOINCREMENT, b); |
354 SELECT 1, name FROM sqlite_master WHERE type='table'; | 354 SELECT 1, name FROM sqlite_master WHERE type='table'; |
355 SELECT 2, name FROM sqlite_temp_master WHERE type='table'; | 355 SELECT 2, name FROM sqlite_temp_master WHERE type='table'; |
356 } | 356 } |
357 } {1 sqlite_sequence 1 t1 2 t3 2 sqlite_sequence} | 357 } {1 sqlite_sequence 1 t1 2 t3 2 sqlite_sequence} |
(...skipping 298 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
656 CREATE VIEW va69637_2 AS SELECT * FROM ta69637_2; | 656 CREATE VIEW va69637_2 AS SELECT * FROM ta69637_2; |
657 CREATE TRIGGER ra69637_2 INSTEAD OF INSERT ON va69637_2 BEGIN | 657 CREATE TRIGGER ra69637_2 INSTEAD OF INSERT ON va69637_2 BEGIN |
658 INSERT INTO ta69637_1(y) VALUES(new.z+10000); | 658 INSERT INTO ta69637_1(y) VALUES(new.z+10000); |
659 END; | 659 END; |
660 INSERT INTO va69637_2 VALUES(123); | 660 INSERT INTO va69637_2 VALUES(123); |
661 SELECT * FROM ta69637_1; | 661 SELECT * FROM ta69637_1; |
662 } | 662 } |
663 } {1 124 2 10123} | 663 } {1 124 2 10123} |
664 } | 664 } |
665 | 665 |
| 666 # 2016-10-03 ticket https://www.sqlite.org/src/tktview/7b3328086a5c1 |
| 667 # Make sure autoincrement plays nicely with the xfer optimization |
| 668 # |
| 669 do_execsql_test autoinc-10.1 { |
| 670 DELETE FROM sqlite_sequence; |
| 671 CREATE TABLE t10a(a INTEGER PRIMARY KEY AUTOINCREMENT, b UNIQUE); |
| 672 INSERT INTO t10a VALUES(888,9999); |
| 673 CREATE TABLE t10b(x INTEGER PRIMARY KEY AUTOINCREMENT, y UNIQUE); |
| 674 INSERT INTO t10b SELECT * FROM t10a; |
| 675 SELECT * FROM sqlite_sequence; |
| 676 } {t10a 888 t10b 888} |
| 677 |
666 | 678 |
667 | 679 |
668 finish_test | 680 finish_test |
OLD | NEW |