/ Check-in [bfb0dd3c]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Add a test case to shared.test. No changes to production code.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: bfb0dd3c2f7e1ffbdf236be4adc3e0d804ed5854
User & Date: dan 2010-07-23 15:55:32
Context
2010-07-23
17:37
Merge two leaves. check-in: 54e5886d user: dan tags: trunk
15:55
Add a test case to shared.test. No changes to production code. check-in: bfb0dd3c user: dan tags: trunk
15:41
Remove the Table.dbMem variable, as it is no longer being used for its original purpose. check-in: 6eddc6e6 user: dan tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to test/shared.test.

  1013   1013       lappend res $name
  1014   1014     }
  1015   1015     set res
  1016   1016   } {db1 db2 db3 db4 db5 db6 db7 db8 db9 db10 db11 db12 db13 db14}
  1017   1017   do_test shared-$av.14.3 {
  1018   1018     db close
  1019   1019   } {}
         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
  1020   1058   
  1021   1059   }
  1022   1060   
  1023   1061   sqlite3_enable_shared_cache $::enable_shared_cache
  1024   1062   finish_test