mirror of
https://github.com/status-im/sqlcipher.git
synced 2026-08-30 22:11:14 +00:00
update to upstream sqlite 3.6.17
This commit is contained in:
+27
-2
@@ -16,7 +16,7 @@
|
||||
# to see what happens in the library if a malloc were to really fail
|
||||
# due to an out-of-memory situation.
|
||||
#
|
||||
# $Id: malloc.test,v 1.78 2009/04/09 01:23:49 drh Exp $
|
||||
# $Id: malloc.test,v 1.81 2009/06/24 13:13:45 drh Exp $
|
||||
|
||||
set testdir [file dirname $argv0]
|
||||
source $testdir/tester.tcl
|
||||
@@ -230,7 +230,7 @@ ifcapable utf16 {
|
||||
} else {
|
||||
set ::bomstr "\xFE\xFF"
|
||||
}
|
||||
append ::bomstr [encoding convertto unicode "123456789_123456789_12345678"]
|
||||
append ::bomstr [encoding convertto unicode "123456789_123456789_123456789"]
|
||||
} -tclbody {
|
||||
sqlite3_column_text16 $::STMT 0
|
||||
sqlite3_column_int $::STMT 0
|
||||
@@ -841,6 +841,31 @@ do_malloc_test 36 -sqlprep {
|
||||
SELECT test_agg_errmsg16(), group_concat(a) FROM t1
|
||||
}
|
||||
|
||||
# At one point, if an OOM occured immediately after obtaining a shared lock
|
||||
# on the database file, the file remained locked. This test case ensures
|
||||
# that bug has been fixed.i
|
||||
if {[db eval {PRAGMA locking_mode}]!="exclusive"} {
|
||||
do_malloc_test 37 -tclprep {
|
||||
sqlite3 db2 test.db
|
||||
execsql {
|
||||
CREATE TABLE t1(a, b);
|
||||
INSERT INTO t1 VALUES(1, 2);
|
||||
} db2
|
||||
} -sqlbody {
|
||||
SELECT * FROM t1;
|
||||
} -cleanup {
|
||||
# Try to write to the database using connection [db2]. If connection [db]
|
||||
# has correctly released the shared lock, this write attempt should
|
||||
# succeed. If [db] has not released the lock, this should hit an
|
||||
# SQLITE_BUSY error.
|
||||
do_test malloc-36.$zRepeat.${::n}.unlocked {
|
||||
execsql {INSERT INTO t1 VALUES(3, 4)} db2
|
||||
} {}
|
||||
db2 close
|
||||
}
|
||||
catch { db2 close }
|
||||
}
|
||||
|
||||
# Ensure that no file descriptors were leaked.
|
||||
do_test malloc-99.X {
|
||||
catch {db close}
|
||||
|
||||
Reference in New Issue
Block a user