Compare commits

..

28 Commits

Author SHA1 Message Date
drh 77f6af2b96 Avoid unnecessary fstat() calls to determine the database size when
transitioning into a read transaction on a rollback-mode database.

FossilOrigin-Name: 6c3476b513965df22d648f9a1b99733af753b44d51163cc7d42a69bf562300e1
2017-05-29 16:45:45 +00:00
drh 5f5a2d1c3c Avoid unnecessary calls to fstat() to determine the database file size.
FossilOrigin-Name: c733a1dea37e4678e7bd0d3d0ca9b8eae1fbdc28615f75d8f1e5141aa53567d9
2017-05-29 14:57:23 +00:00
drh 8abc54e2e8 Fix a typo in a comment. No code changes.
FossilOrigin-Name: cb29b838886769afe866b1172e3d5d7e36387149b79c51f91cf59da3f4a5f25b
2017-05-29 14:30:46 +00:00
drh 979dd1be57 Optimizations to the Walker object and its methods to make the code a little
smaller and to help it run a little faster.

FossilOrigin-Name: 6854a34ed708259f2280f7ee56cec09f7fc99810dc739dc2814ddeae286aa2c4
2017-05-29 14:26:07 +00:00
drh d8a295669c Correctly initialize the iSelectId of FROM clause terms that are a self
join of a reused materialized subquery.  Without this, the EXPLAIN QUERY PLAN
output for the query will identify the subquery using the uninitialized
(and arbitrary) iSelectId.

FossilOrigin-Name: 43c9ae371f6250fee98a7c4011726eff8ad37f5a97add4f490ac3a2dd501a0d2
2017-05-29 13:09:24 +00:00
mistachkin e16a350f17 Improve shell help text for the '.open' command.
FossilOrigin-Name: 7cc940a97efc096ff3725710f526c06f52453bd923fb9e825ce6990275df747a
2017-05-29 03:48:13 +00:00
drh ae2ac854b3 Smaller and faster vdbeSorterCompareText().
FossilOrigin-Name: 542dc4c5eb87017fe03b6c181e779993aa84564785e1177ccf937d52f985593b
2017-05-27 22:42:36 +00:00
drh 14e845a9d4 Small performance increase and size decrease in the btreeInitPage() routine.
FossilOrigin-Name: 6f415833e0554706dcf04f68ecba4ca2e54c08f3bbf6a1dba182bb132c912a2e
2017-05-25 21:35:56 +00:00
drh 137c46f8b6 Merge the LEFT JOIN query flattener fixes from 3.19.2.
FossilOrigin-Name: 6513e4a121e32df7e5cd95f47cdf8049b85bdbcb378cf23db29838fb1143d3ce
2017-05-25 17:27:52 +00:00
drh f43ce0b445 The TK_IF_NULL_ROW expression node must be treated as a variable that
references the table Expr.iTable.
Proposed fix for ticket [7fde638e94287d2c].

FossilOrigin-Name: 77fc23013cebc7797985864b91d78db5d0e2469511732044ebfaf02b891c979a
2017-05-25 00:08:48 +00:00
mistachkin 831265f962 Fix harmless compiler warnings in FTS5.
FossilOrigin-Name: 57a60e959c198b87ed29fab14356f89e0ea7cdb1dd99adbea45b40e8d0cb310a
2017-05-24 15:32:44 +00:00
drh 63ad86e70e Fix a problem in STAT4 equality estimation for multi-column indexes
introduced by check-in [3e0590dee0e68cc1599].

FossilOrigin-Name: cfb0d9e0207128b1c2b48689288a849b19dbc00a22cfaca26eec4bfc773629f8
2017-05-24 04:18:00 +00:00
drh ce13b99f99 Remove the msvc.h header file from the autoconf tarball.
FossilOrigin-Name: 84996aef68adeabc8bd97cad269188c67de628f776337a25ec2d63bc956cee78
2017-05-23 20:00:00 +00:00
drh 92b71757f7 Do not use strcpy() in the (obsolete) amatch extension.
In releasetest.tcl, run Apple tests using -Os instead of -O1

FossilOrigin-Name: 4440e42031b9cb0edf9a8621cd4f46f209392940ec5b9eefcf8c1e3fef5f7b76
2017-05-23 19:35:20 +00:00
drh 1d1fc5e385 Disable the LEFT JOIN flattening optimization for aggregate queries, as it
does not currently work.  Further fix for ticket [cad1ab4cb7b0fc344].

FossilOrigin-Name: 44b21e35c92137cc519d0cc87c627cc531d0bd442a7b9a7356fa2c6bc5f70fb6
2017-05-23 15:21:37 +00:00
drh eff0a7b25e Ensure that the expression rewriter inside the query flattener decends into
the substructure of the TK_IF_NULL_ROW operator.  This is a continuation
of the fix for ticket [cad1ab4cb7b0fc344].

FossilOrigin-Name: 941d8142b7c9a96ff143d1add3c86cf42d61fd08e532d400dac555f23eadbcfb
2017-05-23 12:36:13 +00:00
drh 3f1e9e00e6 When flattening a query, make sure iTable attribute of TK_IF_NULL_ROW
operators (that result from a prior flattening of a LEFT JOIN) are updated
correctly.  Fix for ticket [cad1ab4cb7b0fc344].

FossilOrigin-Name: 92c178507df553e4f1110342c8f9b11b3ee37989e1d634fcaccabf657befa22f
2017-05-23 01:21:07 +00:00
drh d4fb196531 Remove a surplus semicolon, which was harmless on gcc and clang but caused
compile-time errors on msvc.  This only comes up using the encryption extension.

FossilOrigin-Name: 987a2b5537254b1fe843eb798d7eb7f04dbe1e32fb827cfb9e1e1ef6c2096759
2017-05-23 00:32:56 +00:00
dan 07d0f15e93 Fix incompatibilities between the "sqldiff --changeset" command and the
sessions module. Specifically, allow sessions to process changesets containing
tables with zero operations on them and have sqldiff output the expected
output for tables with multi-column primary keys.

FossilOrigin-Name: 0bb23c48064cc64134697469f3f4d2d3610b9e6c7a0dc54a3c47a00bd6c2a860
2017-05-22 18:09:00 +00:00
drh 453ca043a2 Add the ".cd" command to the command-line shell.
FossilOrigin-Name: 5fe28e15b1d6d8a588fcaf93c6035c0e0ab7bcad1067c7933cd430d2e04bbbd8
2017-05-22 18:00:34 +00:00
drh ee841262d9 Increase the version number to 3.20 for the next release cycle.
FossilOrigin-Name: ab471f61ef7d9ed1bf937d5e458f720d12209712a015786434edc818a98168c9
2017-05-22 17:39:37 +00:00
drh d758722449 Merge the last-minute 3.19.0 changes into trunk.
FossilOrigin-Name: e6ba2a93a8d28074ff134dd43c142315de291b7c0a38ecc692863c33975c71c7
2017-05-22 14:04:46 +00:00
dan 21766c0c16 Fix a case where NULL was being passed to memcmp() following an OOM. This is
probably not a real problem, as the number-of-bytes parameter was passed 0 in
this case, but it was causing a santizer complaint.

FossilOrigin-Name: 3ea2bad27e516d5dbfa4a9cb0c767d6a8387280a7e4bbf2ae80cd318da670d66
2017-05-22 08:04:09 +00:00
drh 78436d4c66 When planning a query using sorting, resolve ties in the solver by selecting
loop plans with the smaller unsorted cost.

FossilOrigin-Name: f261678c90297f9767040c577796cc1d4db598aa44b0de6906cb73eaef377dee
2017-05-22 00:45:15 +00:00
drh e46515b53f Prevent a possible NULL pointer dereference in the OP_Found opcode that
can follow an OOM error.  Problem found by OSS-Fuzz.

FossilOrigin-Name: c2de178fe7e2e4e0d764e7e6ac637cfc8c053580c43f7246318dafad2974de3c
2017-05-19 22:51:00 +00:00
drh bcbb066534 Improved comments on one routine in the query planner. Improved diagnostic
output for ".wheretrace".  No production code changes.

