| OLD | NEW |
| 1 # 2005 December 30 | 1 # 2005 December 30 |
| 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 1000 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1011 db2 close | 1011 db2 close |
| 1012 } | 1012 } |
| 1013 lappend res $name | 1013 lappend res $name |
| 1014 } | 1014 } |
| 1015 set res | 1015 set res |
| 1016 } {db1 db2 db3 db4 db5 db6 db7 db8 db9 db10 db11 db12 db13 db14} | 1016 } {db1 db2 db3 db4 db5 db6 db7 db8 db9 db10 db11 db12 db13 db14} |
| 1017 do_test shared-$av.14.3 { | 1017 do_test shared-$av.14.3 { |
| 1018 db close | 1018 db close |
| 1019 } {} | 1019 } {} |
| 1020 | 1020 |
| 1021 # Populate a database schema using connection [db]. Then drop it using |
| 1022 # [db2]. This is to try to find any points where shared-schema elements |
| 1023 # are allocated using the lookaside buffer of [db]. |
| 1024 # |
| 1025 # Mutexes are enabled for this test as that activates a couple of useful |
| 1026 # assert() statements in the C code. |
| 1027 # |
| 1028 do_test shared-$av-15.1 { |
| 1029 file delete -force test.db |
| 1030 sqlite3 db test.db -fullmutex 1 |
| 1031 sqlite3 db2 test.db -fullmutex 1 |
| 1032 execsql { |
| 1033 CREATE TABLE t1(a, b, c); |
| 1034 CREATE INDEX i1 ON t1(a, b); |
| 1035 CREATE VIEW v1 AS SELECT * FROM t1; |
| 1036 CREATE VIEW v2 AS SELECT * FROM t1, v1 |
| 1037 WHERE t1.c=v1.c GROUP BY t1.a ORDER BY v1.b; |
| 1038 CREATE TRIGGER tr1 AFTER INSERT ON t1 |
| 1039 WHEN new.a!=1 |
| 1040 BEGIN |
| 1041 DELETE FROM t1 WHERE a=5; |
| 1042 INSERT INTO t1 VALUES(1, 2, 3); |
| 1043 UPDATE t1 SET c=c+1; |
| 1044 END; |
| 1045 |
| 1046 INSERT INTO t1 VALUES(5, 6, 7); |
| 1047 INSERT INTO t1 VALUES(8, 9, 10); |
| 1048 INSERT INTO t1 VALUES(11, 12, 13); |
| 1049 ANALYZE; |
| 1050 SELECT * FROM t1; |
| 1051 } |
| 1052 } {1 2 6 8 9 12 1 2 5 11 12 14 1 2 4} |
| 1053 do_test shared-$av-15.2 { |
| 1054 execsql { DROP TABLE t1 } db2 |
| 1055 } {} |
| 1056 db close |
| 1057 db2 close |
| 1058 |
| 1021 } | 1059 } |
| 1022 | 1060 |
| 1023 sqlite3_enable_shared_cache $::enable_shared_cache | 1061 sqlite3_enable_shared_cache $::enable_shared_cache |
| 1024 finish_test | 1062 finish_test |
| OLD | NEW |