SQLite

Check-in [bfb0dd3c2f]
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
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: bfb0dd3c2f7e1ffbdf236be4adc3e0d804ed5854
User & Date: dan 2010-07-23 15:55:32.000
Context
2010-07-23
17:37
Merge two leaves. (check-in: 54e5886d84 user: dan tags: trunk)
15:55
Add a test case to shared.test. No changes to production code. (check-in: bfb0dd3c2f user: dan tags: trunk)
15:41
Remove the Table.dbMem variable, as it is no longer being used for its original purpose. (check-in: 6eddc6e601 user: dan tags: trunk)
Changes
Unified Diff Ignore Whitespace Patch
Changes to test/shared.test.
1013
1014
1015
1016
1017
1018
1019






































1020
1021
1022
1023
1024
    lappend res $name
  }
  set res
} {db1 db2 db3 db4 db5 db6 db7 db8 db9 db10 db11 db12 db13 db14}
do_test shared-$av.14.3 {
  db close
} {}







































}

sqlite3_enable_shared_cache $::enable_shared_cache
finish_test







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>





1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
    lappend res $name
  }
  set res
} {db1 db2 db3 db4 db5 db6 db7 db8 db9 db10 db11 db12 db13 db14}
do_test shared-$av.14.3 {
  db close
} {}

# Populate a database schema using connection [db]. Then drop it using
# [db2]. This is to try to find any points where shared-schema elements
# are allocated using the lookaside buffer of [db].
# 
# Mutexes are enabled for this test as that activates a couple of useful
# assert() statements in the C code.
#
do_test shared-$av-15.1 {
  file delete -force test.db
  sqlite3 db test.db -fullmutex 1
  sqlite3 db2 test.db -fullmutex 1
  execsql {
    CREATE TABLE t1(a, b, c);
    CREATE INDEX i1 ON t1(a, b);
    CREATE VIEW v1 AS SELECT * FROM t1; 
    CREATE VIEW v2 AS SELECT * FROM t1, v1 
                      WHERE t1.c=v1.c GROUP BY t1.a ORDER BY v1.b; 
    CREATE TRIGGER tr1 AFTER INSERT ON t1 
      WHEN new.a!=1
    BEGIN
      DELETE FROM t1 WHERE a=5;
      INSERT INTO t1 VALUES(1, 2, 3);
      UPDATE t1 SET c=c+1;
    END;

    INSERT INTO t1 VALUES(5, 6, 7);
    INSERT INTO t1 VALUES(8, 9, 10);
    INSERT INTO t1 VALUES(11, 12, 13);
    ANALYZE;
    SELECT * FROM t1;
  }
} {1 2 6 8 9 12 1 2 5 11 12 14 1 2 4}
do_test shared-$av-15.2 {
  execsql { DROP TABLE t1 } db2
} {}
db close
db2 close

}

sqlite3_enable_shared_cache $::enable_shared_cache
finish_test