OLD | NEW |
1 # 2001 September 15 | 1 # 2001 September 15 |
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 648 matching lines...) Loading... |
659 CREATE TABLE t8(a UNIQUE PRIMARY KEY ON CONFLICT ROLLBACK); | 659 CREATE TABLE t8(a UNIQUE PRIMARY KEY ON CONFLICT ROLLBACK); |
660 INSERT INTO t7 VALUES(1); | 660 INSERT INTO t7 VALUES(1); |
661 INSERT INTO t8 VALUES(1); | 661 INSERT INTO t8 VALUES(1); |
662 } | 662 } |
663 } {} | 663 } {} |
664 do_test index-19.2 { | 664 do_test index-19.2 { |
665 catchsql { | 665 catchsql { |
666 BEGIN; | 666 BEGIN; |
667 INSERT INTO t7 VALUES(1); | 667 INSERT INTO t7 VALUES(1); |
668 } | 668 } |
669 } {1 {column a is not unique}} | 669 } {1 {UNIQUE constraint failed: t7.a}} |
670 do_test index-19.3 { | 670 do_test index-19.3 { |
671 catchsql { | 671 catchsql { |
672 BEGIN; | 672 BEGIN; |
673 } | 673 } |
674 } {1 {cannot start a transaction within a transaction}} | 674 } {1 {cannot start a transaction within a transaction}} |
675 do_test index-19.4 { | 675 do_test index-19.4 { |
676 catchsql { | 676 catchsql { |
677 INSERT INTO t8 VALUES(1); | 677 INSERT INTO t8 VALUES(1); |
678 } | 678 } |
679 } {1 {column a is not unique}} | 679 } {1 {UNIQUE constraint failed: t8.a}} |
680 do_test index-19.5 { | 680 do_test index-19.5 { |
681 catchsql { | 681 catchsql { |
682 BEGIN; | 682 BEGIN; |
683 COMMIT; | 683 COMMIT; |
684 } | 684 } |
685 } {0 {}} | 685 } {0 {}} |
686 do_test index-19.6 { | 686 do_test index-19.6 { |
687 catchsql { | 687 catchsql { |
688 DROP TABLE t7; | 688 DROP TABLE t7; |
689 DROP TABLE t8; | 689 DROP TABLE t8; |
(...skipping 18 matching lines...) Loading... |
708 execsql { | 708 execsql { |
709 CREATE INDEX "t6i2" ON t6(c); | 709 CREATE INDEX "t6i2" ON t6(c); |
710 DROP INDEX "t6i2"; | 710 DROP INDEX "t6i2"; |
711 } | 711 } |
712 } {} | 712 } {} |
713 do_test index-20.2 { | 713 do_test index-20.2 { |
714 execsql { | 714 execsql { |
715 DROP INDEX "t6i1"; | 715 DROP INDEX "t6i1"; |
716 } | 716 } |
717 } {} | 717 } {} |
| 718 |
| 719 # Try to create a TEMP index on a non-TEMP table. */ |
| 720 # |
| 721 do_test index-21.1 { |
| 722 catchsql { |
| 723 CREATE INDEX temp.i21 ON t6(c); |
| 724 } |
| 725 } {1 {cannot create a TEMP index on non-TEMP table "t6"}} |
| 726 do_test index-21.2 { |
| 727 catchsql { |
| 728 CREATE TEMP TABLE t6(x); |
| 729 INSERT INTO temp.t6 values(1),(5),(9); |
| 730 CREATE INDEX temp.i21 ON t6(x); |
| 731 SELECT x FROM t6 ORDER BY x DESC; |
| 732 } |
| 733 } {0 {9 5 1}} |
| 734 |
718 | 735 |
719 | 736 |
720 finish_test | 737 finish_test |
OLD | NEW |