FossilOrigin-Name: 946b87a5282f00d8c532a51f4390e6de781b9a0d6626cb3c077c5622895dc540
2017-05-19 20:55:04 +00:00
drh 748465b49e Fix a documentation typo. No changes to code.
FossilOrigin-Name: 68942a4feeb83e6e1a32d9bd724ae1d72669949adcfad07fb05b0ac48daf5151
2017-05-19 20:47:54 +00:00
drh 1e1c4226ee Fix a documentation typo. No changes to code.
FossilOrigin-Name: cfa4aa203646f44b303138c25672293bb87d97126fe2030d4709e8ad7814a807
2017-05-18 18:17:55 +00:00
115 changed files with 975 additions and 4202 deletions
+9 -22
View File
@@ -63,7 +63,7 @@ LIBREADLINE = @TARGET_READLINE_LIBS@
# Should the database engine be compiled threadsafe
#
#TCC += -DSQLITE_THREADSAFE=@SQLITE_THREADSAFE@
TCC += -DSQLITE_THREADSAFE=@SQLITE_THREADSAFE@
# Any target libraries which libsqlite must be linked against
#
@@ -114,7 +114,7 @@ TCLSH_CMD = @TCLSH_CMD@
# Where do we want to install the tcl plugin
#
TCLLIBDIR = /System/Library/Tcl
TCLLIBDIR = @TCLLIBDIR@
# The suffix used on shared libraries. Ex: ".dll", ".so", ".dylib"
#
@@ -343,9 +343,6 @@ SRC += \
SRC += \
$(TOP)/ext/rtree/rtree.h \
$(TOP)/ext/rtree/rtree.c
SRC += \
$(TOP)/ext/sqlrr/sqlrr.h \
$(TOP)/ext/sqlrr/sqlrr.c
SRC += \
$(TOP)/ext/session/sqlite3session.c \
$(TOP)/ext/session/sqlite3session.h
@@ -538,17 +535,6 @@ EXTHDR += \
$(TOP)/ext/icu/sqliteicu.h
EXTHDR += \
$(TOP)/ext/rtree/sqlite3rtree.h
EXTHDR += \
$(TOP)/ext/sqlrr/sqlrr.h
# If using the amalgamation, use sqlite3.c directly to build the test
# fixture. Otherwise link against libsqlite3.la. (This distinction is
# necessary because the test fixture requires non-API symbols which are
# hidden when the library is built via the amalgamation).
#
TESTFIXTURE_SRC0 = $(TESTSRC2) libsqlite3.la
TESTFIXTURE_SRC1 = sqlite3.c
TESTFIXTURE_SRC = $(TESTSRC) $(TOP)/src/tclsqlite.c $(TESTFIXTURE_SRC$(USE_AMALGAMATION))
# executables needed for testing
#
@@ -602,8 +588,9 @@ libsqlite3.la: $(LIBOBJ)
libtclsqlite3.la: tclsqlite.lo libsqlite3.la
$(LTLINK) -no-undefined -o $@ tclsqlite.lo \
libsqlite3.la @TCL_STUB_LIB_SPEC@ $(TLIBS) \
-rpath "$(TCLLIBDIR)/sqlite3" \
-version-info "8:6:8"
-rpath "$(TCLLIBDIR)" \
-version-info "8:6:8" \
-avoid-version
sqlite3$(TEXE): $(TOP)/src/shell.c sqlite3.c
$(LTLINK) $(READLINE_FLAGS) $(SHELL_OPT) -o $@ \
@@ -1267,10 +1254,10 @@ install: sqlite3$(TEXE) lib_install sqlite3.h sqlite3.pc ${HAVE_TCL:1=tcl_instal
pkgIndex.tcl:
echo 'package ifneeded sqlite3 $(RELEASE) [list load $(TCLLIBDIR)/libtclsqlite3$(SHLIB_SUFFIX) sqlite3]' > $@
tcl_install: lib_install libtclsqlite3.la pkgIndex.tcl
$(INSTALL) -d $(DESTDIR)$(TCLLIBDIR)/sqlite3
$(LTINSTALL) libtclsqlite3.la $(DESTDIR)$(TCLLIBDIR)/sqlite3
rm -f $(DESTDIR)$(TCLLIBDIR)/sqlite3/libtclsqlite3.la $(DESTDIR)$(TCLLIBDIR)/sqlite3/libtclsqlite3.a
$(INSTALL) -m 0644 pkgIndex.tcl $(DESTDIR)$(TCLLIBDIR)/sqlite3
$(INSTALL) -d $(DESTDIR)$(TCLLIBDIR)
$(LTINSTALL) libtclsqlite3.la $(DESTDIR)$(TCLLIBDIR)
rm -f $(DESTDIR)$(TCLLIBDIR)/libtclsqlite3.la $(DESTDIR)$(TCLLIBDIR)/libtclsqlite3.a
$(INSTALL) -m 0644 pkgIndex.tcl $(DESTDIR)$(TCLLIBDIR)
clean:
rm -f *.lo *.la *.o sqlite3$(TEXE) libsqlite3.la
+1 -4
View File
@@ -1505,10 +1505,7 @@ FUZZDATA = \
# when the shell is not being dynamically linked.
#
!IF $(DYNAMIC_SHELL)==0 && $(FOR_WIN10)==0
SHELL_COMPILE_OPTS = $(SHELL_COMPILE_OPTS) -DSQLITE_SHELL_JSON1 -DSQLITE_ENABLE_FTS4
# SHELL_COMPILE_OPTS = $(SHELL_COMPILE_OPTS) -DSQLITE_ENABLE_FTS5
SHELL_COMPILE_OPTS = $(SHELL_COMPILE_OPTS) -DSQLITE_ENABLE_EXPLAIN_COMMENTS
SHELL_COMPILE_OPTS = $(SHELL_COMPILE_OPTS) -DSQLITE_ENABLE_UNKNOWN_SQL_FUNCTION
SHELL_COMPILE_OPTS = $(SHELL_COMPILE_OPTS) -DSQLITE_SHELL_JSON1 -DSQLITE_ENABLE_FTS4 -DSQLITE_ENABLE_EXPLAIN_COMMENTS
!ENDIF
# <<mark>>
+1 -1
View File
@@ -1 +1 @@
3.19.2
3.20.0
+1 -1
View File
@@ -12,7 +12,7 @@ sqlite3_LDADD = @EXTRA_SHELL_OBJ@ @READLINE_LIBS@
sqlite3_DEPENDENCIES = @EXTRA_SHELL_OBJ@
sqlite3_CFLAGS = $(AM_CFLAGS) -DSQLITE_ENABLE_EXPLAIN_COMMENTS
include_HEADERS = sqlite3.h sqlite3ext.h msvc.h
include_HEADERS = sqlite3.h sqlite3ext.h
EXTRA_DIST = sqlite3.1 tea Makefile.msc sqlite3.rc README.txt Replace.cs
pkgconfigdir = ${libdir}/pkgconfig
Vendored
+9 -9
View File
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.69 for sqlite 3.19.2.
# Generated by GNU Autoconf 2.69 for sqlite 3.20.0.
#
#
# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc.
@@ -726,8 +726,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='sqlite'
PACKAGE_TARNAME='sqlite'
PACKAGE_VERSION='3.19.2'
PACKAGE_STRING='sqlite 3.19.2'
PACKAGE_VERSION='3.20.0'
PACKAGE_STRING='sqlite 3.20.0'
PACKAGE_BUGREPORT=''
PACKAGE_URL=''
@@ -1463,7 +1463,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
\`configure' configures sqlite 3.19.2 to adapt to many kinds of systems.
\`configure' configures sqlite 3.20.0 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -1528,7 +1528,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
short | recursive ) echo "Configuration of sqlite 3.19.2:";;
short | recursive ) echo "Configuration of sqlite 3.20.0:";;
esac
cat <<\_ACEOF
@@ -1652,7 +1652,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
sqlite configure 3.19.2
sqlite configure 3.20.0
generated by GNU Autoconf 2.69
Copyright (C) 2012 Free Software Foundation, Inc.
@@ -2071,7 +2071,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by sqlite $as_me 3.19.2, which was
It was created by sqlite $as_me 3.20.0, which was
generated by GNU Autoconf 2.69. Invocation command line was
$ $0 $@
@@ -12151,7 +12151,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
This file was extended by sqlite $as_me 3.19.2, which was
This file was extended by sqlite $as_me 3.20.0, which was
generated by GNU Autoconf 2.69. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@@ -12217,7 +12217,7 @@ _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
sqlite config.status 3.19.2
sqlite config.status 3.20.0
configured by $0, generated by GNU Autoconf 2.69,
with options \\"\$ac_cs_config\\"
+4 -3
View File
@@ -171,10 +171,11 @@ static int fts5HashResize(Fts5Hash *pHash){
for(i=0; i<pHash->nSlot; i++){
while( apOld[i] ){
int iHash;
unsigned int iHash;
Fts5HashEntry *p = apOld[i];
apOld[i] = p->pHashNext;
iHash = fts5HashKey(nNew, (u8*)fts5EntryKey(p), strlen(fts5EntryKey(p)));
iHash = fts5HashKey(nNew, (u8*)fts5EntryKey(p),
(int)strlen(fts5EntryKey(p)));
p->pHashNext = apNew[iHash];
apNew[iHash] = p;
}
@@ -477,7 +478,7 @@ int sqlite3Fts5HashQuery(
int *pnDoclist /* OUT: Size of doclist in bytes */
){
unsigned int iHash = fts5HashKey(pHash->nSlot, (const u8*)pTerm, nTerm);
char *zKey;
char *zKey = 0;
Fts5HashEntry *p;
for(p=pHash->aSlot[iHash]; p; p=p->pHashNext){
+1 -1
View File
@@ -182,7 +182,7 @@ static int fts5tokConnectMethod(
Fts5tokTable *pTab = 0;
int rc;
char **azDequote = 0;
int nDequote;
int nDequote = 0;
rc = sqlite3_declare_vtab(db,
"CREATE TABLE x(input HIDDEN, token, start, end, position)"
+1
View File
@@ -90,6 +90,7 @@ do_test 2.7 {
execsql { SELECT rowid FROM tt('a') ORDER BY rank; } db
} {1 3 2}
db2 close
#--------------------------------------------------------------------------
# At one point there was a problem with queries such as:
-6
View File
@@ -1001,7 +1001,6 @@ static void amatchWriteCost(amatch_word *pWord){
/* Circumvent compiler warnings about the use of strcpy() by supplying
** our own implementation.
*/
#if defined(__OpenBSD__)
static void amatchStrcpy(char *dest, const char *src){
while( (*(dest++) = *(src++))!=0 ){}
}
@@ -1009,11 +1008,6 @@ static void amatchStrcat(char *dest, const char *src){
while( *dest ) dest++;
amatchStrcpy(dest, src);
}
#else
# define amatchStrcpy strcpy
# define amatchStrcat strcat
#endif
/*
** Add a new amatch_word object to the queue.
-1
View File
@@ -63,7 +63,6 @@
#include <string.h>
#include <assert.h>
#include <stdint.h>
#include <stdio.h>
#ifndef SQLITE_AMALGAMATION
+114
View File
@@ -0,0 +1,114 @@
# 2015-07-31
#
# The author disclaims copyright to this source code. In place of
# a legal notice, here is a blessing:
#
# May you do good and not evil.
# May you find forgiveness for yourself and forgive others.
# May you share freely, never taking more than you give.
#
#***********************************************************************
#
# Tests for the [sqldiff --changeset] command.
#
#
if {![info exists testdir]} {
set testdir [file join [file dirname [info script]] .. .. test]
}
source $testdir/tester.tcl
set testprefix sessiondiff
set PROG [test_find_sqldiff]
db close
proc sqlesc {id} {
set ret "'[string map {' ''} $id]'"
set ret
}
proc database_cksum {db1} {
set txt ""
sqlite3 dbtmp $db1
foreach tbl [dbtmp eval {SELECT name FROM sqlite_master WHERE type='table'}] {
set cols [list]
dbtmp eval "PRAGMA table_info = [sqlesc $tbl]" {
lappend cols "quote( $name )"
}
append txt [dbtmp eval \
"SELECT [join $cols {||'.'||}] FROM [sqlesc $tbl] ORDER BY 1"
]
}
dbtmp close
md5 $txt
}
proc readfile {filename} {
set fd [open $filename]
fconfigure $fd -translation binary -encoding binary
set data [read $fd]
close $fd
set data
}
proc get_changeset {db1 db2} {
exec $::PROG --changeset changeset.bin $db1 $db2
set bin [readfile changeset.bin]
return $bin
}
proc xConflict {args} {
return ""
}
proc do_changeset_test {tn sql1 sql2} {
forcedelete test.db123 test.db124
sqlite3 db test.db123
db eval $sql1
db close
sqlite3 db test.db124
db eval $sql2
set cs [get_changeset test.db124 test.db123]
sqlite3changeset_apply db $cs xConflict
db close
set database_cksum1 [database_cksum test.db123]
set database_cksum2 [database_cksum test.db124]
uplevel [list \
do_test $tn [list string compare $database_cksum1 $database_cksum2] 0
]
}
do_changeset_test 1.0 {
CREATE TABLE t1(x PRIMARY KEY);
} {
CREATE TABLE t1(x PRIMARY KEY);
}
do_changeset_test 1.1 {
CREATE TABLE t1(x PRIMARY KEY);
CREATE TABLE t2(x PRIMARY KEY, y);
INSERT INTO t2 VALUES(1, 2);
} {
CREATE TABLE t1(x PRIMARY KEY);
CREATE TABLE t2(x PRIMARY KEY, y);
INSERT INTO t2 VALUES(3, 4);
}
do_changeset_test 1.2 {
CREATE TABLE t2(a, b, c, PRIMARY KEY(b, c));
INSERT INTO t2 VALUES(1, 2, 3);
INSERT INTO t2 VALUES(4, 5, 6);
} {
CREATE TABLE t2(a, b, c, PRIMARY KEY(b, c));
INSERT INTO t2 VALUES(1, 2, 11);
INSERT INTO t2 VALUES(7, 8, 9);
}
finish_test
+2 -1
View File
@@ -2836,11 +2836,12 @@ static int sessionChangesetNext(
p->in.iCurrent = p->in.iNext;
op = p->in.aData[p->in.iNext++];
if( op=='T' || op=='P' ){
while( op=='T' || op=='P' ){
p->bPatchset = (op=='P');
if( sessionChangesetReadTblhdr(p) ) return p->rc;
if( (p->rc = sessionInputBuffer(&p->in, 2)) ) return p->rc;
p->in.iCurrent = p->in.iNext;
if( p->in.iNext>=p->in.nData ) return SQLITE_DONE;
op = p->in.aData[p->in.iNext++];
}
-54
View File
@@ -1,54 +0,0 @@
sqlrr - 10/19/2009
SQL Replay Recording
SUMMARY
-------------------------------------------------------
This extension enables recording sqlite API calls that access the database so that they can be replayed or examined.
USAGE
------------------------------------------------------
Recording is enabled by compiling sqlite with symbolic constant SQLITE_ENABLE_SQLRR defined.
By default logs are written to /tmp/<databasename>_<pid>_<connection_number>.sqlrr, to choose another directory, set the environment variable SQLITE_REPLAY_RECORD_DIR to that path.
FILE FORMAT
-----------------------------------------------------
file: <header>[<sql-command>]*
header: <signature><format-version>
signature: SQLRR (5 bytes)
format-version: n (1 byte)
sql-command: <timestamp><type><arg-data>
timestamp: n (16 bytes)
type: n (1 byte)
open 0
close 1
exec 8
bind-text 16
bind-double 17
bind-int 18
bind-null 19
bind-value 20
bind-clear 21
prep 32
step 33
reset 34
finalize 35
open-arg-data: <connection><path><flags>
close-arg-data: <connection>
exec-arg-data: <connection><len><statement-text>
bind-text-arg-data: <statement-ref><index><len><data>
bind-double-arg-data: <statement-ref><index><data>
bind-int-arg-data: <statement-ref><index><data>
bind-null-arg-data: <statement-ref><index>
bind-value-arg-data: <statement-ref><index><len><data> ???
bind-clear-arg-data: <statement-ref>
prep-arg-data: <connection><len><statement-text>
step-arg-data: <statement-ref>
reset-arg-data: <statement-ref>
finalize-arg-data: <statement-ref>
NOTES
-581
View File
@@ -1,581 +0,0 @@
/*
* sqlrr.c
*/
#include "sqlrr.h"
#if defined(SQLITE_ENABLE_SQLRR)
#include <unistd.h>
#include <string.h>
#include <stdio.h>
#include <sys/param.h>
#include <errno.h>
#include <pthread.h>
#include <libkern/OSAtomic.h>
#include "sqliteInt.h"
#include "vdbeInt.h"
#define LOGSUFFIXLEN 48
/*
* Data types
*/
typedef struct SRRLogRef SRRLogRef;
struct SRRLogRef {
int fd;
sqlite3 *db;
const char *dbPath;
char *logPath;
int connection;
int depth;
SRRLogRef *nextRef;
};
/*
* Globals
*/
SRRLogRef *logRefHead = NULL;
int dbLogCount = 0;
static int srr_enabled = 1;
pthread_mutex_t srr_log_mutex;
static volatile int32_t srr_initialized = 0;
/*
* Log management
*/
extern void SRRecInitialize() {
int go = OSAtomicCompareAndSwap32Barrier(0, 1, &srr_initialized);
if( go ){
pthread_mutex_init(&srr_log_mutex, NULL);
}
}
static SRRLogRef *createLog(sqlite3 *db, const char *dbPath) {
SRRLogRef *ref = NULL;
char *baseDir = getenv("SQLITE_REPLAY_RECORD_DIR");
char logPath[MAXPATHLEN] = "";
char suffix[LOGSUFFIXLEN] = "";
const char *dbName = dbPath;
int len = 0;
int index = 0;
int fd = -1;
size_t out;
unsigned char version = SRR_FILE_VERSION;
SRRecInitialize();
/* construct the path for the log file
* ${SQLITE_REPLAY_DIR}/<dbname>_<pid>_<connection_number>.sqlrr
*/
if (baseDir == NULL) {
baseDir = "/tmp"; /* getenv(TMPDIR) */
}
len = strlen(baseDir);
strlcat(logPath, baseDir, MAXPATHLEN);
if ((len>0) && (baseDir[len-1] != '/')) {
strlcat(logPath, "/", MAXPATHLEN);
}
len = strlen(dbPath);
for (index = len-2; index >= 0; index --){
if (dbPath[index] == '/') {
dbName = &dbPath[index+1];
break;
}
}
strlcat(logPath, dbName, MAXPATHLEN);
int cNum = ++dbLogCount;
snprintf(suffix, sizeof(suffix), "_%d_%d_XXXX.sqlrr", getpid(), cNum);
len = strlcat(logPath, suffix, MAXPATHLEN);
/* make it unique if we have the space */
if ((len + 1) < MAXPATHLEN) {
fd = mkstemps(logPath, 6);
} else {
fprintf(stderr, "Failed to create sqlite replay log path for %s [%s]\n", dbPath, logPath);
return NULL;
}
if (fd == -1) {
fprintf(stderr, "Failed to create sqlite replay log file for %s with path %s [%s]\n", dbPath, logPath, strerror(errno));
return NULL;
}
fprintf(stdout, "Writing sqlite replay log file %s\n", logPath);
out = write(fd, SRR_FILE_SIGNATURE, SRR_FILE_SIGNATURE_LEN);
if (out!=-1) {
out = write(fd, &version, 1);
}
if (out == -1){
fprintf(stderr, "Write failure on log [%s]: %s\n", logPath, strerror(errno));
close(fd);
return NULL;
}
len = strlen(logPath) + 1;
ref = (SRRLogRef *)malloc(sizeof(SRRLogRef));
ref->db = db;
ref->dbPath = dbPath;
ref->logPath = (char *)malloc(len * sizeof(char));
strlcpy(ref->logPath, logPath, len);
ref->fd = fd;
ref->connection = cNum;
ref->depth = 0;
pthread_mutex_lock(&srr_log_mutex);
ref->nextRef = logRefHead;
logRefHead = ref;
pthread_mutex_unlock(&srr_log_mutex);
return ref;
}
static void closeLog(sqlite3 *db) {
SRRLogRef *ref = NULL;
SRRLogRef *lastRef = NULL;
pthread_mutex_lock(&srr_log_mutex);
for (ref = logRefHead; ref != NULL; ref = ref->nextRef) {
if (ref->db == db) {
if (lastRef == NULL) {
logRefHead = ref->nextRef;
} else {
lastRef->nextRef = ref->nextRef;
}
}
}
pthread_mutex_unlock(&srr_log_mutex);
if (ref != NULL) {
fprintf(stdout, "Closing sqlite replay log file %s\n", ref->logPath);
close(ref->fd);
free(ref->logPath);
free(ref);
}
}
static SRRLogRef *getLog(sqlite3 *db) {
pthread_mutex_lock(&srr_log_mutex);
SRRLogRef *ref = logRefHead;
for (ref = logRefHead; ref != NULL; ref = ref->nextRef) {
if (ref->db == db) {
pthread_mutex_unlock(&srr_log_mutex);
return ref;
}
}
pthread_mutex_unlock(&srr_log_mutex);
return NULL;
}
/*
* SQLite recording API
*/
void SQLiteReplayRecorder(int flag) {
srr_enabled = flag;
}
// open-arg-data: <connection><len><path><flags>
void _SRRecOpen(sqlite3 *db, const char *path, int flags) {
if (!srr_enabled) return;
if (db) {
SRRLogRef *ref = createLog(db, path);
if (ref) {
SRRCommand code = SRROpen;
int len = strlen(path);
struct timeval tv;
size_t out;
gettimeofday(&tv, NULL);
out = write(ref->fd, &tv, sizeof(tv));
if (out!=-1) { out=write(ref->fd, &code, sizeof(SRRCommand)); }
if (out!=-1) { out=write(ref->fd, &(ref->connection), sizeof(ref->connection)); }
if (out!=-1) { out=write(ref->fd, &len, sizeof(len)); }
if (out!=-1) { out=write(ref->fd, path, len); }
if (out!=-1) { out=write(ref->fd, &flags, sizeof(flags)); }
if (out==-1) {
fprintf(stderr, "Error writing open to log file [%s]: %s\n", ref->logPath, strerror(errno));
closeLog(db);
}
}
}
}
//close-arg-data: <connection>
void SRRecClose(sqlite3 *db) {
if (!srr_enabled) return;
if (db) {
SRRLogRef *ref = getLog(db);
if (ref) {
SRRCommand code = SRRClose;
struct timeval tv;
size_t out;
gettimeofday(&tv, NULL);
out = write(ref->fd, &tv, sizeof(tv));
if (out!=-1) { out = write(ref->fd, &code, sizeof(SRRCommand)); }
if (out!=-1) { out = write(ref->fd, &(ref->connection), sizeof(ref->connection)); }
if (out==-1) {
fprintf(stderr, "Error writing close to log file [%s]: %s\n", ref->logPath, strerror(errno));
}
closeLog(db);
}
}
}
// exec-arg-data: <connection><len><statement-text>
void SRRecExec(sqlite3 *db, const char *sql) {
if (!srr_enabled) return;
if (db) {
SRRLogRef *ref = getLog(db);
if (ref) {
if (ref->depth == 0) {
SRRCommand code = SRRExec;
int len = strlen(sql);
struct timeval tv;
size_t out;
ref->depth = 1;
gettimeofday(&tv, NULL);
out = write(ref->fd, &tv, sizeof(tv));
if (out!=-1) { out = write(ref->fd, &code, sizeof(SRRCommand)); }
if (out!=-1) { out = write(ref->fd, &(ref->connection), sizeof(ref->connection)); }
if (out!=-1) { out = write(ref->fd, &len, sizeof(len)); }
if (out!=-1) { out = write(ref->fd, sql, len); }
if (out==-1) {
fprintf(stderr, "Error writing exec to log file [%s]: %s\n", ref->logPath, strerror(errno));
closeLog(db);
}
} else {
ref->depth ++;
}
}
}
}
void SRRecExecEnd(sqlite3 *db) {
if (!srr_enabled) return;
if (db) {
SRRLogRef *ref = getLog(db);
if (ref) {
ref->depth --;
}
}
}
// prep-arg-data: <connection><len><statement-text><savesql><statement-ref>
void _SRRecPrepare(sqlite3 *db, const char *sql, int nBytes, int saveSql, sqlite3_stmt *pStmt) {
if (!srr_enabled) return;
if ((db!=NULL)&&(pStmt!=NULL)) {
SRRLogRef *ref = getLog(db);
if (ref && (ref->depth == 0)) {
SRRCommand code = SRRPrepare;
struct timeval tv;
size_t out;
int sqlLen = nBytes;
if (sqlLen == -1) {
sqlLen = strlen(sql);
}
gettimeofday(&tv, NULL);
out = write(ref->fd, &tv, sizeof(tv));
if (out!=-1) { out = write(ref->fd, &code, sizeof(SRRCommand)); }
if (out!=-1) { out = write(ref->fd, &(ref->connection), sizeof(ref->connection)); }
if (out!=-1) { out = write(ref->fd, &sqlLen, sizeof(sqlLen)); }
if (out!=-1) { out = write(ref->fd, sql, sqlLen); }
if (out!=-1) { out = write(ref->fd, &saveSql, sizeof(saveSql)); }
if (out!=-1) {
int64_t stmtInt = (int64_t)((intptr_t)(pStmt));
out = write(ref->fd, &stmtInt, sizeof(int64_t));
}
if (out==-1) {
fprintf(stderr, "Error writing prepare to log file [%s]: %s\n", ref->logPath, strerror(errno));
closeLog(db);
}
}
}
}
//step-arg-data: <statement-ref>
void SRRecStep(sqlite3_stmt *pStmt) {
if (!srr_enabled) return;
if(pStmt!=NULL) {
Vdbe *v = (Vdbe *)pStmt;
SRRLogRef *ref = getLog(v->db);
if (ref) {
if (ref->depth == 0) {
SRRCommand code = SRRStep;
struct timeval tv;
size_t out;
ref->depth = 1;
gettimeofday(&tv, NULL);
out = write(ref->fd, &tv, sizeof(tv));
if (out!=-1) { out = write(ref->fd, &code, sizeof(SRRCommand)); }
if (out!=-1) {
int64_t stmtInt = (int64_t)((intptr_t)(pStmt));
out = write(ref->fd, &stmtInt, sizeof(int64_t));
}
if (out==-1) {
fprintf(stderr, "Error writing step to log file [%s]: %s\n", ref->logPath, strerror(errno));
closeLog(ref->db);
}
} else {
ref->depth ++;
}
}
}
}
void SRRecStepEnd(sqlite3_stmt *pStmt) {
if (!srr_enabled) return;
if(pStmt!=NULL) {
Vdbe *v = (Vdbe *)pStmt;
SRRLogRef *ref = getLog(v->db);
if (ref) {
ref->depth --;
}
}
}
// reset-arg-data: <statement-ref>
void SRRecReset(sqlite3_stmt *pStmt) {
if (!srr_enabled) return;
if(pStmt!=NULL) {
Vdbe *v = (Vdbe *)pStmt;
SRRLogRef *ref = getLog(v->db);
if (ref && (ref->depth == 0)) {
SRRCommand code = SRRReset;
struct timeval tv;
size_t out;
gettimeofday(&tv, NULL);
out = write(ref->fd, &tv, sizeof(tv));
if (out!=-1) { out = write(ref->fd, &code, sizeof(SRRCommand)); }
if (out!=-1) {
int64_t stmtInt = (int64_t)((intptr_t)(pStmt));
out = write(ref->fd, &stmtInt, sizeof(int64_t));
}
if (out==-1) {
fprintf(stderr, "Error writing reset to log file [%s]: %s\n", ref->logPath, strerror(errno));
closeLog(ref->db);
}
}
}
}
// finalize-arg-data: <statement-ref>
void SRRecFinalize(sqlite3_stmt *pStmt) {
if (!srr_enabled) return;
if(pStmt!=NULL) {
Vdbe *v = (Vdbe *)pStmt;
SRRLogRef *ref = getLog(v->db);
if (ref && (ref->depth == 0)) {
SRRCommand code = SRRFinalize;
struct timeval tv;
size_t out;
gettimeofday(&tv, NULL);
out = write(ref->fd, &tv, sizeof(tv));
if (out!=-1) { out = write(ref->fd, &code, sizeof(SRRCommand)); }
if (out!=-1) {
int64_t stmtInt = (int64_t)((intptr_t)(pStmt));
out = write(ref->fd, &stmtInt, sizeof(int64_t));
}
if (out==-1) {
fprintf(stderr, "Error writing finalize to log file [%s]: %s\n", ref->logPath, strerror(errno));
closeLog(ref->db);
}
}
}
}
// bind-text-arg-data: <statement-ref><index><len><data>
void SRRecBindText(sqlite3_stmt *pStmt, int i, const char *zData, int64_t nData) {
if (!srr_enabled) return;
if(pStmt!=NULL) {
Vdbe *v = (Vdbe *)pStmt;
SRRLogRef *ref = getLog(v->db);
if (ref && (ref->depth == 0)) {
SRRCommand code = SRRBindText;
struct timeval tv;
size_t out;
int64_t textLen = nData;
if (textLen == -1) {
textLen = strlen(zData);
}
gettimeofday(&tv, NULL);
out = write(ref->fd, &tv, sizeof(tv));
if (out!=-1) { out = write(ref->fd, &code, sizeof(SRRCommand)); }
if (out!=-1) {
int64_t stmtInt = (int64_t)((intptr_t)(pStmt));
out = write(ref->fd, &stmtInt, sizeof(int64_t));
}
if (out!=-1) { out = write(ref->fd, &i, sizeof(i)); }
if (out!=-1) { out = write(ref->fd, &textLen, sizeof(textLen)); }
if (out!=-1) { out = write(ref->fd, zData, textLen); }
if (out==-1) {
fprintf(stderr, "Error writing bind text to log file [%s]: %s\n", ref->logPath, strerror(errno));
closeLog(ref->db);
}
}
}
}
// bind-blob-arg-data: <statement-ref><index><len>[<data>]
void SRRecBindBlob(sqlite3_stmt *pStmt, int i, const char *zData, int64_t nData) {
if (!srr_enabled) return;
if(pStmt!=NULL) {
Vdbe *v = (Vdbe *)pStmt;
SRRLogRef *ref = getLog(v->db);
if (ref && (ref->depth == 0)) {
SRRCommand code = SRRBindBlob;
struct timeval tv;
size_t out;
gettimeofday(&tv, NULL);
out = write(ref->fd, &tv, sizeof(tv));
if (out!=-1) { out = write(ref->fd, &code, sizeof(SRRCommand)); }
if (out!=-1) {
int64_t stmtInt = (int64_t)((intptr_t)(pStmt));
out = write(ref->fd, &stmtInt, sizeof(int64_t));
}
if (out!=-1) { out = write(ref->fd, &i, sizeof(i)); }
if (zData == NULL) {
int64_t negNData = -nData;
if (out!=-1) { out = write(ref->fd, &negNData, sizeof(negNData)); }
} else {
if (out!=-1) { out = write(ref->fd, &nData, sizeof(nData)); }
if (out!=-1) { out = write(ref->fd, zData, nData); }
}
if (out==-1) {
fprintf(stderr, "Error writing bind blob to log file [%s]: %s\n", ref->logPath, strerror(errno));
closeLog(ref->db);
}
}
}
}
// bind-double-arg-data: <statement-ref><index><data>
void SRRecBindDouble(sqlite3_stmt *pStmt, int i, double value) {
if (!srr_enabled) return;
if(pStmt!=NULL) {
Vdbe *v = (Vdbe *)pStmt;
SRRLogRef *ref = getLog(v->db);
if (ref && (ref->depth == 0)) {
SRRCommand code = SRRBindDouble;
struct timeval tv;
size_t out;
gettimeofday(&tv, NULL);
out = write(ref->fd, &tv, sizeof(tv));
if (out!=-1) { out = write(ref->fd, &code, sizeof(SRRCommand)); }
if (out!=-1) {
int64_t stmtInt = (int64_t)((intptr_t)(pStmt));
out = write(ref->fd, &stmtInt, sizeof(int64_t));
}
if (out!=-1) { out = write(ref->fd, &i, sizeof(i)); }
if (out!=-1) { out = write(ref->fd, &value, sizeof(value)); }
if (out==-1) {
fprintf(stderr, "Error writing bind double to log file [%s]: %s\n", ref->logPath, strerror(errno));
closeLog(ref->db);
}
}
}
}
// bind-int-arg-data: <statement-ref><index><data>
void SRRecBindInt64(sqlite3_stmt *pStmt, int i, int64_t value) {
if (!srr_enabled) return;
if(pStmt!=NULL) {
Vdbe *v = (Vdbe *)pStmt;
SRRLogRef *ref = getLog(v->db);
if (ref && (ref->depth == 0)) {
SRRCommand code = SRRBindInt;
struct timeval tv;
size_t out;
gettimeofday(&tv, NULL);
out = write(ref->fd, &tv, sizeof(tv));
if (out!=-1) { out = write(ref->fd, &code, sizeof(SRRCommand)); }
if (out!=-1) {
int64_t stmtInt = (int64_t)((intptr_t)(pStmt));
out = write(ref->fd, &stmtInt, sizeof(int64_t));
}
if (out!=-1) { out = write(ref->fd, &i, sizeof(i)); }
if (out!=-1) { out = write(ref->fd, &value, sizeof(value)); }
if (out==-1) {
fprintf(stderr, "Error writing bind int to log file [%s]: %s\n", ref->logPath, strerror(errno));
closeLog(ref->db);
}
}
}
}
// bind-null-arg-data: <statement-ref><index>
void SRRecBindNull(sqlite3_stmt *pStmt, int i) {
if (!srr_enabled) return;
if(pStmt!=NULL) {
Vdbe *v = (Vdbe *)pStmt;
SRRLogRef *ref = getLog(v->db);
if (ref && (ref->depth == 0)) {
SRRCommand code = SRRBindNull;
struct timeval tv;
size_t out;
gettimeofday(&tv, NULL);
out = write(ref->fd, &tv, sizeof(tv));
if (out!=-1) { out = write(ref->fd, &code, sizeof(SRRCommand)); }
if (out!=-1) {
int64_t stmtInt = (int64_t)((intptr_t)(pStmt));
out = write(ref->fd, &stmtInt, sizeof(int64_t));
}
if (out!=-1) { out = write(ref->fd, &i, sizeof(i)); }
if (out==-1) {
fprintf(stderr, "Error writing bind null to log file [%s]: %s\n", ref->logPath, strerror(errno));
closeLog(ref->db);
}
}
}
}
// bind-value-arg-data: <statement-ref><index><len><data> ???
void SRRecBindValue(sqlite3_stmt *pStmt, int i, const sqlite3_value *value) {
if (!srr_enabled) return;
if(pStmt!=NULL) {
Vdbe *v = (Vdbe *)pStmt;
SRRLogRef *ref = getLog(v->db);
if (ref && (ref->depth == 0)) {
fprintf(stderr, "SRRecBindValue(sqlite3_bind_value) is not yet supported, closing [%s]: %s\n", ref->logPath, strerror(errno));
closeLog(ref->db);
}
}
}
// bind-clear-arg-data: <statement-ref>
void SRRecClearBindings(sqlite3_stmt *pStmt) {
if (!srr_enabled) return;
if(pStmt!=NULL) {
Vdbe *v = (Vdbe *)pStmt;
SRRLogRef *ref = getLog(v->db);
if (ref && (ref->depth == 0)) {
SRRCommand code = SRRBindClear;
struct timeval tv;
size_t out;
gettimeofday(&tv, NULL);
out = write(ref->fd, &tv, sizeof(tv));
if (out!=-1) { out = write(ref->fd, &code, sizeof(SRRCommand)); }
if (out!=-1) {
int64_t stmtInt = (int64_t)((intptr_t)(pStmt));
out = write(ref->fd, &stmtInt, sizeof(int64_t));
}
if (out==-1) {
fprintf(stderr, "Error writing clear bindings to log file [%s]: %s\n", ref->logPath, strerror(errno));
closeLog(ref->db);
}
}
}
}
#endif /* SQLITE_ENABLE_SQLRR */
-61
View File
@@ -1,61 +0,0 @@
/*
* sqlrr.h
*/
#ifndef _SQLRR_H_
#define _SQLRR_H_
/*
** Header constants
*/
#define SRR_FILE_SIGNATURE "SQLRR"
#define SRR_FILE_SIGNATURE_LEN 5
#define SRR_FILE_VERSION 0x1
#define SRR_FILE_VERSION_LEN 1
#if defined(SQLITE_ENABLE_SQLRR)
#include "sqlite3.h"
#include <sys/types.h>
#define SRRecOpen(A,B,C) if(!rc){_SRRecOpen(A,B,C);}
#define SRRecPrepare(A,B,C,D,E) if(!rc){_SRRecPrepare(A,B,C,D,E);}
typedef enum {
SRROpen = 0,
SRRClose = 1,
SRRExec = 8,
SRRBindText = 16,
SRRBindBlob = 17,
SRRBindDouble = 18,
SRRBindInt = 19,
SRRBindNull = 20,
SRRBindValue = 21,
SRRBindClear = 22,
SRRPrepare = 32,
SRRStep = 33,
SRRReset = 34,
SRRFinalize = 35
} SRRCommand;
extern void SQLiteReplayRecorder(int flag);
extern void _SRRecOpen(sqlite3 *db, const char *path, int flags);
extern void SRRecClose(sqlite3 *db);
extern void SRRecExec(sqlite3 *db, const char *sql);
extern void SRRecExecEnd(sqlite3 *db);
extern void _SRRecPrepare(sqlite3 *db, const char *sql, int nBytes, int saveSql, sqlite3_stmt *stmt);
extern void SRRecStep(sqlite3_stmt *pStmt);
extern void SRRecStepEnd(sqlite3_stmt *pStmt);
extern void SRRecReset(sqlite3_stmt *pStmt);
extern void SRRecFinalize(sqlite3_stmt *pStmt);
extern void SRRecBindText(sqlite3_stmt *pStmt, int i, const char *zData, int64_t nData);
extern void SRRecBindBlob(sqlite3_stmt *pStmt, int i, const char *zData, int64_t nData);
extern void SRRecBindDouble(sqlite3_stmt *pStmt, int i, double value);
extern void SRRecBindInt64(sqlite3_stmt *pStmt, int i, int64_t value);
extern void SRRecBindNull(sqlite3_stmt *pStmt, int i);
extern void SRRecBindValue(sqlite3_stmt *pStmt, int i, const sqlite3_value *value);
extern void SRRecClearBindings(sqlite3_stmt *pStmt);
#endif /* defined(SQLITE_ENABLE_SQLRR) */
#endif /* _SQLRR_H_ */
+18 -6
View File
@@ -224,9 +224,6 @@ SRC += \
$(TOP)/ext/rtree/sqlite3rtree.h \
$(TOP)/ext/rtree/rtree.h \
$(TOP)/ext/rtree/rtree.c
SRC += \
$(TOP)/ext/sqlrr/sqlrr.h \
$(TOP)/ext/sqlrr/sqlrr.c
SRC += \
$(TOP)/ext/session/sqlite3session.c \
$(TOP)/ext/session/sqlite3session.h
@@ -428,7 +425,22 @@ HDR = \
# Header files used by extensions
#
EXTHDR += \
$(TOP)/ext/sqlrr/sqlrr.h
$(TOP)/ext/fts1/fts1.h \
$(TOP)/ext/fts1/fts1_hash.h \
$(TOP)/ext/fts1/fts1_tokenizer.h
EXTHDR += \
$(TOP)/ext/fts2/fts2.h \
$(TOP)/ext/fts2/fts2_hash.h \
$(TOP)/ext/fts2/fts2_tokenizer.h
EXTHDR += \
$(TOP)/ext/fts3/fts3.h \
$(TOP)/ext/fts3/fts3Int.h \
$(TOP)/ext/fts3/fts3_hash.h \
$(TOP)/ext/fts3/fts3_tokenizer.h
EXTHDR += \
$(TOP)/ext/rtree/rtree.h
EXTHDR += \
$(TOP)/ext/icu/sqliteicu.h
EXTHDR += \
$(TOP)/ext/fts5/fts5Int.h \
fts5parse.h \
@@ -545,10 +557,10 @@ sqlite3.o: sqlite3.c
# files are automatically generated. This target takes care of
# all that automatic generation.
#
target_source: $(SRC) $(EXTHDR) $(TOP)/tool/vdbe-compress.tcl fts5.c
target_source: $(SRC) $(TOP)/tool/vdbe-compress.tcl fts5.c
rm -rf tsrc
mkdir tsrc
cp -f $(SRC) $(EXTHDR) tsrc
cp -f $(SRC) tsrc
rm tsrc/sqlite.h.in tsrc/parse.y
tclsh $(TOP)/tool/vdbe-compress.tcl $(OPTS) <tsrc/vdbe.c >vdbe.new
mv vdbe.new tsrc/vdbe.c
+114 -118
View File
@@ -1,16 +1,16 @@
C Add\sdebugging\sfunctions\sbtreePageOriginFile()\sand\sbtreePageOriginOffset().
D 2017-05-27T18:05:32.812
F Makefile.in 227347646e289e3b016ebb7a391ad6ed4ab56525834d56d47d1a83b8d97d6989
C Avoid\sunnecessary\sfstat()\scalls\sto\sdetermine\sthe\sdatabase\ssize\swhen\ntransitioning\sinto\sa\sread\stransaction\son\sa\srollback-mode\sdatabase.
D 2017-05-29T16:45:45.492
F Makefile.in 1cc758ce3374a32425e4d130c2fe7b026b20de5b8843243de75f087c0a2661fb
F Makefile.linux-gcc 7bc79876b875010e8c8f9502eb935ca92aa3c434
F Makefile.msc fb28c0304f8a14c5ce7d4bde9fea1c903f644b49e78ebd9976ab2a1f0eb8afb5
F Makefile.msc 8eeb80162074004e906b53d7340a12a14c471a83743aab975947e95ce061efcc
F README.md 2b15fae33852f2f53996774c21fb41e1d94181c4401a0e43ac93e11f2cc901b9
F VERSION 10a1d396b8a19db3c3cc6c7b909be2cf7ad97c517b4f00af363506fd85aab713
F VERSION 87f1498f27e398bce3da2fa8125c9879a38ed9d87e4b5fb922b351de1e25cadb
F aclocal.m4 a5c22d164aff7ed549d53a90fa56d56955281f50
F art/sqlite370.eps aa97a671332b432a54e1d74ff5e8775be34200c2
F art/sqlite370.ico af56c1d00fee7cd4753e8631ed60703ed0fc6e90
F art/sqlite370.jpg d512473dae7e378a67e28ff96a34da7cb331def2
F autoconf/INSTALL 83e4a25da9fd053c7b3665eaaaf7919707915903
F autoconf/Makefile.am ed95854f5df64c1d0a447d8ecb55edc67e3c32f79f597c3a4870f9ac51698275
F autoconf/Makefile.am 1a47d071e3d5435f8f7ebff7eb6703848bbd65d4
F autoconf/Makefile.msc 1014be616b420a5f48611d21b62ca2f50ec97ee795087ecb8a4d6bf6375ba11d
F autoconf/README.first 6c4f34fe115ff55d4e8dbfa3cecf04a0188292f7
F autoconf/README.txt 4f04b0819303aabaa35fff5f7b257fb0c1ef95f1
@@ -30,7 +30,7 @@ F autoconf/tea/win/rules.vc c511f222b80064096b705dbeb97060ee1d6b6d63
F config.guess 226d9a188c6196f3033ffc651cbc9dcee1a42977
F config.h.in 6376abec766e9a0785178b1823b5a587e9f1ccbc
F config.sub 9ebe4c3b3dab6431ece34f16828b594fb420da55
F configure 1b0309062481dbde6278cb870f1680c81c65202d0bfde469f81c7e22397d6f23 x
F configure 9b883e13b5e4df8d203315a7fb5a47e3c3e6ffa4a2c1a34be8e785fdd8085a99 x
F configure.ac 901e8db2c211e8b655e51ee24f2b8faa33407acde87effc47f70380f3b04e452
F contrib/sqlitecon.tcl 210a913ad63f9f991070821e599d600bd913e0ad
F doc/lemon.html b5a3c07d33ecb8e019ce8f7660fe2dbbad9d7977
@@ -104,13 +104,13 @@ F ext/fts5/fts5_aux.c 67acf8d51723cf28ffc3828210ba662df4b8d267
F ext/fts5/fts5_buffer.c 1dd1ec0446b3acfc2d7d407eb894762a461613e2695273f48e449bfd13e973ff
F ext/fts5/fts5_config.c 5af9c360e99669d29f06492c370892394aba0857
F ext/fts5/fts5_expr.c f2825f714d91bbe62ab5820aee9ad12e0c94205b2a01725eaa9072415ae9ff1c
F ext/fts5/fts5_hash.c 534d5591f479c0999543689122ad6952823bc7c85273a0ff4f7f91d9f914a54b
F ext/fts5/fts5_hash.c 32be400cf761868c9db33efe81a06eb19a17c5402ad477ee9efb51301546dd55
F ext/fts5/fts5_index.c cdceac47287c66500214ee946ca871ac48027a82a0ca82177c1c6af19f181ca0
F ext/fts5/fts5_main.c 1ba0e7806886c1bc16e20d0dde1c2b535d1aeb98cbbb937c4c3e064af5ac6f03
F ext/fts5/fts5_storage.c 7750986004f3f0c94619a85ecb5dd6cbef53e5e3853488e8a906c269d4d11db6
F ext/fts5/fts5_tcl.c 4a901f00c8553740dba63511603f5527d741c26a
F ext/fts5/fts5_test_mi.c 783b86697ebf773c18fc109992426c0173a055bc
F ext/fts5/fts5_test_tok.c f4c27f2e3200653a458f5316f6aaa863f7532d98fff7534ece3670fb7f2c196b
F ext/fts5/fts5_test_tok.c ffd657dd67e7fcdb31bf63fb60b6d867299a581d0f46e97086abacd66c2a9b26
F ext/fts5/fts5_tokenize.c 2ce7b44183538ec46b7907726262ee43ffdd39a8
F ext/fts5/fts5_unicode2.c b450b209b157d598f7b9df9f837afb75a14c24bf
F ext/fts5/fts5_varint.c a5aceacda04dafcbae725413d7a16818ecd65738
@@ -181,7 +181,7 @@ F ext/fts5/test/fts5porter.test 7cdc07bef301d70eebbfa75dcaf45c3680e1d0e1
F ext/fts5/test/fts5porter2.test 2e65633d58a1c525d5af0f6c01e5a59155bb3487
F ext/fts5/test/fts5prefix.test 6ef7e875738412907b17687d25db39a25cbdaba4
F ext/fts5/test/fts5query.test f5ec25f5f2fbb70033424113cdffc101b1985a40
F ext/fts5/test/fts5rank.test 2bdc0c5f22ccc1f9dbe9f4d0b82a491dce6f8a32
F ext/fts5/test/fts5rank.test 485e1d7ab8b0f939172a88e279acd0894b1f64458f92d7cd5826a31335c6a093
F ext/fts5/test/fts5rebuild.test 03935f617ace91ed23a6099c7c74d905227ff29b
F ext/fts5/test/fts5restart.test c17728fdea26e7d0f617d22ad5b4b2862b994c17
F ext/fts5/test/fts5rowid.test 16908a99d6efc9ba21081b4f2b86b3fc699839a6
@@ -209,7 +209,7 @@ F ext/icu/README.txt d9fbbad0c2f647c3fdf715fc9fd64af53aedfc43
F ext/icu/icu.c 84900472a088a3a172c6c079f58a1d3a1952c332
F ext/icu/sqliteicu.h 728867a802baa5a96de7495e9689a8e01715ef37
F ext/misc/README.md 8e008c8d2b02e09096b31dfba033253ac27c6c06a18aa5826e299fa7601d90b2
F ext/misc/amatch.c 211108e201105e4bb0c076527b8cfd34330fc234
F ext/misc/amatch.c 6db4607cb17c54b853a2d7c7c36046d004853f65b9b733e6f019d543d5dfae87
F ext/misc/anycollseq.c 5ffdfde9829eeac52219136ad6aa7cd9a4edb3b15f4f2532de52f4a22525eddb
F ext/misc/carray.c 40c27641010a4dc67e3690bdb7c9d36ca58b3c2d
F ext/misc/closure.c 0d2a038df8fbae7f19de42e7c7d71f2e4dc88704
@@ -273,7 +273,7 @@ F ext/rbu/sqlite3rbu.c 2a89efba9eeba8e6c89a498dc195e8efbdde2694
F ext/rbu/sqlite3rbu.h 6fb6294c34a9ca93b5894a33bca530c6f08decba
F ext/rbu/test_rbu.c 5aa22616afac6f71ebd3d9bc9bf1006cfabcca88
F ext/rtree/README 6315c0d73ebf0ec40dedb5aa0e942bc8b54e3761
F ext/rtree/rtree.c 00dabe6ca21e3dd58f1fade447c39b8a36da381b1f4bfccf966f7835b943b9ae
F ext/rtree/rtree.c 8205d6e4466f766e57ce1b8aa38224ac9e1cec2d2bf4684cd1cc5a6ddf9b7014
F ext/rtree/rtree.h 834dbcb82dc85b2481cde6a07cdadfddc99e9b9e
F ext/rtree/rtree1.test d5f0ba215b3bd1d05269ada86e74073b8445852aa0d33a63e10ec63a09c39473
F ext/rtree/rtree2.test acbb3a4ce0f4fbc2c304d2b4b784cfa161856bba
@@ -315,22 +315,20 @@ F ext/session/sessionG.test 01ef705096a9d3984eebdcca79807a211dee1b60
F ext/session/session_common.tcl 7776eda579773113b30c7abfd4545c445228cb73
F ext/session/session_speed_test.c edc1f96fd5e0e4b16eb03e2a73041013d59e8723
F ext/session/sessionat.test b25d61d663ebc795506bf74079dc4ba0092fad25
F ext/session/sessiondiff.test 7889d8e84cd130fe3712ed7c511f883e0b2a398ed2905d54e48a24edce49bfab
F ext/session/sessionfault.test da273f2712b6411e85e71465a1733b8501dbf6f7
F ext/session/sessionfault2.test 04aa0bc9aa70ea43d8de82c4f648db4de1e990b0
F ext/session/sessionwor.test 2f3744236dc8b170a695b7d8ddc8c743c7e79fdc
F ext/session/sqlite3session.c 13642d9c754cc18f17e141f82860d269e2adf920
F ext/session/sqlite3session.c cc127222a9ea6f4eaa31281aa9da924f5244f6099be0ee526c950684fb3513a6
F ext/session/sqlite3session.h d4db650adfcc7a4360e9f12a09c2d117b1db6b53
F ext/session/test_session.c eb0bd6c1ea791c1d66ee4ef94c16500dad936386
F ext/sqlrr/README.txt 4239030e73023e72a2e727808cd433577d5bf730
F ext/sqlrr/sqlrr.c 8d1e6571cd6a6beabdb5bcdfe3a0e723b914db41
F ext/sqlrr/sqlrr.h 09e4f8929ad9bc2638732c0cc0db5eef8c417824
F ext/userauth/sqlite3userauth.h 7f3ea8c4686db8e40b0a0e7a8e0b00fac13aa7a3
F ext/userauth/user-auth.txt e6641021a9210364665fe625d067617d03f27b04
F ext/userauth/userauth.c 3410be31283abba70255d71fd24734e017a4497f
F install-sh 9d4de14ab9fb0facae2f48780b874848cbf2f895 x
F ltmain.sh 3ff0879076df340d2e23ae905484d8c15d5fdea8
F magic.txt 8273bf49ba3b0c8559cb2774495390c31fd61c60
F main.mk c1eca02dc5500469a14320357534135f86bbcbb43b1ddad4bf70c235aacb37f1
F main.mk 9abb506e717887d57f754bae139b85c1a06d6f2ac25b589f3e792e310567f278
F mkso.sh fd21c06b063bb16a5d25deea1752c2da6ac3ed83
F mptest/config01.test 3c6adcbc50b991866855f1977ff172eb6d901271
F mptest/config02.test 4415dfe36c48785f751e16e32c20b077c28ae504
@@ -349,7 +347,7 @@ F src/auth.c 79f96c6f33bf0e5da8d1c282cee5ebb1852bb8a6ccca3e485d7c459b035d9c3c
F src/backup.c faf17e60b43233c214aae6a8179d24503a61e83b
F src/bitvec.c 17ea48eff8ba979f1f5b04cc484c7bb2be632f33
F src/btmutex.c 0e9ce2d56159b89b9bc8e197e023ee11e39ff8ca
F src/btree.c babb72f4fda4577b8ccd12bc63330fc57e92272678c51b425de5a8268f08a433
F src/btree.c 0065e4bb6dc1431bca7aa806dc5635885aa93f3056bb26a4b6cc0cc53a5131f3
F src/btree.h 80f518c0788be6cec8d9f8e13bd8e380df299d2b5e4ac340dc887b0642647cfc
F src/btreeInt.h a392d353104b4add58b4a59cb185f5d5693dde832c565b77d8d4c343ed98f610
F src/build.c 4026a9c554b233e50c5e9ad46963e676cf54dd2306d952aa1eaa07a1bc9ce14f
@@ -358,8 +356,8 @@ F src/complete.c a3634ab1e687055cd002e11b8f43eb75c17da23e
F src/ctime.c 47d91a25ad8f199a71a5b1b7b169d6dd0d6e98c5719eca801568798743d1161c
F src/date.c cc42a41c7422389860d40419a5e3bce5eaf6e7835c3ba2677751dc653550a5c7
F src/dbstat.c 19ee7a4e89979d4df8e44cfac7a8f905ec89b77d
F src/delete.c 665e705641e5815c3f32d05820d1a5aa630274e568af73f377fdbc614fcf40b4
F src/expr.c 30f61b7d8236def0e99485651e5d983a102afa4cbc8b1ef0ab19ccb1f3841f99
F src/delete.c bc2bfc227002ebe091e7cc321f09a48e52f86e1cd5ff9b028009db0671556749
F src/expr.c 82ccc704a2e5aa114f2a2c67610b87963add6d65336f352bb1782a2942356bcb
F src/fault.c 460f3e55994363812d9d60844b2a6de88826e007
F src/fkey.c db65492ae549c3b548c9ef1f279ce1684f1c473b116e1c56a90878cd5dcf968d
F src/func.c 9d52522cc8ae7f5cdadfe14594262f1618bc1f86083c4cd6da861b4cf5af6174
@@ -369,9 +367,9 @@ F src/hash.h ab34c5c54a9e9de2e790b24349ba5aab3dbb4fd4
F src/hwtime.h 747c1bbe9df21a92e9c50f3bbec1de841dc5e5da
F src/in-operator.md 10cd8f4bcd225a32518407c2fb2484089112fd71
F src/insert.c d4bb3a135948553d18cf992f76f7ed7b18aa0327f250607b5a6671e55d9947d5
F src/legacy.c b143b1fe422524cb29cb5ac907c8a44684333d75
F src/legacy.c e88ed13c2d531decde75d42c2e35623fb9ce3cb0
F src/loadext.c a72909474dadce771d3669bf84bf689424f6f87d471fee898589c3ef9b2acfd9
F src/main.c cb5075a71935209f3834b6a4ba37c7bf16e65c565f270e1186c78b23e38f6190
F src/main.c 1054e4dbb4fcca84246ed48b35164a996f5a52daa56c275157a5d583c0e2cd00
F src/malloc.c e20bb2b48abec52d3faf01cce12e8b4f95973755fafec98d45162dfdab111978
F src/mem0.c 6a55ebe57c46ca1a7d98da93aaa07f99f1059645
F src/mem1.c c12a42539b1ba105e3707d0e628ad70e611040d8f5e38cf942cee30c867083de
@@ -386,38 +384,37 @@ F src/mutex_noop.c 9d4309c075ba9cc7249e19412d3d62f7f94839c4
F src/mutex_unix.c 27bb6cc49485ee46711a6580ab7b3f1402211d23
F src/mutex_w32.c a898fa969823b100c0f5fdc57e54c9a1e419ab4d
F src/notify.c 9711a7575036f0d3040ba61bc6e217f13a9888e7
F src/os.c c03b50496df5815e8f6d45bae4404b73cadf069b
F src/os.c add02933b1dce7a39a005b00a2f5364b763e9a24
F src/os.h 8e976e59eb4ca1c0fca6d35ee803e38951cb0343
F src/os_common.h b2f4707a603e36811d9b1a13278bffd757857b85
F src/os_setup.h 0dbaea40a7d36bf311613d31342e0b99e2536586
F src/os_unix.c 4a58dfdfda7e72aab0e393953890a9b6d40a7ff4
F src/os_win.c 85b19486054c8cd5c4117dea882d983ea065d16e
F src/os_unix.c 30e2c43e4955db990e5b5a81e901f8aa74cc8820
F src/os_win.c 2a6c73eef01c51a048cc4ddccd57f981afbec18a
F src/os_win.h 7b073010f1451abe501be30d12f6bc599824944a
F src/pager.c fcca412103fb548dfb209ba652893e4ca879036b779fd8c1f95eea9a442c074f
F src/pager.h e430a536b3eb5ec053992afd3d561185a33de546d2905c47413403b9899698c4
F src/pager.c 14f6982c470c05b8e85575c69e9c1712010602e20400f8670d8699e21283e0e4
F src/pager.h f2a99646c5533ffe11afa43e9e0bea74054e4efa
F src/parse.y 0513387ce02fea97897d8caef82d45f347818593f24f1bdc48e0c530a8af122d
F src/pcache.c 62835bed959e2914edd26afadfecce29ece0e870
F src/pcache.h 2cedcd8407eb23017d92790b112186886e179490
F src/pcache1.c 4d201a7ee865e9a0ddc214db4c997e44215fefa15c1b0ec53cee40e9ba7a9716
F src/pragma.c 994ebf405c74f44b11ab0ad7113e4d8f26197e3961b5f70aaf7a8c00d4259874
F src/pcache1.c 1195a21fe28e223e024f900b2011e80df53793f0356a24caace4188b098540dc
F src/pragma.c 2362670a9d28b71708aecb2b9b10b3f7be71f4c950961c07e81dc400e3ce6371
F src/pragma.h 37a1311d0388db480388d7ec09054f7103045eff20d4971f8a433b77f40b9921
F src/prepare.c 601681ecade57127ffbb5df1e096a30f29eff54c
F src/prepare.c b1140c3d0cf59bc85ace00ce363153041b424b7a
F src/printf.c 8757834f1b54dae512fb25eb1acc8e94a0d15dd2290b58f2563f65973265adb2
F src/random.c 80f5d666f23feb3e6665a6ce04c7197212a88384
F src/resolve.c 3e518b962d932a997fae373366880fc028c75706
F src/resolve.c ffb69e203f18a7c4013c0b37e657e19abd61379c92480dbbd582bd365c5876aa
F src/rowset.c 7b7e7e479212e65b723bf40128c7b36dc5afdfac
F src/select.c c444ca057d48cf1a4eb8f6a58fbc13418a7f83ae94a6bd6f29f7ad6c704a9e4c
F src/shell.c a37d96b20b3644d0eb905df5aa7a0fcf9f6e73c15898337230c760a24a8df794
F src/sqlite.h.in 74449ff8d024a8e1f6c4ab34b9dd71f781f8cc5ac548951af84efa1645995409
F src/select.c fd0a17fb78130fe840a33024888d41c77ed0bab0340b72cf71b1558d5f465e88
F src/shell.c 3f761fe604174b31aacd2ea2eacef5e6fe550111d60c0d71532cc008c68cf3f3
F src/sqlite.h.in 8dd468837a4f6d76713e3a4cc65bea48095009038593d41040ab46c1b351197f
F src/sqlite3.rc 5121c9e10c3964d5755191c80dd1180c122fc3a8
F src/sqlite3_private.h a81a9c5f97c095cc3e86914a05f8fabe0011f4a1
F src/sqlite3ext.h 58fd0676d3111d02e62e5a35992a7d3da5d3f88753acc174f2d37b774fbbdd28
F src/sqliteInt.h f6dd60bed454c84b87defdcfcf0f9c00a4c25dff60d7e41eb80d14a693809110
F src/sqliteInt.h 80c485ad08b1091a6148637c1b9c334be6ab39cb0d28b839bab96e6783b9d006
F src/sqliteLimit.h 1513bfb7b20378aa0041e7022d04acb73525de35b80b252f1b83fedb4de6a76b
F src/status.c a9e66593dfb28a9e746cba7153f84d49c1ddc4b1
F src/table.c b46ad567748f24a326d9de40e5b9659f96ffff34
F src/tclsqlite.c c8cf60d0c5411d5e70e7c136470d29dbe760d250f55198b71682c67086524e4a
F src/test1.c f6b80b80cba7a56b0eec0339828dddc7383a471f1e3998b3b33eee315b39853b
F src/test1.c c99f0442918a7a5d5b68a95d6024c211989e6c782c15ced5a558994baaf76a5e
F src/test2.c 3efb99ab7f1fc8d154933e02ae1378bac9637da5
F src/test3.c d03f5b5da9a2410b7a91c64b0d3306ed28ab6fee
F src/test4.c 18ec393bb4d0ad1de729f0b94da7267270f3d8e6
@@ -432,7 +429,7 @@ F src/test_backup.c bf5da90c9926df0a4b941f2d92825a01bbe090a0
F src/test_bestindex.c d23f80d334c59662af69191854c76b8d3d0c8c96
F src/test_blob.c f65ac717da2618691cf9dad094e6da0219dcd208
F src/test_btree.c 8b2dc8b8848cf3a4db93f11578f075e82252a274
F src/test_config.c 075bd5db1e2a605bd7838d66512ac06d0184a2953457b50626cb6655f367cc03
F src/test_config.c edcba290248dc18736dd814c9b95863c6762e0b35753048d8cbe5bf65f7abfbb
F src/test_delete.c e2fe07646dff6300b48d49b2fee2fe192ed389e834dd635e3b3bac0ce0bf9f8f
F src/test_demovfs.c a0c3bdd45ed044115c2c9f7779e56eafff18741e
F src/test_devsym.c 4e58dec2602d8e139ca08659f62a62450587cb58
@@ -457,7 +454,7 @@ F src/test_rtree.c 671f3fae50ff116ef2e32a3bf1fe21b5615b4b7b
F src/test_schema.c f575932cb6274d12147a77e13ea4b49d52408513
F src/test_server.c a2615049954cbb9cfb4a62e18e2f0616e4dc38fe
F src/test_sqllog.c 11e6ce7575f489155c604ac4b439f2ac1d3d5aef
F src/test_superlock.c 793bb9d43a924c21993bcd6c2e200d3db8abf34e
F src/test_superlock.c 4839644b9201da822f181c5bc406c0b2385f672e
F src/test_syscall.c 1073306ba2e9bfc886771871a13d3de281ed3939
F src/test_tclvar.c df9fe1213c2634687a9ca0b0bec0d2119d359ae3
F src/test_thread.c 911d15fb14e19c0c542bdc8aabf981c2f10a4858
@@ -474,25 +471,25 @@ F src/update.c c443935c652af9365e033f756550b5032d02e1b06eb2cb890ed7511ae0c051dc
F src/utf.c 699001c79f28e48e9bcdf8a463da029ea660540c
F src/util.c fc081ec6f63448dcd80d3dfad35baecfa104823254a815b081a4d9fe76e1db23
F src/vacuum.c 1fe4555cd8c9b263afb85b5b4ee3a4a4181ad569
F src/vdbe.c b10b07d8f26775bd42d5ea366ef8f6ee4809ffa1cbf1611c6c41a0cd3eb33aa4
F src/vdbe.c 70f1c27d3de7b3ea68d3ee2b7fbf407335b66f7483eb321201ffe53724f9c54e
F src/vdbe.h f7d1456e28875c2dcb964056589b5b7149ab7edf39edeca801596a39bb3d3848
F src/vdbeInt.h 1ecdacc1322fdd3241ec30c32a480e328a6f864e532dc53fae8e0ab68121aebf
F src/vdbeapi.c 70f5682b1558eb0f80eca553552c2869aded88d7c0d13843e63ba1a704a38781
F src/vdbeaux.c 01dcf59b2a96bd3cc9db8c0d7f266518d113587459a2b3316279c4f9c90f28a9
F src/vdbeapi.c dc904b3c5e459727993c2421e653e29d63223846d129fae98adc782b0a996481
F src/vdbeaux.c 8416e4e5cf7b32cc3898cf3a28d05d5a3270c620513b46197f22bd24ca922539
F src/vdbeblob.c 359891617358deefc85bef7bcf787fa6b77facb9
F src/vdbemem.c 2c70f8f5de6c71fb99a22c5b83be9fab5c47cdd8e279fa44a8c00cfed06d7e89
F src/vdbesort.c e72fe02a2121386ba767ede8942e9450878b8fc873abf3d1b6824485f092570c
F src/vdbesort.c f26595dfcc342f4ea8b2e703686c2352638ed578e20acfc3e6534d30bbd4f555
F src/vdbetrace.c 41963d5376f0349842b5fc4aaaaacd7d9cdc0834
F src/vtab.c 35b9bdc2b41de32a417141d12097bcc4e29a77ed7cdb8f836d1d2305d946b61b
F src/vxworks.h d2988f4e5a61a4dfe82c6524dd3d6e4f2ce3cdb9
F src/wal.c dad2233125cf918e8eced1ec9695525b9894cf7d
F src/wal.h 1598818fe90532a622ecdec5baa959f94e10062e
F src/walker.c b71a992b413b3a022572eccf29ef4b4890223791
F src/where.c c6352f15be5031907c68bcbde96cad1a6da20e9f4051d10168a59235de9a8566
F src/wal.c 40c543f0a2195d1b0dc88ef12142bea690009344
F src/wal.h 06b2a0b599cc0f53ea97f497cf8c6b758c999f71
F src/walker.c d46044e7a5842560dfe7122d93ff5145dd4a96f4d0bf5ba5910a7731b8c01e79
F src/where.c 67f98714b07ec3c1d5e033a63d23c0fd70c24861b7b46b69b10700f22dca6ffe
F src/whereInt.h 2a4b634d63ce488b46d4b0da8f2eaa8f9aeab202bc25ef76f007de5e3fba1f20
F src/wherecode.c 8ad48867660519e262a401720845dc76934f86f558ec9606335fafcd7a2554f8
F src/whereexpr.c a2fe3811d45af45a5c6667caabc15e01054fe6228c64e86e1f7d2ba5ef5284f9
F test/8_3_names.test 05034aadccd2253ffe6cbefb06662b8aa4600f77
F test/8_3_names.test ebbb5cd36741350040fd28b432ceadf495be25b2
F test/affinity2.test a6d901b436328bd67a79b41bb0ac2663918fe3bd
F test/affinity3.test 6a101af2fc945ce2912f6fe54dd646018551710d
F test/aggerror.test a867e273ef9e3d7919f03ef4f0e8c0d2767944f2
@@ -526,10 +523,10 @@ F test/async3.test d73a062002376d7edc1fe3edff493edbec1fc2f7
F test/async4.test 1787e3952128aa10238bf39945126de7ca23685a
F test/async5.test 383ab533fdb9f7ad228cc99ee66e1acb34cc0dc0
F test/atof1.test ff0b0156fd705b67c506e1f2bfe9e26102bea9bd
F test/attach.test f4ff7d463473e2fe9ea3184867961b15dcce2cc3
F test/attach.test 9976867b1a6585018f0966857aa82ed44e0bd6dc
F test/attach2.test 0ec5defa340363de6cd50fd595046465e9aaba2d
F test/attach3.test c59d92791070c59272e00183b7353eeb94915976
F test/attach4.test faaaf33fa51f986b414520cb03cecdc7999df108
F test/attach4.test 53bf502f17647c6d6c5add46dda6bac8b6f4665c
F test/attachmalloc.test 3a4bfca9545bfe906a8d2e622de10fbac5b711b0
F test/auth.test 3d6cd8f3978ba55b1202574e6ecd79c6e00914ca44b9bfd6c1fe6fb873fcac88
F test/auth2.test 9eb7fce9f34bf1f50d3f366fb3e606be5a2000a1
@@ -563,7 +560,7 @@ F test/bigfile.test aa74f4e5db51c8e54a1d9de9fa65d01d1eb20b59
F test/bigfile2.test 1b489a3a39ae90c7f027b79110d6b4e1dbc71bfc
F test/bigrow.test f0aeb7573dcb8caaafea76454be3ade29b7fc747
F test/bigsort.test 8299fa9298f4f1e02fc7d2712e8b77d6cd60e5a2
F test/bind.test 30af0fc61bc3836034215cdbdeca46113ca1b4a1
F test/bind.test 3c7b320969000c441a70952b0b15938fbb66237c
F test/bindxfer.test efecd12c580c14df5f4ad3b3e83c667744a4f7e0
F test/bitvec.test 75894a880520164d73b1305c1c3f96882615e142
F test/blob.test e7ac6c7d3a985cc4678c64f325292529a69ae252
@@ -579,7 +576,7 @@ F test/btree01.test e08b3613540145b353f20c81cb18ead54ff12e0f
F test/btree02.test fe69453d474d8154d19b904157ff1db4812fed99
F test/btreefault.test c2bcb542685eea44621275cfedbd8a13f65201e3
F test/busy.test 76b4887f8b9160ba903c1ac22e8ff406ad6ae2f0
F test/cache.test 0bc2195f4a7207108af2617ed356e77daf4412f7
F test/cache.test 13bc046b26210471ca6f2889aceb1ea52dc717de
F test/cacheflush.test af25bb1509df04c1da10e38d8f322d66eceedf61
F test/cachespill.test 895997f84a25b323b166aecb69baab2d6380ea98f9e0bcc688c4493c535cfab9
F test/capi2.test 011c16da245fdc0106a2785035de6b242c05e738
@@ -647,13 +644,13 @@ F test/crashtest1.c 09c1c7d728ccf4feb9e481671e29dda5669bbcc2
F test/createtab.test b5de160630b209c4b8925bdcbbaf48cc90b67fe8
F test/cse.test 277350a26264495e86b1785f34d2d0c8600e021c
F test/csv01.test e0ba3caaa57e4c667a0b45977689fb8082f14348
F test/ctime.test a4effbe5472ef6c0308c4ebcba55c802aa297fff
F test/ctime.test ff6c38e822459d6ca743c34901caf57740b08b54
F test/cursorhint.test 7bc346788390475e77a345da2b92270d04d35856
F test/cursorhint2.test 8457e93d97f665f23f97cdbc8477d16e3480331b
F test/date.test 9b73bbeb1b82d9c1f44dec5cf563bf7da58d2373
F test/dbfuzz.c 73047c920d6210e5912c87cdffd9a1c281d4252e
F test/dbstatus.test 73149851b3aff14fc6db478e58f9083a66422cf5
F test/dbstatus2.test 16194c6aa2d8a050f227890d2ed1eb5f8dcb8300
F test/dbstatus2.test e93ab03bfae6d62d4d935f20de928c19ca0ed0ab
F test/default.test 0cb49b1c315a0d81c81d775e407f66906a2a604d
F test/delete.test acc38fca8ee4851467705b1c2cfea64cd26667e5
F test/delete2.test 3a03f2cca1f9a67ec469915cb8babd6485db43fa
@@ -688,9 +685,9 @@ F test/e_totalchanges.test b12ee5809d3e63aeb83238dd501a7bca7fd72c10
F test/e_update.test f46c2554d915c9197548681e8d8c33a267e84528
F test/e_uri.test 25385396082b67fd02ae0038b95a3b3575fe0519
F test/e_vacuum.test 1b8b4772d05374aa1b8958669138bbb4213ee26a
F test/e_wal.test 95c21e45eefe4cc31e820f998b14f92d1cb3a1bf
F test/e_wal.test ae9a593207a77d711443ee69ffe081fda9243625
F test/e_walauto.test 248af31e73c98df23476a22bdb815524c9dc3ba8
F test/e_walckpt.test 9f20ab843538484c57069074b126699266ee5521
F test/e_walckpt.test 28c371a6bb5e5fe7f31679c1df1763a19d19e8a0
F test/e_walhook.test 4c0613a0c76e7a9d5c4c211e1b4cbcc1143914df
F test/emptytable.test a38110becbdfa6325cd65cb588dca658cd885f62
F test/enc.test e54531cd6bf941ee6760be041dff19a104c7acea
@@ -700,14 +697,14 @@ F test/enc4.test c8f1ce3618508fd0909945beb8b8831feef2c020
F test/eqp.test 3fe051af50921284189d1970eb653f9fcf5117d2
F test/errmsg.test f31592a594b44ee121371d25ddd5d63497bb3401
F test/eval.test a64c9105d6ff163df7cf09d6ac29cdad5922078c
F test/exclusive.test ff85192dcf5000a1b53452a89fa9c5b61b0138cf
F test/exclusive.test 9a57bd66e39144b888ca75c309914fcdefb4e3f9
F test/exclusive2.test 984090e8e9d1b331d2e8111daf6e5d61dda0bef7
F test/exec.test e949714dc127eaa5ecc7d723efec1ec27118fdd7
F test/exists.test 79a75323c78f02bbe9c251ea502a092f9ef63dac
F test/expr.test 66a2c9ac34f74f036faa4092f5402c7d3162fc93
F test/extension01.test 00d13cec817f331a687a243e0e5a2d87b0e358c9
F test/extraquick.test cb254400bd42bfb777ff675356aabf3287978f79
F test/fallocate.test fe52076a43ff99da8411990dbb4f374e81e88c85
F test/fallocate.test 3e979af17dfa7e5e9dda5eba1a696c04fa9d47f7
F test/filectrl.test 6e871c2d35dead1d9a88e176e8d2ca094fec6bb3
F test/filefmt.test e4edbdc637ca9576ccf4337a3cce627d9df7a56c
F test/fkey1.test ba64806ff9a04eecab2679caad377ae99a5e94e4
@@ -870,13 +867,13 @@ F test/in4.test d2b38cba404bc4320f4fe1b595b3d163f212c068
F test/in5.test 7ae37fcd4a5e198291c6ab5f31a5bb3d15397efe8b75a6736d7a95a7b8dd9e08
F test/incrblob.test c9b96afc292aeff43d6687bcb09b0280aa599822
F test/incrblob2.test a5ce5ed1d0b01e2ed347245a21170372528af0a5
F test/incrblob3.test 5fa6f2665ae37da05928bb16851d4f86515af78a
F test/incrblob3.test d8d036fde015d4a159cd3cbae9d29003b37227a4
F test/incrblob4.test 21a52a6843a56cdcce968c6a86b72a7066d0e6ba
F test/incrblob_err.test 69f9247fed50278d48ea710d1a8f9cdb09e4c0b8
F test/incrblobfault.test 74dd8ac108304cea0b4a0df6df63a1567e558758
F test/incrcorrupt.test 6c567fbf870aa9e91866fe52ce6f200cd548939a
F test/incrvacuum.test d2a6ddf5e429720b5fe502766af747915ccf6c32
F test/incrvacuum2.test 1e873b6caf87ce160d4cb6d8c7a46f0570da1ddc
F test/incrvacuum2.test 7d26cfda66c7e55898d196de54ac4ec7d86a4e3d
F test/incrvacuum3.test 75256fb1377e7c39ef2de62bfc42bbff67be295a
F test/incrvacuum_ioerr.test 6ae2f783424e47a0033304808fe27789cf93e635
F test/index.test fe3c7a1aad82af92623747e9c3f3aa94ccd51238
@@ -918,7 +915,7 @@ F test/join5.test bc98ea4b4e5003f5b1453701ebb8cd7d1c01a550
F test/join6.test cfe6503791ceb0cbb509966740286ec423cbf10b
F test/journal1.test 69abc726c51b4a0409189f9a85191205297c0577
F test/journal2.test 9dac6b4ba0ca79c3b21446bbae993a462c2397c4
F test/journal3.test ef775301aa8c64c80efa859e6aa0207add921a93
F test/journal3.test ff8af941f9e06161d3db1b46bb9f965ff0e7f307
F test/jrnlmode.test 7864d59cf7f6e552b9b99ba0f38acd167edc10fa
F test/jrnlmode2.test 81610545a4e6ed239ea8fa661891893385e23a1d
F test/jrnlmode3.test 556b447a05be0e0963f4311e95ab1632b11c9eaa
@@ -941,13 +938,12 @@ F test/lock.test be4fe08118fb988fed741f429b7dd5d65e1c90db
F test/lock2.test 5242d8ac4e2d59c403aebff606af449b455aceff
F test/lock3.test f271375930711ae044080f4fe6d6eda930870d00
F test/lock4.test e175ae13865bc87680607563bafba21f31a26f12
F test/lock5.test 1f1e0fd1670deef8c0a76e8f895bd5e124133ca4
F test/lock6.test 83434ae8ca1d1c5e2eaf74d4e44aa24ab62b291c
F test/lock5.test c6c5e0ebcb21c61a572870cc86c0cb9f14cede38
F test/lock6.test ad5b387a3a8096afd3c68a55b9535056431b0cf5
F test/lock7.test 49f1eaff1cdc491cc5dee3669f3c671d9f172431
F test/lock_common.tcl 7ffb45accf6ee91c736df9bafe0806a44358f035
F test/lock_proxy.test 95be9c32d79be25cf643b4e41a0aa0e53aa21621
F test/lookaside.test 90052e87282de256d613fcf8c9cbb845e4001d2f
F test/main.test 5c893511b64780c8b96563664f8b8d7d959911af
F test/main.test bb75e406c9b64931f3dc7e7f04626633365bb22f
F test/make-where7.tcl 05c16b5d4f5d6512881dfec560cb793915932ef9
F test/malloc.test 21c213365f2cca95ab2d7dc078dc8525f96065f8
F test/malloc3.test e3b32c724b5a124b57cb0ed177f675249ad0c66a
@@ -971,12 +967,12 @@ F test/mallocJ.test b5d1839da331d96223e5f458856f8ffe1366f62e
F test/mallocK.test 27cb5566a6e5f2d76f9d4aa2eca45524401fd61e
F test/mallocL.test fb311ff80afddf3b1a75e52289081f4754d901dc
F test/mallocM.test 78bbe9d3da84a5c679123cdb40d7b2010b18fc46e13897e4f253c6ba6fbff134
F test/malloc_common.tcl 8d368ee0b9d77c9643b174448f137c18b68e49f4
F test/manydb.test 3cd8e52ab3112cb8365afeedd6e8231977920577
F test/malloc_common.tcl aac62499b76be719fac31e7a3e54a7fd53272e7f
F test/manydb.test 28385ae2087967aa05c38624cec7d96ec74feb3e
F test/mem5.test c6460fba403c5703141348cd90de1c294188c68f
F test/memdb.test c46019291625650d71416e770f6a54a281a1a98f
F test/memdb.test c1f2a343ad14398d5d6debda6ea33e80d0dafcc7
F test/memleak.test 10b9c6c57e19fc68c32941495e9ba1c50123f6e2
F test/memsubsys1.test b6037a276f95c88d029868b12c80ff08dbb78700
F test/memsubsys1.test 6d268d0ae90f8d61a2356a1838665654d83de518
F test/memsubsys2.test 3e4a8d0c05fd3e5fa92017c64666730a520c7e08
F test/minmax.test 6751e87b409fe11b02e70a306d846fa544e25a41
F test/minmax2.test b44bae787fc7b227597b01b0ca5575c7cb54d3bc
@@ -996,7 +992,7 @@ F test/mmap2.test 9d6dd9ddb4ad2379f29cc78f38ce1e63ed418022
F test/mmap3.test b3c297e78e6a8520aafcc1a8f140535594c9086e
F test/mmap4.test 2e2b4e32555b58da15176e6fe750f17c9dcf7f93
F test/mmapfault.test d4c9eff9cd8c2dc14bc43e71e042f175b0a26fe3
F test/multiplex.test 659fdd41065d4af3fc769b87052c275d0c4685fb
F test/multiplex.test dc0d67b66f84b484a83cb8bbdf3f0a7f49562ccd
F test/multiplex2.test 580ca5817c7edbe4cc68fa150609c9473393003a
F test/multiplex3.test d228f59eac91839a977eac19f21d053f03e4d101
F test/multiplex4.test e8ae4c4bd70606a5727743241f13b5701990abe4
@@ -1027,24 +1023,24 @@ F test/oserror.test b32dc34f2363ef18532e3a0a7358e3e7e321974f
F test/ossfuzz.c f5abed3177f719df3c3109901fcdd26b9fb7f581c8da50fc26f3a81ddfb2c2ae
F test/ossshell.c 296ab63067841bd1b1e97b46a0b2af48ee7f69d50d1a723008bee12dd7122622
F test/ovfl.test 199c482696defceacee8c8e0e0ef36da62726b2f
F test/pager1.test 15d423765637d8cd54b025f90ed6c8dc311e2fc3
F test/pager1.test 841868017e9dd3cb459b8d78862091a7d9cff21d
F test/pager2.test 67b8f40ae98112bcdba1f2b2d03ea83266418c71
F test/pager3.test 3856d9c80839be0668efee1b74811b1b7f7fc95f
F test/pager4.test a122e9e6925d5b23b31e3dfef8c6a44bbf19590e
F test/pagerfault.test 6b3f03fca89aacb4d1ca2c0216af114acaec0c66
F test/pagerfault.test 42ff797b1e6426c141cc7ee8b7417c9f27427950
F test/pagerfault2.test caf4c7facb914fd3b03a17b31ae2b180c8d6ca1f
F test/pagerfault3.test 1003fcda009bf48a8e22a516e193b6ef0dd1bbd8
F test/pageropt.test 84e4cc5cbca285357f7906e99b21be4f2bf5abc0
F test/pagesize.test 5769fc62d8c890a83a503f67d47508dfdc543305
F test/parser1.test 391b9bf9a229547a129c61ac345ed1a6f5eb1854
F test/pcache.test 9a04fa260cb47dd4fdc5d13c5e97054e05931592
F test/pcache.test c8acbedd3b6fd0f9a7ca887a83b11d24a007972b
F test/pcache2.test af7f3deb1a819f77a6d0d81534e97d1cf62cd442
F test/percentile.test 4243af26b8f3f4555abe166f723715a1f74c77ff
F test/permutations.test 8aaa22a0f428a7e6b8446b97bc7691a273eaeff5dc290fb9129bf79fa9813a6e
F test/pragma.test d3b32e689ffd885b2e7bcaabab21ee4652a4f99f
F test/pragma.test 1e94755164a3a3264cd39836de4bebcb7809e5f8
F test/pragma2.test e5d5c176360c321344249354c0c16aec46214c9f
F test/pragma3.test 14c12bc5352b1e100e0b6b44f371053a81ccf8ed
F test/pragma4.test 2fcabe7a352888f8aa70aad87eabe6481ea99b04
F test/pragma4.test 6e85b6eab8e61ffc9c7db59d842276674e8e3264
F test/pragmafault.test 275edaf3161771d37de60e5c2b412627ac94cef11739236bec12ed1258b240f8
F test/printf.test b3ff34e73d59124140eaf89f7672e21bc2ca5fcc
F test/printf2.test 9e6db85f81c63f2367c34a9d7db384088bd374ad
@@ -1064,12 +1060,12 @@ F test/rdonly.test 64e2696c322e3538df0b1ed624e21f9a23ed9ff8
F test/regexp1.test 497ea812f264d12b6198d6e50a76be4a1973a9d8
F test/regexp2.test 40e894223b3d6672655481493f1be12012f2b33c
F test/reindex.test 44edd3966b474468b823d481eafef0c305022254
F test/releasetest.tcl 936c8b9c72d46a86d0f9d65c536e883c2d79a8f53a5324283757bfc9d8b5a656 x
F test/releasetest.tcl 7bb585433ce7fb2a2c255ae4b5e24f1bc27fe177ec1120f886cc4852f48f5ee9 x
F test/resolver01.test f4022acafda7f4d40eca94dbf16bc5fc4ac30ceb
F test/rollback.test 458fe73eb3ffdfdf9f6ba3e9b7350a6220414dea
F test/rollback2.test 8435d6ff0f13f51d2a4181c232e706005fa90fc5
F test/rollbackfault.test 0e646aeab8840c399cfbfa43daab46fd609cf04a
F test/rowallock.test e8c576ebc92f6b9211662f495658fd39bbcacb5b
F test/rowallock.test 3f88ec6819489d0b2341c7a7528ae17c053ab7cc
F test/rowhash.test 0bc1d31415e4575d10cacf31e1a66b5cc0f8be81
F test/rowid.test 5b7509f384f4f6fae1af3c8c104c8ca299fea18d
F test/rowvalue.test 44f3492f415cc9f374e8388a5eb61503eaca5230
@@ -1117,7 +1113,7 @@ F test/selectF.test 21c94e6438f76537b72532fa9fd4710cdd455fc3
F test/selectG.test e8600e379589e85e9fefd2fe4d44a4cdd63f6982
F test/server1.test 46803bd3fe8b99b30dbc5ff38ffc756f5c13a118
F test/session.test 78fa2365e93d3663a6e933f86e7afc395adf18be
F test/shared.test 13376ba3be1c5685ab1ec184189adabd15fa70be
F test/shared.test 1da9dbad400cee0d93f252ccf76e1ae007a63746
F test/shared2.test 03eb4a8d372e290107d34b6ce1809919a698e879
F test/shared3.test ab693f9b6e156b8bfb2a0ad94f29fe69602a5d38
F test/shared4.test c75f476804e76e26bf6fa0e7b421fb0ca7d07558
@@ -1138,7 +1134,7 @@ F test/shell6.test ab1592ebe881371f651f18ee6a0df21cbfb5310f88cb832ab642d4038f679
F test/shell7.test 07751911b294698e0c5df67bcbd29e7d2f0f2907
F test/shortread1.test bb591ef20f0fd9ed26d0d12e80eee6d7ac8897a3
F test/show_speedtest1_rtree.tcl 32e6c5f073d7426148a6936a0408f4b5b169aba5
F test/shrink.test 09bc6e2473321e7a4711ae7d753865daffc42f4a
F test/shrink.test 1b4330b1fd9e818c04726d45cb28db73087535ce
F test/sidedelete.test f0ad71abe6233e3b153100f3b8d679b19a488329
F test/skipscan1.test 8ab5d2c7c5cd3fe7f172d366e6e74e887cb33cb4
F test/skipscan2.test d1d1450952b7275f0b0a3a981f0230532743951a
@@ -1173,14 +1169,14 @@ F test/sqllimits1.test a74ee2a3740b9f9c2437c246d8fb77354862a142
F test/sqllog.test 6af6cb0b09f4e44e1917e06ce85be7670302517a
F test/stat.test f8f1279ffffabe6df825723af18cc6e0ae70a893
F test/statfault.test f525a7bf633e50afd027700e9a486090684b1ac1
F test/stmt.test fc832e52bd1273144abbb27c07fc01d1acdd9939
F test/stmt.test 64844332db69cf1a735fcb3e11548557fc95392f
F test/subjournal.test 2121a93ef3d3e83d52bf236c8a02aef4009fbf52884754104b2b6cad9a041095
F test/subquery.test d7268d193dd33d5505df965399d3a594e76ae13f
F test/subquery2.test 438f8a7da1457277b22e4176510f7659b286995f
F test/subselect.test 0966aa8e720224dbd6a5e769a3ec2a723e332303
F test/substr.test 18f57c4ca8a598805c4d64e304c418734d843c1a
F test/subtype1.test 7fe09496352f97053af1437150751be2d0a0cae8
F test/superlock.test c86eacd6cead5da9c5ecd25f3d46fca30a927ef2
F test/superlock.test ec94f0556b6488d97f71c79f9061ae08d9ab8f12
F test/symlink.test c9ebe7330d228249e447038276bfc8a7b22f4849
F test/sync.test 2f84bdbc2b2df1fcb0220575b4b9f8cea94b7529
F test/sync2.test 6be8ed007fa063b147773c1982b5bdba97a32badc536bdc6077eff5cf8710ece
@@ -1191,14 +1187,14 @@ F test/table.test b708f3e5fa2542fa51dfab21fc07b36ea445cb2f
F test/tableapi.test 2674633fa95d80da917571ebdd759a14d9819126
F test/tableopts.test dba698ba97251017b7c80d738c198d39ab747930
F test/tclsqlite.test 1d73b9203b1ca8798d7d7310742b8d3febc0d56e
F test/tempdb.test be87085066978807bb9eb934ae3986521e88a675
F test/tempdb.test bd92eba8f20e16a9136e434e20b280794de3cdb6
F test/tempdb2.test 27e41ed540b2f9b056c2e77e9bddc1b875358507
F test/tempfault.test 0c0d349c9a99bf5f374655742577f8712c647900
F test/temptable.test d2c9b87a54147161bcd1822e30c1d1cd891e5b30
F test/temptable2.test cd396beb41117a5302fff61767c35fa4270a0d5e
F test/temptable3.test d11a0974e52b347e45ee54ef1923c91ed91e4637
F test/temptrigger.test 38f0ca479b1822d3117069e014daabcaacefffcc
F test/tester.tcl f98d157a622f083feb74db32ed832b0629127edf
F test/tester.tcl 581f0185434daf7026ccede4c07e8d1479186ec5
F test/thread001.test 9f22fd3525a307ff42a326b6bc7b0465be1745a5
F test/thread002.test e630504f8a06c00bf8bbe68528774dd96aeb2e58
F test/thread003.test ee4c9efc3b86a6a2767516a37bd64251272560a7
@@ -1215,10 +1211,10 @@ F test/time-wordcount.sh 8e0b0f8109367827ad5d58f5cc849705731e4b90
F test/tkt-02a8e81d44.test 6c80d9c7514e2a42d4918bf87bf6bc54f379110c
F test/tkt-26ff0c2d1e.test 888324e751512972c6e0d1a09df740d8f5aaf660
F test/tkt-2a5629202f.test 0521bd25658428baa26665aa53ffed9367d33af2
F test/tkt-2d1a5c67d.test 58a56653795d1787f4ed661f9da7da153b0dc3f9
F test/tkt-2d1a5c67d.test be1326f3061caec85085f4c9ee4490561ca037c0
F test/tkt-2ea2425d34.test 1cf13e6f75d149b3209a0cb32927a82d3d79fb28
F test/tkt-31338dca7e.test 6fb8807851964da0d24e942f2e19c7c705b9fb58
F test/tkt-313723c356.test d78f772dd71d632f3d3f6d3d588c3105b2ab1bb3
F test/tkt-313723c356.test 4b306ad45c736cedf2f5221f6155b92143244b6d
F test/tkt-385a5b56b9.test c0a06ada41d7f06b1686da0e718553f853771d1e
F test/tkt-38cb5df375.test f3cc8671f1eb604d4ae9cf886ed4366bec656678
F test/tkt-3998683a16.test 6d1d04d551ed1704eb3396ca87bb9ccc8c5c1eb7
@@ -1318,7 +1314,7 @@ F test/tkt3357.test 77c37c6482b526fe89941ce951c22d011f5922ed
F test/tkt3419.test 1bbf36d7ea03b638c15804251287c2391f5c1f6b
F test/tkt3424.test 61f831bd2b071bd128fa5d00fbda57e656ca5812
F test/tkt3442.test 53840ec5325bb94544792aad4c20476f81dc26b1
F test/tkt3457.test 08d2d9b3fc37fcc7ad9f24e5d1e004571f2a79c8
F test/tkt3457.test 44e980fe5334753dcc27b94fa4deabc485a92f74
F test/tkt3461.test 228ea328a5a21e8663f80ee3d212a6ad92549a19
F test/tkt3493.test 1686cbde85f8721fc1bdc0ee72f2ef2f63139218
F test/tkt3508.test d75704db9501625c7f7deec119fcaf1696aefb7d
@@ -1424,36 +1420,36 @@ F test/vtabI.test 751b07636700dbdea328e4265b6077ccd6811a3f
F test/vtab_alter.test 9e374885248f69e251bdaacf480b04a197f125e5
F test/vtab_err.test 0d4d8eb4def1d053ac7c5050df3024fd47a3fbd8
F test/vtab_shared.test 5253bff2355a9a3f014c15337da7e177ab0ef8ad
F test/wal.test 83635d428b0a3fe883939cedbaedf29e13a5affd
F test/wal2.test 72286d113a40817702fa59285ee5b82effbfe754
F test/wal3.test 82f70ca79e5db6829f9246f4a30d4a4751921c3b
F test/wal4.test 5755887f321baa4c55de0b91066fa7d0cafcac9d
F test/wal5.test 9304fada875d7279deb2783385b0ae1c02d96b88
F test/wal6.test 3d9b79194d15f5b4f6e4169f89f815c049edb2df
F test/wal.test 613efec03e517e1775d86b993a54877d2e29a477
F test/wal2.test 56b0bc95b8693a0be294f8d210c49025dd094bd7
F test/wal3.test 2a93004bc0fb2b5c29888964024695bade278ab2
F test/wal4.test 4744e155cd6299c6bd99d3eab1c82f77db9cdb3c
F test/wal5.test 9c11da7aeccd83a46d79a556ad11a18d3cb15aa9
F test/wal6.test b602704e4b066199bc89d91ca9000f335dcf4572
F test/wal64k.test 163655ecd2cb8afef4737cac2a40fdd2eeaf20b8
F test/wal7.test 18cf68ab8010ae0a2baaa48e5b59567a9503e63e
F test/wal8.test 82bf6e493002b2d1580823b40e47bce3e15f468a
F test/wal7.test 2ae8f427d240099cc4b2dfef63cff44e2a68a1bd
F test/wal8.test d9df3fba4caad5854ed69ed673c68482514203c8
F test/wal9.test 378e76a9ad09cd9bee06c172ad3547b0129a6750
F test/wal_common.tcl 15f152fd55703975878741beca6cfa4209d5b3b3
F test/walbak.test e322af729156c121183af4847c6e2b17bc629f47
F test/walbig.test 3ca3d94751b80054eed5bda20a1339ae1f619483
F test/wal_common.tcl a98f17fba96206122eff624db0ab13ec377be4fe
F test/walbak.test 018d4e5a3d45c6298d11b99f09a8ef6876527946
F test/walbig.test f437473a16cfb314867c6b5d1dbcd519e73e3434
F test/walblock.test be48f3a75eff0b4456209f26b3ce186c2015497d
F test/walcksum.test add42a54d7c7d9bc72a913792022a195293bef2b
F test/walcrash.test 065a041da88f980df3830f09b7fe308337bb594a
F test/walcrash2.test 6eb6842d34cc5955726264c80566963c32a9cbea
F test/walcrash3.test 279640ffafa23f7564529ccd69bfb97849ccae9d
F test/walcksum.test bb234a1bb42248b3515d992b719708015c384278
F test/walcrash.test 21038858cc552077b0522f50b0fa87e38139306a
F test/walcrash2.test a0edab4e5390f03b99a790de89aad15d6ec70b36
F test/walcrash3.test e426aa58122d20f2b9fbe9a507f9eb8cab85b8af
F test/walcrash4.test e7b6e7639a950a0cca8e210e248c8dad4d63bf20
F test/walfault.test f4160abd02d583d06d7ea9554e7a3f749f6b3410
F test/walhook.test 5d2bdb04fd3e220e2f96e6b566d57e00020bdaec
F test/walmode.test aa45339b4afa435dde5d88e71a95459cc221a3f4
F test/walnoshm.test 559b878f3aab838971d820329ca35f1caa7b038e
F test/walfault.test 1f8389f7709877e9b4cc679033d71d6fe529056b
F test/walhook.test ed00a40ba7255da22d6b66433ab61fab16a63483
F test/walmode.test 4022fe03ae6e830583672caa101f046438a0473c
F test/walnoshm.test 84ca10c544632a756467336b7c3b864d493ee496
F test/waloverwrite.test dad2f26567f1b45174e54fbf9a8dc1cb876a7f03
F test/walpersist.test abd956d66e2f36d2d9d05d3a969f48be6d2ddbec
F test/walpersist.test 8c6b7e3ec1ba91b5e4dc4e0921d6d3f87cd356a6
F test/walprotocol.test 0b92feb132ccebd855494d917d3f6c2d717ace20
F test/walro.test b874ef49167c3a463f798a4caf25c7e13e1a9e7f
F test/walshared.test 04590b10c677f75318701818c50bc0dda5da64ab
F test/walslow.test 07a51cbe9d4895d0a90c7af76d14a62d363ac162
F test/walthread.test c13f5a12fbd9d81e58f49875dc9dd8a52a84cf03
F test/walro.test 4ab7ac01b77c2f894235c699d59e3e3c7f15a160
F test/walshared.test 0befc811dcf0b287efae21612304d15576e35417
F test/walslow.test c05c68d4dc2700a982f89133ce103a1a84cc285f
F test/walthread.test de8dbaf6d9e41481c460ba31ca61e163d7348f8e
F test/where.test f0c325563acde44f2c4ea6ba348e9e29f7121757
F test/where2.test 478d2170637b9211f593120648858593bf2445a1
F test/where3.test 54cdeb02157acc979de41530b804ae7b09552bf1
@@ -1481,7 +1477,7 @@ F test/win32heap.test ea19770974795cff26e11575e12d422dbd16893c
F test/win32lock.test fbf107c91d8f5512be5a5b87c4c42ab9fdd54972
F test/win32longpath.test 169c75a3b2e43481f4a62122510210c67b08f26d
F test/win32nolock.test ac4f08811a562e45a5755e661f45ca85892bdbbc
F test/with1.test cef099a491eac9874f2c28bd2dc86394fb3e47b3
F test/with1.test 732e3ef398dcecb609839cd5ef0cb63beb2a9eff31420f3b745fc55b9e85b61e
F test/with2.test 2b40da883658eb74ad8ad06afabe11a408e7fb87
F test/with3.test e71604a0e53cba82bc04c703987cb1d6751ec0b6
F test/withM.test 693b61765f2b387b5e3e24a4536e2e82de15ff64
@@ -1517,7 +1513,7 @@ F tool/libvers.c caafc3b689638a1d88d44bc5f526c2278760d9b9
F tool/loadfts.c c3c64e4d5e90e8ba41159232c2189dba4be7b862
F tool/logest.c 11346aa019e2e77a00902aa7d0cabd27bd2e8cca
F tool/max-limits.c cbb635fbb37ae4d05f240bfb5b5270bb63c54439
F tool/mkautoconfamal.sh ab527af92dc684028e0d1db3fa6241787fae78987b99e5bbac7eb87e1970b8e5
F tool/mkautoconfamal.sh e855df211ecbcc7131dee817110ff386cfb112f7
F tool/mkkeywordhash.c f7f3b342211ac6a14258b9726d5b97cf4f548f22
F tool/mkmsvcmin.tcl cbd93f1cfa3a0a9ae56fc958510aa3fc3ac65e29cb111716199e3d0e66eefaa4
F tool/mkopcodec.tcl d1b6362bd3aa80d5520d4d6f3765badf01f6c43c
@@ -1526,7 +1522,7 @@ F tool/mkopts.tcl 66ac10d240cc6e86abd37dc908d50382f84ff46e
F tool/mkpragmatab.tcl 32bb40741df11bddc8451de9ea4d130e7b4476d8064794b1cf402ac110840fba
F tool/mkspeedsql.tcl a1a334d288f7adfe6e996f2e712becf076745c97
F tool/mksqlite3c-noext.tcl fef88397668ae83166735c41af99d79f56afaabb
F tool/mksqlite3c.tcl 8f15b936d872f576a71676b91e7dc6404b27bf66
F tool/mksqlite3c.tcl 06b2e6a0f21cc0a5d70fbbd136b3e0a96470645e
F tool/mksqlite3h.tcl 51bd5e7e840a920388a5966c9f2ccc618f434c57bd68c1bab4085b2553e1e237
F tool/mksqlite3internalh.tcl eb994013e833359137eb53a55acdad0b5ae1049b
F tool/mkvsix.tcl b9e0777a213c23156b6542842c238479e496ebf5
@@ -1552,7 +1548,7 @@ F tool/speedtest2.tcl ee2149167303ba8e95af97873c575c3e0fab58ff
F tool/speedtest8.c 2902c46588c40b55661e471d7a86e4dd71a18224
F tool/speedtest8inst1.c 7ce07da76b5e745783e703a834417d725b7d45fd
F tool/split-sqlite3c.tcl d9be87f1c340285a3e081eb19b4a247981ed290c
F tool/sqldiff.c 3fb48a6c6669d2d2c59a7f072a410dd2583579b4
F tool/sqldiff.c 30879bbc8de686df4624e86adce2d8981f500904c1cfb55b5d1eea2ffd9341eb
F tool/srcck1.c 371de5363b70154012955544f86fdee8f6e5326f
F tool/stack_usage.tcl f8e71b92cdb099a147dad572375595eae55eca43
F tool/symbols-mingw.sh 4dbcea7e74768305384c9fd2ed2b41bbf9f0414d
@@ -1585,7 +1581,7 @@ F vsixtest/vsixtest.tcl 6a9a6ab600c25a91a7acc6293828957a386a8a93
F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc
F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e
F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0
P 12964240f1e497e6f02e4a87bf3eff75c807020108c3de83977264cc66188b8d
R 2bfdab9d552d306c18a7beebf16cb9a1
U dan
Z e78eb8e2881553fe9b3c98c2aeb63057
P c733a1dea37e4678e7bd0d3d0ca9b8eae1fbdc28615f75d8f1e5141aa53567d9
R 305c14b2512f47cedccd7e2033ab5eaa
U drh
Z e2a7cd050c361ca9085d24d8c34886c7
+1 -1
View File
@@ -1 +1 @@
214d238a4763adffa914232ffb4a94b27008f5429d2952d139490d6f9fd4114e
6c3476b513965df22d648f9a1b99733af753b44d51163cc7d42a69bf562300e1
+110 -139
View File
@@ -87,14 +87,8 @@ static BtShared *SQLITE_WSD sqlite3SharedCacheList = 0;
** sqlite3_open(), sqlite3_open16(), or sqlite3_open_v2().
*/
int sqlite3_enable_shared_cache(int enable){
#if defined(__APPLE__) && !defined(SQLITE_TEST) && !defined(TH3_COMPATIBILITY)
/* Enable global shared cache function for debugging and unit tests,
** but not for release */
return SQLITE_MISUSE;
#else
sqlite3GlobalConfig.sharedCacheEnabled = enable;
return SQLITE_OK;
#endif
}
#endif
@@ -756,26 +750,6 @@ void sqlite3BtreeClearCursor(BtCursor *pCur){
pCur->eState = CURSOR_INVALID;
}
/*
** This is a debugging routine designed to reveal the file (database or
** wal file) that the page would be read from if it were reread at the
** current time. It returns the name of the file.
*/
static const char *btreePageOriginFile(MemPage *pPage){
return sqlite3PagerOrigin(pPage->pDbPage, 0);
}
/*
** This is a debugging routine designed to reveal the byte offset that
** the page would be read from (from either the database or wal file) if it
** were reread at the current time. The byte offset is returned.
*/
static i64 btreePageOriginOffset(MemPage *pPage){
i64 iOffset = 0;
sqlite3PagerOrigin(pPage->pDbPage, &iOffset);
return iOffset;
}
/*
** In this version of BtreeMoveto, pKey is a packed index record
** such as is generated by the OP_MakeRecord opcode. Unpack the
@@ -1807,6 +1781,16 @@ static int decodeFlags(MemPage *pPage, int flagByte){
** we failed to detect any corruption.
*/
static int btreeInitPage(MemPage *pPage){
int pc; /* Address of a freeblock within pPage->aData[] */
u8 hdr; /* Offset to beginning of page header */
u8 *data; /* Equal to pPage->aData */
BtShared *pBt; /* The main btree structure */
int usableSize; /* Amount of usable space on each page */
u16 cellOffset; /* Offset from start of page to first cell pointer */
int nFree; /* Number of unused bytes on the page */
int top; /* First byte of the cell content area */
int iCellFirst; /* First allowable cell or freeblock offset */
int iCellLast; /* Last possible cell or freeblock offset */
assert( pPage->pBt!=0 );
assert( pPage->pBt->db!=0 );
@@ -1814,127 +1798,114 @@ static int btreeInitPage(MemPage *pPage){
assert( pPage->pgno==sqlite3PagerPagenumber(pPage->pDbPage) );
assert( pPage == sqlite3PagerGetExtra(pPage->pDbPage) );
assert( pPage->aData == sqlite3PagerGetData(pPage->pDbPage) );
assert( pPage->isInit==0 );
if( !pPage->isInit ){
int pc; /* Address of a freeblock within pPage->aData[] */
u8 hdr; /* Offset to beginning of page header */
u8 *data; /* Equal to pPage->aData */
BtShared *pBt; /* The main btree structure */
int usableSize; /* Amount of usable space on each page */
u16 cellOffset; /* Offset from start of page to first cell pointer */
int nFree; /* Number of unused bytes on the page */
int top; /* First byte of the cell content area */
int iCellFirst; /* First allowable cell or freeblock offset */
int iCellLast; /* Last possible cell or freeblock offset */
pBt = pPage->pBt;
hdr = pPage->hdrOffset;
data = pPage->aData;
/* EVIDENCE-OF: R-28594-02890 The one-byte flag at offset 0 indicating
** the b-tree page type. */
if( decodeFlags(pPage, data[hdr]) ) return SQLITE_CORRUPT_BKPT;
assert( pBt->pageSize>=512 && pBt->pageSize<=65536 );
pPage->maskPage = (u16)(pBt->pageSize - 1);
pPage->nOverflow = 0;
usableSize = pBt->usableSize;
pPage->cellOffset = cellOffset = hdr + 8 + pPage->childPtrSize;
pPage->aDataEnd = &data[usableSize];
pPage->aCellIdx = &data[cellOffset];
pPage->aDataOfst = &data[pPage->childPtrSize];
/* EVIDENCE-OF: R-58015-48175 The two-byte integer at offset 5 designates
** the start of the cell content area. A zero value for this integer is
** interpreted as 65536. */
top = get2byteNotZero(&data[hdr+5]);
/* EVIDENCE-OF: R-37002-32774 The two-byte integer at offset 3 gives the
** number of cells on the page. */
pPage->nCell = get2byte(&data[hdr+3]);
if( pPage->nCell>MX_CELL(pBt) ){
/* To many cells for a single page. The page must be corrupt */
return SQLITE_CORRUPT_BKPT;
}
testcase( pPage->nCell==MX_CELL(pBt) );
/* EVIDENCE-OF: R-24089-57979 If a page contains no cells (which is only
** possible for a root page of a table that contains no rows) then the
** offset to the cell content area will equal the page size minus the
** bytes of reserved space. */
assert( pPage->nCell>0 || top==usableSize || CORRUPT_DB );
pBt = pPage->pBt;
/* A malformed database page might cause us to read past the end
** of page when parsing a cell.
**
** The following block of code checks early to see if a cell extends
** past the end of a page boundary and causes SQLITE_CORRUPT to be
** returned if it does.
*/
iCellFirst = cellOffset + 2*pPage->nCell;
iCellLast = usableSize - 4;
if( pBt->db->flags & SQLITE_CellSizeCk ){
int i; /* Index into the cell pointer array */
int sz; /* Size of a cell */
hdr = pPage->hdrOffset;
data = pPage->aData;
/* EVIDENCE-OF: R-28594-02890 The one-byte flag at offset 0 indicating
** the b-tree page type. */
if( decodeFlags(pPage, data[hdr]) ) return SQLITE_CORRUPT_BKPT;
assert( pBt->pageSize>=512 && pBt->pageSize<=65536 );
pPage->maskPage = (u16)(pBt->pageSize - 1);
pPage->nOverflow = 0;
usableSize = pBt->usableSize;
pPage->cellOffset = cellOffset = hdr + 8 + pPage->childPtrSize;
pPage->aDataEnd = &data[usableSize];
pPage->aCellIdx = &data[cellOffset];
pPage->aDataOfst = &data[pPage->childPtrSize];
/* EVIDENCE-OF: R-58015-48175 The two-byte integer at offset 5 designates
** the start of the cell content area. A zero value for this integer is
** interpreted as 65536. */
top = get2byteNotZero(&data[hdr+5]);
/* EVIDENCE-OF: R-37002-32774 The two-byte integer at offset 3 gives the
** number of cells on the page. */
pPage->nCell = get2byte(&data[hdr+3]);
if( pPage->nCell>MX_CELL(pBt) ){
/* To many cells for a single page. The page must be corrupt */
return SQLITE_CORRUPT_BKPT;
}
testcase( pPage->nCell==MX_CELL(pBt) );
/* EVIDENCE-OF: R-24089-57979 If a page contains no cells (which is only
** possible for a root page of a table that contains no rows) then the
** offset to the cell content area will equal the page size minus the
** bytes of reserved space. */
assert( pPage->nCell>0 || top==usableSize || CORRUPT_DB );
/* A malformed database page might cause us to read past the end
** of page when parsing a cell.
**
** The following block of code checks early to see if a cell extends
** past the end of a page boundary and causes SQLITE_CORRUPT to be
** returned if it does.
*/
iCellFirst = cellOffset + 2*pPage->nCell;
iCellLast = usableSize - 4;
if( pBt->db->flags & SQLITE_CellSizeCk ){
int i; /* Index into the cell pointer array */
int sz; /* Size of a cell */
if( !pPage->leaf ) iCellLast--;
for(i=0; i<pPage->nCell; i++){
pc = get2byteAligned(&data[cellOffset+i*2]);
testcase( pc==iCellFirst );
testcase( pc==iCellLast );
if( pc<iCellFirst || pc>iCellLast ){
return SQLITE_CORRUPT_BKPT;
}
sz = pPage->xCellSize(pPage, &data[pc]);
testcase( pc+sz==usableSize );
if( pc+sz>usableSize ){
return SQLITE_CORRUPT_BKPT;
}
if( !pPage->leaf ) iCellLast--;
for(i=0; i<pPage->nCell; i++){
pc = get2byteAligned(&data[cellOffset+i*2]);
testcase( pc==iCellFirst );
testcase( pc==iCellLast );
if( pc<iCellFirst || pc>iCellLast ){
return SQLITE_CORRUPT_BKPT;
}
if( !pPage->leaf ) iCellLast++;
}
/* Compute the total free space on the page
** EVIDENCE-OF: R-23588-34450 The two-byte integer at offset 1 gives the
** start of the first freeblock on the page, or is zero if there are no
** freeblocks. */
pc = get2byte(&data[hdr+1]);
nFree = data[hdr+7] + top; /* Init nFree to non-freeblock free space */
if( pc>0 ){
u32 next, size;
if( pc<iCellFirst ){
/* EVIDENCE-OF: R-55530-52930 In a well-formed b-tree page, there will
** always be at least one cell before the first freeblock.
*/
return SQLITE_CORRUPT_BKPT;
}
while( 1 ){
if( pc>iCellLast ){
return SQLITE_CORRUPT_BKPT; /* Freeblock off the end of the page */
}
next = get2byte(&data[pc]);
size = get2byte(&data[pc+2]);
nFree = nFree + size;
if( next<=pc+size+3 ) break;
pc = next;
}
if( next>0 ){
return SQLITE_CORRUPT_BKPT; /* Freeblock not in ascending order */
}
if( pc+size>(unsigned int)usableSize ){
return SQLITE_CORRUPT_BKPT; /* Last freeblock extends past page end */
sz = pPage->xCellSize(pPage, &data[pc]);
testcase( pc+sz==usableSize );
if( pc+sz>usableSize ){
return SQLITE_CORRUPT_BKPT;
}
}
if( !pPage->leaf ) iCellLast++;
}
/* At this point, nFree contains the sum of the offset to the start
** of the cell-content area plus the number of free bytes within
** the cell-content area. If this is greater than the usable-size
** of the page, then the page must be corrupted. This check also
** serves to verify that the offset to the start of the cell-content
** area, according to the page header, lies within the page.
*/
if( nFree>usableSize ){
/* Compute the total free space on the page
** EVIDENCE-OF: R-23588-34450 The two-byte integer at offset 1 gives the
** start of the first freeblock on the page, or is zero if there are no
** freeblocks. */
pc = get2byte(&data[hdr+1]);
nFree = data[hdr+7] + top; /* Init nFree to non-freeblock free space */
if( pc>0 ){
u32 next, size;
if( pc<iCellFirst ){
/* EVIDENCE-OF: R-55530-52930 In a well-formed b-tree page, there will
** always be at least one cell before the first freeblock.
*/
return SQLITE_CORRUPT_BKPT;
}
pPage->nFree = (u16)(nFree - iCellFirst);
pPage->isInit = 1;
while( 1 ){
if( pc>iCellLast ){
return SQLITE_CORRUPT_BKPT; /* Freeblock off the end of the page */
}
next = get2byte(&data[pc]);
size = get2byte(&data[pc+2]);
nFree = nFree + size;
if( next<=pc+size+3 ) break;
pc = next;
}
if( next>0 ){
return SQLITE_CORRUPT_BKPT; /* Freeblock not in ascending order */
}
if( pc+size>(unsigned int)usableSize ){
return SQLITE_CORRUPT_BKPT; /* Last freeblock extends past page end */
}
}
/* At this point, nFree contains the sum of the offset to the start
** of the cell-content area plus the number of free bytes within
** the cell-content area. If this is greater than the usable-size
** of the page, then the page must be corrupted. This check also
** serves to verify that the offset to the start of the cell-content
** area, according to the page header, lies within the page.
*/
if( nFree>usableSize ){
return SQLITE_CORRUPT_BKPT;
}
pPage->nFree = (u16)(nFree - iCellFirst);
pPage->isInit = 1;
return SQLITE_OK;
}
@@ -3386,7 +3357,7 @@ static int setChildPtrmaps(MemPage *pPage){
Pgno pgno = pPage->pgno;
assert( sqlite3_mutex_held(pPage->pBt->mutex) );
rc = btreeInitPage(pPage);
rc = pPage->isInit ? SQLITE_OK : btreeInitPage(pPage);
if( rc!=SQLITE_OK ) return rc;
nCell = pPage->nCell;
@@ -3437,7 +3408,7 @@ static int modifyPagePointer(MemPage *pPage, Pgno iFrom, Pgno iTo, u8 eType){
int nCell;
int rc;
rc = btreeInitPage(pPage);
rc = pPage->isInit ? SQLITE_OK : btreeInitPage(pPage);
if( rc ) return rc;
nCell = pPage->nCell;
+1 -1
View File
@@ -353,7 +353,7 @@ void sqlite3DeleteFrom(
** API function sqlite3_count_changes) to be set incorrectly.
**
** The "rcauth==SQLITE_OK" terms is the
** IMPLEMENATION-OF: R-17228-37124 If the action code is SQLITE_DELETE and
** IMPLEMENTATION-OF: R-17228-37124 If the action code is SQLITE_DELETE and
** the callback returns SQLITE_IGNORE then the DELETE operation proceeds but
** the truncate optimization is disabled and all rows are deleted
** individually.
+15 -6
View File
@@ -1772,10 +1772,12 @@ static int selectNodeIsConstant(Walker *pWalker, Select *NotUsed){
}
static int exprIsConst(Expr *p, int initFlag, int iCur){
Walker w;
memset(&w, 0, sizeof(w));
w.eCode = initFlag;
w.xExprCallback = exprNodeIsConstant;
w.xSelectCallback = selectNodeIsConstant;
#ifdef SQLITE_DEBUG
w.xSelectCallback2 = sqlite3SelectWalkAssert2;
#endif
w.u.iCur = iCur;
sqlite3WalkExpr(&w, p);
return w.eCode;
@@ -1863,9 +1865,9 @@ static int exprNodeIsConstantOrGroupBy(Walker *pWalker, Expr *pExpr){
*/
int sqlite3ExprIsConstantOrGroupBy(Parse *pParse, Expr *p, ExprList *pGroupBy){
Walker w;
memset(&w, 0, sizeof(w));
w.eCode = 1;
w.xExprCallback = exprNodeIsConstantOrGroupBy;
w.xSelectCallback = 0;
w.u.pGroupBy = pGroupBy;
w.pParse = pParse;
sqlite3WalkExpr(&w, p);
@@ -1893,10 +1895,12 @@ int sqlite3ExprIsConstantOrFunction(Expr *p, u8 isInit){
*/
int sqlite3ExprContainsSubquery(Expr *p){
Walker w;
memset(&w, 0, sizeof(w));
w.eCode = 1;
w.xExprCallback = sqlite3ExprWalkNoop;
w.xSelectCallback = selectNodeIsConstant;
#ifdef SQLITE_DEBUG
w.xSelectCallback2 = sqlite3SelectWalkAssert2;
#endif
sqlite3WalkExpr(&w, p);
return w.eCode==0;
}
@@ -4901,8 +4905,8 @@ int sqlite3FunctionUsesThisSrc(Expr *pExpr, SrcList *pSrcList){
Walker w;
struct SrcCount cnt;
assert( pExpr->op==TK_AGG_FUNCTION );
memset(&w, 0, sizeof(w));
w.xExprCallback = exprSrcCount;
w.xSelectCallback = 0;
w.u.pSrcCount = &cnt;
cnt.pSrc = pSrcList;
cnt.nThis = 0;
@@ -5074,10 +5078,14 @@ static int analyzeAggregate(Walker *pWalker, Expr *pExpr){
return WRC_Continue;
}
static int analyzeAggregatesInSelect(Walker *pWalker, Select *pSelect){
UNUSED_PARAMETER(pWalker);
UNUSED_PARAMETER(pSelect);
pWalker->walkerDepth++;
return WRC_Continue;
}
static void analyzeAggregatesInSelectEnd(Walker *pWalker, Select *pSelect){
UNUSED_PARAMETER(pSelect);
pWalker->walkerDepth--;
}
/*
** Analyze the pExpr expression looking for aggregate functions and
@@ -5090,9 +5098,10 @@ static int analyzeAggregatesInSelect(Walker *pWalker, Select *pSelect){
*/
void sqlite3ExprAnalyzeAggregates(NameContext *pNC, Expr *pExpr){
Walker w;
memset(&w, 0, sizeof(w));
w.xExprCallback = analyzeAggregate;
w.xSelectCallback = analyzeAggregatesInSelect;
w.xSelectCallback2 = analyzeAggregatesInSelectEnd;
w.walkerDepth = 0;
w.u.pNC = pNC;
assert( pNC->pSrcList!=0 );
sqlite3WalkExpr(&w, pExpr);
+1 -9
View File
@@ -16,9 +16,6 @@
*/
#include "sqliteInt.h"
#ifdef SQLITE_ENABLE_SQLRR
# include "sqlrr.h"
#endif
/*
** Execute SQL code. Return one of the SQLITE_ success/failure
@@ -45,9 +42,7 @@ int sqlite3_exec(
if( !sqlite3SafetyCheckOk(db) ) return SQLITE_MISUSE_BKPT;
if( zSql==0 ) zSql = "";
#ifdef SQLITE_ENABLE_SQLRR
SRRecExec(db, zSql);
#endif
sqlite3_mutex_enter(db->mutex);
sqlite3Error(db, SQLITE_OK);
while( rc==SQLITE_OK && zSql[0] ){
@@ -129,9 +124,6 @@ int sqlite3_exec(
exec_out:
if( pStmt ) sqlite3VdbeFinalize((Vdbe *)pStmt);
sqlite3DbFree(db, azCols);
#ifdef SQLITE_ENABLE_SQLRR
SRRecExecEnd(db);
#endif
rc = sqlite3ApiExit(db, rc);
if( rc!=SQLITE_OK && pzErrMsg ){
+1 -154
View File
@@ -16,9 +16,6 @@
*/
#include "sqliteInt.h"
#ifdef SQLITE_ENABLE_SQLRR
# include "sqlrr.h"
#endif
#ifdef SQLITE_ENABLE_FTS3
# include "fts3.h"
#endif
@@ -870,6 +867,7 @@ static int binCollFunc(
/* EVIDENCE-OF: R-65033-28449 The built-in BINARY collation compares
** strings byte by byte using the memcmp() function from the standard C
** library. */
assert( pKey1 && pKey2 );
rc = memcmp(pKey1, pKey2, n);
if( rc==0 ){
if( padFlag
@@ -1231,10 +1229,6 @@ void sqlite3LeaveMutexAndCloseZombie(sqlite3 *db){
if( db->lookaside.bMalloced ){
sqlite3_free(db->lookaside.pStart);
}
#ifdef SQLITE_ENABLE_SQLRR
SRRecClose(db);
#endif
sqlite3_free(db);
}
@@ -2529,44 +2523,6 @@ int sqlite3_limit(sqlite3 *db, int limitId, int newLimit){
}
return oldLimit; /* IMP: R-53341-35419 */
}
#if defined(SQLITE_ENABLE_AUTO_PROFILE)
/* stderr logging */
void _sqlite_auto_profile(void *aux, const char *sql, u64 ns);
void _sqlite_auto_trace(void *aux, const char *sql);
void _sqlite_auto_profile(void *aux, const char *sql, u64 ns) {
#pragma unused(aux)
fprintf(stderr, "Query: %s\n Execution Time: %llu ms\n", sql, ns / 1000000);
}
void _sqlite_auto_trace(void *aux, const char *sql) {
fprintf(stderr, "TraceSQL(%p): %s\n", aux, sql);
}
/* syslog logging */
#include <asl.h>
static aslclient autolog_client = NULL;
static void _close_asl_log() {
if( NULL!=autolog_client ){
asl_close(autolog_client);
autolog_client = NULL;
}
}
static void _open_asl_log() {
if( NULL==autolog_client ){
autolog_client = asl_open("SQLite", NULL, 0);
atexit(_close_asl_log);
}
}
void _sqlite_auto_profile_syslog(void *aux, const char *sql, u64 ns);
void _sqlite_auto_trace_syslog(void *aux, const char *sql);
void _sqlite_auto_profile_syslog(void *aux, const char *sql, u64 ns) {
#pragma unused(aux)
asl_log(autolog_client, NULL, ASL_LEVEL_NOTICE, "Query: %s\n Execution Time: %llu ms\n", sql, ns / 1000000);
}
void _sqlite_auto_trace_syslog(void *aux, const char *sql) {
asl_log(autolog_client, NULL, ASL_LEVEL_NOTICE, "TraceSQL(%p): %s\n", aux, sql);
}
#endif
/*
** This function is used to parse both URIs and non-URI filenames passed by the
@@ -2822,57 +2778,6 @@ int sqlite3ParseUri(
return rc;
}
#if defined(SQLITE_ENABLE_AUTO_PROFILE)
#define SQLITE_AUTOLOGGING_STDERR 1
#define SQLITE_AUTOLOGGING_SYSLOG 2
static void enableAutoLogging(
sqlite3 *db
){
char *envprofile = getenv("SQLITE_AUTO_PROFILE");
if( envprofile!=NULL ){
int where = 0;
if( !strncasecmp("1", envprofile, 1) ){
if( isatty(2) ){
where = SQLITE_AUTOLOGGING_STDERR;
}else{
where = SQLITE_AUTOLOGGING_SYSLOG;
}
} else if( !strncasecmp("stderr", envprofile, 6) ){
where = SQLITE_AUTOLOGGING_STDERR;
} else if( !strncasecmp("syslog", envprofile, 6) ){
where = SQLITE_AUTOLOGGING_SYSLOG;
}
if( where==SQLITE_AUTOLOGGING_STDERR ){
sqlite3_profile(db, _sqlite_auto_profile, db);
}else if( where==SQLITE_AUTOLOGGING_SYSLOG ){
_open_asl_log();
sqlite3_profile(db, _sqlite_auto_profile_syslog, db);
}
}
char *envtrace = getenv("SQLITE_AUTO_TRACE");
if( envtrace!=NULL ){
int where = 0;
if( !strncasecmp("1", envtrace, 1) ){
if( isatty(2) ){
where = SQLITE_AUTOLOGGING_STDERR;
}else{
where = SQLITE_AUTOLOGGING_SYSLOG;
}
} else if( !strncasecmp("stderr", envtrace, 6) ){
where = SQLITE_AUTOLOGGING_STDERR;
} else if( !strncasecmp("syslog", envtrace, 6) ){
where = SQLITE_AUTOLOGGING_SYSLOG;
}
if( where==SQLITE_AUTOLOGGING_STDERR ){
sqlite3_trace(db, _sqlite_auto_trace, db);
}else if( where==SQLITE_AUTOLOGGING_SYSLOG ){
_open_asl_log();
sqlite3_trace(db, _sqlite_auto_trace_syslog, db);
}
}
}
#endif
/*
** This routine does the work of opening a database on behalf of
@@ -3181,30 +3086,7 @@ opendb_out:
}else if( rc!=SQLITE_OK ){
db->magic = SQLITE_MAGIC_SICK;
}
#if defined(__APPLE__) && ENABLE_FORCE_WAL
if( db && !rc ){
if ((0 == access("/var/db/enableForceWAL", R_OK))) {
#ifdef SQLITE_DEBUG
fprintf(stderr, "SQLite WAL journal_mode ENABLED by default.\n");
#endif
sqlite3_exec(db, "pragma journal_mode=wal", NULL, NULL, NULL);
#ifdef SQLITE_DEBUG
// } else {
// fprintf(stderr, "SQLite WAL journal_mode NOT ENABLED by default.\n");
#endif
}
}
#endif
#if defined(SQLITE_ENABLE_AUTO_PROFILE)
if( db && !rc ){
enableAutoLogging(db);
}
#endif
*ppDb = db;
#ifdef SQLITE_ENABLE_SQLRR
SRRecOpen(db, zFilename, flags);
#endif
#ifdef SQLITE_ENABLE_SQLLOG
if( sqlite3GlobalConfig.xSqllog ){
/* Opening a db handle. Fourth parameter is passed 0. */
@@ -3657,20 +3539,11 @@ int sqlite3_file_control(sqlite3 *db, const char *zDbName, int op, void *pArg){
rc = SQLITE_OK;
}else if( fd->pMethods ){
rc = sqlite3OsFileControl(fd, op, pArg);
#ifndef SQLITE_OMIT_WAL
if( (rc==SQLITE_OK)&&(op==SQLITE_FCNTL_LAST_ERRNO)&&(*(int *)pArg==0) ){
sqlite3_file *pWalFd = sqlite3PagerWalFile(pPager);
if( pWalFd&&(pWalFd->pMethods) ){
rc = sqlite3OsFileControl(pWalFd, op, pArg);
}
}
#endif
}else{
rc = SQLITE_NOTFOUND;
}
sqlite3BtreeLeave(pBtree);
}
sqlite3Error(db, rc);
sqlite3_mutex_leave(db->mutex);
return rc;
}
@@ -4108,32 +3981,6 @@ int sqlite3_db_readonly(sqlite3 *db, const char *zDbName){
pBt = sqlite3DbNameToBtree(db, zDbName);
return pBt ? sqlite3BtreeIsReadonly(pBt) : -1;
}
#if (SQLITE_ENABLE_APPLE_SPI>0) && defined(__APPLE__)
#include "sqlite3_private.h"
/*
** Testing a file path for sqlite locks held by a process ID.
** Returns SQLITE_LOCKSTATE_ON if locks are present on path
** that would prevent writing to the database.
*/
int _sqlite3_lockstate(const char *path, pid_t pid){
sqlite3 *db = NULL;
if( sqlite3_open_v2(path, &db, SQLITE_OPEN_READONLY, NULL) == SQLITE_OK ){
LockstatePID lockstate = {pid, -1};
sqlite3_file_control(db, NULL, SQLITE_FCNTL_LOCKSTATE_PID, &lockstate);
sqlite3_close(db);
int state = lockstate.state;
return state;
}
if( NULL!=db ){
sqlite3_close(db); /* need to close even if open returns an error */
}
return SQLITE_LOCKSTATE_ERROR;
}
#endif /* SQLITE_ENABLE_APPLE_SPI */
#ifdef SQLITE_ENABLE_SNAPSHOT
/*
+1 -7
View File
@@ -205,18 +205,12 @@ int sqlite3OsOpen(
int *pFlagsOut
){
int rc;
int openFlags;
DO_OS_MALLOC_TEST(0);
/* 0x87f7f is a mask of SQLITE_OPEN_ flags that are valid to be passed
** down into the VFS layer. Some SQLITE_OPEN_ flags (for example,
** SQLITE_OPEN_FULLMUTEX or SQLITE_OPEN_SHAREDCACHE) are blocked before
** reaching the VFS. */
#if SQLITE_ENABLE_DATA_PROTECTION
openFlags = flags & (0x87f7f | SQLITE_OPEN_FILEPROTECTION_MASK);
#else
openFlags = flags & 0x87f7f;
#endif
rc = pVfs->xOpen(pVfs, zPath, pFile, openFlags, pFlagsOut);
rc = pVfs->xOpen(pVfs, zPath, pFile, flags & 0x87f7f, pFlagsOut);
assert( rc==SQLITE_OK || pFile->pMethods==0 );
return rc;
}
+42 -1314
View File
File diff suppressed because it is too large Load Diff
-9
View File
@@ -3496,15 +3496,6 @@ static int winFileControl(sqlite3_file *id, int op, void *pArg){
OSTRACE(("FCNTL file=%p, rc=SQLITE_OK\n", pFile->h));
return SQLITE_OK;
}
case SQLITE_FCNTL_PERSIST_WAL: {
int bPersist = *(int*)pArg;
if( bPersist<0 ){
*(int*)pArg = pFile->bPersistWal;
}else{
pFile->bPersistWal = bPersist!=0;
}
return SQLITE_OK;
}
case SQLITE_FCNTL_PERSIST_WAL: {
winModeBit(pFile, WINFILE_PERSIST_WAL, (int*)pArg);
OSTRACE(("FCNTL file=%p, rc=SQLITE_OK\n", pFile->h));
+27 -110
View File
@@ -2535,11 +2535,7 @@ static int pager_delmaster(Pager *pPager, const char *zMaster){
if( !pMaster ){
rc = SQLITE_NOMEM_BKPT;
}else{
const int flags =
#if SQLITE_ENABLE_DATA_PROTECTION
(pPager->vfsFlags&SQLITE_OPEN_FILEPROTECTION_MASK)|
#endif
(SQLITE_OPEN_READONLY|SQLITE_OPEN_MASTER_JOURNAL);
const int flags = (SQLITE_OPEN_READONLY|SQLITE_OPEN_MASTER_JOURNAL);
rc = sqlite3OsOpen(pVfs, zMaster, pMaster, flags, 0);
}
if( rc!=SQLITE_OK ) goto delmaster_out;
@@ -2575,11 +2571,7 @@ static int pager_delmaster(Pager *pPager, const char *zMaster){
** so, return without deleting the master journal file.
*/
int c;
int flags =
#if SQLITE_ENABLE_DATA_PROTECTION
(pPager->vfsFlags&SQLITE_OPEN_FILEPROTECTION_MASK)|
#endif
(SQLITE_OPEN_READONLY|SQLITE_OPEN_MAIN_JOURNAL);
int flags = (SQLITE_OPEN_READONLY|SQLITE_OPEN_MAIN_JOURNAL);
rc = sqlite3OsOpen(pVfs, zJournal, pJournal, flags, 0);
if( rc!=SQLITE_OK ){
goto delmaster_out;
@@ -3261,7 +3253,7 @@ static int pagerPagecount(Pager *pPager, Pgno *pnPage){
nPage = sqlite3WalDbsize(pPager->pWal);
/* If the number of pages in the database is not available from the
** WAL sub-system, determine the page counte based on the size of
** WAL sub-system, determine the page count based on the size of
** the database file. If the size of the database file is not an
** integer multiple of the page-size, round up the result.
*/
@@ -3312,23 +3304,21 @@ static int pagerOpenWalIfPresent(Pager *pPager){
if( !pPager->tempFile ){
int isWal; /* True if WAL file exists */
Pgno nPage; /* Size of the database file */
rc = pagerPagecount(pPager, &nPage);
if( rc ) return rc;
if( nPage==0 ){
rc = sqlite3OsDelete(pPager->pVfs, pPager->zWal, 0);
if( rc==SQLITE_IOERR_DELETE_NOENT ) rc = SQLITE_OK;
isWal = 0;
}else{
rc = sqlite3OsAccess(
pPager->pVfs, pPager->zWal, SQLITE_ACCESS_EXISTS, &isWal
);
}
rc = sqlite3OsAccess(
pPager->pVfs, pPager->zWal, SQLITE_ACCESS_EXISTS, &isWal
);
if( rc==SQLITE_OK ){
if( isWal ){
testcase( sqlite3PcachePagecount(pPager->pPCache)==0 );
rc = sqlite3PagerOpenWal(pPager, 0);
Pgno nPage; /* Size of the database file */
rc = pagerPagecount(pPager, &nPage);
if( rc ) return rc;
if( nPage==0 ){
rc = sqlite3OsDelete(pPager->pVfs, pPager->zWal, 0);
}else{
testcase( sqlite3PcachePagecount(pPager->pPCache)==0 );
rc = sqlite3PagerOpenWal(pPager, 0);
}
}else if( pPager->journalMode==PAGER_JOURNALMODE_WAL ){
pPager->journalMode = PAGER_JOURNALMODE_DELETE;
}
@@ -3655,11 +3645,7 @@ static int pagerOpentemp(
sqlite3_opentemp_count++; /* Used for testing and analysis only */
#endif
vfsFlags |=
#if SQLITE_ENABLE_DATA_PROTECTION
(pPager->vfsFlags&SQLITE_OPEN_FILEPROTECTION_MASK)|
#endif
SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE |
vfsFlags |= SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE |
SQLITE_OPEN_EXCLUSIVE | SQLITE_OPEN_DELETEONCLOSE;
rc = sqlite3OsOpen(pPager->pVfs, 0, pFile, vfsFlags, 0);
assert( rc!=SQLITE_OK || isOpen(pFile) );
@@ -4909,9 +4895,6 @@ act_like_temp_file:
pPager->readOnly = (u8)readOnly;
assert( useJournal || pPager->tempFile );
pPager->noSync = pPager->tempFile;
pPager->fullSync = pPager->noSync ?0:1;
pPager->syncFlags = pPager->noSync ? 0 : SQLITE_SYNC_NORMAL;
pPager->ckptSyncFlags = pPager->syncFlags;
if( pPager->noSync ){
assert( pPager->fullSync==0 );
assert( pPager->extraSync==0 );
@@ -5064,11 +5047,7 @@ static int hasHotJournal(Pager *pPager, int *pExists){
** it can be ignored.
*/
if( !jrnlOpen ){
int f =
#if SQLITE_ENABLE_DATA_PROTECTION
(pPager->vfsFlags&SQLITE_OPEN_FILEPROTECTION_MASK)|
#endif
SQLITE_OPEN_READONLY|SQLITE_OPEN_MAIN_JOURNAL;
int f = SQLITE_OPEN_READONLY|SQLITE_OPEN_MAIN_JOURNAL;
rc = sqlite3OsOpen(pVfs, pPager->zJournal, pPager->jfd, f, &f);
}
if( rc==SQLITE_OK ){
@@ -5208,11 +5187,7 @@ int sqlite3PagerSharedLock(Pager *pPager){
pVfs, pPager->zJournal, SQLITE_ACCESS_EXISTS, &bExists);
if( rc==SQLITE_OK && bExists ){
int fout = 0;
int f =
#if SQLITE_ENABLE_DATA_PROTECTION
(pPager->vfsFlags&SQLITE_OPEN_FILEPROTECTION_MASK)|
#endif
SQLITE_OPEN_READWRITE|SQLITE_OPEN_MAIN_JOURNAL;
int f = SQLITE_OPEN_READWRITE|SQLITE_OPEN_MAIN_JOURNAL;
assert( !pPager->tempFile );
rc = sqlite3OsOpen(pVfs, pPager->zJournal, pPager->jfd, f, &fout);
assert( rc!=SQLITE_OK || isOpen(pPager->jfd) );
@@ -5286,19 +5261,14 @@ int sqlite3PagerSharedLock(Pager *pPager){
** detected. The chance of an undetected change is so small that
** it can be neglected.
*/
Pgno nPage = 0;
char dbFileVers[sizeof(pPager->dbFileVers)];
rc = pagerPagecount(pPager, &nPage);
if( rc ) goto failed;
if( nPage>0 ){
IOTRACE(("CKVERS %p %d\n", pPager, sizeof(dbFileVers)));
rc = sqlite3OsRead(pPager->fd, &dbFileVers, sizeof(dbFileVers), 24);
if( rc!=SQLITE_OK && rc!=SQLITE_IOERR_SHORT_READ ){
IOTRACE(("CKVERS %p %d\n", pPager, sizeof(dbFileVers)));
rc = sqlite3OsRead(pPager->fd, &dbFileVers, sizeof(dbFileVers), 24);
if( rc!=SQLITE_OK ){
if( rc!=SQLITE_IOERR_SHORT_READ ){
goto failed;
}
}else{
memset(dbFileVers, 0, sizeof(dbFileVers));
}
@@ -5716,9 +5686,6 @@ static int pager_open_journal(Pager *pPager){
int flags = SQLITE_OPEN_READWRITE|SQLITE_OPEN_CREATE;
int nSpill;
#if SQLITE_ENABLE_DATA_PROTECTION
flags |= (pPager->vfsFlags&SQLITE_OPEN_FILEPROTECTION_MASK);
#endif
if( pPager->tempFile ){
flags |= (SQLITE_OPEN_DELETEONCLOSE|SQLITE_OPEN_TEMP_JOURNAL);
nSpill = sqlite3Config.nStmtSpill;
@@ -6897,18 +6864,6 @@ sqlite3_file *sqlite3PagerFile(Pager *pPager){
return pPager->fd;
}
#if !defined(SQLITE_OMIT_WAL)
/*
** Return the file handle for the WAL journal file associated
** with the pager. This might return NULL if the file has
** not yet been opened.
*/
sqlite3_file *sqlite3PagerWalFile(Pager *pPager){
return ((pPager->pWal) ? sqlite3WalFile(pPager->pWal) : (NULL));
}
#endif
/*
** Return the file handle for the journal file (if it exists).
** This will be either the rollback journal or the WAL file.
@@ -7430,14 +7385,10 @@ static int pagerOpenWal(Pager *pPager){
** (e.g. due to malloc() failure), return an error code.
*/
if( rc==SQLITE_OK ){
#if SQLITE_ENABLE_DATA_PROTECTION
rc = sqlite3WalOpen(pPager->pVfs, pPager->fd, pPager->zWal, pPager->exclusiveMode,
pPager->journalSizeLimit, (pPager->vfsFlags & (SQLITE_OPEN_FILEPROTECTION_MASK | SQLITE_OPEN_READONLY)),
&pPager->pWal);
#else
rc = sqlite3WalOpen(pPager->pVfs, pPager->fd, pPager->zWal, pPager->exclusiveMode,
pPager->journalSizeLimit, (pPager->vfsFlags & SQLITE_OPEN_READONLY), &pPager->pWal);
#endif
rc = sqlite3WalOpen(pPager->pVfs,
pPager->fd, pPager->zWal, pPager->exclusiveMode,
pPager->journalSizeLimit, &pPager->pWal
);
}
pagerFixMaplimit(pPager);
@@ -7531,13 +7482,6 @@ int sqlite3PagerCloseWal(Pager *pPager, sqlite3 *db){
pPager->pageSize, (u8*)pPager->pTmpSpace);
pPager->pWal = 0;
pagerFixMaplimit(pPager);
/* Ensure that the WAL file is deleted even if the PERSIST_WAL
** hint is enabled. */
if( rc==SQLITE_OK ){
rc = sqlite3OsDelete(pPager->pVfs, pPager->zWal, 0);
if( rc==SQLITE_IOERR_DELETE_NOENT ) rc = SQLITE_OK;
}
if( rc && !pPager->exclusiveMode ) pagerUnlockDb(pPager, SHARED_LOCK);
}
}
@@ -7602,31 +7546,4 @@ int sqlite3PagerWalFramesize(Pager *pPager){
}
#endif
/*
** Return the name of the file (wal file or database file) that page
** pPg would be read from if it were reread at this point. Also set
** output parameter (*piOffset) to the offset within said file.
*/
const char *sqlite3PagerOrigin(DbPage *pPg, i64 *piOffset){
Pager *pPager = pPg->pPager;
Pgno pgno = pPg->pgno;
assert( pPager->eState>=PAGER_READER );
assert( assert_pager_state(pPager) );
assert( pPager->hasHeldSharedLock==1 );
if( pagerUseWal(pPager) ){
u32 iFrame = 0;
int rc = sqlite3WalFindFrame(pPager->pWal, pgno, &iFrame);
if( rc!=SQLITE_OK ) return 0;
if( iFrame ){
if( piOffset ) *piOffset = (i64)(iFrame-1) * (pPager->pageSize + 24) + 32;
return (const char*)pPager->zWal;
}
}
if( piOffset ) *piOffset = (i64)pPager->pageSize * (i64)(pgno-1);
return (const char*)pPager->zFilename;
}
#endif /* SQLITE_OMIT_DISKIO */
-3
View File
@@ -204,7 +204,6 @@ int sqlite3PagerMemUsed(Pager*);
const char *sqlite3PagerFilename(Pager*, int);
sqlite3_vfs *sqlite3PagerVfs(Pager*);
sqlite3_file *sqlite3PagerFile(Pager*);
sqlite3_file *sqlite3PagerWalFile(Pager *pPager);
sqlite3_file *sqlite3PagerJrnlFile(Pager*);
const char *sqlite3PagerJournalname(Pager*);
void *sqlite3PagerTempSpace(Pager*);
@@ -237,6 +236,4 @@ void *sqlite3PagerCodec(DbPage *);
# define enable_simulated_io_errors()
#endif
const char *sqlite3PagerOrigin(DbPage *pPg, i64 *piOffset);
#endif /* SQLITE_PAGER_H */
+2 -1
View File
@@ -364,7 +364,8 @@ static void pcache1Free(void *p){
sqlite3MemdebugSetType(p, MEMTYPE_HEAP);
#ifndef SQLITE_DISABLE_PAGECACHE_OVERFLOW_STATS
{
int nFreed = sqlite3MallocSize(p);
int nFreed = 0;
nFreed = sqlite3MallocSize(p);
sqlite3_mutex_enter(pcache1.mutex);
sqlite3StatusDown(SQLITE_STATUS_PAGECACHE_OVERFLOW, nFreed);
sqlite3_mutex_leave(pcache1.mutex);
+2 -2
View File
@@ -217,11 +217,11 @@ static void setAllPagerFlags(sqlite3 *db){
assert( SQLITE_CacheSpill==PAGER_CACHESPILL );
assert( (PAGER_FULLFSYNC | PAGER_CKPT_FULLFSYNC | PAGER_CACHESPILL)
== PAGER_FLAGS_MASK );
assert( (pDb->safety_level & PAGER_SYNCHRONOUS_MASK)==pDb->safety_level );
while( (n--) > 0 ){
if( pDb->pBt ){
sqlite3BtreeSetPagerFlags(pDb->pBt,
(pDb->safety_level & PAGER_SYNCHRONOUS_MASK)
| (db->flags & PAGER_FLAGS_MASK) );
pDb->safety_level | (db->flags & PAGER_FLAGS_MASK) );
}
pDb++;
}
+1 -12
View File
@@ -14,9 +14,6 @@
** from disk.
*/
#include "sqliteInt.h"
#ifdef SQLITE_ENABLE_SQLRR
# include "sqlrr.h"
#endif
/*
** Fill the InitData structure with an error message that indicates
@@ -748,9 +745,6 @@ int sqlite3_prepare(
){
int rc;
rc = sqlite3LockAndPrepare(db,zSql,nBytes,0,0,ppStmt,pzTail);
#ifdef SQLITE_ENABLE_SQLRR
SRRecPrepare(db, zSql, nBytes, 0, *ppStmt);
#endif
assert( rc==SQLITE_OK || ppStmt==0 || *ppStmt==0 ); /* VERIFY: F13021 */
return rc;
}
@@ -763,9 +757,6 @@ int sqlite3_prepare_v2(
){
int rc;
rc = sqlite3LockAndPrepare(db,zSql,nBytes,1,0,ppStmt,pzTail);
#ifdef SQLITE_ENABLE_SQLRR
SRRecPrepare(db, zSql, nBytes, 1, *ppStmt);
#endif
assert( rc==SQLITE_OK || ppStmt==0 || *ppStmt==0 ); /* VERIFY: F13021 */
return rc;
}
@@ -809,9 +800,7 @@ static int sqlite3Prepare16(
if( zSql8 ){
rc = sqlite3LockAndPrepare(db, zSql8, -1, saveSqlFlag, 0, ppStmt, &zTail8);
}
#ifdef SQLITE_ENABLE_SQLRR
SRRecPrepare(db, zSql8, -1, 1, *ppStmt);
#endif
if( zTail8 && pzTail ){
/* If sqlite3_prepare returns a tail pointer, we calculate the
** equivalent pointer into the UTF-16 string by counting the unicode
+1 -3
View File
@@ -1446,8 +1446,6 @@ int sqlite3ResolveExprNames(
w.xExprCallback = resolveExprStep;
w.xSelectCallback = resolveSelectStep;
w.xSelectCallback2 = 0;
w.walkerDepth = 0;
w.eCode = 0;
w.u.pNC = pNC;
sqlite3WalkExpr(&w, pExpr);
#if SQLITE_MAX_EXPR_DEPTH>0
@@ -1501,9 +1499,9 @@ void sqlite3ResolveSelectNames(
Walker w;
assert( p!=0 );
memset(&w, 0, sizeof(w));
w.xExprCallback = resolveExprStep;
w.xSelectCallback = resolveSelectStep;
w.xSelectCallback2 = 0;
w.pParse = pParse;
w.u.pNC = pOuterNC;
sqlite3WalkSelect(&w, p);
+22 -2
View File
@@ -4610,6 +4610,25 @@ int sqlite3ExprWalkNoop(Walker *NotUsed, Expr *NotUsed2){
return WRC_Continue;
}
/*
** No-op routine for the parse-tree walker for SELECT statements.
** subquery in the parser tree.
*/
int sqlite3SelectWalkNoop(Walker *NotUsed, Select *NotUsed2){
UNUSED_PARAMETER2(NotUsed, NotUsed2);
return WRC_Continue;
}
#if SQLITE_DEBUG
/*
** Always assert. This xSelectCallback2 implementation proves that the
** xSelectCallback2 is never invoked.
*/
void sqlite3SelectWalkAssert2(Walker *NotUsed, Select *NotUsed2){
UNUSED_PARAMETER2(NotUsed, NotUsed2);
assert( 0 );
}
#endif
/*
** This routine "expands" a SELECT statement and all of its subqueries.
** For additional information on what it means to "expand" a SELECT
@@ -4625,11 +4644,11 @@ int sqlite3ExprWalkNoop(Walker *NotUsed, Expr *NotUsed2){
*/
static void sqlite3SelectExpand(Parse *pParse, Select *pSelect){
Walker w;
memset(&w, 0, sizeof(w));
w.xExprCallback = sqlite3ExprWalkNoop;
w.pParse = pParse;
if( pParse->hasCompound ){
w.xSelectCallback = convertCompoundSelectToSubquery;
w.xSelectCallback2 = 0;
sqlite3WalkSelect(&w, pSelect);
}
w.xSelectCallback = selectExpander;
@@ -4689,7 +4708,7 @@ static void selectAddSubqueryTypeInfo(Walker *pWalker, Select *p){
static void sqlite3SelectAddTypeInfo(Parse *pParse, Select *pSelect){
#ifndef SQLITE_OMIT_SUBQUERY
Walker w;
memset(&w, 0, sizeof(w));
w.xSelectCallback = sqlite3SelectWalkNoop;
w.xSelectCallback2 = selectAddSubqueryTypeInfo;
w.xExprCallback = sqlite3ExprWalkNoop;
w.pParse = pParse;
@@ -5270,6 +5289,7 @@ int sqlite3Select(
pPrior = isSelfJoinView(pTabList, pItem);
if( pPrior ){
sqlite3VdbeAddOp2(v, OP_OpenDup, pItem->iCursor, pPrior->iCursor);
explainSetInteger(pItem->iSelectId, pPrior->iSelectId);
}else{
sqlite3SelectDestInit(&dest, SRT_EphemTab, pItem->iCursor);
explainSetInteger(pItem->iSelectId, (u8)pParse->iNextSelectId);
+56 -22
View File
@@ -18,11 +18,25 @@
#endif
/*
** If requested, include the SQLite compiler options file for MSVC.
** Warning pragmas copied from msvc.h in the core.
*/
#if defined(INCLUDE_MSVC_H)
#include "msvc.h"
#endif
#if defined(_MSC_VER)
#pragma warning(disable : 4054)
#pragma warning(disable : 4055)
#pragma warning(disable : 4100)
#pragma warning(disable : 4127)
#pragma warning(disable : 4130)
#pragma warning(disable : 4152)
#pragma warning(disable : 4189)
#pragma warning(disable : 4206)
#pragma warning(disable : 4210)
#pragma warning(disable : 4232)
#pragma warning(disable : 4244)
#pragma warning(disable : 4305)
#pragma warning(disable : 4306)
#pragma warning(disable : 4702)
#pragma warning(disable : 4706)
#endif /* defined(_MSC_VER) */
/*
** No support for loadable extensions in VxWorks.
@@ -1163,7 +1177,7 @@ static unsigned char *SHA3Final(SHA3Context *p){
** Implementation of the sha3(X,SIZE) function.
**
** Return a BLOB which is the SIZE-bit SHA3 hash of X. The default
** size is 256. If X is a BLOB, it is hashed as is.
** size is 256. If X is a BLOB, it is hashed as is.
** For all other non-NULL types of input, X is converted into a UTF-8 string
** and the string is hashed without the trailing 0x00 terminator. The hash
** of a NULL value is NULL.
@@ -2997,7 +3011,7 @@ static char **tableColumnList(ShellState *p, const char *zTab){
nPK++;
if( nPK==1
&& sqlite3_stricmp((const char*)sqlite3_column_text(pStmt,2),
"INTEGER")==0
"INTEGER")==0
){
isIPK = 1;
}else{
@@ -3234,6 +3248,7 @@ static char zHelp[] =
".backup ?DB? FILE Backup DB (default \"main\") to FILE\n"
".bail on|off Stop after hitting an error. Default OFF\n"
".binary on|off Turn binary output on or off. Default OFF\n"
".cd DIRECTORY Change the working directory to DIRECTORY\n"
".changes on|off Show number of rows changed by SQL\n"
".check GLOB Fail if output since .testcase does not match\n"
".clone NEWDB Clone data into NEWDB from the existing database\n"
@@ -3279,8 +3294,8 @@ static char zHelp[] =
" tcl TCL list elements\n"
".nullvalue STRING Use STRING in place of NULL values\n"
".once FILENAME Output for the next SQL command only to FILENAME\n"
".open ?--new? ?FILE? Close existing database and reopen FILE\n"
" The --new starts with an empty file\n"
".open ?OPTIONS? ?FILE? Close existing database and reopen FILE\n"
" The --new option starts with an empty file\n"
".output ?FILENAME? Send output to FILENAME or stdout\n"
".print STRING... Print literal STRING\n"
".prompt MAIN CONTINUE Replace the standard prompts\n"
@@ -3345,8 +3360,8 @@ static int process_input(ShellState *p, FILE *in);
/*
** Read the content of file zName into memory obtained from sqlite3_malloc64()
** and return a pointer to the buffer. The caller is responsible for freeing
** the memory.
** and return a pointer to the buffer. The caller is responsible for freeing
** the memory.
**
** If parameter pnByte is not NULL, (*pnByte) is set to the number of bytes
** read.
@@ -4353,15 +4368,15 @@ int shellDeleteFile(const char *zFilename){
** fkey_collate_clause('parent-tab', 'parent-col', 'child-tab', 'child-col')
**
** If either of the named tables or columns do not exist, this function
** returns an empty string. An empty string is also returned if both tables
** returns an empty string. An empty string is also returned if both tables
** and columns exist but have the same default collation sequence. Or,
** if both exist but the default collation sequences are different, this
** function returns the string " COLLATE <parent-collation>", where
** <parent-collation> is the default collation sequence of the parent column.
*/
static void shellFkeyCollateClause(
sqlite3_context *pCtx,
int nVal,
sqlite3_context *pCtx,
int nVal,
sqlite3_value **apVal
){
sqlite3 *db = sqlite3_context_db_handle(pCtx);
@@ -4372,7 +4387,7 @@ static void shellFkeyCollateClause(
const char *zChildCol;
const char *zChildSeq = 0; /* Initialize to avoid false-positive warning */
int rc;
assert( nVal==4 );
zParent = (const char*)sqlite3_value_text(apVal[0]);
zParentCol = (const char*)sqlite3_value_text(apVal[1]);
@@ -4494,7 +4509,7 @@ static int lintFkeyIndexes(
return SQLITE_ERROR;
}
}
/* Register the fkey_collate_clause() SQL function */
rc = sqlite3_create_function(db, "fkey_collate_clause", 4, SQLITE_UTF8,
0, shellFkeyCollateClause, 0, 0
@@ -4537,9 +4552,9 @@ static int lintFkeyIndexes(
raw_printf(stderr, "Error: internal error");
break;
}else{
if( bGroupByParent
if( bGroupByParent
&& (bVerbose || res==0)
&& (zPrev==0 || sqlite3_stricmp(zParent, zPrev))
&& (zPrev==0 || sqlite3_stricmp(zParent, zPrev))
){
raw_printf(out, "-- Parent table %s\n", zParent);
sqlite3_free(zPrev);
@@ -4549,7 +4564,7 @@ static int lintFkeyIndexes(
if( res==0 ){
raw_printf(out, "%s%s --> %s\n", zIndent, zCI, zTarget);
}else if( bVerbose ){
raw_printf(out, "%s/* no extra indexes required for %s -> %s */\n",
raw_printf(out, "%s/* no extra indexes required for %s -> %s */\n",
zIndent, zFrom, zTarget
);
}
@@ -4731,6 +4746,25 @@ static int do_meta_command(char *zLine, ShellState *p){
}
}else
if( c=='c' && strcmp(azArg[0],"cd")==0 ){
if( nArg==2 ){
#if defined(_WIN32) || defined(WIN32)
wchar_t *z = sqlite3_win32_utf8_to_unicode(azArg[1]);
rc = !SetCurrentDirectoryW(z);
sqlite3_free(z);
#else
rc = chdir(azArg[1]);
#endif
if( rc ){
utf8_printf(stderr, "Cannot change to directory \"%s\"\n", azArg[1]);
rc = 1;
}
}else{
raw_printf(stderr, "Usage: .cd DIRECTORY\n");
rc = 1;
}
}else
/* The undocumented ".breakpoint" command causes a call to the no-op
** routine named test_breakpoint().
*/
@@ -5997,7 +6031,7 @@ static int do_meta_command(char *zLine, ShellState *p){
bSelftestExists = 1;
}
if( bSelftestExists ){
rc = sqlite3_get_table(p->db,
rc = sqlite3_get_table(p->db,
"SELECT tno,op,cmd,ans FROM selftest ORDER BY tno",
&azTest, &nRow, &nCol, 0);
if( rc ){
@@ -6021,7 +6055,7 @@ static int do_meta_command(char *zLine, ShellState *p){
const char *zOp = azTest[i*nCol+1];
const char *zSql = azTest[i*nCol+2];
const char *zAns = azTest[i*nCol+3];
if( bVerbose>0 ){
char *zQuote = sqlite3_mprintf("%q", zSql);
printf("%d: %s %s\n", tno, zOp, zSql);
@@ -6099,8 +6133,8 @@ static int do_meta_command(char *zLine, ShellState *p){
if( strcmp(z,"schema")==0 ){
bSchema = 1;
}else
if( strcmp(z,"sha3-224")==0 || strcmp(z,"sha3-256")==0
|| strcmp(z,"sha3-384")==0 || strcmp(z,"sha3-512")==0
if( strcmp(z,"sha3-224")==0 || strcmp(z,"sha3-256")==0
|| strcmp(z,"sha3-384")==0 || strcmp(z,"sha3-512")==0
){
iSize = atoi(&z[5]);
}else
-1
View File
@@ -550,7 +550,6 @@ int sqlite3_exec(
#define SQLITE_OPEN_SHAREDCACHE 0x00020000 /* Ok for sqlite3_open_v2() */
#define SQLITE_OPEN_PRIVATECACHE 0x00040000 /* Ok for sqlite3_open_v2() */
#define SQLITE_OPEN_WAL 0x00080000 /* VFS only */
#define SQLITE_OPEN_FILEPROTECTION_MASK 0x00700000
/* Reserved: 0x00F00000 */
-73
View File
@@ -1,73 +0,0 @@
/*
* sqlite3_private.h
*/
#ifndef _SQLITE3_PRIVATE_H
#define _SQLITE3_PRIVATE_H
#define SQLITE_LOCKSTATE_OFF 0
#define SQLITE_LOCKSTATE_ON 1
#define SQLITE_LOCKSTATE_NOTADB 2
#define SQLITE_LOCKSTATE_ERROR -1
#define SQLITE_LOCKSTATE_ANYPID -1
/*
** Test a file path for sqlite locks held by a process ID (-1 = any PID).
** Returns one of the following integer codes:
**
** SQLITE_LOCKSTATE_OFF no active sqlite file locks match the specified pid
** SQLITE_LOCKSTATE_ON active sqlite file locks match the specified pid
** SQLITE_LOCKSTATE_NOTADB path points to a file that is not an sqlite db file
** SQLITE_LOCKSTATE_ERROR path was not vaild or was unreadable
**
** There is no support for identifying db files encrypted via SEE encryption
** currently. Zero byte files are tested for sqlite locks, but if no sqlite
** locks are present then SQLITE_LOCKSTATE_NOTADB is returned.
*/
extern int _sqlite3_lockstate(const char *path, pid_t pid);
/*
** Test an open database connection for sqlite locks held by a process ID,
** if a process has an open database connection this will avoid trashing file
** locks by re-using open file descriptors for the database file and support
** files (-shm)
*/
#define SQLITE_FCNTL_LOCKSTATE_PID 103
/*
** Pass the SQLITE_TRUNCATE_DATABASE operation code to sqlite3_file_control()
** to truncate a database and its associated journal file to zero length. The
** SQLITE_TRUNCATE_* flags represent optional flags to safely initialize an
** empty database in the place of the truncated database, the flags are passed
** into sqlite3_file_control via the fourth argument using a pointer to an integer
** configured with the ORed flags. If the fourth argument is NULL, the default
** behavior is applied and the database file is truncated to zero bytes, a rollback
** journal (if present) is unlinked, a WAL journal (if present) is truncated to zero
** bytes and the first few bytes of the -shm file is scrambled to trigger existing
** connections to rebuild the index from the database file contents.
*/
#define SQLITE_FCNTL_TRUNCATE_DATABASE 101
#define SQLITE_TRUNCATE_DATABASE SQLITE_FCNTL_TRUNCATE_DATABASE
#define SQLITE_TRUNCATE_INITIALIZE_HEADER_MASK (0x7F<<0)
#define SQLITE_TRUNCATE_JOURNALMODE_WAL (0x1<<0)
#define SQLITE_TRUNCATE_AUTOVACUUM_MASK (0x3<<2)
#define SQLITE_TRUNCATE_AUTOVACUUM_OFF (0x1<<2)
#define SQLITE_TRUNCATE_AUTOVACUUM_FULL (0x2<<2)
#define SQLITE_TRUNCATE_AUTOVACUUM_INCREMENTAL (0x3<<2)
#define SQLITE_TRUNCATE_PAGESIZE_MASK (0x7<<4)
#define SQLITE_TRUNCATE_PAGESIZE_1024 (0x1<<4)
#define SQLITE_TRUNCATE_PAGESIZE_2048 (0x2<<4)
#define SQLITE_TRUNCATE_PAGESIZE_4096 (0x3<<4)
#define SQLITE_TRUNCATE_PAGESIZE_8192 (0x4<<4)
#define SQLITE_TRUNCATE_FORCE (0x1<<7)
/*
** Pass the SQLITE_REPLACE_DATABASE operation code to sqlite3_file_control()
** and a sqlite3 pointer to another open database file to safely copy the
** contents of that database file into the receiving database.
*/
#define SQLITE_FCNTL_REPLACE_DATABASE 102
#define SQLITE_REPLACE_DATABASE SQLITE_FCNTL_REPLACE_DATABASE
#endif
+4 -24
View File
@@ -3337,6 +3337,10 @@ int sqlite3WalkSelect(Walker*, Select*);
int sqlite3WalkSelectExpr(Walker*, Select*);
int sqlite3WalkSelectFrom(Walker*, Select*);
int sqlite3ExprWalkNoop(Walker*, Expr*);
int sqlite3SelectWalkNoop(Walker*, Select*);
#ifdef SQLITE_DEBUG
void sqlite3SelectWalkAssert2(Walker*, Select*);
#endif
/*
** Return code from the parse-tree walking primitives and their
@@ -4345,30 +4349,6 @@ SQLITE_API SQLITE_EXTERN void (SQLITE_CDECL *sqlite3IoTrace)(const char*,...);
#define MEMTYPE_SCRATCH 0x04 /* Scratch allocations */
#define MEMTYPE_PCACHE 0x08 /* Page cache allocations */
#if (SQLITE_ENABLE_APPLE_SPI>0) && defined(__APPLE__)
/*
** An instance of the following structure is used to hold the process ID
** and return-by-reference lockstate value. The SQLITE_FCNTL_LOCKSTATE_PID
** requires the 4th argument to sqlite3_file_control to be a pointer to an
** instance of LockstatePID initialized with a LockstatePID.pid value equal
** to a process ID to be tested, or the special value SQLITE_LOCKSTATE_ANYPID
** The Lockstate.state value is always set to one of the following values
** when sqlite3_file_control returns:
**
** SQLITE_LOCKSTATE_OFF no active sqlite file locks match the specified pid
** SQLITE_LOCKSTATE_ON active sqlite file locks match the specified pid
** SQLITE_LOCKSTATE_NOTADB path points to a file that is not an sqlite db file
** SQLITE_LOCKSTATE_ERROR path was not vaild or was unreadable
*/
typedef struct LockstatePID LockstatePID;
struct LockstatePID {
pid_t pid; /* Process ID to test */
int state; /* The state of the lock (return value) */
};
#endif /* (SQLITE_ENABLE_APPLE_SPI>0) && defined(__APPLE__) */
/*
** Threading interface
*/
+1 -199
View File
@@ -3937,24 +3937,6 @@ static int SQLITE_TCLAPI test_clear_bindings(
return TCL_OK;
}
/*
** Usage: sqlite3_clear_bindings STMT
**
*/
static int test_clear_bindings_null(
void * clientData,
Tcl_Interp *interp,
int objc,
Tcl_Obj *CONST objv[]
){
if( objc!=1 ){
return TCL_ERROR;
}
/* test for handling NULL <rdar://problem/6646331> */
Tcl_SetObjResult(interp, Tcl_NewIntObj(sqlite3_clear_bindings(0)));
return TCL_OK;
}
/*
** Usage: sqlite3_sleep MILLISECONDS
*/
@@ -5609,96 +5591,6 @@ static int SQLITE_TCLAPI file_control_lasterrno_test(
return TCL_OK;
}
#ifdef __APPLE__
/* From sqlite3_private.h */
# ifndef SQLITE_TRUNCATE_DATABASE
# define SQLITE_TRUNCATE_DATABASE 101
# define SQLITE_TRUNCATE_JOURNALMODE_WAL (0x1<<0)
# define SQLITE_TRUNCATE_AUTOVACUUM_MASK (0x3<<2)
# define SQLITE_TRUNCATE_AUTOVACUUM_OFF (0x1<<2)
# define SQLITE_TRUNCATE_AUTOVACUUM_FULL (0x2<<2)
# define SQLITE_TRUNCATE_AUTOVACUUM_INCREMENTAL (0x3<<2)
# define SQLITE_TRUNCATE_PAGESIZE_MASK (0x7<<4)
# define SQLITE_TRUNCATE_PAGESIZE_1024 (0x1<<4)
# define SQLITE_TRUNCATE_PAGESIZE_2048 (0x2<<4)
# define SQLITE_TRUNCATE_PAGESIZE_4096 (0x3<<4)
# define SQLITE_TRUNCATE_PAGESIZE_8192 (0x4<<4)
# endif
# ifndef SQLITE_REPLACE_DATABASE
# define SQLITE_REPLACE_DATABASE 102
# endif
/*
** tclcmd: file_control_truncate_test DB
**
** This TCL command runs the sqlite3_file_control interface and
** verifies correct operation of the SQLITE_TRUNCATE_DATABASE verb.
*/
static int file_control_truncate_test(
ClientData clientData, /* Pointer to sqlite3_enable_XXX function */
Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
int objc, /* Number of arguments */
Tcl_Obj *CONST objv[] /* Command arguments */
){
sqlite3 *db;
int flags;
int rc;
if( objc!=3 ){
Tcl_AppendResult(interp, "wrong # args: should be \"",
Tcl_GetStringFromObj(objv[0], 0), " DB FLAGS", 0);
return TCL_ERROR;
}
if( getDbPointer(interp, Tcl_GetString(objv[1]), &db) ){
return TCL_ERROR;
}
if( Tcl_GetIntFromObj(interp, objv[2], &flags) ){
return TCL_ERROR;
}
rc = sqlite3_file_control(db, NULL, SQLITE_TRUNCATE_DATABASE, &flags);
if( rc ){
Tcl_SetObjResult(interp, Tcl_NewIntObj(rc));
return TCL_ERROR;
}
return TCL_OK;
}
/*
** tclcmd: file_control_replace_test DB
**
** This TCL command runs the sqlite3_file_control interface and
** verifies correct operation of the SQLITE_REPLACE_DATABASE verb.
*/
static int file_control_replace_test(
ClientData clientData, /* Pointer to sqlite3_enable_XXX function */
Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
int objc, /* Number of arguments */
Tcl_Obj *CONST objv[] /* Command arguments */
){
sqlite3 *src_db;
sqlite3 *dst_db;
int rc;
if( objc!=3 ){
Tcl_AppendResult(interp, "wrong # args: should be \"",
Tcl_GetStringFromObj(objv[0], 0), " DST_DB SRC_DB", 0);
return TCL_ERROR;
}
if( getDbPointer(interp, Tcl_GetString(objv[1]), &dst_db) ){
return TCL_ERROR;
}
if( getDbPointer(interp, Tcl_GetString(objv[2]), &src_db) ){
return TCL_ERROR;
}
rc = sqlite3_file_control(dst_db, NULL, SQLITE_REPLACE_DATABASE, src_db);
if( rc ){
Tcl_SetObjResult(interp, Tcl_NewIntObj(rc));
return TCL_ERROR;
}
return TCL_OK;
}
#endif /* __APPLE__ */
/*
** tclcmd: file_control_chunksize_test DB DBNAME SIZE
**
@@ -5844,90 +5736,6 @@ static int SQLITE_TCLAPI file_control_lockproxy_test(
return TCL_OK;
}
#ifdef __APPLE__
#include <sys/param.h>
#include <sys/mount.h>
#include <sys/errno.h>
#endif
/*
** tclcmd: path_is_local PWD
*/
static int path_is_local(
ClientData clientData, /* Pointer to sqlite3_enable_XXX function */
Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
int objc, /* Number of arguments */
Tcl_Obj *CONST objv[] /* Command arguments */
){
#ifdef __APPLE__
const char *zPath;
int nPath;
struct statfs fsInfo;
if( objc!=2 ){
Tcl_AppendResult(interp, "wrong # args: should be \"",
Tcl_GetStringFromObj(objv[0], 0), " PATH", 0);
return TCL_ERROR;
}
zPath = Tcl_GetStringFromObj(objv[1], &nPath);
if( statfs(zPath, &fsInfo) == -1 ){
int err = errno;
Tcl_AppendResult(interp, "Error calling statfs on path",
Tcl_NewIntObj(err), 0);
return TCL_ERROR;
}
if( fsInfo.f_flags&MNT_LOCAL ){
Tcl_SetObjResult(interp, Tcl_NewIntObj(1));
} else {
Tcl_SetObjResult(interp, Tcl_NewIntObj(0));
}
#else
Tcl_SetObjResult(interp, Tcl_NewIntObj(1));
#endif
return TCL_OK;
}
/*
** tclcmd: path_is_dos PWD
*/
static int path_is_dos(
ClientData clientData, /* Pointer to sqlite3_enable_XXX function */
Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
int objc, /* Number of arguments */
Tcl_Obj *CONST objv[] /* Command arguments */
){
#ifdef __APPLE__
const char *zPath;
int nPath;
struct statfs fsInfo;
if( objc!=2 ){
Tcl_AppendResult(interp, "wrong # args: should be \"",
Tcl_GetStringFromObj(objv[0], 0), " PATH", 0);
return TCL_ERROR;
}
zPath = Tcl_GetStringFromObj(objv[1], &nPath);
if( statfs(zPath, &fsInfo) == -1 ){
int err = errno;
Tcl_AppendResult(interp, "Error calling statfs on path",
Tcl_NewIntObj(err), 0);
return TCL_ERROR;
}
if (0 == strncmp("msdos", fsInfo.f_fstypename, 5)) {
Tcl_SetObjResult(interp, Tcl_NewIntObj(1));
} else if (0 == strncmp("exfat", fsInfo.f_fstypename, 5)) {
Tcl_SetObjResult(interp, Tcl_NewIntObj(1));
} else {
Tcl_SetObjResult(interp, Tcl_NewIntObj(0));
}
#else
Tcl_SetObjResult(interp, Tcl_NewIntObj(0));
#endif
return TCL_OK;
}
#if SQLITE_OS_WIN
/*
** tclcmd: file_control_win32_av_retry DB NRETRY DELAY
@@ -6061,6 +5869,7 @@ static int SQLITE_TCLAPI file_control_persist_wal(
Tcl_AppendResult(interp, z, (char*)0);
return TCL_OK;
}
/*
** tclcmd: file_control_powersafe_overwrite DB PSOW-FLAG
**
@@ -7649,7 +7458,6 @@ int Sqlitetest1_Init(Tcl_Interp *interp){
{ "sqlite3_bind_parameter_name", test_bind_parameter_name, 0},
{ "sqlite3_bind_parameter_index", test_bind_parameter_index, 0},
{ "sqlite3_clear_bindings", test_clear_bindings, 0},
{ "sqlite3_clear_bindings_null", test_clear_bindings_null, 0},
{ "sqlite3_sleep", test_sleep, 0},
{ "sqlite3_errcode", test_errcode ,0 },
{ "sqlite3_extended_errcode", test_ex_errcode ,0 },
@@ -7756,10 +7564,6 @@ int Sqlitetest1_Init(Tcl_Interp *interp){
{ "file_control_test", file_control_test, 0 },
{ "file_control_lasterrno_test", file_control_lasterrno_test, 0 },
{ "file_control_lockproxy_test", file_control_lockproxy_test, 0 },
#ifdef __APPLE__
{ "file_control_truncate_test", file_control_truncate_test, 0 },
{ "file_control_replace_test", file_control_replace_test, 0 },
#endif
{ "file_control_chunksize_test", file_control_chunksize_test, 0 },
{ "file_control_sizehint_test", file_control_sizehint_test, 0 },
#if SQLITE_OS_WIN
@@ -7773,8 +7577,6 @@ int Sqlitetest1_Init(Tcl_Interp *interp){
{ "file_control_tempfilename", file_control_tempfilename, 0 },
{ "sqlite3_vfs_list", vfs_list, 0 },
{ "sqlite3_create_function_v2", test_create_function_v2, 0 },
{ "path_is_local", path_is_local, 0 },
{ "path_is_dos", path_is_dos, 0 },
/* Functions from os.h */
#ifndef SQLITE_OMIT_UTF16
+1 -31
View File
@@ -584,21 +584,7 @@ Tcl_SetVar2(interp, "sqlite_options", "mergesort", "1", TCL_GLOBAL_ONLY);
#else
Tcl_SetVar2(interp,"sqlite_options","prefer_proxy_locking","0",TCL_GLOBAL_ONLY);
#endif
#if defined(SQLITE_ENABLE_PURGEABLE_PCACHE) && defined(__APPLE__)
Tcl_SetVar2(interp,"sqlite_options","enable_purgeable_pcache","1",TCL_GLOBAL_ONLY);
#else
Tcl_SetVar2(interp,"sqlite_options","enable_purgeable_pcache","0",TCL_GLOBAL_ONLY);
#endif
#if SQLITE_DEFAULT_CKPTFULLFSYNC
Tcl_SetVar2(interp,"sqlite_options","default_ckptfullfsync","1",TCL_GLOBAL_ONLY);
#else
Tcl_SetVar2(interp,"sqlite_options","default_ckptfullfsync","0",TCL_GLOBAL_ONLY);
#endif
#if SQLITE_ENABLE_PERSIST_WAL
Tcl_SetVar2(interp,"sqlite_options","enable_persist_wal","1",TCL_GLOBAL_ONLY);
#else
Tcl_SetVar2(interp,"sqlite_options","enable_persist_wal","0",TCL_GLOBAL_ONLY);
#endif
#ifdef SQLITE_OMIT_SHARED_CACHE
Tcl_SetVar2(interp, "sqlite_options", "shared_cache", "0", TCL_GLOBAL_ONLY);
@@ -728,22 +714,6 @@ Tcl_SetVar2(interp, "sqlite_options", "mergesort", "1", TCL_GLOBAL_ONLY);
Tcl_SetVar2(interp, "sqlite_options", "sqllog", "0", TCL_GLOBAL_ONLY);
#endif
#ifdef __APPLE__
# if defined(__ppc__)
Tcl_SetVar2(interp, "os_options", "arch", "ppc", TCL_GLOBAL_ONLY);
# elif defined(__i386__)
Tcl_SetVar2(interp, "os_options", "arch", "i386", TCL_GLOBAL_ONLY);
# elif defined(__x86_64__)
Tcl_SetVar2(interp, "os_options", "arch", "x86_64", TCL_GLOBAL_ONLY);
# elif defined(__arm__)
Tcl_SetVar2(interp, "os_options", "arch", "arm", TCL_GLOBAL_ONLY);
# else
# error Unrecognized architecture for exec_options
# endif
#else
Tcl_SetVar2(interp, "os_options", "arch", "unknown", TCL_GLOBAL_ONLY);
#endif
#ifdef SQLITE_ENABLE_URI_00_ERROR
Tcl_SetVar2(interp, "sqlite_options", "uri_00_error", "1", TCL_GLOBAL_ONLY);
#else
+4 -5
View File
@@ -148,7 +148,7 @@ static int superlockWalLock(
** this function must have been obtained from a successful call to
** sqlite3demo_superlock().
*/
static void sqlite3demo_superunlock(void *pLock){
void sqlite3demo_superunlock(void *pLock){
Superlock *p = (Superlock *)pLock;
if( p->bWal ){
int rc; /* Return code */
@@ -179,10 +179,9 @@ static void sqlite3demo_superunlock(void *pLock){
** until either the lock can be obtained or the busy-handler function returns
** 0 (indicating "give up").
*/
static int sqlite3demo_superlock(
int sqlite3demo_superlock(
const char *zPath, /* Path to database file to lock */
const char *zVfs, /* VFS to use to access database file */
int flags, /* Additional flags to pass to sqlite3_open_v2 */
int (*xBusy)(void*,int), /* Busy handler callback */
void *pBusyArg, /* Context arg for busy handler */
void **ppLock /* OUT: Context to pass to superunlock() */
@@ -197,7 +196,7 @@ static int sqlite3demo_superlock(
/* Open a database handle on the file to superlock. */
rc = sqlite3_open_v2(
zPath, &pLock->db, SQLITE_OPEN_READWRITE|SQLITE_OPEN_CREATE|flags, zVfs
zPath, &pLock->db, SQLITE_OPEN_READWRITE|SQLITE_OPEN_CREATE, zVfs
);
/* Install a busy-handler and execute a BEGIN EXCLUSIVE. If this is not
@@ -339,7 +338,7 @@ static int SQLITE_TCLAPI superlock_cmd(
xBusy = superlock_busy;
}
rc = sqlite3demo_superlock(zPath, zVfs, 0, xBusy, &busy, &pLock);
rc = sqlite3demo_superlock(zPath, zVfs, xBusy, &busy, &pLock);
assert( rc==SQLITE_OK || pLock==0 );
assert( rc!=SQLITE_OK || pLock!=0 );
+1 -2
View File
@@ -592,8 +592,7 @@ int sqlite3VdbeExec(
** sqlite3_column_text16() failed. */
goto no_mem;
}
assert( p->rc==SQLITE_OK || (p->rc&0xff)==SQLITE_BUSY
|| (p->rc&0xFF)==SQLITE_LOCKED );
assert( p->rc==SQLITE_OK || (p->rc&0xff)==SQLITE_BUSY );
assert( p->bIsReader || p->readOnly!=0 );
p->iCurrentTime = 0;
assert( p->explain==0 );
+1 -44
View File
@@ -15,9 +15,6 @@
*/
#include "sqliteInt.h"
#include "vdbeInt.h"
#ifdef SQLITE_ENABLE_SQLRR
# include "sqlrr.h"
#endif
#ifndef SQLITE_OMIT_DEPRECATED
/*
@@ -105,9 +102,6 @@ int sqlite3_finalize(sqlite3_stmt *pStmt){
rc = SQLITE_OK;
}else{
Vdbe *v = (Vdbe*)pStmt;
#ifdef SQLITE_ENABLE_SQLRR
SRRecFinalize(pStmt);
#endif
sqlite3 *db = v->db;
if( vdbeSafety(v) ) return SQLITE_MISUSE_BKPT;
sqlite3_mutex_enter(db->mutex);
@@ -134,9 +128,6 @@ int sqlite3_reset(sqlite3_stmt *pStmt){
}else{
Vdbe *v = (Vdbe*)pStmt;
sqlite3 *db = v->db;
#ifdef SQLITE_ENABLE_SQLRR
SRRecReset(pStmt);
#endif
sqlite3_mutex_enter(db->mutex);
checkProfileCallback(db, v);
rc = sqlite3VdbeReset(v);
@@ -156,14 +147,7 @@ int sqlite3_clear_bindings(sqlite3_stmt *pStmt){
int rc = SQLITE_OK;
Vdbe *p = (Vdbe*)pStmt;
#if SQLITE_THREADSAFE
sqlite3_mutex *mutex=NULL;
#endif
if( NULL==pStmt ){ return SQLITE_OK; } /* <rdar://problem/6646331> */
#ifdef SQLITE_ENABLE_SQLRR
SRRecClearBindings(pStmt);
#endif
#if SQLITE_THREADSAFE
mutex = ((Vdbe*)pStmt)->db->mutex;
sqlite3_mutex *mutex = ((Vdbe*)pStmt)->db->mutex;
#endif
sqlite3_mutex_enter(mutex);
for(i=0; i<p->nVar; i++){
@@ -1340,9 +1324,6 @@ int sqlite3_bind_blob(
int nData,
void (*xDel)(void*)
){
#ifdef SQLITE_ENABLE_SQLRR
SRRecBindBlob(pStmt, i, zData, nData);
#endif
#ifdef SQLITE_ENABLE_API_ARMOR
if( nData<0 ) return SQLITE_MISUSE_BKPT;
#endif
@@ -1365,9 +1346,6 @@ int sqlite3_bind_blob64(
int sqlite3_bind_double(sqlite3_stmt *pStmt, int i, double rValue){
int rc;
Vdbe *p = (Vdbe *)pStmt;
#ifdef SQLITE_ENABLE_SQLRR
SRRecBindDouble(pStmt, i, rValue);
#endif
rc = vdbeUnbind(p, i);
if( rc==SQLITE_OK ){
sqlite3VdbeMemSetDouble(&p->aVar[i-1], rValue);
@@ -1376,17 +1354,11 @@ int sqlite3_bind_double(sqlite3_stmt *pStmt, int i, double rValue){
return rc;
}
int sqlite3_bind_int(sqlite3_stmt *p, int i, int iValue){
#ifdef SQLITE_ENABLE_SQLRR
SRRecBindInt64(p, i, (i64)iValue);
#endif
return sqlite3_bind_int64(p, i, (i64)iValue);
}
int sqlite3_bind_int64(sqlite3_stmt *pStmt, int i, sqlite_int64 iValue){
int rc;
Vdbe *p = (Vdbe *)pStmt;
#ifdef SQLITE_ENABLE_SQLRR
SRRecBindInt64(pStmt, i, iValue);
#endif
rc = vdbeUnbind(p, i);
if( rc==SQLITE_OK ){
sqlite3VdbeMemSetInt64(&p->aVar[i-1], iValue);
@@ -1397,9 +1369,6 @@ int sqlite3_bind_int64(sqlite3_stmt *pStmt, int i, sqlite_int64 iValue){
int sqlite3_bind_null(sqlite3_stmt *pStmt, int i){
int rc;
Vdbe *p = (Vdbe*)pStmt;
#ifdef SQLITE_ENABLE_SQLRR
SRRecBindNull(pStmt, i);
#endif
rc = vdbeUnbind(p, i);
if( rc==SQLITE_OK ){
sqlite3_mutex_leave(p->db->mutex);
@@ -1413,9 +1382,6 @@ int sqlite3_bind_text(
int nData,
void (*xDel)(void*)
){
#ifdef SQLITE_ENABLE_SQLRR
SRRecBindText(pStmt, i, zData, nData);
#endif
return bindText(pStmt, i, zData, nData, xDel, SQLITE_UTF8);
}
int sqlite3_bind_text64(
@@ -1442,9 +1408,6 @@ int sqlite3_bind_text16(
int nData,
void (*xDel)(void*)
){
#ifdef SQLITE_ENABLE_SQLRR
SRRecBindText(pStmt, i, zData, nData);
#endif
return bindText(pStmt, i, zData, nData, xDel, SQLITE_UTF16NATIVE);
}
#endif /* SQLITE_OMIT_UTF16 */
@@ -1468,9 +1431,6 @@ int sqlite3_bind_value(sqlite3_stmt *pStmt, int i, const sqlite3_value *pValue){
break;
}
case SQLITE_TEXT: {
#ifdef SQLITE_ENABLE_SQLRR
SRRecBindText(pStmt, i, pValue->z, pValue->n);
#endif
rc = bindText(pStmt,i, pValue->z, pValue->n, SQLITE_TRANSIENT,
pValue->enc);
break;
@@ -1485,9 +1445,6 @@ int sqlite3_bind_value(sqlite3_stmt *pStmt, int i, const sqlite3_value *pValue){
int sqlite3_bind_zeroblob(sqlite3_stmt *pStmt, int i, int n){
int rc;
Vdbe *p = (Vdbe *)pStmt;
#ifdef SQLITE_ENABLE_SQLRR
SRRecBindBlob(pStmt, i, NULL, n);
#endif
rc = vdbeUnbind(p, i);
if( rc==SQLITE_OK ){
sqlite3VdbeMemSetZeroBlob(&p->aVar[i-1], n);
+6 -5
View File
@@ -3731,7 +3731,6 @@ static int vdbeCompareMemString(
}else{
int rc;
const void *v1, *v2;
int n1, n2;
Mem c1;
Mem c2;
sqlite3VdbeMemInit(&c1, pMem1->db, MEM_Null);
@@ -3739,11 +3738,13 @@ static int vdbeCompareMemString(
sqlite3VdbeMemShallowCopy(&c1, pMem1, MEM_Ephem);
sqlite3VdbeMemShallowCopy(&c2, pMem2, MEM_Ephem);
v1 = sqlite3ValueText((sqlite3_value*)&c1, pColl->enc);
n1 = v1==0 ? 0 : c1.n;
v2 = sqlite3ValueText((sqlite3_value*)&c2, pColl->enc);
n2 = v2==0 ? 0 : c2.n;
rc = pColl->xCmp(pColl->pUser, n1, v1, n2, v2);
if( (v1==0 || v2==0) && prcErr ) *prcErr = SQLITE_NOMEM_BKPT;
if( (v1==0 || v2==0) ){
if( prcErr ) *prcErr = SQLITE_NOMEM_BKPT;
rc = 0;
}else{
rc = pColl->xCmp(pColl->pUser, c1.n, v1, c2.n, v2);
}
sqlite3VdbeMemRelease(&c1);
sqlite3VdbeMemRelease(&c2);
return rc;
+3 -3
View File
@@ -815,9 +815,9 @@ static int vdbeSorterCompareText(
int n2;
int res;
getVarint32(&p1[1], n1); n1 = (n1 - 13) / 2;
getVarint32(&p2[1], n2); n2 = (n2 - 13) / 2;
res = memcmp(v1, v2, MIN(n1, n2));
getVarint32(&p1[1], n1);
getVarint32(&p2[1], n2);
res = memcmp(v1, v2, (MIN(n1, n2) - 13)/2);
if( res==0 ){
res = n1 - n2;
}
+7 -50
View File
@@ -1282,12 +1282,11 @@ int sqlite3WalOpen(
const char *zWalName, /* Name of the WAL file */
int bNoShm, /* True to run in heap-memory mode */
i64 mxWalSize, /* Truncate WAL to this size on reset */
int flags, /* VFS file protection flags */
Wal **ppWal /* OUT: Allocated Wal handle */
){
int rc; /* Return Code */
Wal *pRet; /* Object to allocate and return */
int vfsFlags; /* Flags passed to OsOpen() */
int flags; /* Flags passed to OsOpen() */
assert( zWalName && zWalName[0] );
assert( pDbFd );
@@ -1326,13 +1325,9 @@ int sqlite3WalOpen(
pRet->exclusiveMode = (bNoShm ? WAL_HEAPMEMORY_MODE: WAL_NORMAL_MODE);
/* Open file handle on the write-ahead log file. */
if( flags&SQLITE_OPEN_READONLY ){
vfsFlags = flags | SQLITE_OPEN_WAL;
} else {
vfsFlags = flags | (SQLITE_OPEN_READWRITE|SQLITE_OPEN_CREATE|SQLITE_OPEN_WAL);
}
rc = sqlite3OsOpen(pVfs, zWalName, pRet->pWalFd, vfsFlags, &vfsFlags);
if( rc==SQLITE_OK && vfsFlags&SQLITE_OPEN_READONLY ){
flags = (SQLITE_OPEN_READWRITE|SQLITE_OPEN_CREATE|SQLITE_OPEN_WAL);
rc = sqlite3OsOpen(pVfs, zWalName, pRet->pWalFd, flags, &flags);
if( rc==SQLITE_OK && flags&SQLITE_OPEN_READONLY ){
pRet->readOnly = WAL_RDONLY;
}
@@ -2029,9 +2024,6 @@ static int walIndexTryHdr(Wal *pWal, int *pChanged){
** reordering the reads and writes.
*/
aHdr = walIndexHdr(pWal);
if( aHdr==NULL ){
return 1; /* Shouldn't be getting NULL from walIndexHdr, but we are */
}
memcpy(&h1, (void *)&aHdr[0], sizeof(h1));
walShmBarrier(pWal);
memcpy(&h2, (void *)&aHdr[1], sizeof(h2));
@@ -2714,6 +2706,7 @@ Pgno sqlite3WalDbsize(Wal *pWal){
return 0;
}
/*
** This function starts a write transaction on the WAL.
**
@@ -2931,10 +2924,6 @@ typedef struct WalWriter {
sqlite3_int64 iSyncPoint; /* Fsync at this offset */
int syncFlags; /* Flags for the fsync */
int szPage; /* Size of one page */
#if defined(SQLITE_WRITE_WALFRAME_PREBUFFERED)
void *aFrameBuf; /* Frame buffer */
size_t szFrameBuf; /* Size of frame buffer */
#endif
} WalWriter;
/*
@@ -2978,29 +2967,17 @@ static int walWriteOneFrame(
){
int rc; /* Result code from subfunctions */
void *pData; /* Data actually written */
#if defined(SQLITE_WRITE_WALFRAME_PREBUFFERED)
u8 *aFrame = p->aFrameBuf;
#else
u8 aFrame[WAL_FRAME_HDRSIZE]; /* Buffer to assemble frame-header in */
#endif
#if defined(SQLITE_HAS_CODEC)
if( (pData = sqlite3PagerCodec(pPage))==0 ) return SQLITE_NOMEM_BKPT;
#else
pData = pPage->pData;
#endif
walEncodeFrame(p->pWal, pPage->pgno, nTruncate, pData, aFrame);
#if defined(SQLITE_WRITE_WALFRAME_PREBUFFERED)
memcpy(&aFrame[WAL_FRAME_HDRSIZE], pData, p->szPage);
rc = walWriteToLog(p, aFrame, (p->szPage + WAL_FRAME_HDRSIZE), iOffset);
#else
rc = walWriteToLog(p, aFrame, sizeof(aFrame), iOffset);
if( rc ) return rc;
/* Write the page data */
rc = walWriteToLog(p, pData, p->szPage, iOffset+sizeof(aFrame));
#endif
return rc;
}
@@ -3159,13 +3136,6 @@ int sqlite3WalFrames(
w.szPage = szPage;
iOffset = walFrameOffset(iFrame+1, szPage);
szFrame = szPage + WAL_FRAME_HDRSIZE;
#if defined(SQLITE_WRITE_WALFRAME_PREBUFFERED)
w.aFrameBuf = (void *)malloc(szFrame);
if( NULL==w.aFrameBuf ){
return SQLITE_NOMEM;
}
#endif
/* Write all frames into the log file exactly once */
for(p=pList; p; p=p->pDirty){
@@ -3201,12 +3171,7 @@ int sqlite3WalFrames(
assert( iOffset==walFrameOffset(iFrame, szPage) );
nDbSize = (isCommit && p->pDirty==0) ? nTruncate : 0;
rc = walWriteOneFrame(&w, p, nDbSize, iOffset);
if( rc ) {
#if defined(SQLITE_WRITE_WALFRAME_PREBUFFERED)
free(w.aFrameBuf);
#endif
return rc;
}
if( rc ) return rc;
pLast = p;
iOffset += szFrame;
p->flags |= PGHDR_WAL_APPEND;
@@ -3241,12 +3206,7 @@ int sqlite3WalFrames(
testcase( bSync );
while( iOffset<w.iSyncPoint ){
rc = walWriteOneFrame(&w, pLast, nTruncate, iOffset);
if( rc ) {
#if defined(SQLITE_WRITE_WALFRAME_PREBUFFERED)
free(w.aFrameBuf);
#endif
return rc;
}
if( rc ) return rc;
iOffset += szFrame;
nExtra++;
}
@@ -3257,9 +3217,6 @@ int sqlite3WalFrames(
}
}
#if defined(SQLITE_WRITE_WALFRAME_PREBUFFERED)
free(w.aFrameBuf);
#endif
/* If this frame set completes the first transaction in the WAL and
** if PRAGMA journal_size_limit is set, then truncate the WAL to the
** journal size limit, if possible.
+1 -4
View File
@@ -55,7 +55,7 @@
typedef struct Wal Wal;
/* Open and close a connection to a write-ahead log. */
int sqlite3WalOpen(sqlite3_vfs*, sqlite3_file*, const char *, int, i64, int, Wal**);
int sqlite3WalOpen(sqlite3_vfs*, sqlite3_file*, const char *, int, i64, Wal**);
int sqlite3WalClose(Wal *pWal, sqlite3*, int sync_flags, int, u8 *);
/* Set the limiting size of a WAL file. */
@@ -78,9 +78,6 @@ int sqlite3WalReadFrame(Wal *, u32, int, u8 *);
/* If the WAL is not empty, return the size of the database. */
Pgno sqlite3WalDbsize(Wal *pWal);
/* If a WAL journal file has been created, return it */
sqlite3_file *sqlite3WalFile(Wal *pWal);
/* Obtain or release the WRITER lock. */
int sqlite3WalBeginWriteTransaction(Wal *pWal);
int sqlite3WalEndWriteTransaction(Wal *pWal);
+9 -16
View File
@@ -124,8 +124,9 @@ int sqlite3WalkSelectFrom(Walker *pWalker, Select *p){
**
** If it is not NULL, the xSelectCallback() callback is invoked before
** the walk of the expressions and FROM clause. The xSelectCallback2()
** method, if it is not NULL, is invoked following the walk of the
** expressions and FROM clause.
** method is invoked following the walk of the expressions and FROM clause,
** but only if both xSelectCallback and xSelectCallback2 are both non-NULL
** and if the expressions and FROM clause both return WRC_Continue;
**
** Return WRC_Continue under normal conditions. Return WRC_Abort if
** there is an abort request.
@@ -135,27 +136,19 @@ int sqlite3WalkSelectFrom(Walker *pWalker, Select *p){
*/
int sqlite3WalkSelect(Walker *pWalker, Select *p){
int rc;
if( p==0 || (pWalker->xSelectCallback==0 && pWalker->xSelectCallback2==0) ){
return WRC_Continue;
}
rc = WRC_Continue;
pWalker->walkerDepth++;
while( p ){
if( pWalker->xSelectCallback ){
rc = pWalker->xSelectCallback(pWalker, p);
if( rc ) break;
}
if( p==0 || pWalker->xSelectCallback==0 ) return WRC_Continue;
do{
rc = pWalker->xSelectCallback(pWalker, p);
if( rc ) return rc & WRC_Abort;
if( sqlite3WalkSelectExpr(pWalker, p)
|| sqlite3WalkSelectFrom(pWalker, p)
){
pWalker->walkerDepth--;
return WRC_Abort;
}
if( pWalker->xSelectCallback2 ){
pWalker->xSelectCallback2(pWalker, p);
}
p = p->pPrior;
}
pWalker->walkerDepth--;
return rc & WRC_Abort;
}while( p!=0 );
return WRC_Continue;
}
+36 -23
View File
@@ -1192,7 +1192,7 @@ static int whereKeyStats(
iGap = iGap/3;
}
aStat[0] = iLower + iGap;
aStat[1] = pIdx->aAvgEq[iCol];
aStat[1] = pIdx->aAvgEq[nField-1];
}
/* Restore the pRec->nField value before returning. */
@@ -1945,16 +1945,17 @@ static void whereLoopAdjustCost(const WhereLoop *p, WhereLoop *pTemplate){
/*
** Search the list of WhereLoops in *ppPrev looking for one that can be
** supplanted by pTemplate.
** replaced by pTemplate.
**
** Return NULL if the WhereLoop list contains an entry that can supplant
** pTemplate, in other words if pTemplate does not belong on the list.
** Return NULL if pTemplate does not belong on the WhereLoop list.
** In other words if pTemplate ought to be dropped from further consideration.
**
** If pX is a WhereLoop that pTemplate can supplant, then return the
** If pX is a WhereLoop that pTemplate can replace, then return the
** link that points to pX.
**
** If pTemplate cannot supplant any existing element of the list but needs
** to be added to the list, then return a pointer to the tail of the list.
** If pTemplate cannot replace any existing element of the list but needs
** to be added to the list as a new entry, then return a pointer to the
** tail of the list.
*/
static WhereLoop **whereLoopFindLesser(
WhereLoop **ppPrev,
@@ -2099,8 +2100,10 @@ static int whereLoopInsert(WhereLoopBuilder *pBuilder, WhereLoop *pTemplate){
if( p!=0 ){
sqlite3DebugPrintf("replace: ");
whereLoopPrint(p, pBuilder->pWC);
sqlite3DebugPrintf(" with: ");
}else{
sqlite3DebugPrintf(" add: ");
}
sqlite3DebugPrintf(" add: ");
whereLoopPrint(pTemplate, pBuilder->pWC);
}
#endif
@@ -4000,8 +4003,8 @@ static int wherePathSolver(WhereInfo *pWInfo, LogEst nRowEst){
** this candidate as not viable. */
#ifdef WHERETRACE_ENABLED /* 0x4 */
if( sqlite3WhereTrace&0x4 ){
sqlite3DebugPrintf("Skip %s cost=%-3d,%3d order=%c\n",
wherePathName(pFrom, iLoop, pWLoop), rCost, nOut,
sqlite3DebugPrintf("Skip %s cost=%-3d,%3d,%3d order=%c\n",
wherePathName(pFrom, iLoop, pWLoop), rCost, nOut, rUnsorted,
isOrdered>=0 ? isOrdered+'0' : '?');
}
#endif
@@ -4019,26 +4022,36 @@ static int wherePathSolver(WhereInfo *pWInfo, LogEst nRowEst){
pTo = &aTo[jj];
#ifdef WHERETRACE_ENABLED /* 0x4 */
if( sqlite3WhereTrace&0x4 ){
sqlite3DebugPrintf("New %s cost=%-3d,%3d order=%c\n",
wherePathName(pFrom, iLoop, pWLoop), rCost, nOut,
sqlite3DebugPrintf("New %s cost=%-3d,%3d,%3d order=%c\n",
wherePathName(pFrom, iLoop, pWLoop), rCost, nOut, rUnsorted,
isOrdered>=0 ? isOrdered+'0' : '?');
}
#endif
}else{
/* Control reaches here if best-so-far path pTo=aTo[jj] covers the
** same set of loops and has the sam isOrdered setting as the
** same set of loops and has the same isOrdered setting as the
** candidate path. Check to see if the candidate should replace
** pTo or if the candidate should be skipped */
if( pTo->rCost<rCost || (pTo->rCost==rCost && pTo->nRow<=nOut) ){
** pTo or if the candidate should be skipped.
**
** The conditional is an expanded vector comparison equivalent to:
** (pTo->rCost,pTo->nRow,pTo->rUnsorted) <= (rCost,nOut,rUnsorted)
*/
if( pTo->rCost<rCost
|| (pTo->rCost==rCost
&& (pTo->nRow<nOut
|| (pTo->nRow==nOut && pTo->rUnsorted<=rUnsorted)
)
)
){
#ifdef WHERETRACE_ENABLED /* 0x4 */
if( sqlite3WhereTrace&0x4 ){
sqlite3DebugPrintf(
"Skip %s cost=%-3d,%3d order=%c",
wherePathName(pFrom, iLoop, pWLoop), rCost, nOut,
"Skip %s cost=%-3d,%3d,%3d order=%c",
wherePathName(pFrom, iLoop, pWLoop), rCost, nOut, rUnsorted,
isOrdered>=0 ? isOrdered+'0' : '?');
sqlite3DebugPrintf(" vs %s cost=%-3d,%d order=%c\n",
sqlite3DebugPrintf(" vs %s cost=%-3d,%3d,%3d order=%c\n",
wherePathName(pTo, iLoop+1, 0), pTo->rCost, pTo->nRow,
pTo->isOrdered>=0 ? pTo->isOrdered+'0' : '?');
pTo->rUnsorted, pTo->isOrdered>=0 ? pTo->isOrdered+'0' : '?');
}
#endif
/* Discard the candidate path from further consideration */
@@ -4051,12 +4064,12 @@ static int wherePathSolver(WhereInfo *pWInfo, LogEst nRowEst){
#ifdef WHERETRACE_ENABLED /* 0x4 */
if( sqlite3WhereTrace&0x4 ){
sqlite3DebugPrintf(
"Update %s cost=%-3d,%3d order=%c",
wherePathName(pFrom, iLoop, pWLoop), rCost, nOut,
"Update %s cost=%-3d,%3d,%3d order=%c",
wherePathName(pFrom, iLoop, pWLoop), rCost, nOut, rUnsorted,
isOrdered>=0 ? isOrdered+'0' : '?');
sqlite3DebugPrintf(" was %s cost=%-3d,%3d order=%c\n",
sqlite3DebugPrintf(" was %s cost=%-3d,%3d,%3d order=%c\n",
wherePathName(pTo, iLoop+1, 0), pTo->rCost, pTo->nRow,
pTo->isOrdered>=0 ? pTo->isOrdered+'0' : '?');
pTo->rUnsorted, pTo->isOrdered>=0 ? pTo->isOrdered+'0' : '?');
}
#endif
}
-2
View File
@@ -146,8 +146,6 @@ ifcapable !wal {
finish_test
return
}
if ![wal_is_ok] { finish_test; return }
db close
forcedelete test.db
do_test 8_3_names-5.0 {
+17 -18
View File
@@ -737,24 +737,23 @@ do_test attach-6.1 {
}
} {0 {}}
if {$tcl_platform(platform)=="unix"} {
sqlite3 dbx cannot-read
dbx eval {CREATE TABLE t1(a,b,c)}
dbx close
file attributes cannot-read -permission 0000
if {[file writable cannot-read]} {
#puts "\n**** Tests do not work when run as root ****"
forcedelete cannot-read
#exit 1
} else {
do_test attach-6.2 {
catchsql {
ATTACH DATABASE 'cannot-read' AS noread;
}
} {1 {unable to open database: cannot-read}}
do_test attach-6.2.2 {
db errorcode
} {14}
}
do_test attach-6.2 {
sqlite3 dbx cannot-read
dbx eval {CREATE TABLE t1(a,b,c)}
dbx close
file attributes cannot-read -permission 0000
if {[file writable cannot-read]} {
puts "\n**** Tests do not work when run as root ****"
forcedelete cannot-read
exit 1
}
catchsql {
ATTACH DATABASE 'cannot-read' AS noread;
}
} {1 {unable to open database: cannot-read}}
do_test attach-6.2.2 {
db errorcode
} {14}
forcedelete cannot-read
}
-1
View File
@@ -80,7 +80,6 @@ foreach {name f} $files {
set mode wal
}
ifcapable !wal { set mode delete }
if ![wal_is_ok] { set mode delete }
lappend L $mode
append S "
PRAGMA $name.journal_mode = WAL;
-3
View File
@@ -656,9 +656,6 @@ do_test bind-13.4 {
[sqlite3_column_type $VM 2]
} {NULL NULL NULL}
sqlite3_finalize $VM
do_test bind-13.5 {
sqlite3_clear_bindings_null
} {0}
#--------------------------------------------------------------------
# These tests attempt to reproduce bug #3463.
+5 -16
View File
@@ -107,17 +107,12 @@ do_execsql_test cache-2.3.3 {
} {main exclusive temp closed}
do_test cache-2.3.4 { pager_cache_size db } 2
do_execsql_test cache-2.3.5 COMMIT
if !$::sqlite_options(enable_purgeable_pcache) {
# purgeable pcache doesn't share cache between connections
do_test cache-2.3.6 { pager_cache_size db } 1
}
do_test cache-2.3.6 { pager_cache_size db } 1
do_execsql_test cache-2.3.7 {
SELECT * FROM t1 UNION SELECT * FROM t2;
} {1 2 i j x y}
if !$::sqlite_options(enable_purgeable_pcache) {
# purgeable pcache doesn't share cache between connections
do_test cache-2.3.8 { pager_cache_size db } 1
}
do_test cache-2.3.8 { pager_cache_size db } 1
# Tests for cache_size = 0.
#
@@ -135,17 +130,11 @@ do_execsql_test cache-2.4.3 {
do_test cache-2.4.4 { pager_cache_size db } 2
do_execsql_test cache-2.4.5 COMMIT
if !$::sqlite_options(enable_purgeable_pcache) {
# purgeable pcache doesn't share cache between connections
do_test cache-2.4.6 { pager_cache_size db } 0
}
do_test cache-2.4.6 { pager_cache_size db } 0
do_execsql_test cache-2.4.7 {
SELECT * FROM t1 UNION SELECT * FROM t2;
} {1 2 i j x y}
if !$::sqlite_options(enable_purgeable_pcache) {
# purgeable pcache doesn't share cache between connections
do_test cache-2.4.8 { pager_cache_size db } 0
}
do_test cache-2.4.8 { pager_cache_size db } 0
sqlite3_soft_heap_limit $cmdlinearg(soft-heap-limit)
finish_test
+1 -1
View File
@@ -203,7 +203,7 @@ foreach opt $opts {
set ans2 [ catchsql {
SELECT sqlite_compileoption_used($opt);
} ]
list [ lindex $ans1 0 ] [ expr { [lindex [lindex $ans1 1] 0]==$opt } ] \
list [ lindex $ans1 0 ] [ expr { [lindex $ans1 1]==$opt } ] \
[ expr { $ans2 } ]
} {0 1 {0 1}}
incr tc 1
-3
View File
@@ -38,9 +38,6 @@ proc db_write {db {reset 0}} {
}
do_test 1.1 {
ifcapable enable_persist_wal {
file_control_persist_wal db 0
}
db close
sqlite3 db test.db
execsql { PRAGMA mmap_size = 0 }
+1 -2
View File
@@ -33,8 +33,7 @@ testvfs oldvfs -iversion 1
#
# All three done with VFS "oldvfs", which has iVersion==1 and so does
# not support shared memory.
#
forcedelete test.db-shm
#
sqlite3 db test.db -vfs oldvfs
do_execsql_test 1.1.1 {
PRAGMA journal_mode = WAL;
-1
View File
@@ -440,7 +440,6 @@ foreach {tn script} {
# It's not. Test case "$tp.6".
#
do_test $tp.4 {
forcedelete abc.db-shm abc.db-wal
forcecopy test.db abc.db
sqlite3 db4 abc.db
db4 eval { SELECT * FROM t1 UNION ALL SELECT * FROM t2 }
+5 -1
View File
@@ -401,8 +401,12 @@ sqlite3 db test.db
# if we're using proxy locks, we use 3 filedescriptors for a db
# that is open but NOT writing changes, normally
# sqlite uses 1 (proxy locking adds the conch and the local lock)
set using_proxy 0
foreach {name value} [array get env SQLITE_FORCE_PROXY_LOCKING] {
set using_proxy $value
}
set extrafds 0
if {[forced_proxy_locking]} {
if {$using_proxy!=0} {
set extrafds 2
}
+1 -12
View File
@@ -76,24 +76,13 @@ set skipwaltests [expr {
[permutation]=="journaltest" || [permutation]=="inmemory_journal"
}]
ifcapable !wal { set skipwaltests 1 }
if {![wal_is_ok]} { set skipwaltests 1 }
if {!$skipwaltests} {
db close
forcedelete test.db
ifcapable enable_persist_wal {
forcedelete test.db-journal
forcedelete test.db-wal
forcedelete test.db-shm
}
if {[forced_proxy_locking]} {
forcedelete .test.db-conch
}
sqlite3 db test.db
ifcapable enable_persist_wal {
file_control_persist_wal db 0
}
file_control_chunksize_test db main [expr 32*1024]
do_test fallocate-2.1 {
execsql {
PRAGMA page_size = 1024;
+6 -11
View File
@@ -260,17 +260,12 @@ proc access_method {args} {
return ""
}
#set sqlite_os_trace 1
# AFP asserts because the "db incrblob blobs v 1" clears the file locks and the unlock fails (HFS doesn't care about a failed unlock)
if {[path_is_local "."]} {
do_test incrblob3-7.2 {
sqlite3 db test.db
sqlite3_db_config_lookaside db 0 0 0
list [catch {db incrblob blobs v 1} msg] $msg
} {1 {database schema has changed}}
db close
}
do_test incrblob3-7.2 {
sqlite3 db test.db
sqlite3_db_config_lookaside db 0 0 0
list [catch {db incrblob blobs v 1} msg] $msg
} {1 {database schema has changed}}
db close
tvfs delete
finish_test
-3
View File
@@ -15,7 +15,6 @@
set testdir [file dirname $argv0]
source $testdir/tester.tcl
source $testdir/wal_common.tcl
# If this build of the library does not support auto-vacuum, omit this
# whole file.
@@ -135,8 +134,6 @@ do_test incrvacuum2-3.2 {
integrity_check incrvacuum2-3.3
if ![wal_is_ok] { finish_test; return }
if {[wal_is_capable]} {
# At one point, when a specific page was being extracted from the b-tree
# free-list (e.g. during an incremental-vacuum), all trunk pages that
+1 -1
View File
@@ -20,7 +20,7 @@ source $testdir/malloc_common.tcl
# If a connection is required to create a journal file, it creates it with
# the same file-system permissions as the database file itself. Test this.
#
if {$::tcl_platform(platform) == "unix" && ![path_is_dos "."]} {
if {$::tcl_platform(platform) == "unix"} {
# Changed on 2012-02-13: umask is deliberately ignored for -wal, -journal,
# and -shm files.
+68 -74
View File
@@ -106,95 +106,89 @@ if {[catch {sqlite3 db test.db -vfs unix-flock} msg]} {
return
}
# Only run the flock tests on a local file system
if { [path_is_local "."] } {
do_test lock5-flock.1 {
sqlite3 db test.db -vfs unix-flock
execsql {
CREATE TABLE t1(a, b);
BEGIN;
INSERT INTO t1 VALUES(1, 2);
}
} {}
do_test lock5-flock.1 {
sqlite3 db test.db -vfs unix-flock
execsql {
CREATE TABLE t1(a, b);
BEGIN;
INSERT INTO t1 VALUES(1, 2);
}
} {}
# Make sure we are not accidentally using the dotfile locking scheme.
do_test lock5-flock.2 {
file exists test.db.lock
} {0}
# Make sure we are not accidentally using the dotfile locking scheme.
do_test lock5-flock.2 {
file exists test.db.lock
} {0}
do_test lock5-flock.3 {
catch { sqlite3 db2 test.db -vfs unix-flock }
catchsql { SELECT * FROM t1 } db2
} {1 {database is locked}}
do_test lock5-flock.3 {
catch { sqlite3 db2 test.db -vfs unix-flock }
catchsql { SELECT * FROM t1 } db2
} {1 {database is locked}}
do_test lock5-flock.4 {
execsql COMMIT
catchsql { SELECT * FROM t1 } db2
} {0 {1 2}}
do_test lock5-flock.4 {
execsql COMMIT
catchsql { SELECT * FROM t1 } db2
} {0 {1 2}}
do_test lock5-flock.5 {
execsql BEGIN
catchsql { SELECT * FROM t1 } db2
} {0 {1 2}}
do_test lock5-flock.5 {
execsql BEGIN
catchsql { SELECT * FROM t1 } db2
} {0 {1 2}}
do_test lock5-flock.6 {
execsql {SELECT * FROM t1}
catchsql { SELECT * FROM t1 } db2
} {1 {database is locked}}
do_test lock5-flock.6 {
execsql {SELECT * FROM t1}
catchsql { SELECT * FROM t1 } db2
} {1 {database is locked}}
do_test lock5-flock.7 {
db close
catchsql { SELECT * FROM t1 } db2
} {0 {1 2}}
do_test lock5-flock.7 {
db close
catchsql { SELECT * FROM t1 } db2
} {0 {1 2}}
do_test lock5-flock.8 {
db2 close
} {}
do_test lock5-flock.8 {
db2 close
} {}
#####################################################################
#####################################################################
do_test lock5-none.1 {
sqlite3 db test.db -vfs unix-none
sqlite3 db2 test.db -vfs unix-none
execsql { PRAGMA mmap_size = 0 } db2
execsql {
BEGIN;
INSERT INTO t1 VALUES(3, 4);
}
} {}
do_test lock5-none.2 {
execsql { SELECT * FROM t1 }
} {1 2 3 4}
do_test lock5-none.3 {
execsql { SELECT * FROM t1; } db2
} {1 2}
do_test lock5-none.4 {
execsql {
BEGIN;
SELECT * FROM t1;
} db2
} {1 2}
do_test lock5-none.5 {
execsql COMMIT
execsql {SELECT * FROM t1} db2
} {1 2}
do_test lock5-none.1 {
sqlite3 db test.db -vfs unix-none
sqlite3 db2 test.db -vfs unix-none
execsql {
BEGIN;
INSERT INTO t1 VALUES(3, 4);
}
} {}
do_test lock5-none.2 {
execsql { SELECT * FROM t1 }
} {1 2 3 4}
do_test lock5-flock.3 {
execsql { SELECT * FROM t1 } db2
} {1 2}
do_test lock5-none.4 {
execsql {
BEGIN;
SELECT * FROM t1;
} db2
} {1 2}
do_test lock5-none.5 {
execsql COMMIT
} {}
ifcapable memorymanage {
do_test lock5-none.6 {
sqlite3_release_memory 1000000
execsql {SELECT * FROM t1} db2
} {1 2}
ifcapable memorymanage {
do_test lock5-none.6 {
sqlite3_release_memory 1000000
execsql {SELECT * FROM t1} db2
} {1 2 3 4}
}
do_test lock5-flock.X {
db close
db2 close
} {}
} {1 2 3 4}
}
do_test lock5-none.X {
db close
db2 close
} {}
ifcapable lock_proxy_pragmas {
set env(SQLITE_FORCE_PROXY_LOCKING) $::using_proxy
}
+3 -5
View File
@@ -126,10 +126,9 @@ ifcapable lock_proxy_pragmas&&prefer_proxy_locking {
set lockpath
} {{:auto: (not held)}}
set lpp [exec mktemp -t fail]
do_test lock6-1.4.1 {
execsql "PRAGMA lock_proxy_file='$lpp'"
catchsql {
PRAGMA lock_proxy_file="notmine";
select * from sqlite_master;
} db
} {1 {database is locked}}
@@ -138,7 +137,7 @@ ifcapable lock_proxy_pragmas&&prefer_proxy_locking {
execsql {
PRAGMA lock_proxy_file;
} db
} $lpp
} {notmine}
do_test lock6-1.5 {
testfixture $::tf1 {
@@ -151,10 +150,9 @@ ifcapable lock_proxy_pragmas&&prefer_proxy_locking {
catch {testfixture $::tf1 {db close}}
set lpp [exec mktemp -t ok]
do_test lock6-1.6 {
execsql "PRAGMA lock_proxy_file='$lpp'"
execsql {
PRAGMA lock_proxy_file="mine";
select * from sqlite_master;
} db
} {}
-142
View File
@@ -1,142 +0,0 @@
# 2008 June 28
#
# The author disclaims copyright to this source code. In place of
# a legal notice, here is a blessing:
#
# May you do good and not evil.
# May you find forgiveness for yourself and forgive others.
# May you share freely, never taking more than you give.
#
#***********************************************************************
# This file implements regression tests for SQLite library. The
# focus of this script is database proxy locks.
#
# $Id$
set testdir [file dirname $argv0]
source $testdir/tester.tcl
# This file is only run if using the unix backend compiled with the
# SQLITE_ENABLE_LOCKING_STYLE macro.
db close
if {[catch {sqlite3 db test.db -vfs unix-none} msg]} {
finish_test
return
}
db close
file delete -force test.db.lock
#####################################################################
ifcapable lock_proxy_pragmas&&prefer_proxy_locking {
set ::using_proxy 0
foreach {name value} [array get env SQLITE_FORCE_PROXY_LOCKING] {
set ::using_proxy $value
}
# enable the proxy locking for these tests
set env(SQLITE_FORCE_PROXY_LOCKING) "1"
# test conch file creation
#
catch { file delete lock_proxy_test.db }
catch { file delete .lock_proxy_test.db-conch }
# test that proxy locking mode creates conch files
do_test lock_proxy1.0 {
sqlite3 db2 lock_proxy_test.db
catchsql {
create table x(y);
} db2
file exists .lock_proxy_test.db-conch
} {1}
catch { db2 close }
# test proxy locking readonly file system handling
#
if {[file exists /usr/bin/hdiutil]} {
puts "Creating readonly file system for proxy locking tests..."
if {[file exists /Volumes/readonly]} {
exec hdiutil detach /Volumes/readonly
}
if {[file exists readonly.dmg]} {
file delete readonly.dmg
}
exec hdiutil create -megabytes 1 -fs HFS+ readonly.dmg -volname readonly
exec hdiutil attach readonly.dmg
# create test1.db and a .test1.db-conch for host4
set sqlite_hostid_num 4
sqlite3 db2 /Volumes/readonly/test1.db
execsql {
create table x(y);
} db2
db2 close
# create test2.db and a .test2.db-conch for host5
set sqlite_hostid_num 5
sqlite3 db2 /Volumes/readonly/test2.db
execsql {
create table x(y);
} db2
db2 close
# create test3.db without a conch file
set env(SQLITE_FORCE_PROXY_LOCKING) "0"
sqlite3 db2 /Volumes/readonly/test3.db
execsql {
create table x(y);
} db2
db2 close
exec hdiutil detach /Volumes/readonly
exec hdiutil attach -readonly readonly.dmg
# test that an unwritable, host-mismatched conch file prevents
# read only proxy-locking mode database access
set env(SQLITE_FORCE_PROXY_LOCKING) "1"
do_test lock_proxy2.0 {
sqlite3 db2 /Volumes/readonly/test1.db
catchsql {
select * from sqlite_master;
} db2
} {1 {database is locked}}
catch { db2 close }
# test that an unwritable, host-matching conch file allows
# read only proxy-locking mode database access
do_test lock_proxy2.1 {
sqlite3 db2 /Volumes/readonly/test2.db
catchsql {
select * from sqlite_master;
} db2
} {0 {table x x 2 {CREATE TABLE x(y)}}}
catch { db2 close }
# test that an unwritable, nonexistant conch file allows
# read only proxy-locking mode database access
do_test lock_proxy2.2 {
sqlite3 db2 /Volumes/readonly/test3.db
catchsql {
select * from sqlite_master;
} db2
} {0 {table x x 2 {CREATE TABLE x(y)}}}
catch { db2 close }
exec hdiutil detach /Volumes/readonly
file delete readonly.dmg
}
set env(SQLITE_FORCE_PROXY_LOCKING) "0"
set sqlite_hostid_num 0
}
#####################################################################
file delete -force test.db
ifcapable lock_proxy_pragmas&&prefer_proxy_locking {
set env(SQLITE_FORCE_PROXY_LOCKING) $::using_proxy
}
finish_test
+3 -3
View File
@@ -314,7 +314,7 @@ if {[permutation] == ""} {
#
do_test main-3.1 {
catch {db close}
catch {foreach f [glob -nocomplain testdb/*] {forcedelete $f}}
foreach f [glob -nocomplain testdb/*] {forcedelete $f}
forcedelete testdb
sqlite3 db testdb
set v [catch {execsql {SELECT * from T1 where x!!5}} msg]
@@ -322,7 +322,7 @@ do_test main-3.1 {
} {1 {unrecognized token: "!"}}
do_test main-3.2 {
catch {db close}
catch {foreach f [glob -nocomplain testdb/*] {forcedelete $f}}
foreach f [glob -nocomplain testdb/*] {forcedelete $f}
forcedelete testdb
sqlite3 db testdb
set v [catch {execsql {SELECT * from T1 where ^x}} msg]
@@ -442,7 +442,7 @@ do_test main-3.2.30 {
do_test main-3.3 {
catch {db close}
catch {foreach f [glob -nocomplain testdb/*] {forcedelete $f}}
foreach f [glob -nocomplain testdb/*] {forcedelete $f}
forcedelete testdb
sqlite3 db testdb
execsql {
+1 -1
View File
@@ -445,7 +445,7 @@ proc do_malloc_test {tn args} {
set zRepeat "transient"
if {$::iRepeat} {set zRepeat "persistent"}
restore_prng_state
catch {foreach file [glob -nocomplain test.db-mj*] {forcedelete $file}}
foreach file [glob -nocomplain test.db-mj*] {forcedelete $file}
do_test ${tn}.${zRepeat}.${::n} {
+5 -1
View File
@@ -22,8 +22,12 @@ set N 300
# if we're using proxy locks, we use 5 filedescriptors for a db
# that is open and in the middle of writing changes, normally
# sqlite uses 3 (proxy locking adds the conch and the local lock)
set using_proxy 0
foreach {name value} [array get env SQLITE_FORCE_PROXY_LOCKING] {
set using_proxy value
}
set num_fd_per_openwrite_db 3
if {[forced_proxy_locking]} {
if {$using_proxy>0} {
set num_fd_per_openwrite_db 5
}
+18 -20
View File
@@ -11,6 +11,7 @@
# This file implements regression tests for SQLite library. The
# focus of this script is in-memory database backend.
#
# $Id: memdb.test,v 1.19 2009/05/18 16:04:38 danielk1977 Exp $
set testdir [file dirname $argv0]
@@ -406,26 +407,23 @@ do_test memdb-8.2 {
# Test that auto-vacuum works with in-memory databases.
#
set msize [sqlite3_status SQLITE_STATUS_MALLOC_SIZE 0]
if {[lindex $msize 2]!=0} {
ifcapable autovacuum {
do_test memdb-9.1 {
db close
sqlite3 db test.db
db cache size 0
execsql {
PRAGMA auto_vacuum = full;
CREATE TABLE t1(a);
INSERT INTO t1 VALUES(randstr(1000,1000));
INSERT INTO t1 VALUES(randstr(1000,1000));
INSERT INTO t1 VALUES(randstr(1000,1000));
}
set before [db one {PRAGMA page_count}]
execsql { DELETE FROM t1 }
set after [db one {PRAGMA page_count}]
expr {$before>$after}
} {1}
}
ifcapable autovacuum {
do_test memdb-9.1 {
db close
sqlite3 db test.db
db cache size 0
execsql {
PRAGMA auto_vacuum = full;
CREATE TABLE t1(a);
INSERT INTO t1 VALUES(randstr(1000,1000));
INSERT INTO t1 VALUES(randstr(1000,1000));
INSERT INTO t1 VALUES(randstr(1000,1000));
}
set before [db one {PRAGMA page_count}]
execsql { DELETE FROM t1 }
set after [db one {PRAGMA page_count}]
expr {$before>$after}
} {1}
}
} ;# ifcapable memorydb
+46 -57
View File
@@ -124,20 +124,18 @@ sqlite3_config singlethread
sqlite3_initialize
reset_highwater_marks
build_test_db memsubsys1-3.1 {PRAGMA page_size=1024}
if !$::sqlite_options(enable_purgeable_pcache) {
do_test memsubsys1-3.1.3 {
set pg_used [lindex [sqlite3_status SQLITE_STATUS_PAGECACHE_USED 0] 2]
} 0
do_test memsubsys1-3.1.4 {
set overflow [lindex [sqlite3_status SQLITE_STATUS_PAGECACHE_OVERFLOW 0] 2]
# Note: The measured PAGECACHE_OVERFLOW is amount malloc() returns, not what
# was requested. System malloc() implementations might (arbitrarily) return
# slightly different oversize buffers, which can result in different
# PAGECACHE_OVERFLOW sizes between consecutive runs. So we cannot do an
# exact comparison. Simply verify that the amount is within 5%.
expr {$overflow>=$max_pagecache*0.95 && $overflow<=$max_pagecache*1.05}
} 1
}
do_test memsubsys1-3.1.3 {
set pg_used [lindex [sqlite3_status SQLITE_STATUS_PAGECACHE_USED 0] 2]
} 0
do_test memsubsys1-3.1.4 {
set overflow [lindex [sqlite3_status SQLITE_STATUS_PAGECACHE_OVERFLOW 0] 2]
# Note: The measured PAGECACHE_OVERFLOW is amount malloc() returns, not what
# was requested. System malloc() implementations might (arbitrarily) return
# slightly different oversize buffers, which can result in slightly different
# PAGECACHE_OVERFLOW sizes between consecutive runs. So we cannot do an
# exact comparison. Simply verify that the amount is within 5%.
expr {$overflow>=$max_pagecache*0.95 && $overflow<=$max_pagecache*1.05}
} 1
do_test memsubsys1-3.1.5 {
set s_used [lindex [sqlite3_status SQLITE_STATUS_SCRATCH_USED 0] 2]
} 0
@@ -172,11 +170,9 @@ do_test memsubsys1-4.3 {
set pg_used [lindex [sqlite3_status SQLITE_STATUS_PAGECACHE_USED 0] 2]
expr {$pg_used>=45 && $pg_used<=50}
} 1
if !$::sqlite_options(enable_purgeable_pcache) {
do_test memsubsys1-4.4 {
set pg_ovfl [lindex [sqlite3_status SQLITE_STATUS_PAGECACHE_OVERFLOW 0] 2]
} 0
}
do_test memsubsys1-4.4 {
set pg_ovfl [lindex [sqlite3_status SQLITE_STATUS_PAGECACHE_OVERFLOW 0] 2]
} 0
do_test memsubsys1-4.5 {
set maxreq [lindex [sqlite3_status SQLITE_STATUS_MALLOC_SIZE 0] 2]
expr {$maxreq<7000}
@@ -199,20 +195,17 @@ build_test_db memsubsys1-5 {PRAGMA page_size=4096}
do_test memsubsys1-5.3 {
set pg_used [lindex [sqlite3_status SQLITE_STATUS_PAGECACHE_USED 0] 2]
} {/^2[34]$/}
set msize [sqlite3_status SQLITE_STATUS_MALLOC_SIZE 0]
if {[lindex $msize 2]!=0} {
do_test memsubsys1-5.4 {
set maxreq [lindex [sqlite3_status SQLITE_STATUS_MALLOC_SIZE 0] 2]
expr {$maxreq>4096}
} 1
do_test memsubsys1-5.5 {
set s_used [lindex [sqlite3_status SQLITE_STATUS_SCRATCH_USED 0] 2]
} 0
do_test memsubsys1-5.6 {
set s_ovfl [lindex [sqlite3_status SQLITE_STATUS_SCRATCH_OVERFLOW 0] 2]
expr {$s_ovfl>6000}
} 1
}
do_test memsubsys1-5.4 {
set maxreq [lindex [sqlite3_status SQLITE_STATUS_MALLOC_SIZE 0] 2]
expr {$maxreq>4096}
} 1
do_test memsubsys1-5.5 {
set s_used [lindex [sqlite3_status SQLITE_STATUS_SCRATCH_USED 0] 2]
} 0
do_test memsubsys1-5.6 {
set s_ovfl [lindex [sqlite3_status SQLITE_STATUS_SCRATCH_OVERFLOW 0] 2]
expr {$s_ovfl>6000}
} 1
# Test 6: Activate both PAGECACHE and SCRATCH with a 4k page size.
# Make it so that SCRATCH is large enough
@@ -259,15 +252,13 @@ do_test memsubsys1-7.3 {
set pg_used [lindex [sqlite3_status SQLITE_STATUS_PAGECACHE_USED 0] 2]
expr {$pg_used<24}
} 1
if !$::sqlite_options(enable_purgeable_pcache) {
do_test memsubsys1-7.4 {
set pg_ovfl [lindex [sqlite3_status SQLITE_STATUS_PAGECACHE_OVERFLOW 0] 2]
} 0
do_test memsubsys1-7.5 {
set maxreq [lindex [sqlite3_status SQLITE_STATUS_MALLOC_SIZE 0] 2]
expr {$maxreq<4100 + 8200*[nonzero_reserved_bytes]}
} 1
}
do_test memsubsys1-7.4 {
set pg_ovfl [lindex [sqlite3_status SQLITE_STATUS_PAGECACHE_OVERFLOW 0] 2]
} 0
do_test memsubsys1-7.5 {
set maxreq [lindex [sqlite3_status SQLITE_STATUS_MALLOC_SIZE 0] 2]
expr {$maxreq<(4100 + 8200*[nonzero_reserved_bytes])}
} 1
do_test memsubsys1-7.6 {
set s_used [lindex [sqlite3_status SQLITE_STATUS_SCRATCH_USED 0] 2]
} 1
@@ -290,21 +281,19 @@ do_test memsubsys1-8.1 {
do_test memsubsys1-8.2 {
set s_ovfl [lindex [sqlite3_status SQLITE_STATUS_SCRATCH_OVERFLOW 0] 2]
} 0
if {[lindex $msize 2]!=0} {
do_test memsubsys1-8.3 {
sqlite3 db :memory:
db eval {
CREATE TABLE t1(x);
INSERT INTO t1 VALUES(zeroblob(400));
INSERT INTO t1 VALUES(zeroblob(400));
INSERT INTO t1 SELECT * FROM t1;
INSERT INTO t1 SELECT * FROM t1;
INSERT INTO t1 SELECT * FROM t1;
}
expr {[lindex [sqlite3_status SQLITE_STATUS_SCRATCH_OVERFLOW 0] 2]>0}
} 1
db close
}
do_test memsubsys1-8.3 {
sqlite3 db :memory:
db eval {
CREATE TABLE t1(x);
INSERT INTO t1 VALUES(zeroblob(400));
INSERT INTO t1 VALUES(zeroblob(400));
INSERT INTO t1 SELECT * FROM t1;
INSERT INTO t1 SELECT * FROM t1;
INSERT INTO t1 SELECT * FROM t1;
}
expr {[lindex [sqlite3_status SQLITE_STATUS_SCRATCH_OVERFLOW 0] 2]>0}
} 1
db close
sqlite3_shutdown
sqlite3_config_memstatus 0
sqlite3_initialize
-6
View File
@@ -14,12 +14,6 @@ set testdir [file dirname $argv0]
source $testdir/tester.tcl
source $testdir/malloc_common.tcl
# AFP doesn't like multiplex db tests
if { ![path_is_local "."] } {
finish_test
return
}
# The tests in this file assume that SQLite is compiled without
# ENABLE_8_3_NAMES.
#
+31 -40
View File
@@ -548,8 +548,6 @@ proc copy_on_mj_delete {method filename args} {
return SQLITE_OK
}
if {![forced_proxy_locking]} {
# proxy locking uses can't deal with auto proxy file paths longer than MAXPATHLEN
foreach {tn1 tcl} {
1 { set prefix "test.db" }
2 {
@@ -736,7 +734,6 @@ foreach {tn1 tcl} {
db close
tv delete
forcedelete $dirname
}
# Set up a VFS to make a copy of the file-system just before deleting a
# journal file to commit a transaction. The transaction modifies exactly
@@ -1218,7 +1215,7 @@ do_execsql_test pager1-6.12 { PRAGMA max_page_count } {11}
# $ws: The expected size of the WAL file, in bytes, after executing
# the SQL script. Or -1 if the WAL is not expected to exist.
#
if {$::sqlite_options(wal) && [wal_is_ok]} {
ifcapable wal {
faultsim_delete_and_reopen
foreach {tn sql res js ws} [subst {
@@ -1254,9 +1251,6 @@ if {$::sqlite_options(wal) && [wal_is_ok]} {
10 { SELECT * FROM t1 } {1 2 3 4 5 6 7 8} 0 -1
}] {
ifcapable enable_persist_wal {
file_control_persist_wal db 0
}
do_execsql_test pager1-7.1.$tn.1 $sql $res
catch { set J -1 ; set J [file size test.db-journal] }
catch { set W -1 ; set W [file size test.db-wal] }
@@ -2047,7 +2041,7 @@ do_test pager1-20.2.2 {
}
} {}
if {$::sqlite_options(wal) && [wal_is_ok]} {
ifcapable wal {
do_test pager1-20.3.1 {
faultsim_delete_and_reopen
db func a_string a_string
@@ -2082,7 +2076,7 @@ if {$::sqlite_options(wal) && [wal_is_ok]} {
# pager1-21.1.*: The VFS has an iVersion less than 2, or
# pager1-21.2.*: The VFS does not provide xShmXXX() methods.
#
if {$::sqlite_options(wal) && [wal_is_ok]} {
ifcapable wal {
do_test pager1-21.0 {
faultsim_delete_and_reopen
execsql {
@@ -2113,36 +2107,33 @@ if {$::sqlite_options(wal) && [wal_is_ok]} {
# pager1-22.1.*: is a no-op on a non-WAL db, and
# pager1-22.2.*: does not cause xSync calls with a synchronous=off db.
#
do_test pager1-22.1.1 {
faultsim_delete_and_reopen
execsql {
CREATE TABLE ko(c DEFAULT 'abc', b DEFAULT 'def');
INSERT INTO ko DEFAULT VALUES;
}
execsql { PRAGMA wal_checkpoint }
} {0 -1 -1}
do_test pager1-22.2.1 {
testvfs tv -default 1
tv filter xSync
tv script xSyncCb
proc xSyncCb {args} {incr ::synccount}
sqlite3 db test.db
# Switch the db to WAL mode. And then execute a SELECT to make sure
# that the WAL file is open. Note that this may change the synchronous
# setting if DEFAULT_WAL_SAFETYLEVEL is defined.
execsql { PRAGMA journal_mode = WAL ; SELECT * FROM ko }
# Set synchronous=OFF. Insert some data and run a checkpoint. Since
# sync=off, this should not cause any calls to the xSync() method.
set ::synccount 0
execsql {
PRAGMA synchronous = off;
INSERT INTO ko DEFAULT VALUES;
PRAGMA wal_checkpoint;
}
set synccount
} {0}
ifcapable wal {
do_test pager1-22.1.1 {
faultsim_delete_and_reopen
execsql {
CREATE TABLE ko(c DEFAULT 'abc', b DEFAULT 'def');
INSERT INTO ko DEFAULT VALUES;
}
execsql { PRAGMA wal_checkpoint }
} {0 -1 -1}
do_test pager1-22.2.1 {
testvfs tv -default 1
tv filter xSync
tv script xSyncCb
proc xSyncCb {args} {incr ::synccount}
set ::synccount 0
sqlite3 db test.db
execsql {
PRAGMA synchronous = off;
PRAGMA journal_mode = WAL;
INSERT INTO ko DEFAULT VALUES;
}
execsql { PRAGMA wal_checkpoint }
set synccount
} {0}
db close
tv delete
}
#-------------------------------------------------------------------------
# Tests for changing journal mode.
@@ -2390,7 +2381,7 @@ do_test pager1.27.1 {
# the same database.
#
catch { db close }
if {$::sqlite_options(wal) && [wal_is_ok]} {
ifcapable wal {
do_multiclient_test tn {
do_test pager1-28.$tn.1 {
sql1 {
-33
View File
@@ -1062,39 +1062,6 @@ ifcapable crashtest {
}
#-------------------------------------------------------------------------
# When a 3.7.0 client opens a write-transaction on a database file that
# has been appended to or truncated by a pre-370 client, it updates
# the db-size in the file header immediately. This test case provokes
# errors during that operation.
#
do_test pagerfault-22-pre1 {
faultsim_delete_and_reopen
db func a_string a_string
execsql {
PRAGMA page_size = 1024;
PRAGMA auto_vacuum = 0;
CREATE TABLE t1(a);
CREATE INDEX i1 ON t1(a);
INSERT INTO t1 VALUES(a_string(3000));
CREATE TABLE t2(a);
INSERT INTO t2 VALUES(1);
}
db close
sql36231 { INSERT INTO t1 VALUES(a_string(3000)) }
faultsim_save_and_close
} {}
do_faultsim_test pagerfault-22 -prep {
faultsim_restore_and_reopen
} -body {
execsql { INSERT INTO t2 VALUES(2) }
execsql { SELECT * FROM t2 }
} -test {
faultsim_test_result {0 {1 2}}
faultsim_integrity_check
}
#-------------------------------------------------------------------------
# When a 3.7.0 client opens a write-transaction on a database file that
# has been appended to or truncated by a pre-370 client, it updates
+1 -6
View File
@@ -117,9 +117,7 @@ do_test pcache-1.7 {
# page. Because the number of allocated pages is greater than the
# configured maximum, this page should be freed immediately instead of
# recycled.
# Note- purgable_pcache doesn't share caches between connections and these tests
# are only useful for testing that feature.
if !$::sqlite_options(enable_purgeable_pcache) {
#
do_test pcache-1.8 {
execsql {ROLLBACK} db2
pcache_stats
@@ -180,8 +178,5 @@ do_test pcache-1.15 {
}
pcache_stats
} {current 14 max 15 min 10 recyclable 14}
} else {
db2 close
}
finish_test
+32 -137
View File
@@ -1504,12 +1504,7 @@ sqlite3 dbX :memory:
dbX eval {PRAGMA temp_store_directory = ""}
dbX close
set skip_lock_proxy_tests [path_is_dos "."]
ifcapable !(lock_proxy_pragmas&&prefer_proxy_locking) {
set skip_lock_proxy_tests 1
}
if !$skip_lock_proxy_tests {
ifcapable lock_proxy_pragmas&&prefer_proxy_locking {
set sqlite_hostid_num 1
set using_proxy 0
@@ -1523,67 +1518,67 @@ if !$skip_lock_proxy_tests {
set env(SQLITE_FORCE_PROXY_LOCKING) "0"
sqlite3 db test.db
# set lock proxy name and then query it via pragma interface
set lpp [exec mktemp -t "proxy1"]
do_test pragma-16.1 {
execsql "PRAGMA lock_proxy_file='$lpp'"
execsql "select * from sqlite_master"
execsql "PRAGMA lock_proxy_file"
} $lpp
execsql {
PRAGMA lock_proxy_file="mylittleproxy";
select * from sqlite_master;
}
execsql {
PRAGMA lock_proxy_file;
}
} {mylittleproxy}
# 2 database connections can share a lock proxy file
do_test pragma-16.2 {
sqlite3 db2 test.db
execsql "PRAGMA lock_proxy_file='$lpp'" db2
execsql {
PRAGMA lock_proxy_file="mylittleproxy";
} db2
} {}
db2 close
# 2nd database connection should auto-name an existing lock proxy file
do_test pragma-16.2.1 {
sqlite3 db2 test.db
execsql {
PRAGMA lock_proxy_file=":auto:";
select * from sqlite_master;
} db2
execsql "PRAGMA lock_proxy_file" db2
} $lpp
execsql {
PRAGMA lock_proxy_file;
} db2
} {mylittleproxy}
db2 close
set lpp2 [exec mktemp -t "proxy2"]
# 2nd database connection cannot override the lock proxy file
do_test pragma-16.3 {
sqlite3 db2 test.db
execsql "PRAGMA lock_proxy_file='$lpp2'" db2
execsql {
PRAGMA lock_proxy_file="myotherproxy";
} db2
catchsql {
select * from sqlite_master;
} db2
} {1 {database is locked}}
set lpp3 [exec mktemp -t "proxy3"]
# lock proxy file can be renamed if no other connections are active
do_test pragma-16.4 {
db2 close
db close
sqlite3 db2 test.db
execsql "PRAGMA lock_proxy_file='$lpp3'" db2
execsql "PRAGMA lock_proxy_file='$lpp2'" db2
execsql "PRAGMA lock_proxy_file" db2
} $lpp2
execsql {
PRAGMA lock_proxy_file="myoriginalproxy";
PRAGMA lock_proxy_file="myotherproxy";
PRAGMA lock_proxy_file;
} db2
} {myotherproxy}
db2 close
set env(SQLITE_FORCE_PROXY_LOCKING) "1"
# auto-naming should reuse the last proxy name when available
do_test pragma-16.5 {
sqlite3 db2 test.db
execsql {
PRAGMA lock_proxy_file=":auto:";
PRAGMA lock_proxy_file;
} db2
} $lpp2
} {myotherproxy}
# auto-naming a new proxy should use a predictable & unique name
do_test pragma-16.6 {
db2 close
sqlite3 db2 test2.db
@@ -1595,7 +1590,6 @@ if !$skip_lock_proxy_tests {
} {1}
set sqlite_hostid_num 2
# db access should be limited to one host at a time (simulate 2nd host id)
do_test pragma-16.7 {
list [catch {
sqlite3 db test2.db
@@ -1607,7 +1601,6 @@ if !$skip_lock_proxy_tests {
} {1 {database is locked}}
db close
# default to using proxy locking (simulate network file system detection)
do_test pragma-16.8 {
list [catch {
sqlite3 db test2.db
@@ -1616,25 +1609,19 @@ if !$skip_lock_proxy_tests {
} {1 {database is locked}}
db2 close
set lpp4 [exec mktemp -t "proxy4"]
# check that db is unlocked after first host connection closes
do_test pragma-16.8.1 {
execsql "PRAGMA lock_proxy_file='$lpp4'"
execsql "select * from sqlite_master"
execsql "PRAGMA lock_proxy_file"
} $lpp4
execsql {
PRAGMA lock_proxy_file="yetanotherproxy";
PRAGMA lock_proxy_file;
}
} {yetanotherproxy}
do_test pragma-16.8.2 {
execsql {
create table if not exists mine(x);
insert into mine values (1);
create table mine(x);
}
} {}
db close
file delete -force proxytest.db
file delete -force .proxytest.db-conch
do_test pragma-16.9 {
sqlite3 db proxytest.db
set lockpath2 [execsql {
@@ -1644,98 +1631,6 @@ if !$skip_lock_proxy_tests {
string match "*proxytest.db:auto:" $lockpath2
} {1}
# ensure creating directories for a lock proxy file works
set lpp5d [exec mktemp -d -t "proxy5"]
set lpp5 $lpp5d/sub/dir/lock
db close
do_test pragma-16.10.1 {
sqlite3 db proxytest.db
execsql "PRAGMA lock_proxy_file='$lpp5'"
set lockpath2 [execsql {
PRAGMA lock_proxy_file;
} db]
string match "*sub/dir/lock" $lockpath2
} {1}
# ensure that after deleting the path, setting ":auto:" works correctly
db close
file delete -force $lpp5d
do_test pragma-16.10.2 {
sqlite3 db proxytest.db
set lockpath3 [execsql {
PRAGMA lock_proxy_file=":auto:";
create table if not exists pt(y);
PRAGMA lock_proxy_file;
} db]
string match "*sub/dir/lock" $lockpath3
} {1}
# ensure that if the path can not be created (file instead of dir)
# setting :auto: deals with it by creating a new autonamed lock file
db close
file delete -force $lpp5d
close [open "$lpp5d" a]
do_test pragma-16.10.3 {
sqlite3 db proxytest.db
set lockpath2 [execsql {
PRAGMA lock_proxy_file=":auto:";
create table if not exists zz(y);
PRAGMA lock_proxy_file;
} db]
string match "*proxytest.db:auto:" $lockpath2
} {1}
# make sure we can deal with ugly file paths correctly
db close
file delete -force $lpp5d
set lpp6 [exec mktemp -d -t "proxy6"]/./././////./proxytest/../proxytest/sub/dir/lock
do_test pragma-16.10.4 {
sqlite3 db proxytest.db
execsql "PRAGMA lock_proxy_file='$lpp6'"
set lockpath4 [execsql {
create table if not exists aa(bb);
PRAGMA lock_proxy_file;
} db]
string match "*proxytest/sub/dir/lock" $lockpath4
} {1}
# ensure that if the path can not be created (perm), setting :auto: deals
db close
file delete -force $lpp5d
do_test pragma-16.10.5 {
sqlite3 db proxytest.db
execsql "PRAGMA lock_proxy_file='$lpp5'"
execsql {
create table if not exists bb(bb);
}
db close
file delete -force $lpp5d
file mkdir $lpp5d
file attributes $lpp5d -permission 0000
sqlite3 db proxytest.db
set lockpath5 [execsql {
PRAGMA lock_proxy_file=":auto:";
create table if not exists cc(bb);
PRAGMA lock_proxy_file;
} db]
string match "*proxytest.db:auto:" $lockpath5
} {1}
# ensure that if the path can not be created, locking fails
db close
do_test pragma-16.10.6 {
sqlite3 db proxytest.db
execsql "PRAGMA lock_proxy_file='$lpp5'"
catchsql {
create table if not exists faily(y);
PRAGMA lock_proxy_file;
} db
} {1 {database is locked}}
db close
file attributes $lpp5d -permission 0777
file delete -force $lpp5d
set env(SQLITE_FORCE_PROXY_LOCKING) $using_proxy
set sqlite_hostid_num 0
}
+3 -5
View File
@@ -23,7 +23,7 @@ proc do_pragma_ncol_test {tn sql nCol} {
}
# If there is no RHS argument, the following PRAGMA statements operate as
# queries, returning a single row containing a single column.
# queries, returning a single row containing a single column.
#
# Or, if there is RHS argument, they return zero rows of zero columns.
#
@@ -54,8 +54,6 @@ foreach {tn sql} {
24 "PRAGMA schema_version = 211"
25 "PRAGMA short_column_names = 1"
26 "PRAGMA synchronous = full"
27 "PRAGMA temp_store_directory = '/tmp'"
28 "PRAGMA temp_store_directory = ''"
29 "PRAGMA temp_store = memory"
30 "PRAGMA user_version = 405"
31 "PRAGMA writable_schema = 1"
@@ -64,7 +62,7 @@ foreach {tn sql} {
# Without RHS:
do_pragma_ncol_test 1.$tn.1 [lindex [split $sql =] 0] 1
# With RHS:
do_pragma_ncol_test 1.$tn.2 $sql 0
}
@@ -79,7 +77,7 @@ foreach {tn sql} {
5 "PRAGMA case_sensitive_like"
} {
do_pragma_ncol_test 2.$tn.1 $sql 0
do_pragma_ncol_test 1.$tn.1 $sql 0
}
+1 -1
View File
@@ -179,7 +179,7 @@ array set ::Configs [strip_comments {
-DSQLITE_ENABLE_LOCKING_STYLE=1
}
"Apple" {
-O1 # Avoid a compiler bug in gcc 4.2.1 build 5658
-Os
-DHAVE_GMTIME_R=1
-DHAVE_ISNAN=1
-DHAVE_LOCALTIME_R=1
-6
View File
@@ -11,18 +11,12 @@
#***********************************************************************
# This file implements regression tests for SQLite library. The
# focus of this file is testing locks on read-only WAL-mode databases.
#
# Note that the apple-osx branch does not allow read-only WAL-mode
# databases (per check-in from Adam Swift on 2011-06-24 20:47:06) and
# so this test module is disabled in the apple-osx branch.
set testdir [file dirname $argv0]
source $testdir/tester.tcl
source $testdir/lock_common.tcl
set testprefix rowallock
finish_test; return ;# This test module disabled in the apple-osx branch
set mmap_res 1000000
ifcapable !mmap {
set mmap_res 0
+5 -1
View File
@@ -45,9 +45,13 @@ ifcapable autovacuum {
# if we're using proxy locks, we use 2 filedescriptors for a db
# that is open but NOT yet locked, after a lock is taken we'll have 3,
# normally sqlite uses 1 (proxy locking adds the conch and the local lock)
set using_proxy 0
foreach {name value} [array get env SQLITE_FORCE_PROXY_LOCKING] {
set using_proxy $value
}
set extrafds_prelock 0
set extrafds_postlock 0
if {[forced_proxy_locking]} {
if {$using_proxy>0} {
set extrafds_prelock 1
set extrafds_postlock 2
}
-5
View File
@@ -17,11 +17,6 @@ set testdir [file dirname $argv0]
source $testdir/tester.tcl
test_set_config_pagecache 0 0
# purgeable pcache tracks memory differently
ifcapable {enable_purgeable_pcache} {
finish_test
return
}
unset -nocomplain baseline
do_test shrink-1.1 {
db eval {
+7 -24
View File
@@ -30,19 +30,8 @@ if {$::TEMP_STORE==3} {
finish_test
return
}
# if we're using proxy locks, we use 3 filedescriptors for a db
# that is open but NOT writing changes, normally
# sqlite uses 1 (proxy locking adds the conch and the local lock)
set extrafds 0
if {[forced_proxy_locking]} {
set extrafds 2
}
do_test stmt-1.2 {
set sqlite_open_file_count
expr $sqlite_open_file_count-$extrafds
} {1}
do_test stmt-1.3 {
execsql {
@@ -51,20 +40,17 @@ do_test stmt-1.3 {
INSERT INTO t1 VALUES(1, 1);
}
set sqlite_open_file_count
expr $sqlite_open_file_count-$extrafds
} {2}
do_test stmt-1.4 {
execsql {
INSERT INTO t1 SELECT a+1, b+1 FROM t1;
}
set sqlite_open_file_count
expr $sqlite_open_file_count-$extrafds
# 2016-03-04: statement-journal open deferred
} {2}
do_test stmt-1.5 {
execsql COMMIT
set sqlite_open_file_count
expr $sqlite_open_file_count-$extrafds
} {1}
do_test stmt-1.6.1 {
execsql {
@@ -72,38 +58,35 @@ do_test stmt-1.6.1 {
INSERT INTO t1 SELECT a+2, b+2 FROM t1;
}
set sqlite_open_file_count
expr $sqlite_open_file_count-$extrafds
} {2}
do_test stmt-1.6.2 {
execsql { INSERT INTO t1 SELECT a+4, b+4 FROM t1 }
set sqlite_open_file_count
expr $sqlite_open_file_count-$extrafds
# 2016-03-04: statement-journal open deferred
} {2}
do_test stmt-1.7 {
execsql COMMIT
set sqlite_open_file_count
expr $sqlite_open_file_count-$extrafds
} {1}
proc filecount {testname sql expected extrafds} {
proc filecount {testname sql expected} {
uplevel [list do_test $testname [subst -nocommand {
execsql BEGIN
execsql { $sql }
set ret [set sqlite_open_file_count]
execsql ROLLBACK
set ret
}] [ expr $expected+$extrafds ] ]
}] $expected]
}
filecount stmt-2.1 { INSERT INTO t1 VALUES(9, 9) } 2 $extrafds
filecount stmt-2.2 { REPLACE INTO t1 VALUES(9, 9) } 2 $extrafds
filecount stmt-2.3 { INSERT INTO t1 SELECT 9, 9 } 2 $extrafds
filecount stmt-2.1 { INSERT INTO t1 VALUES(9, 9) } 2
filecount stmt-2.2 { REPLACE INTO t1 VALUES(9, 9) } 2
filecount stmt-2.3 { INSERT INTO t1 SELECT 9, 9 } 2
filecount stmt-2.4 {
INSERT INTO t1 SELECT 9, 9;
INSERT INTO t1 SELECT 10, 10;
} 2 $extrafds
} 2
do_test stmt-2.5 {
execsql { CREATE INDEX i1 ON t1(b) }
@@ -111,6 +94,6 @@ do_test stmt-2.5 {
filecount stmt-2.6 {
REPLACE INTO t1 VALUES(5, 5);
REPLACE INTO t1 VALUES(5, 5);
} 2 $extrafds
} 2
finish_test
-12
View File
@@ -13,7 +13,6 @@
set testdir [file dirname $argv0]
source $testdir/tester.tcl
source $testdir/lock_common.tcl
source $testdir/wal_common.tcl
set testprefix superlock
do_not_use_codec
@@ -44,11 +43,6 @@ do_not_use_codec
#
#
if {[forced_proxy_locking]} {
finish_test
return
}
do_execsql_test 1.1 {
CREATE TABLE t1(a, b);
INSERT INTO t1 VALUES(1, 2);
@@ -64,12 +58,6 @@ do_test 1.2 { sqlite3demo_superlock unlock test.db } {unlock}
do_catchsql_test 1.3 { SELECT * FROM t1 } {1 {database is locked}}
do_test 1.4 { unlock } {}
ifcapable !wal {finish_test ; return }
if { ![wal_is_ok] } {
finish_test
return
}
do_execsql_test 2.1 {
INSERT INTO t1 VALUES(3, 4);
PRAGMA journal_mode = WAL;
+2 -7
View File
@@ -52,11 +52,6 @@ do_test tempdb-1.2 {
}
} {}
set extrafds 0
if {[forced_proxy_locking]} {
set extrafds 2
}
do_test tempdb-2.1 {
# Set $::jrnl_in_memory if the journal file is expected to be in-memory.
# Similarly, set $::subj_in_memory if the sub-journal file is expected
@@ -81,7 +76,7 @@ do_test tempdb-2.2 {
}
catchsql { INSERT INTO t1 SELECT * FROM t2 }
set sqlite_open_file_count
} [expr 1 + $extrafds + (0==$jrnl_in_memory)]
} [expr 1 + (0==$jrnl_in_memory)]
do_test tempdb-2.3 {
execsql {
PRAGMA temp_store = 'memory';
@@ -93,6 +88,6 @@ do_test tempdb-2.3 {
}
catchsql { INSERT INTO t1 SELECT * FROM t2 }
set sqlite_open_file_count
} [expr 1 + $extrafds + (0==$jrnl_in_memory)]
} [expr 1 + (0==$jrnl_in_memory)]
finish_test
+4 -46
View File
@@ -579,23 +579,6 @@ if {[info exists cmdlinearg]==0} {
#
sqlite3_soft_heap_limit $cmdlinearg(soft-heap-limit)
proc forced_proxy_locking {} {
if $::sqlite_options(lock_proxy_pragmas)&&$::sqlite_options(prefer_proxy_locking) {
set force_proxy_value 0
set force_key "SQLITE_FORCE_PROXY_LOCKING="
foreach {env_pair} [exec env] {
if { [string first $force_key $env_pair] == 0} {
set force_proxy_value [string range $env_pair [string length $force_key] end]
}
}
if { "$force_proxy_value " == "1 " } {
return 1
}
}
return 0
}
# Create a test database
#
proc reset_db {} {
@@ -603,14 +586,6 @@ proc reset_db {} {
forcedelete test.db
forcedelete test.db-journal
forcedelete test.db-wal
if {[forced_proxy_locking]} {
sqlite3 db ./test.db
set lock_proxy_path [db eval "PRAGMA lock_proxy_file;"]
catch {db close}
# puts "deleting $lock_proxy_path"
file delete -force $lock_proxy_path
file delete -force test.db
}
sqlite3 db ./test.db
set ::DB [sqlite3_connection_pointer db]
if {[info exists ::SETUP_SQL]} {
@@ -1238,15 +1213,11 @@ proc finalize_testing {} {
memdebug_log_sql leaks.sql
}
}
catch {
foreach f [glob -nocomplain test.db-*-journal] {
forcedelete $f
}
foreach f [glob -nocomplain test.db-*-journal] {
forcedelete $f
}
catch {
foreach f [glob -nocomplain test.db-mj*] {
forcedelete $f
}
foreach f [glob -nocomplain test.db-mj*] {
forcedelete $f
}
exit [expr {$nErr>0}]
}
@@ -2073,19 +2044,6 @@ proc presql {} {
set presql
}
proc wal_is_ok {} {
if { [forced_proxy_locking] } {
return 1
}
if { ![path_is_local "."] } {
return 0
}
if { [path_is_dos "."] } {
return 0
}
return 1
}
proc isquick {} {
set ret 0
catch {set ret $::G(isquick)}
-1
View File
@@ -21,7 +21,6 @@ set testprefix tkt-2d1a5c67d
ifcapable {!vtab} {finish_test; return}
if {[wal_is_capable]==0} {finish_test; return}
if {![wal_is_ok]} {finish_test; return}
for {set ii 1} {$ii<=10} {incr ii} {
do_test tkt-2d1a5c67d.1.$ii {
-1
View File
@@ -19,7 +19,6 @@ source $testdir/tester.tcl
source $testdir/malloc_common.tcl
if {![wal_is_capable]} { finish_test ; return }
if ![wal_is_ok] { finish_test; return }
do_execsql_test tkt-313723c356.1 {
PRAGMA page_size = 1024;
+21 -22
View File
@@ -70,28 +70,27 @@ catch {
test_syscall fault 1 1
}
if { ![path_is_dos "."] } {
do_test tkt3457-1.2 {
forcecopy bak.db-journal test.db-journal
file attributes test.db-journal -permissions ---------
catchsql { SELECT * FROM t1 }
} {1 {unable to open database file}}
do_test tkt3457-1.3 {
forcecopy bak.db-journal test.db-journal
file attributes test.db-journal -permissions -w--w--w-
catchsql { SELECT * FROM t1 }
} {1 {unable to open database file}}
do_test tkt3457-1.4 {
forcecopy bak.db-journal test.db-journal
file attributes test.db-journal -permissions r--r--r--
catchsql { SELECT * FROM t1 }
} {1 {unable to open database file}}
do_test tkt3457-1.5 {
forcecopy bak.db-journal test.db-journal
file attributes test.db-journal -permissions rw-rw-rw-
catchsql { SELECT * FROM t1 }
} {0 {1 2 3 4 5 6}}
}
do_test tkt3457-1.2 {
forcecopy bak.db-journal test.db-journal
file attributes test.db-journal -permissions ---------
catchsql { SELECT * FROM t1 }
} {1 {unable to open database file}}
do_test tkt3457-1.3 {
forcecopy bak.db-journal test.db-journal
file attributes test.db-journal -permissions -w--w--w-
catchsql { SELECT * FROM t1 }
} {1 {unable to open database file}}
do_test tkt3457-1.4 {
forcecopy bak.db-journal test.db-journal
file attributes test.db-journal -permissions r--r--r--
catchsql { SELECT * FROM t1 }
} {1 {unable to open database file}}
do_test tkt3457-1.5 {
forcecopy bak.db-journal test.db-journal
file attributes test.db-journal -permissions rw-rw-rw-
catchsql { SELECT * FROM t1 }
} {0 {1 2 3 4 5 6}}
# Reenable fchmod
catch {
+1 -41
View File
@@ -22,10 +22,6 @@ source $testdir/wal_common.tcl
set testprefix wal
ifcapable !wal {finish_test ; return }
if { ![wal_is_ok] } {
finish_test
return
}
test_set_config_pagecache 0 0
proc reopen_db {} {
@@ -177,9 +173,6 @@ do_test wal-4.3 {
} {a b}
do_test wal-4.4.1 {
ifcapable enable_persist_wal {
file_control_persist_wal db 0
}
db close
sqlite3 db test.db
db func blob blob
@@ -231,9 +224,6 @@ db2 close
do_test wal-4.5.1 {
reopen_db
ifcapable enable_persist_wal {
file_control_persist_wal db 0
}
db func blob blob
execsql {
PRAGMA journal_mode = WAL;
@@ -348,9 +338,6 @@ foreach sector {512 4096} {
forcedelete test.db test.db-wal
do_test wal-6.$sector.$pgsz.1 {
sqlite3 db test.db -vfs devsym
ifcapable enable_persist_wal {
file_control_persist_wal db 0
}
execsql "
PRAGMA page_size = $pgsz;
PRAGMA auto_vacuum = 0;
@@ -737,9 +724,6 @@ do_test wal-11.8 {
list [expr [file size test.db]/1024] [file size test.db-wal]
} [list 37 [wal_file_size 40 1024]]
do_test wal-11.9 {
ifcapable enable_persist_wal {
file_control_persist_wal db 0
}
db close
list [expr [file size test.db]/1024] [log_deleted test.db-wal]
} {37 1}
@@ -754,9 +738,6 @@ sqlite3_wal db test.db
#ifcapable !mmap {set nWal 37}
set nWal 34
ifcapable enable_persist_wal {
file_control_persist_wal db 0
}
do_test wal-11.10 {
execsql {
PRAGMA cache_size = 10;
@@ -804,9 +785,6 @@ do_test wal-12.1 {
list [expr [file size test.db]/1024] [file size test.db-wal]
} [list 1 [wal_file_size 5 1024]]
do_test wal-12.2 {
ifcapable enable_persist_wal {
file_control_persist_wal db 0
}
db close
sqlite3 db test.db
execsql {
@@ -844,9 +822,6 @@ do_test wal-12.6 {
execsql { SELECT * FROM t2 } db2
} {B 2}
db2 close
ifcapable enable_persist_wal {
file_control_persist_wal db 0
}
db close
#-------------------------------------------------------------------------
@@ -1004,12 +979,10 @@ foreach {tn ckpt_cmd ckpt_res ckpt_main ckpt_aux} {
PRAGMA aux.auto_vacuum = 0;
PRAGMA main.journal_mode = WAL;
PRAGMA aux.journal_mode = WAL;
SELECT count(*) FROM main.sqlite_master, aux.sqlite_master;
PRAGMA main.synchronous = NORMAL;
PRAGMA aux.synchronous = NORMAL;
PRAGMA aux.synchronous = FULL;
}
} {wal wal 0}
} {wal wal}
do_test wal-16.$tn.2 {
execsql {
@@ -1080,7 +1053,6 @@ foreach {tn sectorsize logsize} "
PRAGMA page_size = 512;
PRAGMA cache_size = -2000;
PRAGMA journal_mode = WAL;
SELECT * FROM sqlite_master;
PRAGMA synchronous = FULL;
}
execsql {
@@ -1296,9 +1268,6 @@ do_test wal-19.2 {
}
} {1 2 3 4 5 6}
do_test wal-19.3 {
ifcapable enable_persist_wal {
file_control_persist_wal db2 0
}
db close
db2 close
file exists test.db-wal
@@ -1451,9 +1420,6 @@ do_test wal-23.1 {
INSERT INTO t1 VALUES(1, 2);
INSERT INTO t1 VALUES(3, 4);
}
ifcapable enable_persist_wal {
file_control_persist_wal db 0
}
faultsim_save_and_close
sqlite3_shutdown
@@ -1500,9 +1466,6 @@ ifcapable autovacuum {
INSERT INTO t1 SELECT * FROM t1;
} {wal}
do_test 24.2 {
ifcapable enable_persist_wal {
file_control_persist_wal db 0
}
execsql {
DELETE FROM t1;
PRAGMA wal_checkpoint;
@@ -1531,9 +1494,6 @@ ifcapable autovacuum {
} [wal_file_size 1 1024]
}
ifcapable enable_persist_wal {
file_control_persist_wal db 0
}
db close
sqlite3_shutdown
test_sqlite3_log
+13 -52
View File
@@ -22,7 +22,6 @@ source $testdir/wal_common.tcl
set testprefix wal2
ifcapable !wal {finish_test ; return }
if ![wal_is_ok] {finish_test ; return }
set sqlite_sync_count 0
proc cond_incr_sync_count {adj} {
@@ -72,13 +71,6 @@ proc incr_tvfs_hdr {file idx incrval} {
set_tvfs_hdr $file $ints
}
set shmpath test.db-shm
if {[forced_proxy_locking]} {
sqlite3 db test.db
set shmpath [execsql { pragma lock_proxy_file }]-shm
db close
}
#-------------------------------------------------------------------------
# Test case wal2-1.*:
@@ -579,15 +571,9 @@ do_test wal2-6.3.1 {
list [file exists test.db-wal] [file exists test.db-journal]
} {1 0}
do_test wal2-6.3.2 {
ifcapable enable_persist_wal {
file_control_persist_wal db 0
}
execsql { PRAGMA journal_mode = DELETE }
file exists test.db-wal
} {0}
do_test wal2-6.3.2.1 {
execsql { PRAGMA journal_mode; }
} {delete}
do_test wal2-6.3.3 {
execsql { PRAGMA lock_status }
} {main exclusive temp closed}
@@ -734,9 +720,7 @@ foreach {tn sql res expected_locks} {
do_test wal2-6.4.$tn.1 { execsql $S } $res
do_test wal2-6.4.$tn.2 { set ::locks } $L
}
ifcapable enable_persist_wal {
file_control_persist_wal db 0
}
db close
tvfs delete
@@ -967,9 +951,6 @@ do_test wal2-10.1.1 {
INSERT INTO t1 VALUES(1, 2);
INSERT INTO t1 VALUES(3, 4);
}
if {[forced_proxy_locking]} {
forcecopy $shmpath sv_test.db-shm
}
faultsim_save_and_close
} {}
do_test wal2-10.1.2 {
@@ -1069,11 +1050,6 @@ tvfs delete
# file itself. Test this.
#
if {$::tcl_platform(platform) == "unix"} {
if {[forced_proxy_locking]} {
# faultsim_delete_and_reopen doesn't know about the shm file redirect...
forcedelete $shmpath
}
faultsim_delete_and_reopen
# Changed on 2012-02-13: umask is deliberately ignored for -wal files.
#set umask [exec /bin/sh -c umask]
@@ -1087,7 +1063,7 @@ if {$::tcl_platform(platform) == "unix"} {
PRAGMA journal_mode = WAL;
}
db close
list [file exists test.db-wal] [file exists $shmpath]
list [file exists test.db-wal] [file exists test.db-shm]
} {0 0}
foreach {tn permissions} {
@@ -1102,22 +1078,19 @@ if {$::tcl_platform(platform) == "unix"} {
file attributes test.db -permissions
} $permissions
do_test wal2-12.2.$tn.2 {
list [file exists test.db-wal] [file exists $shmpath]
list [file exists test.db-wal] [file exists test.db-shm]
} {0 0}
do_test wal2-12.2.$tn.3 {
sqlite3 db test.db
execsql { INSERT INTO tx DEFAULT VALUES }
list [file exists test.db-wal] [file exists $shmpath]
list [file exists test.db-wal] [file exists test.db-shm]
} {1 1}
do_test wal2-12.2.$tn.4 {
list [file attr test.db-wal -perm] [file attr $shmpath -perm]
list [file attr test.db-wal -perm] [file attr test.db-shm -perm]
} [list $effective $effective]
do_test wal2-12.2.$tn.5 {
ifcapable enable_persist_wal {
file_control_persist_wal db 0
}
db close
list [file exists test.db-wal] [file exists $shmpath]
list [file exists test.db-wal] [file exists test.db-shm]
} {0 0}
}
}
@@ -1130,7 +1103,7 @@ if {$::tcl_platform(platform) == "unix"} {
if {$::tcl_platform(platform) == "unix"} {
proc perm {} {
set L [list]
foreach f {test.db test.db-wal $shmpath} {
foreach f {test.db test.db-wal test.db-shm} {
if {[file exists $f]} {
lappend L [file attr $f -perm]
} else {
@@ -1140,10 +1113,6 @@ if {$::tcl_platform(platform) == "unix"} {
set L
}
if {[forced_proxy_locking]} {
# faultsim_delete_and_reopen doesn't know about the shm file redirect...
forcedelete $shmpath
}
faultsim_delete_and_reopen
execsql {
PRAGMA journal_mode = WAL;
@@ -1152,11 +1121,8 @@ if {$::tcl_platform(platform) == "unix"} {
INSERT INTO t1 VALUES('3.14', '2.72');
}
do_test wal2-13.1.1 {
list [file exists $shmpath] [file exists test.db-wal]
list [file exists test.db-shm] [file exists test.db-wal]
} {1 1}
if {[forced_proxy_locking]} {
forcecopy $shmpath proxysv_test.db-shm
}
faultsim_save_and_close
foreach {tn db_perm wal_perm shm_perm can_open can_read can_write} {
@@ -1170,17 +1136,14 @@ if {$::tcl_platform(platform) == "unix"} {
9 00000 00644 00644 0 0 0
} {
faultsim_restore
if {[forced_proxy_locking]} {
forcecopy proxysv_test.db-shm $shmpath
}
do_test wal2-13.$tn.1 {
file attr test.db -perm $db_perm
file attr test.db-wal -perm $wal_perm
file attr $shmpath -perm $shm_perm
file attr test.db-shm -perm $shm_perm
set L [file attr test.db -perm]
lappend L [file attr test.db-wal -perm]
lappend L [file attr $shmpath -perm]
lappend L [file attr test.db-shm -perm]
} [list $db_perm $wal_perm $shm_perm]
# If $can_open is true, then it should be possible to open a database
@@ -1244,8 +1207,6 @@ foreach {tn sql reslist} {
set sqlite_sync_count 0
set sqlite_fullsync_count 0
set useres $reslist
do_execsql_test wal2-14.$tn.2 {
PRAGMA wal_autocheckpoint = 10;
CREATE TABLE t1(a, b); -- 2 wal syncs
@@ -1261,7 +1222,7 @@ foreach {tn sql reslist} {
do_test wal2-14.$tn.3 {
cond_incr_sync_count 1
list $sqlite_sync_count $sqlite_fullsync_count
} [lrange $useres 0 1]
} [lrange $reslist 0 1]
set sqlite_sync_count 0
set sqlite_fullsync_count 0
@@ -1269,7 +1230,7 @@ foreach {tn sql reslist} {
do_test wal2-14.$tn.4 {
execsql { INSERT INTO t1 VALUES(7, zeroblob(12*4096)) }
list $sqlite_sync_count $sqlite_fullsync_count
} [lrange $useres 2 3]
} [lrange $reslist 2 3]
set sqlite_sync_count 0
set sqlite_fullsync_count 0
@@ -1281,7 +1242,7 @@ foreach {tn sql reslist} {
execsql { INSERT INTO t1 VALUES(13, 14) }
db close
list $sqlite_sync_count $sqlite_fullsync_count
} [lrange $useres 4 5]
} [lrange $reslist 4 5]
}
catch { db close }
+1 -4
View File
@@ -19,7 +19,6 @@ source $testdir/lock_common.tcl
source $testdir/wal_common.tcl
source $testdir/malloc_common.tcl
ifcapable !wal {finish_test ; return }
if ![wal_is_ok] {finish_test ; return }
set a_string_counter 1
proc a_string {n} {
@@ -212,8 +211,6 @@ foreach {tn syncmode synccount} {
foreach {method filename id flags} $args break
lappend ::syncs [file tail $filename] $flags
}
set usecount $synccount
do_test wal3-3.$tn {
forcedelete test.db test.db-wal test.db-journal
@@ -236,7 +233,7 @@ foreach {tn syncmode synccount} {
}
T filter {}
set ::syncs
} $usecount
} $synccount
db close
T delete
-4
View File
@@ -16,10 +16,6 @@ set testdir [file dirname $argv0]
source $testdir/tester.tcl
source $testdir/malloc_common.tcl
ifcapable !wal {finish_test ; return }
if { ![wal_is_ok] || [path_is_dos "."]} {
finish_test
return
}
do_test wal4-1.1 {
execsql {
-11
View File
@@ -18,7 +18,6 @@ source $testdir/tester.tcl
source $testdir/lock_common.tcl
source $testdir/wal_common.tcl
ifcapable !wal {finish_test ; return }
if ![wal_is_ok] { finish_test; return }
do_not_use_codec
set testprefix wal5
@@ -81,11 +80,6 @@ foreach {testprefix do_wal_checkpoint} {
}
proc reopen_all {} {
ifcapable enable_persist_wal {
code1 { file_control_persist_wal db 0 }
code2 { file_control_persist_wal db2 0 }
code3 { file_control_persist_wal db3 0 }
}
code1 {db close}
code2 {db2 close}
code3 {db3 close}
@@ -349,11 +343,6 @@ foreach {testprefix do_wal_checkpoint} {
do_test 3.$tn.4 { code3 { do_wal_checkpoint db3 } } {0 2 2}
ifcapable enable_persist_wal {
code1 { file_control_persist_wal db 0 }
code2 { file_control_persist_wal db2 0 }
code3 { file_control_persist_wal db3 0 }
}
code1 {db close}
code2 {db2 close}
code3 {db3 close}
-2
View File
@@ -21,8 +21,6 @@ source $testdir/wal_common.tcl
source $testdir/malloc_common.tcl
ifcapable !wal {finish_test ; return }
if { ![wal_is_ok] } {finish_test ; return }
#-------------------------------------------------------------------------
# Changing to WAL mode in one connection forces the change in others.
#
-1
View File
@@ -16,7 +16,6 @@
set testdir [file dirname $argv0]
source $testdir/tester.tcl
ifcapable !wal {finish_test ; return }
if ![wal_is_ok] { finish_test; return }
# Case 1: No size limit. Journal can get large.
#
-2
View File
@@ -26,9 +26,7 @@
set testdir [file dirname $argv0]
source $testdir/tester.tcl
set ::testprefix wal8
ifcapable !wal {finish_test ; return }
if ![wal_is_ok] { finish_test; return }
do_not_use_codec
db close
-14
View File
@@ -33,20 +33,6 @@ proc wal_cksum_intlist {ckv1 ckv2 intlist} {
}
}
# If the synchronous mode for the main database of db handle $db
# is either OFF or NORMAL, return $nRight. Otherwise, if it is
# FULL, return $nWrite+$nTrans.
#
proc wal_frames {db nWrite nTrans} {
set nRet $nWrite
switch -- [$db one {PRAGMA main.synchronous}] {
0 { }
1 { }
default { incr nRet $nTrans }
}
set nRet
}
# This proc calculates checksums in the same way as those used by SQLite
# in WAL files. If the $endian argument is "big", then checksums are
-7
View File
@@ -21,7 +21,6 @@ source $testdir/malloc_common.tcl
do_not_use_codec
ifcapable !wal {finish_test ; return }
if { ![wal_is_ok] } { finish_test ; return }
# Test organization:
@@ -325,9 +324,6 @@ foreach {tn src dest dest_final} {
do_test walbak-4.$tn.1 {
sqlite3 db test.db
db eval "PRAGMA journal_mode = $src"
ifcapable enable_persist_wal {
file_control_persist_wal db 0
}
db eval {
CREATE TABLE t1(a, b);
INSERT INTO t1 VALUES('I', 'II');
@@ -336,9 +332,6 @@ foreach {tn src dest dest_final} {
sqlite3 db2 test.db2
db2 eval "PRAGMA journal_mode = $dest"
ifcapable enable_persist_wal {
file_control_persist_wal db2 0
}
db2 eval {
CREATE TABLE t2(x, y);
INSERT INTO t2 VALUES('1', '2');
-5
View File
@@ -21,7 +21,6 @@ ifcapable !wal {
finish_test
return
}
if ![wal_is_ok] { finish_test; return }
# Do not use a codec for this file, as the database is manipulated using
# external methods (the [fake_big_file] and [hexio_write] commands).
@@ -33,10 +32,6 @@ ifcapable !lfs {
finish_test
return
}
if { ![wal_is_ok] } {
finish_test
return
}
set a_string_counter 1
proc a_string {n} {
-1
View File
@@ -16,7 +16,6 @@ source $testdir/lock_common.tcl
source $testdir/wal_common.tcl
ifcapable !wal {finish_test ; return }
if ![wal_is_ok] { finish_test; return }
# Read and return the contents of file $filename. Treat the content as
# binary data.
-1
View File
@@ -28,7 +28,6 @@
set testdir [file dirname $argv0]
source $testdir/tester.tcl
ifcapable !wal {finish_test ; return }
if ![wal_is_ok] { finish_test; return }
db close

Some files were not shown because too many files have changed in this diff Show More