mirror of
https://github.com/sqlite/sqlite.git
synced 2025-12-24 14:17:58 +03:00
Merge the latest trunk changes into the sessions branch.
FossilOrigin-Name: eb036d6f81e15bac013316bf5b1b2ba3e0bd4605
This commit is contained in:
@@ -177,8 +177,8 @@ LIBOBJS0 = alter.lo analyze.lo attach.lo auth.lo \
|
||||
random.lo resolve.lo rowset.lo rtree.lo select.lo status.lo \
|
||||
table.lo tokenize.lo trigger.lo \
|
||||
update.lo util.lo vacuum.lo \
|
||||
vdbe.lo vdbeapi.lo vdbeaux.lo vdbeblob.lo vdbemem.lo vdbetrace.lo \
|
||||
wal.lo walker.lo where.lo utf.lo vtab.lo
|
||||
vdbe.lo vdbeapi.lo vdbeaux.lo vdbeblob.lo vdbemem.lo vdbesort.lo \
|
||||
vdbetrace.lo wal.lo walker.lo where.lo utf.lo vtab.lo
|
||||
|
||||
# Object files for the amalgamation.
|
||||
#
|
||||
@@ -274,6 +274,7 @@ SRC = \
|
||||
$(TOP)/src/vdbeaux.c \
|
||||
$(TOP)/src/vdbeblob.c \
|
||||
$(TOP)/src/vdbemem.c \
|
||||
$(TOP)/src/vdbesort.c \
|
||||
$(TOP)/src/vdbetrace.c \
|
||||
$(TOP)/src/vdbeInt.h \
|
||||
$(TOP)/src/vtab.c \
|
||||
@@ -740,6 +741,9 @@ vdbeblob.lo: $(TOP)/src/vdbeblob.c $(HDR)
|
||||
vdbemem.lo: $(TOP)/src/vdbemem.c $(HDR)
|
||||
$(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/vdbemem.c
|
||||
|
||||
vdbesort.lo: $(TOP)/src/vdbesort.c $(HDR)
|
||||
$(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/vdbesort.c
|
||||
|
||||
vdbetrace.lo: $(TOP)/src/vdbetrace.c $(HDR)
|
||||
$(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/vdbetrace.c
|
||||
|
||||
|
||||
80
Makefile.msc
80
Makefile.msc
@@ -11,6 +11,23 @@ TOP = .
|
||||
#
|
||||
USE_AMALGAMATION = 1
|
||||
|
||||
# Set this to non-0 to create and use PDBs.
|
||||
#
|
||||
SYMBOLS = 1
|
||||
|
||||
# Set this to one of the following values to enable various debugging
|
||||
# features. Each level includes the debugging options from the previous
|
||||
# levels. Currently, the recognized values for DEBUG are:
|
||||
#
|
||||
# 0 == NDEBUG: Disables assert() and other runtime diagnostics.
|
||||
# 1 == Disables NDEBUG and all optimizations and then enables PDBs.
|
||||
# 2 == SQLITE_DEBUG: Enables various diagnostics messages and code.
|
||||
# 3 == SQLITE_WIN32_MALLOC_VALIDATE: Validate the Win32 native heap per call.
|
||||
# 4 == SQLITE_DEBUG_OS_TRACE: Enables output from the OSTRACE() macros.
|
||||
# 5 == SQLITE_ENABLE_IOTRACE: Enables output from the IOTRACE() macros.
|
||||
#
|
||||
DEBUG = 0
|
||||
|
||||
# Version numbers and release number for the SQLite being compiled.
|
||||
#
|
||||
VERSION = 3.7
|
||||
@@ -20,13 +37,13 @@ RELEASE = 3.7.7
|
||||
# C Compiler and options for use in building executables that
|
||||
# will run on the platform that is doing the build.
|
||||
#
|
||||
BCC = cl.exe -O2
|
||||
BCC = cl.exe
|
||||
|
||||
# C Compile and options for use in building executables that
|
||||
# will run on the target platform. (BCC and TCC are usually the
|
||||
# same unless your are cross-compiling.)
|
||||
#
|
||||
TCC = cl.exe -W3 -O2 -DSQLITE_OS_WIN=1 -I. -I$(TOP)\src -fp:precise
|
||||
TCC = cl.exe -W3 -DSQLITE_OS_WIN=1 -I. -I$(TOP)\src -fp:precise
|
||||
|
||||
# The mksqlite3c.tcl and mksqlite3h.tcl scripts will pull in
|
||||
# any extension header files by default. For non-amalgamation
|
||||
@@ -41,7 +58,38 @@ TCC = $(TCC) -I$(TOP)\ext\rtree
|
||||
# Omitting the define will cause extra debugging code to be inserted and
|
||||
# includes extra comments when "EXPLAIN stmt" is used.
|
||||
#
|
||||
!IF $(DEBUG)==0
|
||||
TCC = $(TCC) -DNDEBUG
|
||||
!ENDIF
|
||||
|
||||
!IF $(DEBUG)>1
|
||||
TCC = $(TCC) -DSQLITE_DEBUG
|
||||
!ENDIF
|
||||
|
||||
!IF $(DEBUG)>3
|
||||
TCC = $(TCC) -DSQLITE_DEBUG_OS_TRACE=1
|
||||
!ENDIF
|
||||
|
||||
!IF $(DEBUG)>4
|
||||
TCC = $(TCC) -DSQLITE_ENABLE_IOTRACE
|
||||
!ENDIF
|
||||
|
||||
#
|
||||
# Prevent warnings about "insecure" runtime library functions being used.
|
||||
#
|
||||
TCC = $(TCC) -D_CRT_SECURE_NO_DEPRECATE -D_CRT_SECURE_NO_WARNINGS
|
||||
|
||||
#
|
||||
# Use native Win32 heap instead of malloc/free?
|
||||
#
|
||||
# TCC = $(TCC) -DSQLITE_WIN32_MALLOC=1
|
||||
|
||||
#
|
||||
# Validate the heap on every call into the native Win32 heap subsystem?
|
||||
#
|
||||
!IF $(DEBUG)>2
|
||||
TCC = $(TCC) -DSQLITE_WIN32_MALLOC_VALIDATE=1
|
||||
!ENDIF
|
||||
|
||||
# The locations of the Tcl header and library files. Also, the library that
|
||||
# non-stubs enabled programs using Tcl must link against. These variables
|
||||
@@ -119,6 +167,18 @@ TCC = $(TCC) $(OPT_FEATURE_FLAGS)
|
||||
# ie. make "OPTS=-DSQLITE_ENABLE_FOO=1 -DSQLITE_OMIT_FOO=1".
|
||||
TCC = $(TCC) $(OPTS)
|
||||
|
||||
# If symbols are enabled, enable PDBs.
|
||||
# If debugging is enabled, disable all optimizations and enable PDBs.
|
||||
!IF $(DEBUG)>0
|
||||
TCC = $(TCC) -Od -D_DEBUG
|
||||
!ELSE
|
||||
TCC = $(TCC) -O2
|
||||
!ENDIF
|
||||
|
||||
!IF $(DEBUG)>0 || $(SYMBOLS)!=0
|
||||
TCC = $(TCC) -Zi
|
||||
!ENDIF
|
||||
|
||||
# libtool compile/link
|
||||
LTCOMPILE = $(TCC) -Fo$@
|
||||
LTLIB = lib.exe
|
||||
@@ -133,6 +193,11 @@ LTLINKOPTS = /MACHINE:$(PLATFORM)
|
||||
LTLIBOPTS = /MACHINE:$(PLATFORM)
|
||||
!ENDIF
|
||||
|
||||
# If debugging is enabled, enable PDBs.
|
||||
!IF $(DEBUG)>0 || $(SYMBOLS)!=0
|
||||
LTLINKOPTS = $(LTLINKOPTS) /DEBUG
|
||||
!ENDIF
|
||||
|
||||
# nawk compatible awk.
|
||||
NAWK = gawk.exe
|
||||
|
||||
@@ -157,8 +222,8 @@ LIBOBJS0 = alter.lo analyze.lo attach.lo auth.lo \
|
||||
random.lo resolve.lo rowset.lo rtree.lo select.lo status.lo \
|
||||
table.lo tokenize.lo trigger.lo \
|
||||
update.lo util.lo vacuum.lo \
|
||||
vdbe.lo vdbeapi.lo vdbeaux.lo vdbeblob.lo vdbemem.lo vdbetrace.lo \
|
||||
wal.lo walker.lo where.lo utf.lo vtab.lo
|
||||
vdbe.lo vdbeapi.lo vdbeaux.lo vdbeblob.lo vdbemem.lo vdbesort.lo \
|
||||
vdbetrace.lo wal.lo walker.lo where.lo utf.lo vtab.lo
|
||||
|
||||
# Object files for the amalgamation.
|
||||
#
|
||||
@@ -257,6 +322,7 @@ SRC = \
|
||||
$(TOP)\src\vdbeaux.c \
|
||||
$(TOP)\src\vdbeblob.c \
|
||||
$(TOP)\src\vdbemem.c \
|
||||
$(TOP)\src\vdbesort.c \
|
||||
$(TOP)\src\vdbetrace.c \
|
||||
$(TOP)\src\vdbeInt.h \
|
||||
$(TOP)\src\vtab.c \
|
||||
@@ -398,6 +464,7 @@ TESTSRC2 = \
|
||||
$(TOP)\src\vdbeaux.c \
|
||||
$(TOP)\src\vdbe.c \
|
||||
$(TOP)\src\vdbemem.c \
|
||||
$(TOP)\src\vdbesort.c \
|
||||
$(TOP)\src\vdbetrace.c \
|
||||
$(TOP)\src\where.c \
|
||||
parse.c \
|
||||
@@ -711,6 +778,9 @@ vdbeblob.lo: $(TOP)\src\vdbeblob.c $(HDR)
|
||||
vdbemem.lo: $(TOP)\src\vdbemem.c $(HDR)
|
||||
$(LTCOMPILE) -c $(TOP)\src\vdbemem.c
|
||||
|
||||
vdbesort.lo: $(TOP)\src\vdbesort.c $(HDR)
|
||||
$(LTCOMPILE) -c $(TOP)\src\vdbesort.c
|
||||
|
||||
vdbetrace.lo: $(TOP)\src\vdbetrace.c $(HDR)
|
||||
$(LTCOMPILE) -c $(TOP)\src\vdbetrace.c
|
||||
|
||||
@@ -887,7 +957,7 @@ dll: sqlite3.dll
|
||||
sqlite3.def: libsqlite3.lib
|
||||
echo EXPORTS > sqlite3.def
|
||||
dumpbin /all libsqlite3.lib \
|
||||
| $(NAWK) "/ 1 _sqlite3_/ { sub(/^.* _/,\"\");print }" \
|
||||
| $(NAWK) "/ 1 _?sqlite3_/ { sub(/^.* _?/,\"\");print }" \
|
||||
| sort >> sqlite3.def
|
||||
|
||||
sqlite3.dll: $(LIBOBJ) sqlite3.def
|
||||
|
||||
13
main.mk
13
main.mk
@@ -66,8 +66,8 @@ LIBOBJ+= alter.o analyze.o attach.o auth.o \
|
||||
random.o resolve.o rowset.o rtree.o select.o status.o \
|
||||
table.o tokenize.o trigger.o \
|
||||
update.o util.o vacuum.o \
|
||||
vdbe.o vdbeapi.o vdbeaux.o vdbeblob.o vdbemem.o vdbetrace.o \
|
||||
wal.o walker.o where.o utf.o vtab.o
|
||||
vdbe.o vdbeapi.o vdbeaux.o vdbeblob.o vdbemem.o vdbesort.o \
|
||||
vdbetrace.o wal.o walker.o where.o utf.o vtab.o
|
||||
|
||||
|
||||
|
||||
@@ -156,6 +156,7 @@ SRC = \
|
||||
$(TOP)/src/vdbeaux.c \
|
||||
$(TOP)/src/vdbeblob.c \
|
||||
$(TOP)/src/vdbemem.c \
|
||||
$(TOP)/src/vdbesort.c \
|
||||
$(TOP)/src/vdbetrace.c \
|
||||
$(TOP)/src/vdbeInt.h \
|
||||
$(TOP)/src/vtab.c \
|
||||
@@ -386,6 +387,14 @@ sqlite3.c: target_source $(TOP)/tool/mksqlite3c.tcl
|
||||
echo '#endif /* USE_SYSTEM_SQLITE */' >>tclsqlite3.c
|
||||
cat $(TOP)/src/tclsqlite.c >>tclsqlite3.c
|
||||
|
||||
sqlite3.c-debug: target_source $(TOP)/tool/mksqlite3c.tcl
|
||||
tclsh $(TOP)/tool/mksqlite3c.tcl --linemacros
|
||||
echo '#ifndef USE_SYSTEM_SQLITE' >tclsqlite3.c
|
||||
cat sqlite3.c >>tclsqlite3.c
|
||||
echo '#endif /* USE_SYSTEM_SQLITE */' >>tclsqlite3.c
|
||||
echo '#line 1 "tclsqlite.c"' >>tclsqlite3.c
|
||||
cat $(TOP)/src/tclsqlite.c >>tclsqlite3.c
|
||||
|
||||
sqlite3-all.c: sqlite3.c $(TOP)/tool/split-sqlite3c.tcl
|
||||
tclsh $(TOP)/tool/split-sqlite3c.tcl
|
||||
|
||||
|
||||
424
manifest
424
manifest
@@ -1,9 +1,9 @@
|
||||
C Merge\sthe\slatest\strunk\schanges\sinto\sthe\ssessions\sbranch.
|
||||
D 2011-08-03T21:46:58.295
|
||||
D 2011-08-26T19:20:47.301
|
||||
F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f
|
||||
F Makefile.in 1e6988b3c11dee9bd5edc0c804bd4468d74a9cdc
|
||||
F Makefile.in 8c930e7b493d59099ea1304bd0f2aed152eb3315
|
||||
F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23
|
||||
F Makefile.msc 8e04f517922b9e31a5bf975f07bb66df79ae7076
|
||||
F Makefile.msc 55fe94bf23b4c1ff035f19b0ae2ea486350f8d01
|
||||
F Makefile.vxworks c85ec1d8597fe2f7bc225af12ac1666e21379151
|
||||
F README cd04a36fbc7ea56932a4052d7d0b7f09f27c33d6
|
||||
F VERSION f724de7326e87b7f3b0a55f16ef4b4d993680d54
|
||||
@@ -23,7 +23,7 @@ F art/src_logo.gif 9341ef09f0e53cd44c0c9b6fc3c16f7f3d6c2ad9
|
||||
F config.guess 226d9a188c6196f3033ffc651cbc9dcee1a42977
|
||||
F config.h.in 405a958bdb3af382a809dccb08a44694923ddd61
|
||||
F config.sub 9ebe4c3b3dab6431ece34f16828b594fb420da55
|
||||
F configure 93e7e695581fa7bef4949161453d9845c5592ad0 x
|
||||
F configure 4010a2e577b7d43c429672858d442ac5a570fdcd x
|
||||
F configure.ac 298a759c086e72c013da459c2aec02a104f4224f
|
||||
F contrib/sqlitecon.tcl 210a913ad63f9f991070821e599d600bd913e0ad
|
||||
F doc/lemon.html 3091574143dd3415669b6745843ff8d011d33549
|
||||
@@ -116,7 +116,7 @@ F ext/session/sqlite3session.h f374c9c4c96e08f67ac418871c29d423245c7673
|
||||
F ext/session/test_session.c ea4dc9b4a1895c8e6bddcbfe3838d7eb57df2d99
|
||||
F install-sh 9d4de14ab9fb0facae2f48780b874848cbf2f895 x
|
||||
F ltmain.sh 3ff0879076df340d2e23ae905484d8c15d5fdea8
|
||||
F main.mk 47bb833f273c17812370a750b1a697cd14580b75
|
||||
F main.mk cb6055cd875d73dee78a7f88c04cd49457d8cc9a
|
||||
F mkdll.sh 7d09b23c05d56532e9d44a50868eb4b12ff4f74a
|
||||
F mkextu.sh 416f9b7089d80e5590a29692c9d9280a10dbad9f
|
||||
F mkextw.sh 4123480947681d9b434a5e7b1ee08135abe409ac
|
||||
@@ -133,21 +133,21 @@ F src/alter.c ac80a0f31189f8b4a524ebf661e47e84536ee7f5
|
||||
F src/analyze.c a425d62e8fa9ebcb4359ab84ff0c62c6563d2e2a
|
||||
F src/attach.c 12c6957996908edc31c96d7c68d4942c2474405f
|
||||
F src/auth.c 523da7fb4979469955d822ff9298352d6b31de34
|
||||
F src/backup.c 986c15232757f2873dff35ee3b35cbf935fc573c
|
||||
F src/backup.c 28a4fe55327ff708bfaf9d4326d02686f7a553c3
|
||||
F src/bitvec.c af50f1c8c0ff54d6bdb7a80e2fceca5a93670bef
|
||||
F src/btmutex.c 976f45a12e37293e32cae0281b15a21d48a8aaa7
|
||||
F src/btree.c 8c46f0ab69ad9549c75a3a91fed87abdaa743e2f
|
||||
F src/btree.h f5d775cd6cfc7ac32a2535b70e8d2af48ef5f2ce
|
||||
F src/btree.c ed13fdefdbe671d5777773dcfb3a162ddb4623ae
|
||||
F src/btree.h 9ddf04226eac592d4cc3709c5a8b33b2351ff5f7
|
||||
F src/btreeInt.h 67978c014fa4f7cc874032dd3aacadd8db656bc3
|
||||
F src/build.c 5e614e586d9f8a81c16c80b545b9e1747f96c1bb
|
||||
F src/build.c 2d5de52df616a3bf5a659cbca85211c46e2ba9bd
|
||||
F src/callback.c 0425c6320730e6d3981acfb9202c1bed9016ad1a
|
||||
F src/complete.c dc1d136c0feee03c2f7550bafc0d29075e36deac
|
||||
F src/ctime.c 7deec4534f3b5a0c3b4a4cbadf809d321f64f9c4
|
||||
F src/ctime.c caf51429be3e0d4114056a8273b0fff812ff8ae9
|
||||
F src/date.c a3c6842bad7ae632281811de112a8ba63ff08ab3
|
||||
F src/delete.c 614d6e012aa5b624e78f3b556243497825de196b
|
||||
F src/expr.c 4bbdfaf66bc614be9254ce0c26a17429067a3e07
|
||||
F src/fault.c 160a0c015b6c2629d3899ed2daf63d75754a32bb
|
||||
F src/fkey.c c8492fed772af1ed61251582707266227612b45b
|
||||
F src/fkey.c 9f00ea98f6b360d477b5a78b5b59a1fbde82431c
|
||||
F src/func.c 59bb046d7e3df1ab512ac339ccb0a6f996a17cb7
|
||||
F src/global.c c70a46f28680f8d7c097dbc0430ccf3b932e90b0
|
||||
F src/hash.c 458488dcc159c301b8e7686280ab209f1fb915af
|
||||
@@ -158,7 +158,7 @@ F src/journal.c 552839e54d1bf76fb8f7abe51868b66acacf6a0e
|
||||
F src/legacy.c a199d7683d60cef73089e892409113e69c23a99f
|
||||
F src/lempar.c 7f026423f4d71d989e719a743f98a1cbd4e6d99e
|
||||
F src/loadext.c 99a161b27a499fc8ad40745b7b1900a26f0a5f51
|
||||
F src/main.c 8a386605c22e4b2becfe96bab2ac7128b480d489
|
||||
F src/main.c 13b9a1d38084dd4996ad5f759c4b0e1fc1c010c0
|
||||
F src/malloc.c 591aedb20ae40813f1045f2ef253438a334775d9
|
||||
F src/mem0.c 6a55ebe57c46ca1a7d98da93aaa07f99f1059645
|
||||
F src/mem1.c 00bd8265c81abb665c48fea1e0c234eb3b922206
|
||||
@@ -177,14 +177,14 @@ F src/os.c fcc717427a80b2ed225373f07b642dc1aad7490b
|
||||
F src/os.h 9dbed8c2b9c1f2f2ebabc09e49829d4777c26bf9
|
||||
F src/os_common.h 65a897143b64667d23ed329a7984b9b405accb58
|
||||
F src/os_os2.c 4a75888ba3dfc820ad5e8177025972d74d7f2440
|
||||
F src/os_unix.c 51caec436f811fa387a85cf7b05f13962c7fe0dc
|
||||
F src/os_win.c 60af92b1b1cc7aee13f5e0b5f9dde2d7abb41354
|
||||
F src/pager.c 120550e7ef01dafaa2cbb4a0528c0d87c8f12b41
|
||||
F src/pager.h 3f8c783de1d4706b40b1ac15b64f5f896bcc78d1
|
||||
F src/os_unix.c 1a34ca3794ced80e4a4ebcc3ba1f4c516762e534
|
||||
F src/os_win.c 86bcb5bd0386c761c764c3383879469346da3a14
|
||||
F src/pager.c 817f7f7140c9fa2641f28e6330e924708ddd870d
|
||||
F src/pager.h 2bab1b2ea4eac58663b5833e3522e36b5ff63447
|
||||
F src/parse.y 12b7ebd61ea54f0e1b1083ff69cc2c8ce9353d58
|
||||
F src/pcache.c 49e718c095810c6b3334e3a6d89970aceaddefce
|
||||
F src/pcache.h c683390d50f856d4cd8e24342ae62027d1bb6050
|
||||
F src/pcache1.c 912bd5687d6df344698d8e69560f347b6e21c18a
|
||||
F src/pcache1.c c8982f7048a70b7fd37975a8f6c84d6bc294175a
|
||||
F src/pragma.c ebcd20f1e654f5cb3aeef864ed69c4697719fbaa
|
||||
F src/prepare.c e64261559a3187698a3e7e6c8b001a4f4f98dab4
|
||||
F src/printf.c 585a36b6a963df832cfb69505afa3a34ed5ef8a1
|
||||
@@ -193,19 +193,19 @@ F src/resolve.c 36368f44569208fa074e61f4dd0b6c4fb60ca2b4
|
||||
F src/rowset.c 69afa95a97c524ba6faf3805e717b5b7ae85a697
|
||||
F src/select.c d219c4b68d603cc734b6f9b1e2780fee12a1fa0d
|
||||
F src/shell.c bbe7818ff5bc8614105ceb81ad67b8bdc0b671dd
|
||||
F src/sqlite.h.in db27d510c1016b3dfbac947bccfe7b648d1fa478
|
||||
F src/sqlite.h.in 355493ac9492746a0bbd17a4fd40911aa89b5a3a
|
||||
F src/sqlite3ext.h 1a1a4f784aa9c3b00edd287940197de52487cd93
|
||||
F src/sqliteInt.h 113559f0c2202c4e648b5d647d7b2409604fb516
|
||||
F src/sqliteInt.h a6f805d591b7b71703eb33dd9cd60ced889b71c6
|
||||
F src/sqliteLimit.h 164b0e6749d31e0daa1a4589a169d31c0dec7b3d
|
||||
F src/status.c 7ac64842c86cec2fc1a1d0e5c16d3beb8ad332bf
|
||||
F src/table.c 2cd62736f845d82200acfa1287e33feb3c15d62e
|
||||
F src/tclsqlite.c e85bada4bf1796274a2cd7b3db9a663f8df31880
|
||||
F src/test1.c e7ea726d26b9007bae7907d8b40280c70ec6c504
|
||||
F src/tclsqlite.c be0e691e223a907aa032c7b3ed310dc0ff048109
|
||||
F src/test1.c 7439efb86c1022f19a39a8e61de2cbac23ffab03
|
||||
F src/test2.c 80d323d11e909cf0eb1b6fbb4ac22276483bcf31
|
||||
F src/test3.c 124ff9735fb6bb7d41de180d6bac90e7b1509432
|
||||
F src/test4.c d1e5a5e904d4b444cf572391fdcb017638e36ff7
|
||||
F src/test5.c e1a19845625144caf038031234a12185e40d315c
|
||||
F src/test6.c c7256cc21d2409486d094277d5b017e8eced44ba
|
||||
F src/test6.c 3191b4ab964a144230ff9ef96c093520375c7b2a
|
||||
F src/test7.c 2e0781754905c8adc3268d8f0967e7633af58843
|
||||
F src/test8.c 6b1d12912a04fe6fca8c45bb9c3ea022f4352228
|
||||
F src/test9.c bea1e8cf52aa93695487badedd6e1886c321ea60
|
||||
@@ -213,7 +213,7 @@ F src/test_async.c 0612a752896fad42d55c3999a5122af10dcf22ad
|
||||
F src/test_autoext.c 30e7bd98ab6d70a62bb9ba572e4c7df347fe645e
|
||||
F src/test_backup.c c129c91127e9b46e335715ae2e75756e25ba27de
|
||||
F src/test_btree.c 47cd771250f09cdc6e12dda5bc71bc0b3abc96e2
|
||||
F src/test_config.c 70c74ef7a696c1b40d6415d48ee4c8f668cd16a8
|
||||
F src/test_config.c fc48c199ad4b88c99bf7c727cae407ca53145c3d
|
||||
F src/test_demovfs.c 20a4975127993f4959890016ae9ce5535a880094
|
||||
F src/test_devsym.c e7498904e72ba7491d142d5c83b476c4e76993bc
|
||||
F src/test_func.c cbdec5cededa0761daedde5baf06004a9bf416b5
|
||||
@@ -224,23 +224,23 @@ F src/test_intarray.c d879bbf8e4ce085ab966d1f3c896a7c8b4f5fc99
|
||||
F src/test_intarray.h 489edb9068bb926583445cb02589344961054207
|
||||
F src/test_journal.c 03313c693cca72959dcaaf79f8d76f21c01e19ff
|
||||
F src/test_loadext.c df586c27176e3c2cb2e099c78da67bf14379a56e
|
||||
F src/test_malloc.c 7ca7be34e0e09ef0ed6619544552ed95732e41f6
|
||||
F src/test_multiplex.c 731fb740a9fd4b11cb7b1990c62fc88d01c90dfd
|
||||
F src/test_malloc.c 91d5cf1751d3e563754fd183da1c020727b5480e
|
||||
F src/test_multiplex.c 3fc368022c46fe44ec22c5e1ed727223a54a6a1d
|
||||
F src/test_multiplex.h e99c571bc4968b7a9363b661481f3934bfead61d
|
||||
F src/test_mutex.c a6bd7b9cf6e19d989e31392b06ac8d189f0d573e
|
||||
F src/test_onefile.c 40cf9e212a377a6511469384a64b01e6e34b2eec
|
||||
F src/test_osinst.c 62b0b8ef21ce754cc94e17bb42377ed8795dba32
|
||||
F src/test_pcache.c 7bf828972ac0d2403f5cfa4cd14da41f8ebe73d8
|
||||
F src/test_quota.c cc4f67e12558a252ea4a11720be268348f4b1595
|
||||
F src/test_rtree.c 30c981837445a4e187ee850a49c4760d9642f7c3
|
||||
F src/test_quota.c a391c866217e92986c6f523f05b08aa6956c8419
|
||||
F src/test_rtree.c 6d06306e29946dc36f528a3a2cdc3add794656f1
|
||||
F src/test_schema.c 8c06ef9ddb240c7a0fcd31bc221a6a2aade58bf0
|
||||
F src/test_server.c 2f99eb2837dfa06a4aacf24af24c6affdf66a84f
|
||||
F src/test_stat.c f682704b5d1ba8e1d4e7e882a6d7922e2dcf066c
|
||||
F src/test_superlock.c 2b97936ca127d13962c3605dbc9a4ef269c424cd
|
||||
F src/test_syscall.c 162c4ec0137a549c009bb9ecab550527743cfc5d
|
||||
F src/test_syscall.c a992d8c80ea91fbf21fb2dd570db40e77dd7e6ae
|
||||
F src/test_tclvar.c f4dc67d5f780707210d6bb0eb6016a431c04c7fa
|
||||
F src/test_thread.c fe9a7803fc1d69cccb60f016f28c1cedf2d9fcfa
|
||||
F src/test_vfs.c 956cb3f5cbd2a0d09129540e615bb0fb761c083d
|
||||
F src/test_thread.c dc77f920d24f2f515bd315b87942b6396332a414
|
||||
F src/test_vfs.c b0baec983bd6f872715a4b44c8f39104fec333af
|
||||
F src/test_vfstrace.c 0b884e06094a746da729119a2cabdc7aa790063d
|
||||
F src/test_wholenumber.c 6129adfbe7c7444f2e60cc785927f3aa74e12290
|
||||
F src/test_wsd.c 41cadfd9d97fe8e3e4e44f61a4a8ccd6f7ca8fe9
|
||||
@@ -250,57 +250,58 @@ F src/update.c 2d67e24d5a44d8b1c0839bf2ee0c391593e852bf
|
||||
F src/utf.c c53eb7404b3eb5c1cbb5655c6a7a0e0ce6bd50f0
|
||||
F src/util.c 06302ffd2b80408d4f6c7af71f7090e0cf8d8ff7
|
||||
F src/vacuum.c 05513dca036a1e7848fe18d5ed1265ac0b32365e
|
||||
F src/vdbe.c 303d8b3bc93a464739c03b2fff51d360dcf1a163
|
||||
F src/vdbe.h 322af148cceef120bb1ec9cff7f122e76abf94da
|
||||
F src/vdbeInt.h 3de6588b36c833969aebab202e1766d586c37ec2
|
||||
F src/vdbe.c 9bc9b5f1231b9ea1bd35fecb775cce970fe47ac7
|
||||
F src/vdbe.h ee8ba0243ff76fae3af1d020c8d82d8368a2a744
|
||||
F src/vdbeInt.h 1b36e54662ef3ee5c9ce4a5933e122ffb8782b93
|
||||
F src/vdbeapi.c ddd061183e2c3015f676e53ee85fcaf306617e8e
|
||||
F src/vdbeaux.c 7d0b75a04ac466d25a90fefd1df83361a2ab0ad7
|
||||
F src/vdbeaux.c 4b5f0e80af001976d61ecb1c1e44c03dd7cb3d16
|
||||
F src/vdbeblob.c fde0374afb0c512614aed191ac2683f6772d2b8f
|
||||
F src/vdbemem.c 0498796b6ffbe45e32960d6a1f5adfb6e419883b
|
||||
F src/vdbesort.c 8a61a6d731cbe612217edf9eece6197f37c9489e
|
||||
F src/vdbetrace.c 5d0dc3d5fd54878cc8d6d28eb41deb8d5885b114
|
||||
F src/vtab.c 901791a47318c0562cd0c676a2c6ff1bc530e582
|
||||
F src/wal.c 3154756177d6219e233d84291d5b05f4e06ff5e9
|
||||
F src/wal.h 66b40bd91bc29a5be1c88ddd1f5ade8f3f48728a
|
||||
F src/walker.c 3112bb3afe1d85dc52317cb1d752055e9a781f8f
|
||||
F src/where.c 7d09f4c1512affb60cc1190a4b33d121d4ce039a
|
||||
F test/8_3_names.test b93687beebd17f6ebf812405a6833bae5d1f4199
|
||||
F test/8_3_names.test 631ea964a3edb091cf73c3b540f6bcfdb36ce823
|
||||
F test/aggerror.test a867e273ef9e3d7919f03ef4f0e8c0d2767944f2
|
||||
F test/alias.test 4529fbc152f190268a15f9384a5651bbbabc9d87
|
||||
F test/all.test 52fc8dee494092031a556911d404ca30a749a30b
|
||||
F test/alter.test a3f570072b53d7c0fe463bab3f5affa8e113c487
|
||||
F test/alter2.test e0c09d630d650ea32333781a4ed3c45eb02c4289
|
||||
F test/alter3.test 8677e48d95536f7a6ed86a1a774744dadcc22b07
|
||||
F test/alter4.test 1e5dd6b951e9f65ca66422edff02e56df82dd403
|
||||
F test/alter.test 5314fc01ef51ab8af0b8890725b710ed48d4806b
|
||||
F test/alter2.test 7ea05c7d92ac99349a802ef7ada17294dd647060
|
||||
F test/alter3.test 49c9d9fba2b8fcdce2dedeca97bbf1f369cc548d
|
||||
F test/alter4.test b2debc14d8cbe4c1d12ccd6a41eef88a8c1f15d5
|
||||
F test/altermalloc.test e81ac9657ed25c6c5bb09bebfa5a047cd8e4acfc
|
||||
F test/analyze.test c8cb89e8736336f1f0646c8123e6028a14c7b55e
|
||||
F test/analyze.test 68b43c1f9cd6ffc3bbb30d27a23712b38c413eca
|
||||
F test/analyze2.test 8f2b1534d43f5547ce9a6b736c021d4192c75be3
|
||||
F test/analyze3.test d61f55d8b472fc6e713160b1e577f7a68e63f38b
|
||||
F test/analyze4.test 757b37875cf9bb528d46f74497bc789c88365045
|
||||
F test/analyze5.test 1de8d66b11aae5a1453aa042d62e834a476bac9c
|
||||
F test/analyze6.test c125622a813325bba1b4999040ddc213773c2290
|
||||
F test/analyze7.test 5508e7828164ea0b518ed219bed7320a481863d4
|
||||
F test/async.test ad4ba51b77cd118911a3fe1356b0809da9c108c3
|
||||
F test/async2.test bf5e2ca2c96763b4cba3d016249ad7259a5603b6
|
||||
F test/async3.test 93edaa9122f498e56ea98c36c72abc407f4fb11e
|
||||
F test/async.test 1d0e056ba1bb9729283a0f22718d3a25e82c277b
|
||||
F test/async2.test c0a9bd20816d7d6a2ceca7b8c03d3d69c28ffb8b
|
||||
F test/async3.test d73a062002376d7edc1fe3edff493edbec1fc2f7
|
||||
F test/async4.test 1787e3952128aa10238bf39945126de7ca23685a
|
||||
F test/async5.test f3592d79c84d6e83a5f50d3fd500445f7d97dfdf
|
||||
F test/attach.test 2bb09073d7d5499127db00f50780766dcea913e1
|
||||
F test/attach2.test a295d2d7061adcee5884ef4a93c7c96a82765437
|
||||
F test/attach3.test bd9830bc3a0d22ed1310c9bff6896927937017dc
|
||||
F test/async5.test 0dd8701bd588bf6e70c2557a22ae3f22b2567b4c
|
||||
F test/attach.test 0e6f8de2589f11a5f474ef57fe5af2877e61c0e8
|
||||
F test/attach2.test e54436ed956d3d88bdee61221da59bf3935a0966
|
||||
F test/attach3.test d89ccfe4fe6e2b5e368d480fcdfe4b496c54cf4e
|
||||
F test/attach4.test 31f9eb0ca7bdbc393cc4657b877903a226a83d4b
|
||||
F test/attachmalloc.test 1d5b821a676f7bf0b00d87cc106b78966789ba57
|
||||
F test/attachmalloc.test 3a4bfca9545bfe906a8d2e622de10fbac5b711b0
|
||||
F test/auth.test b047105c32da7db70b842fd24056723125ecc2ff
|
||||
F test/auth2.test 270baddc8b9c273682760cffba6739d907bd2882
|
||||
F test/auth3.test a4755e6a2a2fea547ffe63c874eb569e60a28eb5
|
||||
F test/autoinc.test 85ef3180a737e6580086a018c09c6f1a52759b46
|
||||
F test/autoinc.test bd30d372d00045252f6c2e41b5f41455e1975acf
|
||||
F test/autoindex1.test 058d0b331ae6840a61bbee910d8cbae27bfd5991
|
||||
F test/autovacuum.test bb7c0885e6f8f1d633045de48f2b66082162766d
|
||||
F test/autovacuum_ioerr2.test 598b0663074d3673a9c1bc9a16e80971313bafe6
|
||||
F test/autovacuum.test fcaf4616ae5bb18098db1cb36262565e5c841c3c
|
||||
F test/autovacuum_ioerr2.test 8a367b224183ad801e0e24dcb7d1501f45f244b4
|
||||
F test/avtrans.test 0252654f4295ddda3b2cce0e894812259e655a85
|
||||
F test/backcompat.test 0f23ff8d516acdf42f3d866a66d85306de2d02bc
|
||||
F test/backup.test 004d3b78bffd990741ab50133ed4347c25c172b1
|
||||
F test/backup2.test b7c69f937c912e85ac8a5dbd1e1cf290302b2d49
|
||||
F test/backup_ioerr.test 1f012e692f42c0442ae652443258f70e9f20fa38
|
||||
F test/backcompat.test 71eeb75ea567c060774c4e8db4b0e703f21c7677
|
||||
F test/backup.test 6970614b002b056ae5bab5b76559905e02b6f0b2
|
||||
F test/backup2.test b4966934b2dc10a9a6546114566ea69b34a5185e
|
||||
F test/backup_ioerr.test 40d208bc9224b666ee3ed423f49bc9062a36a9d0
|
||||
F test/backup_malloc.test 7162d604ec2b4683c4b3799a48657fb8b5e2d450
|
||||
F test/badutf.test d5360fc31f643d37a973ab0d8b4fb85799c3169f
|
||||
F test/badutf2.test f5bc7f2d280670ecd79b9cf4f0f1760c607fe51f
|
||||
@@ -322,9 +323,9 @@ F test/boundary4.test 89e02fa66397b8a325d5eb102b5806f961f8ec4b
|
||||
F test/busy.test 76b4887f8b9160ba903c1ac22e8ff406ad6ae2f0
|
||||
F test/cache.test 754baab2f18089fc9bcba7afaeb4dc907c6c6de2
|
||||
F test/capi2.test 835d4cee9f542ea50fa8d01f3fe6de80b0627360
|
||||
F test/capi3.test 5c1ea6c940f2d7c4d5af8ef1ec2f92a267d2e37a
|
||||
F test/capi3.test 7200dff6acb17b9a4b6f9918f554eaae04968ddd
|
||||
F test/capi3b.test efb2b9cfd127efa84433cd7a2d72ce0454ae0dc4
|
||||
F test/capi3c.test bea67403a5e37a4b33230ee4723e315a2ffb31e7
|
||||
F test/capi3c.test ccf0acf045dbacd09f6229aa4efed670aaba76a9
|
||||
F test/capi3d.test cd36571f014f34bdc4421967f6453cbb597d5d16
|
||||
F test/capi3e.test f7408dda65c92b9056199fdc180f893015f83dde
|
||||
F test/cast.test 4c275cbdc8202d6f9c54a3596701719868ac7dc3
|
||||
@@ -336,59 +337,59 @@ F test/collate3.test d28d2cfab2c3a3d4628ae4b2b7afc9965daa3b4c
|
||||
F test/collate4.test 3d3f123f83fd8ccda6f48d617e44e661b9870c7d
|
||||
F test/collate5.test 67f1d3e848e230ff4802815a79acb0a8b5e69bd7
|
||||
F test/collate6.test 8be65a182abaac8011a622131486dafb8076e907
|
||||
F test/collate7.test fac8db7aac3978466c04ae892cc74dcf2bc031aa
|
||||
F test/collate7.test 8ec29d98f3ee4ccebce6e16ce3863fb6b8c7b868
|
||||
F test/collate8.test df26649cfcbddf109c04122b340301616d3a88f6
|
||||
F test/collate9.test 3adcc799229545940df2f25308dd1ad65869145a
|
||||
F test/collateA.test b8218ab90d1fa5c59dcf156efabb1b2599c580d6
|
||||
F test/colmeta.test 087c42997754b8c648819832241daf724f813322
|
||||
F test/colname.test 08948a4809d22817e0e5de89c7c0a8bd90cb551b
|
||||
F test/conflict.test cabc41f7616675df71b4fddabca3bd5d9221915a
|
||||
F test/corrupt.test 1a5bef8b2d178859af69814ecedcd37219a89968
|
||||
F test/corrupt2.test 808a28d0ca3b97e9aa8c91cd2b485ea2700b76d1
|
||||
F test/corrupt.test 4aabd06cff3fe759e3e658bcc17b71789710665e
|
||||
F test/corrupt2.test 9c0ab4becd50e9050bc1ebb8675456a4e5587bf0
|
||||
F test/corrupt3.test e3006aaf579d2ed7f1b94bf4cc695d3c784fa5af
|
||||
F test/corrupt4.test b963f9e01e0f92d15c76fb0747876fd4b96dc30a
|
||||
F test/corrupt5.test c23da7bfb20917cc7fdbb13ee25c7cc4e9fffeff
|
||||
F test/corrupt6.test 4e4161aef1f30b9f34582bb4142334b7f47eacae
|
||||
F test/corrupt7.test a90caf89c7d7cb7893ea4d92529bd0c129317ee4
|
||||
F test/corrupt8.test 48eb37ffb9a03bceada62219e2bd4c92f4b0cb75
|
||||
F test/corrupt9.test fad0bc26a5c972580a8d763c62f24094f4e8ef25
|
||||
F test/corruptA.test 856ea7a2eb5c1c767abbdf02679ac6cb158e4643
|
||||
F test/corruptB.test 44133515cf46c4d7bba691e3bcfa478080413af0
|
||||
F test/corruptC.test 483aa35dadfd96bdf549e38d75ffc2942576477e
|
||||
F test/corruptD.test 63a449a3146b460231535d04a409d14ce71795ad
|
||||
F test/corruptE.test 7290b61145d954be549340e462ca84826d8a31a3
|
||||
F test/corrupt9.test 959179e68dc0b7b99f424cf3e0381c86dcdd0112
|
||||
F test/corruptA.test fafa652aa585753be4f6b62ff0bb250266eaf7ce
|
||||
F test/corruptB.test 20d4a20cbed23958888c3e8995b424a47223d647
|
||||
F test/corruptC.test 62a767fe64acb1975f58cc6171192839c783edbb
|
||||
F test/corruptD.test 99b1999dbfa7cc04aaeac9d695a2445d4e7c7458
|
||||
F test/corruptE.test 78f7e1b9fd4a92e5951c7a5e414f2c4492733870
|
||||
F test/count.test 454e1ce985c94d13efeac405ce54439f49336163
|
||||
F test/crash.test 1b6ac8410689ff78028887f445062dc897c9ac89
|
||||
F test/crash.test 519dc29f6fea151f015a23236e555239353946eb
|
||||
F test/crash2.test 5b14d4eb58b880e231361d3b609b216acda86651
|
||||
F test/crash3.test 776f9363554c029fcce71d9e6600fa0ba6359ce7
|
||||
F test/crash4.test 02ff4f15c149ca1e88a5c299b4896c84d9450c3b
|
||||
F test/crash5.test 80a2f7073381837fc082435c97df52a830abcd80
|
||||
F test/crash6.test 9c730cf06335003cb1f5cfceddacd044155336e0
|
||||
F test/crash7.test e20a7b9ee1d16eaef7c94a4cb7ed2191b4d05970
|
||||
F test/crash8.test 76b95451933fe172ce8e26bff22d5c663c8ae473
|
||||
F test/crash3.test 8f5de9d32ab9ab95475a9efe7f47a940aa889418
|
||||
F test/crash4.test fe2821baf37168dc59dd733dcf7dba2a401487bc
|
||||
F test/crash5.test 69226a1b948d8961395b7ad2a1df084c212ce8cf
|
||||
F test/crash6.test 4c56f1e40d0291e1110790a99807aa875b1647ba
|
||||
F test/crash7.test 6c6a369af266af2ef50ab34df8f94d719065e2c1
|
||||
F test/crash8.test 38767cb504bbe491de6be4a7006b154973a2309f
|
||||
F test/crashtest1.c 09c1c7d728ccf4feb9e481671e29dda5669bbcc2
|
||||
F test/createtab.test 199cf68f44e5d9e87a0b8afc7130fdeb4def3272
|
||||
F test/createtab.test b5de160630b209c4b8925bdcbbaf48cc90b67fe8
|
||||
F test/cse.test 277350a26264495e86b1785f34d2d0c8600e021c
|
||||
F test/ctime.test 7bd009071e242aac4f18521581536b652b789a47
|
||||
F test/ctime.test 7f0bd5084d9dd7da9ad46901810896edd2ebb463
|
||||
F test/date.test a18a2ce81add84b17b06559e82ad7bb91bc6ddff
|
||||
F test/dbstatus.test 175b088308f2ce3f7afb8208f25c10878ee05921
|
||||
F test/dbstatus.test a719af0f226bd280748a4bb9054c0a5a9fc1b16c
|
||||
F test/default.test 6faf23ccb300114924353007795aa9a8ec0aa9dc
|
||||
F test/delete.test f7629d9eb245dfca170169cc5c7a735dec34aeb4
|
||||
F test/delete.test a065b05d2ebf60fd16639c579a4adfb7c381c701
|
||||
F test/delete2.test 3a03f2cca1f9a67ec469915cb8babd6485db43fa
|
||||
F test/delete3.test 555e84a00a99230b7d049d477a324a631126a6ab
|
||||
F test/descidx1.test b1353c1a15cfbee97b13a1dcedaf0fe78163ba6a
|
||||
F test/descidx1.test 533dcbda614b0463b0ea029527fd27e5a9ab2d66
|
||||
F test/descidx2.test 9f1a0c83fd57f8667c82310ca21b30a350888b5d
|
||||
F test/descidx3.test fe720e8b37d59f4cef808b0bf4e1b391c2e56b6f
|
||||
F test/diskfull.test 0cede7ef9d8f415d9d3944005c76be7589bb5ebb
|
||||
F test/diskfull.test 106391384780753ea6896b7b4f005d10e9866b6e
|
||||
F test/distinct.test 8c4d951fc40aba84421060e07b16099d2f4c2fdf
|
||||
F test/distinctagg.test 1a6ef9c87a58669438fc771450d7a72577417376
|
||||
F test/e_createtable.test 4771686a586b6ae414f927c389b2c101cc05c028
|
||||
F test/e_delete.test e2ae0d3fce5efd70fef99025e932afffc5616fab
|
||||
F test/e_droptrigger.test ddd4b28ed8a3d81bd5153fa0ab7559529a2ca03a
|
||||
F test/e_dropview.test b347bab30fc8de67b131594b3cd6f3d3bdaa753d
|
||||
F test/e_expr.test 71b55f90c9336ecec5a99641679036931260c754
|
||||
F test/e_expr.test d93ccded2409c66637dc1649a02f169e041b63d8
|
||||
F test/e_fkey.test 38039b840ab19331000b0f0eb1d82baa7208a67a
|
||||
F test/e_fts3.test 75bb0aee26384ef586165e21018a17f7cd843469
|
||||
F test/e_fts3.test 5c02288842e4f941896fd44afdef564dd5fc1459
|
||||
F test/e_insert.test 76d4bb5da9b28014d515d91ffe29a79a1e99f2bc
|
||||
F test/e_reindex.test a064f0878b8f848fbca38f1f61f82f15a3000c64
|
||||
F test/e_resolve.test dcce9308fb13b934ce29591105d031d3e14fbba6
|
||||
@@ -398,19 +399,19 @@ F test/e_update.test b926341a65955d69a6375c9eb4fd82e7089bc83a
|
||||
F test/e_uri.test 6f35b491f80dac005c8144f38b2dfb4d96483596
|
||||
F test/e_vacuum.test 6c09c2af7f2f140518f371c5342100118f779dcf
|
||||
F test/enc.test e54531cd6bf941ee6760be041dff19a104c7acea
|
||||
F test/enc2.test 6d91a5286f59add0cfcbb2d0da913b76f2242398
|
||||
F test/enc3.test 5c550d59ff31dccdba5d1a02ae11c7047d77c041
|
||||
F test/enc4.test b145fa25feb56ea1d51a5bc43ca268c0cf691a67
|
||||
F test/enc2.test 796c59832e2b9a52842f382ffda8f3e989db03ad
|
||||
F test/enc3.test 90683ad0e6ea587b9d5542ca93568af9a9858c40
|
||||
F test/enc4.test c8f1ce3618508fd0909945beb8b8831feef2c020
|
||||
F test/eqp.test f14fadd76da53405e9885e2431cacf7191d83cdb
|
||||
F test/eval.test bc269c365ba877554948441e91ad5373f9f91be3
|
||||
F test/exclusive.test 53e1841b422e554cecf0160f937c473d6d0e3062
|
||||
F test/exclusive2.test 343d55130c12c67b8bf10407acec043a6c26c86b
|
||||
F test/exclusive.test a1b324cb21834a490cd052d409d34789cfef57cb
|
||||
F test/exclusive2.test 372be98f6de44dd78734e364b7b626ea211761a6
|
||||
F test/exec.test e949714dc127eaa5ecc7d723efec1ec27118fdd7
|
||||
F test/exists.test 8f7b27b61c2fbe5822f0a1f899c715d14e416e30
|
||||
F test/expr.test 67c9fd6f8f829e239dc8b0f4a08a73c08b09196d
|
||||
F test/fallocate.test 43dc34b8c24be6baffadc3b4401ee15710ce83c6
|
||||
F test/filectrl.test 97003734290887566e01dded09dc9e99cb937e9e
|
||||
F test/filefmt.test f178cfc29501a14565954c961b226e61877dd32c
|
||||
F test/fallocate.test b5d34437bd7ab01d41b1464b8117aefd4d32160e
|
||||
F test/filectrl.test 4eb0178956ca25a756e6d79711a90fec7157b454
|
||||
F test/filefmt.test ffa17b5aebc3eb4b1e3be1ccb5ee906ffbd97f6e
|
||||
F test/fkey1.test 01c7de578e11747e720c2d9aeef27f239853c4da
|
||||
F test/fkey2.test 080969fe219b3b082b0e097ac18c6af2e5b0631f
|
||||
F test/fkey3.test 5ec899d12b13bcf1e9ef40eff7fb692fdb91392e
|
||||
@@ -424,12 +425,12 @@ F test/fts1d.test a73deace5c18df4a549b12908bade4f05dcf1a2f
|
||||
F test/fts1e.test 77244843e925560b5a0b70069c3e7ab62f181ed2
|
||||
F test/fts1f.test 2d6cb10d8b7a4e6edc321bbdb3982f1f48774714
|
||||
F test/fts1i.test 6bfe08cdfdced063a39a50c8601da65e6274d879
|
||||
F test/fts1j.test e4c0ffcd0ba2adce09c6b7b43ffd0749b5fda5c7
|
||||
F test/fts1j.test e3797475796043a161e348c46a309664cac83f7f
|
||||
F test/fts1k.test 65d3b41487b9f738d11b0f00eca375c0ca6bd970
|
||||
F test/fts1l.test 15c119ed2362b2b28d5300c0540a6a43eab66c36
|
||||
F test/fts1m.test 2d9ca67b095d49f037a914087cc0a61e89da4f0c
|
||||
F test/fts1n.test a2317dcd27b1d087ee3878b30e0a59c593c98b7a
|
||||
F test/fts1o.test 382b8b07a2d6de5610814d9477117c4430464b9c
|
||||
F test/fts1o.test fd92f82ea9090dbc2a13d4cd58aafe5afa371b6a
|
||||
F test/fts1porter.test d86e9c3e0c7f8ff95add6582b4b585fb4e02b96d
|
||||
F test/fts2.test e3fb95f96a650411574efc136f3fb10eef479ed7
|
||||
F test/fts2a.test 473a5c8b473a4e21a8e3fddaed1e59666e0c6ab7
|
||||
@@ -441,12 +442,12 @@ F test/fts2f.test cf84096235991709c1e61caa389632aa0a4f976d
|
||||
F test/fts2g.test d49d6f6c900e6e20a0fb980ec1cd568dee12af76
|
||||
F test/fts2h.test 223af921323b409d4b5b18ff4e51619541b174bb
|
||||
F test/fts2i.test 1b22451d1f13f7c509baec620dc3a4a754885dd6
|
||||
F test/fts2j.test f68d7611f76309bc8b94170f3740d9fbbc061d9b
|
||||
F test/fts2j.test 298fa1670aa21cd445b282d139b70c72e7ade12b
|
||||
F test/fts2k.test c7ebf4a4937594aa07459e3e1bca1251c1be8659
|
||||
F test/fts2l.test 3333336621524cf7d60bb62d6ef6ab69647866ed
|
||||
F test/fts2m.test 4b30142ead6f3ed076e880a2a464064c5ad58c51
|
||||
F test/fts2n.test 12b9c5352128cebd1c6b8395e43788d4b09087c2
|
||||
F test/fts2o.test c6a79567d85403dc4d15b89f3f9799a0a0aef065
|
||||
F test/fts2o.test 09cd920d585ebf1c2910b6be869efa286e308a84
|
||||
F test/fts2p.test 4b48c35c91e6a7dbf5ac8d1e5691823cc999aafb
|
||||
F test/fts2q.test b2fbbe038b7a31a52a6079b215e71226d8c6a682
|
||||
F test/fts2r.test b154c30b63061d8725e320fba1a39e2201cadd5e
|
||||
@@ -462,12 +463,12 @@ F test/fts3af.test d394978c534eabf22dd0837e718b913fd66b499c
|
||||
F test/fts3ag.test 0b7d303f61ae5d620c4efb5e825713ea34ff9441
|
||||
F test/fts3ah.test dc9f66c32c296f1bc8bcc4535126bddfeca62894
|
||||
F test/fts3ai.test d29cee6ed653e30de478066881cec8aa766531b2
|
||||
F test/fts3aj.test 584facbc9ac4381a7ec624bfde677340ffc2a5a4
|
||||
F test/fts3aj.test 0ed71e1dd9b03b843a857dc3eb9b15630e0104fc
|
||||
F test/fts3ak.test bd14deafe9d1586e8e9bf032411026ac4f8c925d
|
||||
F test/fts3al.test 07d64326e79bbdbab20ee87fc3328fbf01641c9f
|
||||
F test/fts3am.test 218aa6ba0dfc50c7c16b2022aac5c6be593d08d8
|
||||
F test/fts3an.test a49ccadc07a2f7d646ec1b81bc09da2d85a85b18
|
||||
F test/fts3ao.test b83f99f70e9eec85f27d75801a974b3f820e01f9
|
||||
F test/fts3ao.test 60a15590d3c8578e943e4a149524b16b9bc1be92
|
||||
F test/fts3atoken.test 402ef2f7c2fb4b3d4fa0587df6441c1447e799b3
|
||||
F test/fts3auto.test c1a30b37002b7c764a96937fbc71065b73d69494
|
||||
F test/fts3aux1.test 0b02743955d56fc0d4d66236a26177bd1b726de0
|
||||
@@ -493,9 +494,9 @@ F test/fts3prefix.test 36246609111ec1683f7ea5ed27666ce2cefb5676
|
||||
F test/fts3query.test ef79d31fdb355d094baec1c1b24b60439a1fb8a2
|
||||
F test/fts3rnd.test 1320d8826a845e38a96e769562bf83d7a92a15d0
|
||||
F test/fts3shared.test 8bb266521d7c5495c0ae522bb4d376ad5387d4a2
|
||||
F test/fts3snippet.test a12f22a3ba4dd59751a57c79b031d07ab5f51ddd
|
||||
F test/fts3snippet.test 8e956051221a34c7daeb504f023cb54d5fa5a8b2
|
||||
F test/fts3sort.test 63d52c1812904b751f9e1ff487472e44833f5402
|
||||
F test/fts4aa.test 148d9eb54901af23b5d402b1f388f43e559e1728
|
||||
F test/fts4aa.test 6e7f90420b837b2c685f3bcbe84c868492d40a68
|
||||
F test/func.test 6c5ce11e3a0021ca3c0649234e2d4454c89110ca
|
||||
F test/func2.test 772d66227e4e6684b86053302e2d74a2500e1e0f
|
||||
F test/func3.test 001021e5b88bd02a3b365a5c5fd8f6f49d39744a
|
||||
@@ -503,40 +504,42 @@ F test/fuzz.test 77fd50afc12847af50fcf1941679d90adebadde6
|
||||
F test/fuzz2.test 207d0f9d06db3eaf47a6b7bfc835b8e2fc397167
|
||||
F test/fuzz3.test aec64345184d1662bd30e6a17851ff659d596dc5
|
||||
F test/fuzz_common.tcl a87dfbb88c2a6b08a38e9a070dabd129e617b45b
|
||||
F test/fuzz_malloc.test dd7001ac86d09c154a7dff064f4739c60e2b312c
|
||||
F test/fuzz_malloc.test 328f70aaca63adf29b4c6f06505ed0cf57ca7c26
|
||||
F test/fuzzer1.test ddfb04f3bd5cfdda3b1aa15b78d3ad055c9cc50f
|
||||
F test/hook.test 4fd80e9c3ffb49de0379e2a026ef2fe7b9f3e534
|
||||
F test/hook.test 94b927b15883f5c1477ab09eecd16275addb08f4
|
||||
F test/icu.test 70df4faca133254c042d02ae342c0a141f2663f4
|
||||
F test/in.test 19b642bb134308980a92249750ea4ce3f6c75c2d
|
||||
F test/in2.test 5d4c61d17493c832f7d2d32bef785119e87bde75
|
||||
F test/in3.test 3cbf58c87f4052cee3a58b37b6389777505aa0c0
|
||||
F test/in4.test 64f3cc1acde1b9161ccdd8e5bde3daefdb5b2617
|
||||
F test/incrblob.test 76e787ca3301d9bfa6906031c626d26f8dd707de
|
||||
F test/incrblob.test 3307c04876fe025e10256e3cc8050ab5a84aa27f
|
||||
F test/incrblob2.test edc3a96e557bd61fb39acc8d2edd43371fbbaa19
|
||||
F test/incrblob3.test aedbb35ea1b6450c33b98f2b6ed98e5020be8dc7
|
||||
F test/incrblob_err.test d2562d2771ebffd4b3af89ef64c140dd44371597
|
||||
F test/incrblobfault.test 917c0292224c64a56ef7215fd633a3a82f805be0
|
||||
F test/incrvacuum.test 453d1e490d8f5ad2c9b3a54282a0690d6ae56462
|
||||
F test/incrvacuum2.test ae04573b73ad52179f56e194fff0fbe43b509d23
|
||||
F test/incrvacuum_ioerr.test 57d2f5777ab13fa03b87b262a4ea1bad5cfc0291
|
||||
F test/incrvacuum.test d2a6ddf5e429720b5fe502766af747915ccf6c32
|
||||
F test/incrvacuum2.test 62fbeb85459fe4e501684d8fb5b6e98a23e3b0c0
|
||||
F test/incrvacuum_ioerr.test 22f208d01c528403240e05beecc41dc98ed01637
|
||||
F test/index.test b5429732b3b983fa810e3ac867d7ca85dae35097
|
||||
F test/index2.test ee83c6b5e3173a3d7137140d945d9a5d4fdfb9d6
|
||||
F test/index3.test 423a25c789fc8cc51aaf2a4370bbdde2d9e9eed7
|
||||
F test/index4.test c82a59c9ae2ac01804bdb100162dca057318f40f
|
||||
F test/indexedby.test be501e381b82b2f8ab406309ba7aac46e221f4ad
|
||||
F test/indexfault.test 31d4ab9a7d2f6e9616933eb079722362a883eb1d
|
||||
F test/init.test 15c823093fdabbf7b531fe22cf037134d09587a7
|
||||
F test/insert.test aef273dd1cee84cc92407469e6bd1b3cdcb76908
|
||||
F test/insert2.test 4f3a04d168c728ed5ec2c88842e772606c7ce435
|
||||
F test/insert3.test 1b7db95a03ad9c5013fdf7d6722b6cd66ee55e30
|
||||
F test/insert4.test 63ea672b0fc6d3a9a0ccee774a771510b1e684c4
|
||||
F test/insert5.test 1f93cbe9742110119133d7e8e3ccfe6d7c249766
|
||||
F test/insert5.test 394f96728d1258f406fe5f5aeb0aaf29487c39a6
|
||||
F test/intarray.test 066b7d7ac38d25bf96f87f1b017bfc687551cdd4
|
||||
F test/interrupt.test 42e7cf98646fd9cb4a3b131a93ed3c50b9e149f1
|
||||
F test/intpkey.test 537669fd535f62632ca64828e435b9e54e8d677f
|
||||
F test/io.test 1b895d6774491895cbc75659969f07ca01860c88
|
||||
F test/ioerr.test 622aebd2f24779cafaf5dd3e3c2b349ce40ade3b
|
||||
F test/io.test b278aa8fa609ed0dcc825df31b2d9f526c5a52bd
|
||||
F test/ioerr.test 40bb2cfcab63fb6aa7424cd97812a84bc16b5fb8
|
||||
F test/ioerr2.test 1b56cb80d5b0726ee3ba325ca175734541e32955
|
||||
F test/ioerr3.test d3cec5e1a11ad6d27527d0d38573fbff14c71bdd
|
||||
F test/ioerr4.test fc6eddfec2efc2f1ed217b9eae4c1c1d3516ce86
|
||||
F test/ioerr4.test f130fe9e71008577b342b8874d52984bd04ede2c
|
||||
F test/ioerr5.test 2edfa4fb0f896f733071303b42224df8bedd9da4
|
||||
F test/join.test 8d63cc4d230a7affafa4b6ab0b97c49b8ccb365c
|
||||
F test/join2.test f2171c265e57ee298a27e57e7051d22962f9f324
|
||||
@@ -544,40 +547,40 @@ F test/join3.test 6f0c774ff1ba0489e6c88a3e77b9d3528fb4fda0
|
||||
F test/join4.test 1a352e4e267114444c29266ce79e941af5885916
|
||||
F test/join5.test 86675fc2919269aa923c84dd00ee4249b97990fe
|
||||
F test/join6.test bf82cf3f979e9eade83ad0d056a66c5ed71d1901
|
||||
F test/journal1.test 36f2d1bb9bf03f790f43fbdb439e44c0657fab19
|
||||
F test/journal2.test 50a3604768494d4a337f194f0a9480e7c57dcb72
|
||||
F test/journal3.test ff175219be1b02d2f7e54297ad7e491b7533edb6
|
||||
F test/jrnlmode.test e3fe6c4a2c3213d285650dc8e33aab7eaaa5ce53
|
||||
F test/jrnlmode2.test a19e28de1a6ec898067e46a122f1b71c9323bf00
|
||||
F test/jrnlmode3.test c6522b276ba315fd1416198de6fc1da9e72409fb
|
||||
F test/journal1.test 8b71ef1ed5798bdc0e6eb616d8694e2c2c188d4d
|
||||
F test/journal2.test 29937bdbb253bbfd92057610120bdc0aa7e84a0a
|
||||
F test/journal3.test 6fd28532c88b447db844186bc190523108b6dbb4
|
||||
F test/jrnlmode.test 9ee3a78f53d52cca737db69293d15dc41c0cbd36
|
||||
F test/jrnlmode2.test 81610545a4e6ed239ea8fa661891893385e23a1d
|
||||
F test/jrnlmode3.test 556b447a05be0e0963f4311e95ab1632b11c9eaa
|
||||
F test/keyword1.test a2400977a2e4fde43bf33754c2929fda34dbca05
|
||||
F test/lastinsert.test 474d519c68cb79d07ecae56a763aa7f322c72f51
|
||||
F test/laststmtchanges.test ae613f53819206b3222771828d024154d51db200
|
||||
F test/like.test 9cc5261d22f2108a27cedff8a972aa3284a4ba52
|
||||
F test/like.test 7b4aaa4a8192fdec90e0a905984c92a688c51e48
|
||||
F test/like2.test 3b2ee13149ba4a8a60b59756f4e5d345573852da
|
||||
F test/limit.test 2db7b3b34fb925b8e847d583d2eb67531d0ce67e
|
||||
F test/loadext.test 0393ce12d9616aa87597dd0ec88181de181f6db0
|
||||
F test/loadext.test dab17f7014f8079698dbd4b02705562b0ce6db5f
|
||||
F test/loadext2.test 0bcaeb4d81cd5b6e883fdfea3c1bdbe1f173cbca
|
||||
F test/lock.test db74fdf5a73bad29ab3d862ea78bf1068972cc1d
|
||||
F test/lock2.test 5242d8ac4e2d59c403aebff606af449b455aceff
|
||||
F test/lock3.test f271375930711ae044080f4fe6d6eda930870d00
|
||||
F test/lock4.test c82268c031d39345d05efa672f80b025481b3ae5
|
||||
F test/lock5.test b2abb5e711bc59b0eae00f6c97a36ec9f458fada
|
||||
F test/lock4.test e175ae13865bc87680607563bafba21f31a26f12
|
||||
F test/lock5.test 5ad6a1f536036ff1be915cfdd41481aeafda3273
|
||||
F test/lock6.test ad5b387a3a8096afd3c68a55b9535056431b0cf5
|
||||
F test/lock7.test 64006c84c1c616657e237c7ad6532b765611cf64
|
||||
F test/lock_common.tcl 0c270b121d40959fa2f3add382200c27045b3d95
|
||||
F test/lookaside.test 93f07bac140c5bb1d49f3892d2684decafdc7af2
|
||||
F test/main.test 9d7bbfcc1b52c88ba7b2ba6554068ecf9939f252
|
||||
F test/main.test 39c4bb8a157f57298ed1659d6df89d9f35aaf2c8
|
||||
F test/make-where7.tcl 05c16b5d4f5d6512881dfec560cb793915932ef9
|
||||
F test/malloc.test 76017be66cec4375a4b4ea5c71245e27a9fe2d0b
|
||||
F test/malloc3.test 4128b1e6ffa506103b278ad97af89174f310c7ca
|
||||
F test/malloc.test 8c727fe29fccd280cbf8f6acf08bd10b76beaf34
|
||||
F test/malloc3.test de8eca0c3e748878845fdca3663ec4b642073caf
|
||||
F test/malloc4.test 957337613002b7058a85116493a262f679f3a261
|
||||
F test/malloc5.test 4d16d1bb26d2deddd7c4f480deec341f9b2d0e22
|
||||
F test/malloc5.test 338e0f7df5fde4a0129c8002a915410e1080bfb4
|
||||
F test/malloc6.test 2f039d9821927eacae43e1831f815e157659a151
|
||||
F test/malloc7.test 7c68a32942858bc715284856c5507446bba88c3a
|
||||
F test/malloc8.test 9b7a3f8cb9cf0b12fff566e80a980b1767bd961d
|
||||
F test/malloc9.test 2307c6ee3703b0a21391f3ea92388b4b73f9105e
|
||||
F test/mallocA.test 4b650c745aab289079454f4d1c02abe5c97ab6b3
|
||||
F test/mallocA.test 47006c8d70f29b030652e251cb9d35ba60289198
|
||||
F test/mallocAll.test 98f1be74bc9f49a858bc4f361fc58e26486798be
|
||||
F test/mallocB.test bc475ab850cda896142ab935bbfbc74c24e51ed6
|
||||
F test/mallocC.test 3dffe16532f109293ce1ccecd0c31dca55ef08c4
|
||||
@@ -589,53 +592,53 @@ F test/mallocH.test 79b65aed612c9b3ed2dcdaa727c85895fd1bfbdb
|
||||
F test/mallocI.test a88c2b9627c8506bf4703d8397420043a786cdb6
|
||||
F test/mallocJ.test b5d1839da331d96223e5f458856f8ffe1366f62e
|
||||
F test/mallocK.test d79968641d1b70d88f6c01bdb9a7eb4a55582cc9
|
||||
F test/malloc_common.tcl 50d0ed21eed0ae9548b58935bd29ac89a05a54fa
|
||||
F test/manydb.test b3d3bc4c25657e7f68d157f031eb4db7b3df0d3c
|
||||
F test/malloc_common.tcl 2930895b0962823ec679853e67e58dd6d8198b3c
|
||||
F test/manydb.test 28385ae2087967aa05c38624cec7d96ec74feb3e
|
||||
F test/mem5.test c6460fba403c5703141348cd90de1c294188c68f
|
||||
F test/memdb.test 708a028d6d373e5b3842e4bdc8ba80998c9a4da6
|
||||
F test/memdb.test 4b5d2671588ed59cb08642adc67fd78c666dc9c2
|
||||
F test/memleak.test 10b9c6c57e19fc68c32941495e9ba1c50123f6e2
|
||||
F test/memsubsys1.test 679db68394a5692791737b150852173b3e2fea10
|
||||
F test/memsubsys2.test 72a731225997ad5e8df89fdbeae9224616b6aecc
|
||||
F test/memsubsys1.test 39f1ddddf76ce51a3232aab0279668e23cf00f83
|
||||
F test/memsubsys2.test 3a1c1a9de48e5726faa85108b02459fae8cb9ee9
|
||||
F test/minmax.test 722d80816f7e096bf2c04f4111f1a6c1ba65453d
|
||||
F test/minmax2.test 33504c01a03bd99226144e4b03f7631a274d66e0
|
||||
F test/minmax3.test cc1e8b010136db0d01a6f2a29ba5a9f321034354
|
||||
F test/misc1.test e56baf44656dd68d6475a4b44521045a60241e9b
|
||||
F test/misc2.test a628db7b03e18973e5d446c67696b03de718c9fd
|
||||
F test/misc1.test 55cb2bfbf4a8cd61f4be1effc30426ad41696bff
|
||||
F test/misc2.test 00d7de54eda90e237fc9a38b9e5ccc769ebf6d4d
|
||||
F test/misc3.test 72c5dc87a78e7865c5ec7a969fc572913dbe96b6
|
||||
F test/misc4.test 9c078510fbfff05a9869a0b6d8b86a623ad2c4f6
|
||||
F test/misc5.test 9f9338f8211c7f5d1cbe16331fa65d019501aa50
|
||||
F test/misc5.test 528468b26d03303b1f047146e5eefc941b9069f5
|
||||
F test/misc6.test 953cc693924d88e6117aeba16f46f0bf5abede91
|
||||
F test/misc7.test 29032efcd3d826fbd409e2a7af873e7939f4a4e3
|
||||
F test/misuse.test 30b3a458e5a70c31e74c291937b6c82204c59f33
|
||||
F test/multiplex.test b45367b1dac7dfa4c5b8ff0f3844260804a0034d
|
||||
F test/misc7.test eafaa41b9133d7a2ded4641bbe5f340731d35a52
|
||||
F test/misuse.test ba4fb5d1a6101d1c171ea38b3c613d0661c83054
|
||||
F test/multiplex.test 9df8bf738b3b97c718fceb3fadb30900ba494418
|
||||
F test/mutex1.test 78b2b9bb320e51d156c4efdb71b99b051e7a4b41
|
||||
F test/mutex2.test bfeaeac2e73095b2ac32285d2756e3a65e681660
|
||||
F test/nan.test dc212a22b36109fd1ae37154292444ef249c5ec2
|
||||
F test/notify1.test 8433bc74bd952fb8a6e3f8d7a4c2b28dfd69e310
|
||||
F test/notify2.test 195a467e021f74197be2c4fb02d6dee644b8d8db
|
||||
F test/notify3.test d60923e186e0900f4812a845fcdfd8eea096e33a
|
||||
F test/notify1.test 669b2b743618efdc18ca4b02f45423d5d2304abf
|
||||
F test/notify2.test 9503e51b9a272a5405c205ad61b7623d5a9ca489
|
||||
F test/notify3.test a86259abbfb923aa27d30f0fc038c88e5251488a
|
||||
F test/notnull.test cc7c78340328e6112a13c3e311a9ab3127114347
|
||||
F test/null.test a8b09b8ed87852742343b33441a9240022108993
|
||||
F test/openv2.test af02ed0a9cbc0d2a61b8f35171d4d117e588e4ec
|
||||
F test/openv2.test 0d3040974bf402e19b7df4b783e447289d7ab394
|
||||
F test/oserror.test 3fe52e0bd2891a9bf7cdeb639554992453d46301
|
||||
F test/pager1.test 228a831060dab96bc91b03ba2a85cedefd1ab38a
|
||||
F test/pager1.test 70c94c895ffaf4dc34ee4b66e6e4cd713af41edc
|
||||
F test/pager2.test 745b911dde3d1f24ae0870bd433dfa83d7c658c1
|
||||
F test/pager3.test 3856d9c80839be0668efee1b74811b1b7f7fc95f
|
||||
F test/pagerfault.test 4194b8ea2a5da7958cd155556605ff554e1b065a
|
||||
F test/pagerfault.test 452f2cc23e3bfcfa935f4442aec1da4fe1dc0442
|
||||
F test/pagerfault2.test 1f79ea40d1133b2683a2f811b00f2399f7ec2401
|
||||
F test/pagerfault3.test f16e2efcb5fc9996d1356f7cbc44c998318ae1d7
|
||||
F test/pageropt.test 8146bf448cf09e87bb1867c2217b921fb5857806
|
||||
F test/pagesize.test 76aa9f23ecb0741a4ed9d2e16c5fa82671f28efb
|
||||
F test/pagesize.test 1dd51367e752e742f58e861e65ed7390603827a0
|
||||
F test/pcache.test 065aa286e722ab24f2e51792c1f093bf60656b16
|
||||
F test/pcache2.test 0d85f2ab6963aee28c671d4c71bec038c00a1d16
|
||||
F test/permutations.test f9ad1fcadd10a7fd4014de58e61178c3329a5c03
|
||||
F test/pragma.test fdfc09067ea104a0c247a1a79d8093b56656f850
|
||||
F test/pragma2.test 5364893491b9231dd170e3459bfc2e2342658b47
|
||||
F test/pcache2.test bc67c6802989dba05cdf3a4574fd882e238c7ecf
|
||||
F test/permutations.test 97d576e6384f1779e4428516a48458ce8cf7dfd1
|
||||
F test/pragma.test c8108e01da04f16e67e5754e610bc62c1b993f6c
|
||||
F test/pragma2.test 3a55f82b954242c642f8342b17dffc8b47472947
|
||||
F test/printf.test 05970cde31b1a9f54bd75af60597be75a5c54fea
|
||||
F test/progress.test 5b075c3c790c7b2a61419bc199db87aaf48b8301
|
||||
F test/ptrchng.test ef1aa72d6cf35a2bbd0869a649b744e9d84977fc
|
||||
F test/quick.test 1681febc928d686362d50057c642f77a02c62e57
|
||||
F test/quota.test 48c3a5a98687d67ef06fc16d2e603284756bbec3
|
||||
F test/quota.test 1c59a396e8f7b5d8466fa74b59f2aeb778d74f7a
|
||||
F test/quote.test 215897dbe8de1a6f701265836d6601cc6ed103e6
|
||||
F test/randexpr1.tcl 40dec52119ed3a2b8b2a773bce24b63a3a746459
|
||||
F test/randexpr1.test 1084050991e9ba22c1c10edd8d84673b501cc25a
|
||||
@@ -643,21 +646,21 @@ F test/rdonly.test c267d050a1d9a6a321de502b737daf28821a518d
|
||||
F test/reindex.test 44edd3966b474468b823d481eafef0c305022254
|
||||
F test/releasetest.mk 2eced2f9ae701fd0a29e714a241760503ccba25a
|
||||
F test/releasetest.tcl fa302d03fd9acfce6d910553a33473bfcf561958
|
||||
F test/rollback.test 1a83118ea6db4e7d8c10eaa63871b5e90502ffdc
|
||||
F test/rollback.test a1b4784b864331eae8b2a98c189efa2a8b11ff07
|
||||
F test/rowhash.test 0bc1d31415e4575d10cacf31e1a66b5cc0f8be81
|
||||
F test/rowid.test e58e0acef38b527ed1b0b70d3ada588f804af287
|
||||
F test/rtree.test 0c8d9dd458d6824e59683c19ab2ffa9ef946f798
|
||||
F test/savepoint.test a1bef7ace82cc7922975fa96b06176e9bd5114cf
|
||||
F test/savepoint.test e575217b07d6a6e895e66f4eda076570815e0027
|
||||
F test/savepoint2.test 9b8543940572a2f01a18298c3135ad0c9f4f67d7
|
||||
F test/savepoint3.test e328085853b14898d78ceea00dfe7db18bb6a9ec
|
||||
F test/savepoint4.test c8f8159ade6d2acd9128be61e1230f1c1edc6cc0
|
||||
F test/savepoint5.test 0735db177e0ebbaedc39812c8d065075d563c4fd
|
||||
F test/savepoint6.test 76d3948568b2cdc0c13a671cadcae75009b183d6
|
||||
F test/savepoint6.test f41279c5e137139fa5c21485773332c7adb98cd7
|
||||
F test/schema.test 8f7999be894260f151adf15c2c7540f1c6d6a481
|
||||
F test/schema2.test 906408621ea881fdb496d878b1822572a34e32c5
|
||||
F test/schema3.test 1bc1008e1f8cb5654b248c55f27249366eb7ed38
|
||||
F test/schema4.test e6a66e20cc69f0e306667c08be7fda3d11707dc5
|
||||
F test/securedel.test 328d2921c0ca49bdd3352e516b0377fc07143254
|
||||
F test/securedel.test 87a2561151af1f1e349071a89fdd77059f50113c
|
||||
F test/select1.test f67ca2dfc05df41c7b86eb32ca409b427a5f43b0
|
||||
F test/select2.test 352480e0e9c66eda9c3044e412abdf5be0215b56
|
||||
F test/select3.test 2ce595f8fb8e2ac10071d3b4e424cadd4634a054
|
||||
@@ -672,12 +675,12 @@ F test/selectB.test 0d072c5846071b569766e6cd7f923f646a8b2bfa
|
||||
F test/selectC.test f9bf1bc4581b5b8158caa6e4e4f682acb379fb25
|
||||
F test/server1.test f5b790d4c0498179151ca8a7715a65a7802c859c
|
||||
F test/session.test c1a17c11ef7d01c24fe2b9f7871190d949a8e718
|
||||
F test/shared.test b9114eaea7e748a3a4c8ff7b9ca806c8f95cef3e
|
||||
F test/shared2.test 7f6ad2d857d0f4e5d6a0b9a897b5e56a6b6ea18c
|
||||
F test/shared3.test d69bdd5f156580876c5345652d21dc2092e85962
|
||||
F test/shared4.test d0fadacb50bb6981b2fb9dc6d1da30fa1edddf83
|
||||
F test/shared6.test 990d2584b5db28e6e1f24742c711b26e59757b67
|
||||
F test/shared7.test 8114027cb5e8c376e467115703d46e5ac4e77739
|
||||
F test/shared.test 34945a516532b11182c3eb26e31247eee3c9ae48
|
||||
F test/shared2.test 8f71d4eb4d5261280de92284df74172545c852cc
|
||||
F test/shared3.test ebf77f023f4bdaa8f74f65822b559e86ce5c6257
|
||||
F test/shared4.test 72d90821e8d2fc918a08f16d32880868d8ee8e9d
|
||||
F test/shared6.test 866bb4982c45ce216c61ded5e8fde4e7e2f3ffa9
|
||||
F test/shared7.test 960760bc8d03e1419e70dea69cf41db62853616e
|
||||
F test/shared_err.test 91e26ec4f3fbe07951967955585137e2f18993de
|
||||
F test/sharedlock.test ffa0a3c4ac192145b310f1254f8afca4d553eabf
|
||||
F test/shortread1.test bb591ef20f0fd9ed26d0d12e80eee6d7ac8897a3
|
||||
@@ -689,32 +692,32 @@ F test/speed1.test f2974a91d79f58507ada01864c0e323093065452
|
||||
F test/speed1p.explain d841e650a04728b39e6740296b852dccdca9b2cb
|
||||
F test/speed1p.test c4a469f29f135f4d76c55b1f2a52f36e209466cc
|
||||
F test/speed2.test 53177056baf6556dcbdcf032bbdfc41c1aa74ded
|
||||
F test/speed3.test 5a419039e9da95d906adb2298af2849600c81c11
|
||||
F test/speed3.test d32043614c08c53eafdc80f33191d5bd9b920523
|
||||
F test/speed4.test abc0ad3399dcf9703abed2fff8705e4f8e416715
|
||||
F test/speed4p.explain 6b5f104ebeb34a038b2f714150f51d01143e59aa
|
||||
F test/speed4p.test 0e51908951677de5a969b723e03a27a1c45db38b
|
||||
F test/sqllimits1.test 0ebf7bed0b99c96f24e0b7fa5e59dbc42359c421
|
||||
F test/stat.test c7b20ea43003dc2dc33335e231c27be8284c4a2a
|
||||
F test/sqllimits1.test b1aae27cc98eceb845e7f7adf918561256e31298
|
||||
F test/stat.test 0997f6a57a35866b14111ed361ed8851ce7978ae
|
||||
F test/stmt.test 25d64e3dbf9a3ce89558667d7f39d966fe2a71b9
|
||||
F test/subquery.test b524f57c9574b2c0347045b4510ef795d4686796
|
||||
F test/subselect.test d24fd8757daf97dafd2e889c73ea4c4272dcf4e4
|
||||
F test/substr.test 18f57c4ca8a598805c4d64e304c418734d843c1a
|
||||
F test/superlock.test 5d7a4954b0059c903f82c7b67867bc5451a7c082
|
||||
F test/sync.test 2bd73b585089c99e76b3e1796c42059b7d89d872
|
||||
F test/syscall.test 707c95e4ab7863e13f1293c6b0c76bead30249b3
|
||||
F test/sync.test a34cd43e98b7fb84eabbf38f7ed8f7349b3f3d85
|
||||
F test/syscall.test 966addf703faee6a5d509abe6d8885e393e552fd
|
||||
F test/sysfault.test c79441d88d23696fbec7b147dba98d42a04f523f
|
||||
F test/table.test 04ba066432430657712d167ebf28080fe878d305
|
||||
F test/table.test 50c47f5fe9c112e92723af27cd735e6c92de6f85
|
||||
F test/tableapi.test 2674633fa95d80da917571ebdd759a14d9819126
|
||||
F test/tclsqlite.test 1ce9b6340d6d412420634e129a2e3722c651056a
|
||||
F test/tclsqlite.test d5298750115768bca173da8043ffac2924be21a0
|
||||
F test/tempdb.test 19d0f66e2e3eeffd68661a11c83ba5e6ace9128c
|
||||
F test/temptable.test 1a21a597055dcf6002b6f1ee867632dccd6e925c
|
||||
F test/temptrigger.test b0273db072ce5f37cf19140ceb1f0d524bbe9f05
|
||||
F test/tester.tcl 3b6143fdafff36c516cf0fd663a20cd420aae36f
|
||||
F test/temptable.test 51edd31c65ed1560dd600b1796e8325df96318e2
|
||||
F test/temptrigger.test 26670ed7a39cf2296a7f0a9e0a1d7bdb7abe936d
|
||||
F test/tester.tcl 8db832ad03331dcae2f39b435feb2f789cd4e8d9
|
||||
F test/thread001.test a3e6a7254d1cb057836cb3145b60c10bf5b7e60f
|
||||
F test/thread002.test afd20095e6e845b405df4f2c920cb93301ca69db
|
||||
F test/thread003.test b824d4f52b870ae39fc5bae4d8070eca73085dca
|
||||
F test/thread002.test 716631b06cccf33b368ab7f6dd3cad92907b8928
|
||||
F test/thread003.test 33d2d46e6a53ccb2ff8dc4d0c4e3b3aaee36dcd1
|
||||
F test/thread004.test f51dfc3936184aaf73ee85f315224baad272a87f
|
||||
F test/thread005.test bf5c374ca65dd89fd56c8fe511ccfb46875bda5e
|
||||
F test/thread005.test 50d10b5684399676174bd96c94ad4250b1a2c8b6
|
||||
F test/thread1.test df115faa10a4ba1d456e9d4d9ec165016903eae4
|
||||
F test/thread2.test f35d2106452b77523b3a2b7d1dcde2e5ee8f9e46
|
||||
F test/thread_common.tcl 334639cadcb9f912bf82aa73f49efd5282e6cadd
|
||||
@@ -723,7 +726,7 @@ F test/threadtest2.c ace893054fa134af3fc8d6e7cfecddb8e3acefb9
|
||||
F test/threadtest3.c 0ed13e09690f6204d7455fac3b0e8ece490f6eef
|
||||
F test/tkt-02a8e81d44.test 58494de77be2cf249228ada3f313fa399821c6ab
|
||||
F test/tkt-26ff0c2d1e.test 888324e751512972c6e0d1a09df740d8f5aaf660
|
||||
F test/tkt-2d1a5c67d.test 73574c758502bf23260c17f97fcd9316dfb5a060
|
||||
F test/tkt-2d1a5c67d.test b028a811049eb472cb2d3a43fc8ce4f6894eebda
|
||||
F test/tkt-2ea2425d34.test 1cf13e6f75d149b3209a0cb32927a82d3d79fb28
|
||||
F test/tkt-31338dca7e.test 5741cd48de500347a437ba1be58c8335e83c5a5e
|
||||
F test/tkt-313723c356.test c47f8a9330523e6f35698bf4489bcb29609b53ac
|
||||
@@ -734,7 +737,7 @@ F test/tkt-4a03edc4c8.test 2865e4edbc075b954daa82f8da7cc973033ec76e
|
||||
F test/tkt-54844eea3f.test a12b851128f46a695e4e378cca67409b9b8f5894
|
||||
F test/tkt-5d863f876e.test 884072c2de496ddbb90c387c9ebc0d4f44a91b8e
|
||||
F test/tkt-5e10420e8d.test 904d1687b3c06d43e5b3555bbcf6802e7c0ffd84
|
||||
F test/tkt-5ee23731f.test 3581260f2a71e51db94e1506ba6b0f7311d002a9
|
||||
F test/tkt-5ee23731f.test 9db6e1d7209dc0794948b260d6f82b2b1de83a9f
|
||||
F test/tkt-752e1646fc.test ea78d88d14fe9866bdd991c634483334639e13bf
|
||||
F test/tkt-78e04e52ea.test ab52f0c1e2de6e46c910f4cc16b086bba05952b7
|
||||
F test/tkt-80ba201079.test a09684db1a0bd55b8838f606adccee456a51ddbf
|
||||
@@ -743,6 +746,7 @@ F test/tkt-8454a207b9.test c583a9f814a82a2b5ba95207f55001c9f0cd816c
|
||||
F test/tkt-91e2e8ba6f.test 08c4f94ae07696b05c9b822da0b4e5337a2f54c5
|
||||
F test/tkt-94c04eaadb.test be5ea61cb04dfdc047d19b5c5a9e75fa3da67a7f
|
||||
F test/tkt-9d68c883.test 458f7d82a523d7644b54b497c986378a7d8c8b67
|
||||
F test/tkt-b1d3a2e531.test 610ef582413171b379652663111b1f996d9f8f78
|
||||
F test/tkt-b351d95f9.test d14a503c414c5c58fdde3e80f9a3cfef986498c0
|
||||
F test/tkt-b72787b1.test e6b62b2b2785c04d0d698d6a603507e384165049
|
||||
F test/tkt-bd484a090c.test 60460bf946f79a79712b71f202eda501ca99b898
|
||||
@@ -750,7 +754,7 @@ F test/tkt-cbd054fa6b.test f14f97ea43662e6f70c9e63287081e8be5d9d589
|
||||
F test/tkt-d11f09d36e.test fb44f7961aa6d4b632fb7b9768239832210b5fc7
|
||||
F test/tkt-d635236375.test 9d37e988b47d87505bc9445be0ca447002df5d09
|
||||
F test/tkt-d82e3f3721.test 731359dfdcdb36fea0559cd33fec39dd0ceae8e6
|
||||
F test/tkt-f3e5abed55.test 19fb59268da6f20a69a181b9c14154132d1c65e3
|
||||
F test/tkt-f3e5abed55.test 669bb076f2ac573c7398ce00f40cd0ca502043a9
|
||||
F test/tkt-f777251dc7a.test 6f24c053bc5cdb7e1e19be9a72c8887cf41d5e87
|
||||
F test/tkt-f7b4edec.test d998a08ff2b18b7f62edce8e3044317c45efe6c7
|
||||
F test/tkt-f973c7ac31.test 1da0ed15ec2c7749fb5ce2828cd69d07153ad9f4
|
||||
@@ -767,8 +771,8 @@ F test/tkt1536.test 83ff7a7b6e248016f8d682d4f7a4ae114070d466
|
||||
F test/tkt1537.test e3a14332de9770be8ff14bd15c19a49cbec10808
|
||||
F test/tkt1567.test 18023cc3626a365f0118e17b66decedec93b1a6f
|
||||
F test/tkt1644.test 80b6a2bb17885f3cf1cb886d97cdad13232bb869
|
||||
F test/tkt1667.test 5d208e8d8cbcf82a446b315774290b66b464bc5f
|
||||
F test/tkt1873.test 255a002b9afdcf8b0fa3188984e2c964202340e9
|
||||
F test/tkt1667.test 4700d931ed19ea3983e8e703becb28079250b460
|
||||
F test/tkt1873.test 0e1b8c023050a430c2525179ed4022ddc7c31264
|
||||
F test/tkt2141.test f543d96f50d5a5dc0bc744f7db74ea166720ce46
|
||||
F test/tkt2192.test ff40157e5f42e65f844255d220fc6b290470942f
|
||||
F test/tkt2213.test a9702175601a57b61aba095a233b001d6f362474
|
||||
@@ -782,13 +786,13 @@ F test/tkt2450.test 77ed94863f2049c1420288ddfea2d41e5e0971d6
|
||||
F test/tkt2565.test 8be666e927cb207aae88188f31c331870878b650
|
||||
F test/tkt2640.test 28134f5d1e05658ef182520cf0b680fa3de5211b
|
||||
F test/tkt2643.test 3f3ebb743da00d4fed4fcf6daed92a0e18e57813
|
||||
F test/tkt2686.test 08f0f584461bc4990376936daa0a9bd3e6e81671
|
||||
F test/tkt2686.test 6ee01c9b9e9c48f6d3a1fdd553b1cc4258f903d6
|
||||
F test/tkt2767.test 569000d842678f9cf2db7e0d1b27cbc9011381b0
|
||||
F test/tkt2817.test 94646b604c7dbae7058782f6582c05e200700aa9
|
||||
F test/tkt2820.test 017fdee33aaef7abc092beab6088816f1942304b
|
||||
F test/tkt2817.test f31839e01f4243cff7399ef654d3af3558cb8d8d
|
||||
F test/tkt2820.test 39940276b3436d125deb7d8ebeee053e4cf13213
|
||||
F test/tkt2822.test a2b27a58df62d1b2e712f91dbe42ad3b7e0e77cc
|
||||
F test/tkt2832.test a9b0b74a02dca166a04d9e37739c414b10929caa
|
||||
F test/tkt2854.test b81dc3144901b123fe5674471adf5a47ca48a7c3
|
||||
F test/tkt2854.test e432965db29e27e16f539b2ba7f502eb2ccc49af
|
||||
F test/tkt2920.test a8737380e4ae6424e00c0273dc12775704efbebf
|
||||
F test/tkt2927.test 4752868b9eeeb07a217f7f19f4cbaac98d6d086d
|
||||
F test/tkt2942.test c5c87d179799ca6d1fbe83c815510b87cd5ec7ce
|
||||
@@ -804,7 +808,7 @@ F test/tkt3357.test 77c37c6482b526fe89941ce951c22d011f5922ed
|
||||
F test/tkt3419.test 1bbf36d7ea03b638c15804251287c2391f5c1f6b
|
||||
F test/tkt3424.test 61f831bd2b071bd128fa5d00fbda57e656ca5812
|
||||
F test/tkt3442.test 0adb70e9fe9cb750a702065a68ad647409dbc158
|
||||
F test/tkt3457.test edbf54b05cbe5165f00192becbd621038f1615e4
|
||||
F test/tkt3457.test eb68bb3b19c8677cff06c639ff15d206dbf17fd6
|
||||
F test/tkt3461.test 228ea328a5a21e8663f80ee3d212a6ad92549a19
|
||||
F test/tkt3493.test 1686cbde85f8721fc1bdc0ee72f2ef2f63139218
|
||||
F test/tkt3508.test d75704db9501625c7f7deec119fcaf1696aefb7d
|
||||
@@ -813,7 +817,7 @@ F test/tkt3527.test ee4af96183579565987e58873a7490bc04934ffb
|
||||
F test/tkt3541.test 5dc257bde9bc833ab9cc6844bf170b998dbb950a
|
||||
F test/tkt3554.test f599967f279077bace39220cbe76085c7b423725
|
||||
F test/tkt3581.test 1966b7193f1e3f14951cce8c66907ae69454e9a3
|
||||
F test/tkt35xx.test ed9721bd9eb1693b3b4d3cf2a093fa7f92af0c93
|
||||
F test/tkt35xx.test 69d038ce5898f1b64f2084b780bbab1cf9be0a25
|
||||
F test/tkt3630.test 929f64852103054125200bc825c316d5f75d42f7
|
||||
F test/tkt3718.test 3b59dcb5c4e7754dacd91e7fd353a61492cc402a
|
||||
F test/tkt3731.test 0c5f4cbffe102d43c3b2188af91a9e36348f974b
|
||||
@@ -844,19 +848,19 @@ F test/trace2.test 962175290996d5f06dc4402ca218bbfc7df4cb20
|
||||
F test/trans.test 6e1b4c6a42dba31bd65f8fa5e61a2708e08ddde6
|
||||
F test/trans2.test d5337e61de45e66b1fcbf9db833fa8c82e624b22
|
||||
F test/trans3.test d728abaa318ca364dc370e06576aa7e5fbed7e97
|
||||
F test/trigger1.test 2e18561f85e448bb633c9c9de792e9bbf7b2dd3e
|
||||
F test/trigger1.test 38c657eaf9907344c9e0bcb16af94a452c6babde
|
||||
F test/trigger2.test 834187beafd1db383af0c659cfa49b0576832816
|
||||
F test/trigger3.test d2c60d8be271c355d61727411e753181e877230a
|
||||
F test/trigger4.test 8e90ee98cba940cd5f96493f82e55083806ab8a0
|
||||
F test/trigger4.test 74700b76ebf3947b2f7a92405141eb2cf2a5d359
|
||||
F test/trigger5.test 619391a3e9fc194081d22cefd830d811e7badf83
|
||||
F test/trigger6.test 0e411654f122552da6590f0b4e6f781048a4a9b9
|
||||
F test/trigger7.test b39e6dee1debe0ff9c2ef66326668f149f07c9c4
|
||||
F test/trigger8.test 30cb0530bd7c4728055420e3f739aa00412eafa4
|
||||
F test/trigger9.test 5b0789f1c5c4600961f8e68511b825b87be53e31
|
||||
F test/triggerA.test eaf11a29db2a11967d2d4b49d37f92bce598194e
|
||||
F test/triggerA.test e0aaba16d3547193d36bbd82a1b0ed75e9c88d40
|
||||
F test/triggerB.test 56780c031b454abac2340dbb3b71ac5c56c3d7fe
|
||||
F test/triggerC.test 02c690febf608ae20b9af86184a9867f79855b1d
|
||||
F test/triggerD.test bfdac1143deee8fb12b6a3640d76e5669a567ff6
|
||||
F test/triggerC.test 4d4bdaf0230c206b50d350330107ef9802bc2d4f
|
||||
F test/triggerD.test 8e7f3921a92a5797d472732108109e44575fa650
|
||||
F test/tt3_checkpoint.c 415eccce672d681b297485fc20f44cdf0eac93af
|
||||
F test/types.test bf816ce73c7dfcfe26b700c19f97ef4050d194ff
|
||||
F test/types2.test 3555aacf8ed8dc883356e59efc314707e6247a84
|
||||
@@ -867,53 +871,53 @@ F test/unordered.test e81169ce2a8f31b2c6b66af691887e1376ab3ced
|
||||
F test/update.test 8bc86fd7ef1a00014f76dc6a6a7c974df4aef172
|
||||
F test/uri.test 53de9a2549cbda9c343223236918ef502f6a9051
|
||||
F test/utf16align.test 54cd35a27c005a9b6e7815d887718780b6a462ae
|
||||
F test/vacuum.test 29b60e8cc9e573b39676df6c4a75fe9e02d04a09
|
||||
F test/vacuum2.test 91a84c9b08adfc4472097d2e8deb0150214e0e76
|
||||
F test/vacuum3.test f39ad1428347c5808cd2da7578c470f186a4d0ce
|
||||
F test/vacuum.test 9516f3a8e49be666f2dde28561e4be5ae5612de0
|
||||
F test/vacuum2.test af432e6e3bfc0ea20a80cb86a03c7d9876d38324
|
||||
F test/vacuum3.test 77ecdd54592b45a0bcb133339f99f1ae0ae94d0d
|
||||
F test/vacuum4.test d3f8ecff345f166911568f397d2432c16d2867d9
|
||||
F test/varint.test ab7b110089a08b9926ed7390e7e97bdefeb74102
|
||||
F test/veryquick.test 7701bb609fe8bf6535514e8b849a309e8f00573b
|
||||
F test/view.test 45f518205ecdb6dd23a86dd4a99bb4ae945e625d
|
||||
F test/vtab1.test 7b79832824cbae37ff01a06ed155027f7c15bf9e
|
||||
F test/view.test b182a67ec43f490b156b5a710827a341be83dd17
|
||||
F test/vtab1.test b40b7e531dea8f0f7e78c76ff96eed103f58d015
|
||||
F test/vtab2.test 7bcffc050da5c68f4f312e49e443063e2d391c0d
|
||||
F test/vtab3.test baad99fd27217f5d6db10660522e0b7192446de1
|
||||
F test/vtab4.test 942f8b8280b3ea8a41dae20e7822d065ca1cb275
|
||||
F test/vtab5.test 889f444970393c73f1e077e2bdc5d845e157a391
|
||||
F test/vtab6.test c7f290d172609d636fbfc58166eadcb55d5c117c
|
||||
F test/vtab7.test a8c3c3cb3eb60be364991bd714e4927e26c4cd85
|
||||
F test/vtab7.test ae560ebea870ed04e9aa4177cc302f910faaabb5
|
||||
F test/vtab8.test e19fa4a538fcd1bb66c22825fa8f71618fb13583
|
||||
F test/vtab9.test ea58d2b95d61955f87226381716b2d0b1d4e4f9b
|
||||
F test/vtabA.test c86e1990b7e1e2bb34602a06fffa4c69f2b516dc
|
||||
F test/vtabB.test 04df5dc531b9f44d9ca65b9c1b79f12b5922a796
|
||||
F test/vtabC.test 1cf7896ab6859bfe3074244b2b0e12de5cbdd766
|
||||
F test/vtabC.test 4528f459a13136f982e75614d120aef165f17292
|
||||
F test/vtabD.test 74167b1578e5886fe4c886d6bef2fd1406444c42
|
||||
F test/vtabE.test 7c4693638d7797ce2eda17af74292b97e705cc61
|
||||
F test/vtabF.test fd5ad376f5a34fe0891df1f3cddb4fe7c3eb077e
|
||||
F test/vtab_alter.test 9e374885248f69e251bdaacf480b04a197f125e5
|
||||
F test/vtab_err.test 0d4d8eb4def1d053ac7c5050df3024fd47a3fbd8
|
||||
F test/vtab_shared.test 0eff9ce4f19facbe0a3e693f6c14b80711a4222d
|
||||
F test/wal.test 5617ad308bfdb8a8885220d8a261a6096a8d7e57
|
||||
F test/wal2.test aa0fb2314b3235be4503c06873e41ebfc0757782
|
||||
F test/wal3.test d512a5c8b4aa345722d11e8f1671db7eb15a0e39
|
||||
F test/wal4.test 3404b048fa5e10605facaf70384e6d2943412e30
|
||||
F test/wal.test e11da8d5ea8a38a247339455098357e9adf63d76
|
||||
F test/wal2.test ad6412596815f553cd30f271d291ab003092bc7e
|
||||
F test/wal3.test 18da4e65c30c43c646ad40e145e9a074e4062fc9
|
||||
F test/wal4.test 4744e155cd6299c6bd99d3eab1c82f77db9cdb3c
|
||||
F test/wal5.test 08e145a352b1223930c7f0a1de82a8747a99c322
|
||||
F test/wal6.test 2e3bc767d9c2ce35c47106148d43fcbd072a93b3
|
||||
F test/wal7.test 2ae8f427d240099cc4b2dfef63cff44e2a68a1bd
|
||||
F test/wal_common.tcl a98f17fba96206122eff624db0ab13ec377be4fe
|
||||
F test/walbak.test 4df1c7369da0301caeb9a48fa45997fd592380e4
|
||||
F test/walbak.test b9f68e39646375c2b877be906babcc15d38b4877
|
||||
F test/walbig.test e882bc1d014afffbfa2b6ba36e0f07d30a633ad0
|
||||
F test/walcksum.test a37b36375c595e61bdb7e1ec49b5f0979b6fc7ce
|
||||
F test/walcrash.test e763841551d6b23677ccb419797c1589dcbdbaf5
|
||||
F test/walcksum.test f5447800a157c9e2234fbb8e80243f0813941bde
|
||||
F test/walcrash.test 4fcb661faf71db91214156d52d43ee327f52bde1
|
||||
F test/walcrash2.test 019d60b89d96c1937adb2b30b850ac7e86e5a142
|
||||
F test/walfault.test 58fce626359c9376fe35101b5c0f2df8040aa839
|
||||
F test/walfault.test efb0d5724893133e71b8d9d90abdb781845a6bb0
|
||||
F test/walhook.test ed00a40ba7255da22d6b66433ab61fab16a63483
|
||||
F test/walmode.test 22ddccd073c817ac9ead62b88ac446e8dedc7d2c
|
||||
F test/walnoshm.test a074428046408f4eb5c6a00e09df8cc97ff93317
|
||||
F test/walmode.test 4022fe03ae6e830583672caa101f046438a0473c
|
||||
F test/walnoshm.test 84ca10c544632a756467336b7c3b864d493ee496
|
||||
F test/walpersist.test 45fb0c94fb63908e2d66b1d99ce4645bfce0fa1e
|
||||
F test/walro.test 2d5d69e2e99da19ce6faab340330234fc4ca0720
|
||||
F test/walshared.test 6dda2293880c300baf5d791c307f653094585761
|
||||
F test/walslow.test d21625e2e99e11c032ce949e8a94661576548933
|
||||
F test/walthread.test a25a393c068a2b42b44333fa3fdaae9072f1617c
|
||||
F test/walslow.test e7be6d9888f83aa5d3d3c7c08aa9b5c28b93609a
|
||||
F test/walthread.test a2ed5270eb695284d4ad27d252517bdc3317ee2a
|
||||
F test/where.test de337a3fe0a459ec7c93db16a519657a90552330
|
||||
F test/where2.test 43d4becaf5a5df854e6c21d624a1cb84c6904554
|
||||
F test/where3.test 8e1175c7ef710c70502858fc4fb08d784b3620b9
|
||||
@@ -927,10 +931,11 @@ F test/where9.test 24f19ad14bb1b831564ced5273e681e495662848
|
||||
F test/whereA.test 24c234263c8fe358f079d5e57d884fb569d2da0a
|
||||
F test/whereB.test 0def95db3bdec220a731c7e4bec5930327c1d8c5
|
||||
F test/wherelimit.test 5e9fd41e79bb2b2d588ed999d641d9c965619b31
|
||||
F test/win32lock.test e12fe40524705cde9a4f5af4668e811807807b84
|
||||
F test/win32lock.test b2a539e85ae6b2d78475e016a9636b4451dc7fb9
|
||||
F test/zeroblob.test caaecfb4f908f7bc086ed238668049f96774d688
|
||||
F tool/build-shell.sh 12aa4391073a777fcb6dcc490b219a018ae98bac
|
||||
F tool/diffdb.c 7524b1b5df217c20cd0431f6789851a4e0cb191b
|
||||
F tool/extract.c 054069d81b095fbdc189a6f5d4466e40380505e2
|
||||
F tool/fragck.tcl 5265a95126abcf6ab357f7efa544787e5963f439
|
||||
F tool/genfkey.README cf68fddd4643bbe3ff8e31b8b6d8b0a1b85e20f4
|
||||
F tool/genfkey.test 4196a8928b78f51d54ef58e99e99401ab2f0a7e5
|
||||
@@ -940,9 +945,10 @@ F tool/lempar.c 01ca97f87610d1dac6d8cd96ab109ab1130e76dc
|
||||
F tool/mkkeywordhash.c d2e6b4a5965e23afb80fbe74bb54648cd371f309
|
||||
F tool/mkopts.tcl 66ac10d240cc6e86abd37dc908d50382f84ff46e
|
||||
F tool/mkspeedsql.tcl a1a334d288f7adfe6e996f2e712becf076745c97
|
||||
F tool/mksqlite3c.tcl 1fa0ed9cfdc768bf5de7e65fda8d97a46dd2a7e6
|
||||
F tool/mksqlite3c.tcl 9fbac513cd9d5ac95ad55630f49bb16c5347ab75
|
||||
F tool/mksqlite3h.tcl 78013ad79a5e492e5f764f3c7a8ef834255061f8
|
||||
F tool/mksqlite3internalh.tcl 7b43894e21bcb1bb39e11547ce7e38a063357e87
|
||||
F tool/offsets.c fe4262fdfa378e8f5499a42136d17bf3b98f6091
|
||||
F tool/omittest.tcl 8086c014cbae90f1f2b564d59d05a5e4ac1783c9
|
||||
F tool/opcodeDoc.awk b3a2a3d5d3075b8bd90b7afe24283efdd586659c
|
||||
F tool/restore_jrnl.tcl 6957a34f8f1f0f8285e07536225ec3b292a9024a
|
||||
@@ -967,8 +973,8 @@ F tool/split-sqlite3c.tcl d9be87f1c340285a3e081eb19b4a247981ed290c
|
||||
F tool/symbols.sh caaf6ccc7300fd43353318b44524853e222557d5
|
||||
F tool/tostr.awk 11760e1b94a5d3dcd42378f3cc18544c06cfa576
|
||||
F tool/vdbe-compress.tcl d70ea6d8a19e3571d7ab8c9b75cba86d1173ff0f
|
||||
F tool/warnings.sh 2ebae31e1eb352696f3c2f7706a34c084b28c262
|
||||
P 62c446340475b52b843c0345eda32ebe86fa9159 a2135ad13049c170b33315a949b1544e6a136183
|
||||
R 734a54c8f931fe24e65682db655c7b9e
|
||||
F tool/warnings.sh b7fdb2cc525f5ef4fa43c80e771636dd3690f9d2
|
||||
P c5709036087b6b4fb6391ab7e4b4b870aac87a31 1dada5158215d1816edb69ff2610f9d2259ce19d
|
||||
R a4d0f9879dd116c25d083f8cdc0d0501
|
||||
U drh
|
||||
Z 34a261d71dea5b8394b2283d95dc3275
|
||||
Z 0ce927a650c1609d421fc43e47e08b7b
|
||||
|
||||
@@ -1 +1 @@
|
||||
c5709036087b6b4fb6391ab7e4b4b870aac87a31
|
||||
eb036d6f81e15bac013316bf5b1b2ba3e0bd4605
|
||||
180
src/backup.c
180
src/backup.c
@@ -410,102 +410,106 @@ int sqlite3_backup_step(sqlite3_backup *p, int nPage){
|
||||
** the case where the source and destination databases have the
|
||||
** same schema version.
|
||||
*/
|
||||
if( rc==SQLITE_DONE
|
||||
&& (rc = sqlite3BtreeUpdateMeta(p->pDest,1,p->iDestSchema+1))==SQLITE_OK
|
||||
){
|
||||
int nDestTruncate;
|
||||
|
||||
if( p->pDestDb ){
|
||||
sqlite3ResetInternalSchema(p->pDestDb, -1);
|
||||
}
|
||||
|
||||
/* Set nDestTruncate to the final number of pages in the destination
|
||||
** database. The complication here is that the destination page
|
||||
** size may be different to the source page size.
|
||||
**
|
||||
** If the source page size is smaller than the destination page size,
|
||||
** round up. In this case the call to sqlite3OsTruncate() below will
|
||||
** fix the size of the file. However it is important to call
|
||||
** sqlite3PagerTruncateImage() here so that any pages in the
|
||||
** destination file that lie beyond the nDestTruncate page mark are
|
||||
** journalled by PagerCommitPhaseOne() before they are destroyed
|
||||
** by the file truncation.
|
||||
*/
|
||||
assert( pgszSrc==sqlite3BtreeGetPageSize(p->pSrc) );
|
||||
assert( pgszDest==sqlite3BtreeGetPageSize(p->pDest) );
|
||||
if( pgszSrc<pgszDest ){
|
||||
int ratio = pgszDest/pgszSrc;
|
||||
nDestTruncate = (nSrcPage+ratio-1)/ratio;
|
||||
if( nDestTruncate==(int)PENDING_BYTE_PAGE(p->pDest->pBt) ){
|
||||
nDestTruncate--;
|
||||
if( rc==SQLITE_DONE ){
|
||||
rc = sqlite3BtreeUpdateMeta(p->pDest,1,p->iDestSchema+1);
|
||||
if( rc==SQLITE_OK ){
|
||||
if( p->pDestDb ){
|
||||
sqlite3ResetInternalSchema(p->pDestDb, -1);
|
||||
}
|
||||
if( destMode==PAGER_JOURNALMODE_WAL ){
|
||||
rc = sqlite3BtreeSetVersion(p->pDest, 2);
|
||||
}
|
||||
}else{
|
||||
nDestTruncate = nSrcPage * (pgszSrc/pgszDest);
|
||||
}
|
||||
sqlite3PagerTruncateImage(pDestPager, nDestTruncate);
|
||||
|
||||
if( pgszSrc<pgszDest ){
|
||||
/* If the source page-size is smaller than the destination page-size,
|
||||
** two extra things may need to happen:
|
||||
if( rc==SQLITE_OK ){
|
||||
int nDestTruncate;
|
||||
/* Set nDestTruncate to the final number of pages in the destination
|
||||
** database. The complication here is that the destination page
|
||||
** size may be different to the source page size.
|
||||
**
|
||||
** * The destination may need to be truncated, and
|
||||
**
|
||||
** * Data stored on the pages immediately following the
|
||||
** pending-byte page in the source database may need to be
|
||||
** copied into the destination database.
|
||||
** If the source page size is smaller than the destination page size,
|
||||
** round up. In this case the call to sqlite3OsTruncate() below will
|
||||
** fix the size of the file. However it is important to call
|
||||
** sqlite3PagerTruncateImage() here so that any pages in the
|
||||
** destination file that lie beyond the nDestTruncate page mark are
|
||||
** journalled by PagerCommitPhaseOne() before they are destroyed
|
||||
** by the file truncation.
|
||||
*/
|
||||
const i64 iSize = (i64)pgszSrc * (i64)nSrcPage;
|
||||
sqlite3_file * const pFile = sqlite3PagerFile(pDestPager);
|
||||
i64 iOff;
|
||||
i64 iEnd;
|
||||
|
||||
assert( pFile );
|
||||
assert( (i64)nDestTruncate*(i64)pgszDest >= iSize || (
|
||||
nDestTruncate==(int)(PENDING_BYTE_PAGE(p->pDest->pBt)-1)
|
||||
&& iSize>=PENDING_BYTE && iSize<=PENDING_BYTE+pgszDest
|
||||
));
|
||||
|
||||
/* This call ensures that all data required to recreate the original
|
||||
** database has been stored in the journal for pDestPager and the
|
||||
** journal synced to disk. So at this point we may safely modify
|
||||
** the database file in any way, knowing that if a power failure
|
||||
** occurs, the original database will be reconstructed from the
|
||||
** journal file. */
|
||||
rc = sqlite3PagerCommitPhaseOne(pDestPager, 0, 1);
|
||||
|
||||
/* Write the extra pages and truncate the database file as required. */
|
||||
iEnd = MIN(PENDING_BYTE + pgszDest, iSize);
|
||||
for(
|
||||
iOff=PENDING_BYTE+pgszSrc;
|
||||
rc==SQLITE_OK && iOff<iEnd;
|
||||
iOff+=pgszSrc
|
||||
){
|
||||
PgHdr *pSrcPg = 0;
|
||||
const Pgno iSrcPg = (Pgno)((iOff/pgszSrc)+1);
|
||||
rc = sqlite3PagerGet(pSrcPager, iSrcPg, &pSrcPg);
|
||||
if( rc==SQLITE_OK ){
|
||||
u8 *zData = sqlite3PagerGetData(pSrcPg);
|
||||
rc = sqlite3OsWrite(pFile, zData, pgszSrc, iOff);
|
||||
assert( pgszSrc==sqlite3BtreeGetPageSize(p->pSrc) );
|
||||
assert( pgszDest==sqlite3BtreeGetPageSize(p->pDest) );
|
||||
if( pgszSrc<pgszDest ){
|
||||
int ratio = pgszDest/pgszSrc;
|
||||
nDestTruncate = (nSrcPage+ratio-1)/ratio;
|
||||
if( nDestTruncate==(int)PENDING_BYTE_PAGE(p->pDest->pBt) ){
|
||||
nDestTruncate--;
|
||||
}
|
||||
sqlite3PagerUnref(pSrcPg);
|
||||
}
|
||||
if( rc==SQLITE_OK ){
|
||||
rc = backupTruncateFile(pFile, iSize);
|
||||
}else{
|
||||
nDestTruncate = nSrcPage * (pgszSrc/pgszDest);
|
||||
}
|
||||
sqlite3PagerTruncateImage(pDestPager, nDestTruncate);
|
||||
|
||||
/* Sync the database file to disk. */
|
||||
if( rc==SQLITE_OK ){
|
||||
rc = sqlite3PagerSync(pDestPager);
|
||||
if( pgszSrc<pgszDest ){
|
||||
/* If the source page-size is smaller than the destination page-size,
|
||||
** two extra things may need to happen:
|
||||
**
|
||||
** * The destination may need to be truncated, and
|
||||
**
|
||||
** * Data stored on the pages immediately following the
|
||||
** pending-byte page in the source database may need to be
|
||||
** copied into the destination database.
|
||||
*/
|
||||
const i64 iSize = (i64)pgszSrc * (i64)nSrcPage;
|
||||
sqlite3_file * const pFile = sqlite3PagerFile(pDestPager);
|
||||
i64 iOff;
|
||||
i64 iEnd;
|
||||
|
||||
assert( pFile );
|
||||
assert( (i64)nDestTruncate*(i64)pgszDest >= iSize || (
|
||||
nDestTruncate==(int)(PENDING_BYTE_PAGE(p->pDest->pBt)-1)
|
||||
&& iSize>=PENDING_BYTE && iSize<=PENDING_BYTE+pgszDest
|
||||
));
|
||||
|
||||
/* This call ensures that all data required to recreate the original
|
||||
** database has been stored in the journal for pDestPager and the
|
||||
** journal synced to disk. So at this point we may safely modify
|
||||
** the database file in any way, knowing that if a power failure
|
||||
** occurs, the original database will be reconstructed from the
|
||||
** journal file. */
|
||||
rc = sqlite3PagerCommitPhaseOne(pDestPager, 0, 1);
|
||||
|
||||
/* Write the extra pages and truncate the database file as required */
|
||||
iEnd = MIN(PENDING_BYTE + pgszDest, iSize);
|
||||
for(
|
||||
iOff=PENDING_BYTE+pgszSrc;
|
||||
rc==SQLITE_OK && iOff<iEnd;
|
||||
iOff+=pgszSrc
|
||||
){
|
||||
PgHdr *pSrcPg = 0;
|
||||
const Pgno iSrcPg = (Pgno)((iOff/pgszSrc)+1);
|
||||
rc = sqlite3PagerGet(pSrcPager, iSrcPg, &pSrcPg);
|
||||
if( rc==SQLITE_OK ){
|
||||
u8 *zData = sqlite3PagerGetData(pSrcPg);
|
||||
rc = sqlite3OsWrite(pFile, zData, pgszSrc, iOff);
|
||||
}
|
||||
sqlite3PagerUnref(pSrcPg);
|
||||
}
|
||||
if( rc==SQLITE_OK ){
|
||||
rc = backupTruncateFile(pFile, iSize);
|
||||
}
|
||||
|
||||
/* Sync the database file to disk. */
|
||||
if( rc==SQLITE_OK ){
|
||||
rc = sqlite3PagerSync(pDestPager);
|
||||
}
|
||||
}else{
|
||||
rc = sqlite3PagerCommitPhaseOne(pDestPager, 0, 0);
|
||||
}
|
||||
|
||||
/* Finish committing the transaction to the destination database. */
|
||||
if( SQLITE_OK==rc
|
||||
&& SQLITE_OK==(rc = sqlite3BtreeCommitPhaseTwo(p->pDest, 0))
|
||||
){
|
||||
rc = SQLITE_DONE;
|
||||
}
|
||||
}else{
|
||||
rc = sqlite3PagerCommitPhaseOne(pDestPager, 0, 0);
|
||||
}
|
||||
|
||||
/* Finish committing the transaction to the destination database. */
|
||||
if( SQLITE_OK==rc
|
||||
&& SQLITE_OK==(rc = sqlite3BtreeCommitPhaseTwo(p->pDest, 0))
|
||||
){
|
||||
rc = SQLITE_DONE;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
21
src/btree.c
21
src/btree.c
@@ -1734,11 +1734,22 @@ int sqlite3BtreeOpen(
|
||||
/* A BTREE_SINGLE database is always a temporary and/or ephemeral */
|
||||
assert( (flags & BTREE_SINGLE)==0 || isTempDb );
|
||||
|
||||
/* The BTREE_SORTER flag is only used if SQLITE_OMIT_MERGE_SORT is undef */
|
||||
#ifdef SQLITE_OMIT_MERGE_SORT
|
||||
assert( (flags & BTREE_SORTER)==0 );
|
||||
#endif
|
||||
|
||||
/* BTREE_SORTER is always on a BTREE_SINGLE, BTREE_OMIT_JOURNAL */
|
||||
assert( (flags & BTREE_SORTER)==0 ||
|
||||
(flags & (BTREE_SINGLE|BTREE_OMIT_JOURNAL))
|
||||
==(BTREE_SINGLE|BTREE_OMIT_JOURNAL) );
|
||||
|
||||
if( db->flags & SQLITE_NoReadlock ){
|
||||
flags |= BTREE_NO_READLOCK;
|
||||
}
|
||||
if( isMemdb ){
|
||||
flags |= BTREE_MEMORY;
|
||||
flags &= ~BTREE_SORTER;
|
||||
}
|
||||
if( (vfsFlags & SQLITE_OPEN_MAIN_DB)!=0 && (isMemdb || isTempDb) ){
|
||||
vfsFlags = (vfsFlags & ~SQLITE_OPEN_MAIN_DB) | SQLITE_OPEN_TEMP_DB;
|
||||
@@ -7277,9 +7288,16 @@ static int btreeDropTable(Btree *p, Pgno iTable, int *piMoved){
|
||||
return rc;
|
||||
}
|
||||
int sqlite3BtreeDropTable(Btree *p, int iTable, int *piMoved){
|
||||
BtShared *pBt = p->pBt;
|
||||
int rc;
|
||||
sqlite3BtreeEnter(p);
|
||||
rc = btreeDropTable(p, iTable, piMoved);
|
||||
if( (pBt->openFlags&BTREE_SINGLE) ){
|
||||
pBt->nPage = 0;
|
||||
sqlite3PagerTruncateImage(pBt->pPager, 1);
|
||||
rc = newDatabase(pBt);
|
||||
}else{
|
||||
rc = btreeDropTable(p, iTable, piMoved);
|
||||
}
|
||||
sqlite3BtreeLeave(p);
|
||||
return rc;
|
||||
}
|
||||
@@ -8142,7 +8160,6 @@ int sqlite3BtreeSetVersion(Btree *pBtree, int iVersion){
|
||||
BtShared *pBt = pBtree->pBt;
|
||||
int rc; /* Return code */
|
||||
|
||||
assert( pBtree->inTrans==TRANS_NONE );
|
||||
assert( iVersion==1 || iVersion==2 );
|
||||
|
||||
/* If setting the version fields to 1, do not automatically open the
|
||||
|
||||
@@ -61,6 +61,7 @@ int sqlite3BtreeOpen(
|
||||
#define BTREE_MEMORY 4 /* This is an in-memory DB */
|
||||
#define BTREE_SINGLE 8 /* The file contains at most 1 b-tree */
|
||||
#define BTREE_UNORDERED 16 /* Use of a hash implementation is OK */
|
||||
#define BTREE_SORTER 32 /* Used as accumulator in external merge sort */
|
||||
|
||||
int sqlite3BtreeClose(Btree*);
|
||||
int sqlite3BtreeSetCacheSize(Btree*,int);
|
||||
|
||||
82
src/build.c
82
src/build.c
@@ -1674,7 +1674,7 @@ void sqlite3CreateView(
|
||||
const char *z;
|
||||
Token sEnd;
|
||||
DbFixer sFix;
|
||||
Token *pName;
|
||||
Token *pName = 0;
|
||||
int iDb;
|
||||
sqlite3 *db = pParse->db;
|
||||
|
||||
@@ -1980,6 +1980,29 @@ static void destroyTable(Parse *pParse, Table *pTab){
|
||||
#endif
|
||||
}
|
||||
|
||||
/*
|
||||
** Remove entries from the sqlite_stat1 and sqlite_stat2 tables
|
||||
** after a DROP INDEX or DROP TABLE command.
|
||||
*/
|
||||
static void sqlite3ClearStatTables(
|
||||
Parse *pParse, /* The parsing context */
|
||||
int iDb, /* The database number */
|
||||
const char *zType, /* "idx" or "tbl" */
|
||||
const char *zName /* Name of index or table */
|
||||
){
|
||||
static const char *azStatTab[] = { "sqlite_stat1", "sqlite_stat2" };
|
||||
int i;
|
||||
const char *zDbName = pParse->db->aDb[iDb].zName;
|
||||
for(i=0; i<ArraySize(azStatTab); i++){
|
||||
if( sqlite3FindTable(pParse->db, azStatTab[i], zDbName) ){
|
||||
sqlite3NestedParse(pParse,
|
||||
"DELETE FROM %Q.%s WHERE %s=%Q",
|
||||
zDbName, azStatTab[i], zType, zName
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
** This routine is called to do the work of a DROP TABLE statement.
|
||||
** pName is the name of the table to be dropped.
|
||||
@@ -2119,14 +2142,7 @@ void sqlite3DropTable(Parse *pParse, SrcList *pName, int isView, int noErr){
|
||||
sqlite3NestedParse(pParse,
|
||||
"DELETE FROM %Q.%s WHERE tbl_name=%Q and type!='trigger'",
|
||||
pDb->zName, SCHEMA_TABLE(iDb), pTab->zName);
|
||||
|
||||
/* Drop any statistics from the sqlite_stat1 table, if it exists */
|
||||
if( sqlite3FindTable(db, "sqlite_stat1", db->aDb[iDb].zName) ){
|
||||
sqlite3NestedParse(pParse,
|
||||
"DELETE FROM %Q.sqlite_stat1 WHERE tbl=%Q", pDb->zName, pTab->zName
|
||||
);
|
||||
}
|
||||
|
||||
sqlite3ClearStatTables(pParse, iDb, "tbl", pTab->zName);
|
||||
if( !isView && !IsVirtual(pTab) ){
|
||||
destroyTable(pParse, pTab);
|
||||
}
|
||||
@@ -2308,6 +2324,7 @@ static void sqlite3RefillIndex(Parse *pParse, Index *pIndex, int memRootPage){
|
||||
Table *pTab = pIndex->pTable; /* The table that is indexed */
|
||||
int iTab = pParse->nTab++; /* Btree cursor used for pTab */
|
||||
int iIdx = pParse->nTab++; /* Btree cursor used for pIndex */
|
||||
int iSorter = iTab; /* Cursor opened by OpenSorter (if in use) */
|
||||
int addr1; /* Address of top of loop */
|
||||
int tnum; /* Root page of index */
|
||||
Vdbe *v; /* Generate code into this virtual machine */
|
||||
@@ -2317,6 +2334,15 @@ static void sqlite3RefillIndex(Parse *pParse, Index *pIndex, int memRootPage){
|
||||
sqlite3 *db = pParse->db; /* The database connection */
|
||||
int iDb = sqlite3SchemaToIndex(db, pIndex->pSchema);
|
||||
|
||||
/* Set bUseSorter to use OP_OpenSorter, or clear it to insert directly
|
||||
** into the index. The sorter is used unless either OMIT_MERGE_SORT is
|
||||
** defined or the system is configured to store temp files in-memory. */
|
||||
#ifdef SQLITE_OMIT_MERGE_SORT
|
||||
static const int bUseSorter = 0;
|
||||
#else
|
||||
const int bUseSorter = !sqlite3TempInMemory(pParse->db);
|
||||
#endif
|
||||
|
||||
#ifndef SQLITE_OMIT_AUTHORIZATION
|
||||
if( sqlite3AuthCheck(pParse, SQLITE_REINDEX, pIndex->zName, 0,
|
||||
db->aDb[iDb].zName ) ){
|
||||
@@ -2341,10 +2367,29 @@ static void sqlite3RefillIndex(Parse *pParse, Index *pIndex, int memRootPage){
|
||||
if( memRootPage>=0 ){
|
||||
sqlite3VdbeChangeP5(v, 1);
|
||||
}
|
||||
|
||||
/* Open the sorter cursor if we are to use one. */
|
||||
if( bUseSorter ){
|
||||
iSorter = pParse->nTab++;
|
||||
sqlite3VdbeAddOp4(v, OP_OpenSorter, iSorter, 0, 0, (char*)pKey, P4_KEYINFO);
|
||||
sqlite3VdbeChangeP5(v, BTREE_SORTER);
|
||||
}
|
||||
|
||||
/* Open the table. Loop through all rows of the table, inserting index
|
||||
** records into the sorter. */
|
||||
sqlite3OpenTable(pParse, iTab, iDb, pTab, OP_OpenRead);
|
||||
addr1 = sqlite3VdbeAddOp2(v, OP_Rewind, iTab, 0);
|
||||
regRecord = sqlite3GetTempReg(pParse);
|
||||
regIdxKey = sqlite3GenerateIndexKey(pParse, pIndex, iTab, regRecord, 1);
|
||||
|
||||
if( bUseSorter ){
|
||||
sqlite3VdbeAddOp2(v, OP_IdxInsert, iSorter, regRecord);
|
||||
sqlite3VdbeAddOp2(v, OP_Next, iTab, addr1+1);
|
||||
sqlite3VdbeJumpHere(v, addr1);
|
||||
addr1 = sqlite3VdbeAddOp2(v, OP_Sort, iSorter, 0);
|
||||
sqlite3VdbeAddOp2(v, OP_RowKey, iSorter, regRecord);
|
||||
}
|
||||
|
||||
if( pIndex->onError!=OE_None ){
|
||||
const int regRowid = regIdxKey + pIndex->nColumn;
|
||||
const int j2 = sqlite3VdbeCurrentAddr(v) + 2;
|
||||
@@ -2363,13 +2408,15 @@ static void sqlite3RefillIndex(Parse *pParse, Index *pIndex, int memRootPage){
|
||||
sqlite3HaltConstraint(
|
||||
pParse, OE_Abort, "indexed columns are not unique", P4_STATIC);
|
||||
}
|
||||
sqlite3VdbeAddOp2(v, OP_IdxInsert, iIdx, regRecord);
|
||||
sqlite3VdbeAddOp3(v, OP_IdxInsert, iIdx, regRecord, bUseSorter);
|
||||
sqlite3VdbeChangeP5(v, OPFLAG_USESEEKRESULT);
|
||||
sqlite3ReleaseTempReg(pParse, regRecord);
|
||||
sqlite3VdbeAddOp2(v, OP_Next, iTab, addr1+1);
|
||||
sqlite3VdbeAddOp2(v, OP_Next, iSorter, addr1+1);
|
||||
sqlite3VdbeJumpHere(v, addr1);
|
||||
|
||||
sqlite3VdbeAddOp1(v, OP_Close, iTab);
|
||||
sqlite3VdbeAddOp1(v, OP_Close, iIdx);
|
||||
sqlite3VdbeAddOp1(v, OP_Close, iSorter);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -2949,15 +2996,9 @@ void sqlite3DropIndex(Parse *pParse, SrcList *pName, int ifExists){
|
||||
sqlite3BeginWriteOperation(pParse, 1, iDb);
|
||||
sqlite3NestedParse(pParse,
|
||||
"DELETE FROM %Q.%s WHERE name=%Q AND type='index'",
|
||||
db->aDb[iDb].zName, SCHEMA_TABLE(iDb),
|
||||
pIndex->zName
|
||||
db->aDb[iDb].zName, SCHEMA_TABLE(iDb), pIndex->zName
|
||||
);
|
||||
if( sqlite3FindTable(db, "sqlite_stat1", db->aDb[iDb].zName) ){
|
||||
sqlite3NestedParse(pParse,
|
||||
"DELETE FROM %Q.sqlite_stat1 WHERE idx=%Q",
|
||||
db->aDb[iDb].zName, pIndex->zName
|
||||
);
|
||||
}
|
||||
sqlite3ClearStatTables(pParse, iDb, "idx", pIndex->zName);
|
||||
sqlite3ChangeCookie(pParse, iDb);
|
||||
destroyRootPage(pParse, pIndex->tnum, iDb);
|
||||
sqlite3VdbeAddOp4(v, OP_DropIndex, iDb, 0, 0, pIndex->zName, 0);
|
||||
@@ -3329,8 +3370,9 @@ void sqlite3SrcListIndexedBy(Parse *pParse, SrcList *p, Token *pIndexedBy){
|
||||
** operator with A. This routine shifts that operator over to B.
|
||||
*/
|
||||
void sqlite3SrcListShiftJoinType(SrcList *p){
|
||||
if( p && p->a ){
|
||||
if( p ){
|
||||
int i;
|
||||
assert( p->a || p->nSrc==0 );
|
||||
for(i=p->nSrc-1; i>0; i--){
|
||||
p->a[i].jointype = p->a[i-1].jointype;
|
||||
}
|
||||
|
||||
@@ -257,6 +257,9 @@ static const char * const azCompileOpt[] = {
|
||||
#ifdef SQLITE_OMIT_MEMORYDB
|
||||
"OMIT_MEMORYDB",
|
||||
#endif
|
||||
#ifdef SQLITE_OMIT_MERGE_SORT
|
||||
"OMIT_MERGE_SORT",
|
||||
#endif
|
||||
#ifdef SQLITE_OMIT_OR_OPTIMIZATION
|
||||
"OMIT_OR_OPTIMIZATION",
|
||||
#endif
|
||||
@@ -323,6 +326,9 @@ static const char * const azCompileOpt[] = {
|
||||
#ifdef SQLITE_OMIT_XFER_OPT
|
||||
"OMIT_XFER_OPT",
|
||||
#endif
|
||||
#ifdef SQLITE_PAGECACHE_BLOCKALLOC
|
||||
"PAGECACHE_BLOCKALLOC",
|
||||
#endif
|
||||
#ifdef SQLITE_PERFORMANCE_TRACE
|
||||
"PERFORMANCE_TRACE",
|
||||
#endif
|
||||
|
||||
17
src/fkey.c
17
src/fkey.c
@@ -734,7 +734,24 @@ void sqlite3FkCheck(
|
||||
pTo = sqlite3LocateTable(pParse, 0, pFKey->zTo, zDb);
|
||||
}
|
||||
if( !pTo || locateFkeyIndex(pParse, pTo, pFKey, &pIdx, &aiFree) ){
|
||||
assert( isIgnoreErrors==0 || (regOld!=0 && regNew==0) );
|
||||
if( !isIgnoreErrors || db->mallocFailed ) return;
|
||||
if( pTo==0 ){
|
||||
/* If isIgnoreErrors is true, then a table is being dropped. In this
|
||||
** case SQLite runs a "DELETE FROM xxx" on the table being dropped
|
||||
** before actually dropping it in order to check FK constraints.
|
||||
** If the parent table of an FK constraint on the current table is
|
||||
** missing, behave as if it is empty. i.e. decrement the relevant
|
||||
** FK counter for each row of the current table with non-NULL keys.
|
||||
*/
|
||||
Vdbe *v = sqlite3GetVdbe(pParse);
|
||||
int iJump = sqlite3VdbeCurrentAddr(v) + pFKey->nCol + 1;
|
||||
for(i=0; i<pFKey->nCol; i++){
|
||||
int iReg = pFKey->aCol[i].iFrom + regOld + 1;
|
||||
sqlite3VdbeAddOp2(v, OP_IsNull, iReg, iJump);
|
||||
}
|
||||
sqlite3VdbeAddOp2(v, OP_FkCounter, pFKey->isDeferred, -1);
|
||||
}
|
||||
continue;
|
||||
}
|
||||
assert( pFKey->nCol==1 || (aiFree && pIdx) );
|
||||
|
||||
10
src/main.c
10
src/main.c
@@ -234,6 +234,16 @@ int sqlite3_initialize(void){
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/* Do extra initialization steps requested by the SQLITE_EXTRA_INIT
|
||||
** compile-time option.
|
||||
*/
|
||||
#ifdef SQLITE_EXTRA_INIT
|
||||
if( rc==SQLITE_OK && sqlite3GlobalConfig.isInit ){
|
||||
int SQLITE_EXTRA_INIT(void);
|
||||
rc = SQLITE_EXTRA_INIT();
|
||||
}
|
||||
#endif
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
||||
|
||||
213
src/os_unix.c
213
src/os_unix.c
@@ -208,7 +208,6 @@ struct unixFile {
|
||||
sqlite3_io_methods const *pMethod; /* Always the first entry */
|
||||
unixInodeInfo *pInode; /* Info about locks on this inode */
|
||||
int h; /* The file descriptor */
|
||||
int dirfd; /* File descriptor for the directory */
|
||||
unsigned char eFileLock; /* The type of lock held on this fd */
|
||||
unsigned char ctrlFlags; /* Behavioral bits. UNIXFILE_* flags */
|
||||
int lastErrno; /* The unix errno from last I/O error */
|
||||
@@ -253,6 +252,11 @@ struct unixFile {
|
||||
#define UNIXFILE_EXCL 0x01 /* Connections from one process only */
|
||||
#define UNIXFILE_RDONLY 0x02 /* Connection is read only */
|
||||
#define UNIXFILE_PERSIST_WAL 0x04 /* Persistent WAL mode */
|
||||
#ifndef SQLITE_DISABLE_DIRSYNC
|
||||
# define UNIXFILE_DIRSYNC 0x08 /* Directory sync needed */
|
||||
#else
|
||||
# define UNIXFILE_DIRSYNC 0x00
|
||||
#endif
|
||||
|
||||
/*
|
||||
** Include code that is common to all os_*.c files
|
||||
@@ -298,6 +302,9 @@ static int posixOpen(const char *zFile, int flags, int mode){
|
||||
return open(zFile, flags, mode);
|
||||
}
|
||||
|
||||
/* Forward reference */
|
||||
static int openDirectory(const char*, int*);
|
||||
|
||||
/*
|
||||
** Many system calls are accessed through pointer-to-functions so that
|
||||
** they may be overridden at runtime to facilitate fault injection during
|
||||
@@ -394,6 +401,12 @@ static struct unix_syscall {
|
||||
#endif
|
||||
#define osFallocate ((int(*)(int,off_t,off_t))aSyscall[15].pCurrent)
|
||||
|
||||
{ "unlink", (sqlite3_syscall_ptr)unlink, 0 },
|
||||
#define osUnlink ((int(*)(const char*))aSyscall[16].pCurrent)
|
||||
|
||||
{ "openDirectory", (sqlite3_syscall_ptr)openDirectory, 0 },
|
||||
#define osOpenDirectory ((int(*)(const char*,int*))aSyscall[17].pCurrent)
|
||||
|
||||
}; /* End of the overrideable system calls */
|
||||
|
||||
/*
|
||||
@@ -1750,10 +1763,6 @@ static int unixUnlock(sqlite3_file *id, int eFileLock){
|
||||
*/
|
||||
static int closeUnixFile(sqlite3_file *id){
|
||||
unixFile *pFile = (unixFile*)id;
|
||||
if( pFile->dirfd>=0 ){
|
||||
robust_close(pFile, pFile->dirfd, __LINE__);
|
||||
pFile->dirfd=-1;
|
||||
}
|
||||
if( pFile->h>=0 ){
|
||||
robust_close(pFile, pFile->h, __LINE__);
|
||||
pFile->h = -1;
|
||||
@@ -1761,7 +1770,7 @@ static int closeUnixFile(sqlite3_file *id){
|
||||
#if OS_VXWORKS
|
||||
if( pFile->pId ){
|
||||
if( pFile->isDelete ){
|
||||
unlink(pFile->pId->zCanonicalName);
|
||||
osUnlink(pFile->pId->zCanonicalName);
|
||||
}
|
||||
vxworksReleaseFileId(pFile->pId);
|
||||
pFile->pId = 0;
|
||||
@@ -2010,7 +2019,7 @@ static int dotlockUnlock(sqlite3_file *id, int eFileLock) {
|
||||
|
||||
/* To fully unlock the database, delete the lock file */
|
||||
assert( eFileLock==NO_LOCK );
|
||||
if( unlink(zLockFile) ){
|
||||
if( osUnlink(zLockFile) ){
|
||||
int rc = 0;
|
||||
int tErrno = errno;
|
||||
if( ENOENT != tErrno ){
|
||||
@@ -3034,17 +3043,19 @@ static int seekAndWrite(unixFile *id, i64 offset, const void *pBuf, int cnt){
|
||||
#elif defined(USE_PREAD64)
|
||||
do{ got = osPwrite64(id->h, pBuf, cnt, offset);}while( got<0 && errno==EINTR);
|
||||
#else
|
||||
newOffset = lseek(id->h, offset, SEEK_SET);
|
||||
SimulateIOError( newOffset-- );
|
||||
if( newOffset!=offset ){
|
||||
if( newOffset == -1 ){
|
||||
((unixFile*)id)->lastErrno = errno;
|
||||
}else{
|
||||
((unixFile*)id)->lastErrno = 0;
|
||||
do{
|
||||
newOffset = lseek(id->h, offset, SEEK_SET);
|
||||
SimulateIOError( newOffset-- );
|
||||
if( newOffset!=offset ){
|
||||
if( newOffset == -1 ){
|
||||
((unixFile*)id)->lastErrno = errno;
|
||||
}else{
|
||||
((unixFile*)id)->lastErrno = 0;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
do{ got = osWrite(id->h, pBuf, cnt); }while( got<0 && errno==EINTR );
|
||||
got = osWrite(id->h, pBuf, cnt);
|
||||
}while( got<0 && errno==EINTR );
|
||||
#endif
|
||||
TIMER_END;
|
||||
if( got<0 ){
|
||||
@@ -3246,6 +3257,50 @@ static int full_fsync(int fd, int fullSync, int dataOnly){
|
||||
return rc;
|
||||
}
|
||||
|
||||
/*
|
||||
** Open a file descriptor to the directory containing file zFilename.
|
||||
** If successful, *pFd is set to the opened file descriptor and
|
||||
** SQLITE_OK is returned. If an error occurs, either SQLITE_NOMEM
|
||||
** or SQLITE_CANTOPEN is returned and *pFd is set to an undefined
|
||||
** value.
|
||||
**
|
||||
** The directory file descriptor is used for only one thing - to
|
||||
** fsync() a directory to make sure file creation and deletion events
|
||||
** are flushed to disk. Such fsyncs are not needed on newer
|
||||
** journaling filesystems, but are required on older filesystems.
|
||||
**
|
||||
** This routine can be overridden using the xSetSysCall interface.
|
||||
** The ability to override this routine was added in support of the
|
||||
** chromium sandbox. Opening a directory is a security risk (we are
|
||||
** told) so making it overrideable allows the chromium sandbox to
|
||||
** replace this routine with a harmless no-op. To make this routine
|
||||
** a no-op, replace it with a stub that returns SQLITE_OK but leaves
|
||||
** *pFd set to a negative number.
|
||||
**
|
||||
** If SQLITE_OK is returned, the caller is responsible for closing
|
||||
** the file descriptor *pFd using close().
|
||||
*/
|
||||
static int openDirectory(const char *zFilename, int *pFd){
|
||||
int ii;
|
||||
int fd = -1;
|
||||
char zDirname[MAX_PATHNAME+1];
|
||||
|
||||
sqlite3_snprintf(MAX_PATHNAME, zDirname, "%s", zFilename);
|
||||
for(ii=(int)strlen(zDirname); ii>1 && zDirname[ii]!='/'; ii--);
|
||||
if( ii>0 ){
|
||||
zDirname[ii] = '\0';
|
||||
fd = robust_open(zDirname, O_RDONLY|O_BINARY, 0);
|
||||
if( fd>=0 ){
|
||||
#ifdef FD_CLOEXEC
|
||||
osFcntl(fd, F_SETFD, osFcntl(fd, F_GETFD, 0) | FD_CLOEXEC);
|
||||
#endif
|
||||
OSTRACE(("OPENDIR %-3d %s\n", fd, zDirname));
|
||||
}
|
||||
}
|
||||
*pFd = fd;
|
||||
return (fd>=0?SQLITE_OK:unixLogError(SQLITE_CANTOPEN_BKPT, "open", zDirname));
|
||||
}
|
||||
|
||||
/*
|
||||
** Make sure all writes to a particular file are committed to disk.
|
||||
**
|
||||
@@ -3286,28 +3341,23 @@ static int unixSync(sqlite3_file *id, int flags){
|
||||
pFile->lastErrno = errno;
|
||||
return unixLogError(SQLITE_IOERR_FSYNC, "full_fsync", pFile->zPath);
|
||||
}
|
||||
if( pFile->dirfd>=0 ){
|
||||
OSTRACE(("DIRSYNC %-3d (have_fullfsync=%d fullsync=%d)\n", pFile->dirfd,
|
||||
|
||||
/* Also fsync the directory containing the file if the DIRSYNC flag
|
||||
** is set. This is a one-time occurrance. Many systems (examples: AIX)
|
||||
** are unable to fsync a directory, so ignore errors on the fsync.
|
||||
*/
|
||||
if( pFile->ctrlFlags & UNIXFILE_DIRSYNC ){
|
||||
int dirfd;
|
||||
OSTRACE(("DIRSYNC %s (have_fullfsync=%d fullsync=%d)\n", pFile->zPath,
|
||||
HAVE_FULLFSYNC, isFullsync));
|
||||
#ifndef SQLITE_DISABLE_DIRSYNC
|
||||
/* The directory sync is only attempted if full_fsync is
|
||||
** turned off or unavailable. If a full_fsync occurred above,
|
||||
** then the directory sync is superfluous.
|
||||
*/
|
||||
if( (!HAVE_FULLFSYNC || !isFullsync) && full_fsync(pFile->dirfd,0,0) ){
|
||||
/*
|
||||
** We have received multiple reports of fsync() returning
|
||||
** errors when applied to directories on certain file systems.
|
||||
** A failed directory sync is not a big deal. So it seems
|
||||
** better to ignore the error. Ticket #1657
|
||||
*/
|
||||
/* pFile->lastErrno = errno; */
|
||||
/* return SQLITE_IOERR; */
|
||||
rc = osOpenDirectory(pFile->zPath, &dirfd);
|
||||
if( rc==SQLITE_OK && dirfd>=0 ){
|
||||
full_fsync(dirfd, 0, 0);
|
||||
robust_close(pFile, dirfd, __LINE__);
|
||||
}else if( rc==SQLITE_CANTOPEN ){
|
||||
rc = SQLITE_OK;
|
||||
}
|
||||
#endif
|
||||
/* Only need to sync once, so close the directory when we are done */
|
||||
robust_close(pFile, pFile->dirfd, __LINE__);
|
||||
pFile->dirfd = -1;
|
||||
pFile->ctrlFlags &= ~UNIXFILE_DIRSYNC;
|
||||
}
|
||||
return rc;
|
||||
}
|
||||
@@ -3466,7 +3516,11 @@ static int unixFileControl(sqlite3_file *id, int op, void *pArg){
|
||||
return SQLITE_OK;
|
||||
}
|
||||
case SQLITE_FCNTL_SIZE_HINT: {
|
||||
return fcntlSizeHint(pFile, *(i64 *)pArg);
|
||||
int rc;
|
||||
SimulateIOErrorBenign(1);
|
||||
rc = fcntlSizeHint(pFile, *(i64 *)pArg);
|
||||
SimulateIOErrorBenign(0);
|
||||
return rc;
|
||||
}
|
||||
case SQLITE_FCNTL_PERSIST_WAL: {
|
||||
int bPersist = *(int*)pArg;
|
||||
@@ -4162,7 +4216,7 @@ static int unixShmUnmap(
|
||||
assert( pShmNode->nRef>0 );
|
||||
pShmNode->nRef--;
|
||||
if( pShmNode->nRef==0 ){
|
||||
if( deleteFlag && pShmNode->h>=0 ) unlink(pShmNode->zFilename);
|
||||
if( deleteFlag && pShmNode->h>=0 ) osUnlink(pShmNode->zFilename);
|
||||
unixShmPurge(pDbFd);
|
||||
}
|
||||
unixLeaveMutex();
|
||||
@@ -4475,7 +4529,7 @@ typedef const sqlite3_io_methods *(*finder_type)(const char*,unixFile*);
|
||||
static int fillInUnixFile(
|
||||
sqlite3_vfs *pVfs, /* Pointer to vfs object */
|
||||
int h, /* Open file descriptor of file being opened */
|
||||
int dirfd, /* Directory file descriptor */
|
||||
int syncDir, /* True to sync directory on first sync */
|
||||
sqlite3_file *pId, /* Write to the unixFile structure here */
|
||||
const char *zFilename, /* Name of the file being opened */
|
||||
int noLock, /* Omit locking if true */
|
||||
@@ -4506,7 +4560,6 @@ static int fillInUnixFile(
|
||||
|
||||
OSTRACE(("OPEN %-3d %s\n", h, zFilename));
|
||||
pNew->h = h;
|
||||
pNew->dirfd = dirfd;
|
||||
pNew->zPath = zFilename;
|
||||
if( memcmp(pVfs->zName,"unix-excl",10)==0 ){
|
||||
pNew->ctrlFlags = UNIXFILE_EXCL;
|
||||
@@ -4516,6 +4569,9 @@ static int fillInUnixFile(
|
||||
if( isReadOnly ){
|
||||
pNew->ctrlFlags |= UNIXFILE_RDONLY;
|
||||
}
|
||||
if( syncDir ){
|
||||
pNew->ctrlFlags |= UNIXFILE_DIRSYNC;
|
||||
}
|
||||
|
||||
#if OS_VXWORKS
|
||||
pNew->pId = vxworksFindFileId(zFilename);
|
||||
@@ -4642,13 +4698,12 @@ static int fillInUnixFile(
|
||||
if( rc!=SQLITE_OK ){
|
||||
if( h>=0 ) robust_close(pNew, h, __LINE__);
|
||||
h = -1;
|
||||
unlink(zFilename);
|
||||
osUnlink(zFilename);
|
||||
isDelete = 0;
|
||||
}
|
||||
pNew->isDelete = isDelete;
|
||||
#endif
|
||||
if( rc!=SQLITE_OK ){
|
||||
if( dirfd>=0 ) robust_close(pNew, dirfd, __LINE__);
|
||||
if( h>=0 ) robust_close(pNew, h, __LINE__);
|
||||
}else{
|
||||
pNew->pMethod = pLockingStyle;
|
||||
@@ -4657,37 +4712,6 @@ static int fillInUnixFile(
|
||||
return rc;
|
||||
}
|
||||
|
||||
/*
|
||||
** Open a file descriptor to the directory containing file zFilename.
|
||||
** If successful, *pFd is set to the opened file descriptor and
|
||||
** SQLITE_OK is returned. If an error occurs, either SQLITE_NOMEM
|
||||
** or SQLITE_CANTOPEN is returned and *pFd is set to an undefined
|
||||
** value.
|
||||
**
|
||||
** If SQLITE_OK is returned, the caller is responsible for closing
|
||||
** the file descriptor *pFd using close().
|
||||
*/
|
||||
static int openDirectory(const char *zFilename, int *pFd){
|
||||
int ii;
|
||||
int fd = -1;
|
||||
char zDirname[MAX_PATHNAME+1];
|
||||
|
||||
sqlite3_snprintf(MAX_PATHNAME, zDirname, "%s", zFilename);
|
||||
for(ii=(int)strlen(zDirname); ii>1 && zDirname[ii]!='/'; ii--);
|
||||
if( ii>0 ){
|
||||
zDirname[ii] = '\0';
|
||||
fd = robust_open(zDirname, O_RDONLY|O_BINARY, 0);
|
||||
if( fd>=0 ){
|
||||
#ifdef FD_CLOEXEC
|
||||
osFcntl(fd, F_SETFD, osFcntl(fd, F_GETFD, 0) | FD_CLOEXEC);
|
||||
#endif
|
||||
OSTRACE(("OPENDIR %-3d %s\n", fd, zDirname));
|
||||
}
|
||||
}
|
||||
*pFd = fd;
|
||||
return (fd>=0?SQLITE_OK:unixLogError(SQLITE_CANTOPEN_BKPT, "open", zDirname));
|
||||
}
|
||||
|
||||
/*
|
||||
** Return the name of a directory in which to put temporary files.
|
||||
** If no suitable temporary file directory can be found, return NULL.
|
||||
@@ -4920,7 +4944,6 @@ static int unixOpen(
|
||||
){
|
||||
unixFile *p = (unixFile *)pFile;
|
||||
int fd = -1; /* File descriptor returned by open() */
|
||||
int dirfd = -1; /* Directory file descriptor */
|
||||
int openFlags = 0; /* Flags to pass to open() */
|
||||
int eType = flags&0xFFFFFF00; /* Type of file to open */
|
||||
int noLock; /* True to omit locking primitives */
|
||||
@@ -4939,7 +4962,7 @@ static int unixOpen(
|
||||
** a file-descriptor on the directory too. The first time unixSync()
|
||||
** is called the directory file descriptor will be fsync()ed and close()d.
|
||||
*/
|
||||
int isOpenDirectory = (isCreate && (
|
||||
int syncDir = (isCreate && (
|
||||
eType==SQLITE_OPEN_MASTER_JOURNAL
|
||||
|| eType==SQLITE_OPEN_MAIN_JOURNAL
|
||||
|| eType==SQLITE_OPEN_WAL
|
||||
@@ -4993,7 +5016,7 @@ static int unixOpen(
|
||||
p->pUnused = pUnused;
|
||||
}else if( !zName ){
|
||||
/* If zName is NULL, the upper layer is requesting a temp file. */
|
||||
assert(isDelete && !isOpenDirectory);
|
||||
assert(isDelete && !syncDir);
|
||||
rc = unixGetTempname(MAX_PATHNAME+1, zTmpname);
|
||||
if( rc!=SQLITE_OK ){
|
||||
return rc;
|
||||
@@ -5049,7 +5072,7 @@ static int unixOpen(
|
||||
#if OS_VXWORKS
|
||||
zPath = zName;
|
||||
#else
|
||||
unlink(zName);
|
||||
osUnlink(zName);
|
||||
#endif
|
||||
}
|
||||
#if SQLITE_ENABLE_LOCKING_STYLE
|
||||
@@ -5058,19 +5081,6 @@ static int unixOpen(
|
||||
}
|
||||
#endif
|
||||
|
||||
if( isOpenDirectory ){
|
||||
rc = openDirectory(zPath, &dirfd);
|
||||
if( rc!=SQLITE_OK ){
|
||||
/* It is safe to close fd at this point, because it is guaranteed not
|
||||
** to be open on a database file. If it were open on a database file,
|
||||
** it would not be safe to close as this would release any locks held
|
||||
** on the file by this process. */
|
||||
assert( eType!=SQLITE_OPEN_MAIN_DB );
|
||||
robust_close(p, fd, __LINE__);
|
||||
goto open_finished;
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef FD_CLOEXEC
|
||||
osFcntl(fd, F_SETFD, osFcntl(fd, F_GETFD, 0) | FD_CLOEXEC);
|
||||
#endif
|
||||
@@ -5082,7 +5092,6 @@ static int unixOpen(
|
||||
struct statfs fsInfo;
|
||||
if( fstatfs(fd, &fsInfo) == -1 ){
|
||||
((unixFile*)pFile)->lastErrno = errno;
|
||||
if( dirfd>=0 ) robust_close(p, dirfd, __LINE__);
|
||||
robust_close(p, fd, __LINE__);
|
||||
return SQLITE_IOERR_ACCESS;
|
||||
}
|
||||
@@ -5114,9 +5123,6 @@ static int unixOpen(
|
||||
** not while other file descriptors opened by the same process on
|
||||
** the same file are working. */
|
||||
p->lastErrno = errno;
|
||||
if( dirfd>=0 ){
|
||||
robust_close(p, dirfd, __LINE__);
|
||||
}
|
||||
robust_close(p, fd, __LINE__);
|
||||
rc = SQLITE_IOERR_ACCESS;
|
||||
goto open_finished;
|
||||
@@ -5124,7 +5130,7 @@ static int unixOpen(
|
||||
useProxy = !(fsInfo.f_flags&MNT_LOCAL);
|
||||
}
|
||||
if( useProxy ){
|
||||
rc = fillInUnixFile(pVfs, fd, dirfd, pFile, zPath, noLock,
|
||||
rc = fillInUnixFile(pVfs, fd, syncDir, pFile, zPath, noLock,
|
||||
isDelete, isReadonly);
|
||||
if( rc==SQLITE_OK ){
|
||||
rc = proxyTransformUnixFile((unixFile*)pFile, ":auto:");
|
||||
@@ -5142,7 +5148,7 @@ static int unixOpen(
|
||||
}
|
||||
#endif
|
||||
|
||||
rc = fillInUnixFile(pVfs, fd, dirfd, pFile, zPath, noLock,
|
||||
rc = fillInUnixFile(pVfs, fd, syncDir, pFile, zPath, noLock,
|
||||
isDelete, isReadonly);
|
||||
open_finished:
|
||||
if( rc!=SQLITE_OK ){
|
||||
@@ -5164,13 +5170,13 @@ static int unixDelete(
|
||||
int rc = SQLITE_OK;
|
||||
UNUSED_PARAMETER(NotUsed);
|
||||
SimulateIOError(return SQLITE_IOERR_DELETE);
|
||||
if( unlink(zPath)==(-1) && errno!=ENOENT ){
|
||||
if( osUnlink(zPath)==(-1) && errno!=ENOENT ){
|
||||
return unixLogError(SQLITE_IOERR_DELETE, "unlink", zPath);
|
||||
}
|
||||
#ifndef SQLITE_DISABLE_DIRSYNC
|
||||
if( dirSync ){
|
||||
int fd;
|
||||
rc = openDirectory(zPath, &fd);
|
||||
rc = osOpenDirectory(zPath, &fd);
|
||||
if( rc==SQLITE_OK ){
|
||||
#if OS_VXWORKS
|
||||
if( fsync(fd)==-1 )
|
||||
@@ -5181,6 +5187,8 @@ static int unixDelete(
|
||||
rc = unixLogError(SQLITE_IOERR_DIR_FSYNC, "fsync", zPath);
|
||||
}
|
||||
robust_close(0, fd, __LINE__);
|
||||
}else if( rc==SQLITE_CANTOPEN ){
|
||||
rc = SQLITE_OK;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@@ -5742,7 +5750,6 @@ static int proxyCreateUnixFile(
|
||||
int islockfile /* if non zero missing dirs will be created */
|
||||
) {
|
||||
int fd = -1;
|
||||
int dirfd = -1;
|
||||
unixFile *pNew;
|
||||
int rc = SQLITE_OK;
|
||||
int openFlags = O_RDWR | O_CREAT;
|
||||
@@ -5807,7 +5814,7 @@ static int proxyCreateUnixFile(
|
||||
pUnused->flags = openFlags;
|
||||
pNew->pUnused = pUnused;
|
||||
|
||||
rc = fillInUnixFile(&dummyVfs, fd, dirfd, (sqlite3_file*)pNew, path, 0, 0, 0);
|
||||
rc = fillInUnixFile(&dummyVfs, fd, 0, (sqlite3_file*)pNew, path, 0, 0, 0);
|
||||
if( rc==SQLITE_OK ){
|
||||
*ppFile = pNew;
|
||||
return SQLITE_OK;
|
||||
@@ -5921,7 +5928,7 @@ static int proxyBreakConchLock(unixFile *pFile, uuid_t myHostID){
|
||||
end_breaklock:
|
||||
if( rc ){
|
||||
if( fd>=0 ){
|
||||
unlink(tPath);
|
||||
osUnlink(tPath);
|
||||
robust_close(pFile, fd, __LINE__);
|
||||
}
|
||||
fprintf(stderr, "failed to break stale lock on %s, %s\n", cPath, errmsg);
|
||||
@@ -6744,7 +6751,7 @@ int sqlite3_os_init(void){
|
||||
|
||||
/* Double-check that the aSyscall[] array has been constructed
|
||||
** correctly. See ticket [bb3a86e890c8e96ab] */
|
||||
assert( ArraySize(aSyscall)==16 );
|
||||
assert( ArraySize(aSyscall)==18 );
|
||||
|
||||
/* Register all VFSes defined in the aVfs[] array */
|
||||
for(i=0; i<(sizeof(aVfs)/sizeof(sqlite3_vfs)); i++){
|
||||
|
||||
302
src/os_win.c
302
src/os_win.c
@@ -119,6 +119,76 @@ struct winFile {
|
||||
#endif
|
||||
};
|
||||
|
||||
/*
|
||||
* If compiled with SQLITE_WIN32_MALLOC on Windows, we will use the
|
||||
* various Win32 API heap functions instead of our own.
|
||||
*/
|
||||
#ifdef SQLITE_WIN32_MALLOC
|
||||
/*
|
||||
* The initial size of the Win32-specific heap. This value may be zero.
|
||||
*/
|
||||
#ifndef SQLITE_WIN32_HEAP_INIT_SIZE
|
||||
# define SQLITE_WIN32_HEAP_INIT_SIZE ((SQLITE_DEFAULT_CACHE_SIZE) * \
|
||||
(SQLITE_DEFAULT_PAGE_SIZE) + 4194304)
|
||||
#endif
|
||||
|
||||
/*
|
||||
* The maximum size of the Win32-specific heap. This value may be zero.
|
||||
*/
|
||||
#ifndef SQLITE_WIN32_HEAP_MAX_SIZE
|
||||
# define SQLITE_WIN32_HEAP_MAX_SIZE (0)
|
||||
#endif
|
||||
|
||||
/*
|
||||
* The extra flags to use in calls to the Win32 heap APIs. This value may be
|
||||
* zero for the default behavior.
|
||||
*/
|
||||
#ifndef SQLITE_WIN32_HEAP_FLAGS
|
||||
# define SQLITE_WIN32_HEAP_FLAGS (0)
|
||||
#endif
|
||||
|
||||
/*
|
||||
** The winMemData structure stores information required by the Win32-specific
|
||||
** sqlite3_mem_methods implementation.
|
||||
*/
|
||||
typedef struct winMemData winMemData;
|
||||
struct winMemData {
|
||||
#ifndef NDEBUG
|
||||
u32 magic; /* Magic number to detect structure corruption. */
|
||||
#endif
|
||||
HANDLE hHeap; /* The handle to our heap. */
|
||||
BOOL bOwned; /* Do we own the heap (i.e. destroy it on shutdown)? */
|
||||
};
|
||||
|
||||
#ifndef NDEBUG
|
||||
#define WINMEM_MAGIC 0x42b2830b
|
||||
#endif
|
||||
|
||||
static struct winMemData win_mem_data = {
|
||||
#ifndef NDEBUG
|
||||
WINMEM_MAGIC,
|
||||
#endif
|
||||
NULL, FALSE
|
||||
};
|
||||
|
||||
#ifndef NDEBUG
|
||||
#define winMemAssertMagic() assert( win_mem_data.magic==WINMEM_MAGIC )
|
||||
#else
|
||||
#define winMemAssertMagic()
|
||||
#endif
|
||||
|
||||
#define winMemGetHeap() win_mem_data.hHeap
|
||||
|
||||
static void *winMemMalloc(int nBytes);
|
||||
static void winMemFree(void *pPrior);
|
||||
static void *winMemRealloc(void *pPrior, int nBytes);
|
||||
static int winMemSize(void *p);
|
||||
static int winMemRoundup(int n);
|
||||
static int winMemInit(void *pAppData);
|
||||
static void winMemShutdown(void *pAppData);
|
||||
|
||||
const sqlite3_mem_methods *sqlite3MemGetWin32(void);
|
||||
#endif /* SQLITE_WIN32_MALLOC */
|
||||
|
||||
/*
|
||||
** Forward prototypes.
|
||||
@@ -171,6 +241,188 @@ static int sqlite3_os_type = 0;
|
||||
}
|
||||
#endif /* SQLITE_OS_WINCE */
|
||||
|
||||
#ifdef SQLITE_WIN32_MALLOC
|
||||
/*
|
||||
** Allocate nBytes of memory.
|
||||
*/
|
||||
static void *winMemMalloc(int nBytes){
|
||||
HANDLE hHeap;
|
||||
void *p;
|
||||
|
||||
winMemAssertMagic();
|
||||
hHeap = winMemGetHeap();
|
||||
assert( hHeap!=0 );
|
||||
assert( hHeap!=INVALID_HANDLE_VALUE );
|
||||
#ifdef SQLITE_WIN32_MALLOC_VALIDATE
|
||||
assert ( HeapValidate(hHeap, SQLITE_WIN32_HEAP_FLAGS, NULL) );
|
||||
#endif
|
||||
assert( nBytes>=0 );
|
||||
p = HeapAlloc(hHeap, SQLITE_WIN32_HEAP_FLAGS, (SIZE_T)nBytes);
|
||||
if( !p ){
|
||||
sqlite3_log(SQLITE_NOMEM, "failed to HeapAlloc %u bytes (%d), heap=%p",
|
||||
nBytes, GetLastError(), (void*)hHeap);
|
||||
}
|
||||
return p;
|
||||
}
|
||||
|
||||
/*
|
||||
** Free memory.
|
||||
*/
|
||||
static void winMemFree(void *pPrior){
|
||||
HANDLE hHeap;
|
||||
|
||||
winMemAssertMagic();
|
||||
hHeap = winMemGetHeap();
|
||||
assert( hHeap!=0 );
|
||||
assert( hHeap!=INVALID_HANDLE_VALUE );
|
||||
#ifdef SQLITE_WIN32_MALLOC_VALIDATE
|
||||
assert ( HeapValidate(hHeap, SQLITE_WIN32_HEAP_FLAGS, pPrior) );
|
||||
#endif
|
||||
if( !pPrior ) return; /* Passing NULL to HeapFree is undefined. */
|
||||
if( !HeapFree(hHeap, SQLITE_WIN32_HEAP_FLAGS, pPrior) ){
|
||||
sqlite3_log(SQLITE_NOMEM, "failed to HeapFree block %p (%d), heap=%p",
|
||||
pPrior, GetLastError(), (void*)hHeap);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
** Change the size of an existing memory allocation
|
||||
*/
|
||||
static void *winMemRealloc(void *pPrior, int nBytes){
|
||||
HANDLE hHeap;
|
||||
void *p;
|
||||
|
||||
winMemAssertMagic();
|
||||
hHeap = winMemGetHeap();
|
||||
assert( hHeap!=0 );
|
||||
assert( hHeap!=INVALID_HANDLE_VALUE );
|
||||
#ifdef SQLITE_WIN32_MALLOC_VALIDATE
|
||||
assert ( HeapValidate(hHeap, SQLITE_WIN32_HEAP_FLAGS, pPrior) );
|
||||
#endif
|
||||
assert( nBytes>=0 );
|
||||
if( !pPrior ){
|
||||
p = HeapAlloc(hHeap, SQLITE_WIN32_HEAP_FLAGS, (SIZE_T)nBytes);
|
||||
}else{
|
||||
p = HeapReAlloc(hHeap, SQLITE_WIN32_HEAP_FLAGS, pPrior, (SIZE_T)nBytes);
|
||||
}
|
||||
if( !p ){
|
||||
sqlite3_log(SQLITE_NOMEM, "failed to %s %u bytes (%d), heap=%p",
|
||||
pPrior ? "HeapReAlloc" : "HeapAlloc", nBytes, GetLastError(),
|
||||
(void*)hHeap);
|
||||
}
|
||||
return p;
|
||||
}
|
||||
|
||||
/*
|
||||
** Return the size of an outstanding allocation, in bytes.
|
||||
*/
|
||||
static int winMemSize(void *p){
|
||||
HANDLE hHeap;
|
||||
SIZE_T n;
|
||||
|
||||
winMemAssertMagic();
|
||||
hHeap = winMemGetHeap();
|
||||
assert( hHeap!=0 );
|
||||
assert( hHeap!=INVALID_HANDLE_VALUE );
|
||||
#ifdef SQLITE_WIN32_MALLOC_VALIDATE
|
||||
assert ( HeapValidate(hHeap, SQLITE_WIN32_HEAP_FLAGS, NULL) );
|
||||
#endif
|
||||
if( !p ) return 0;
|
||||
n = HeapSize(hHeap, SQLITE_WIN32_HEAP_FLAGS, p);
|
||||
if( n==(SIZE_T)-1 ){
|
||||
sqlite3_log(SQLITE_NOMEM, "failed to HeapSize block %p (%d), heap=%p",
|
||||
p, GetLastError(), (void*)hHeap);
|
||||
return 0;
|
||||
}
|
||||
return (int)n;
|
||||
}
|
||||
|
||||
/*
|
||||
** Round up a request size to the next valid allocation size.
|
||||
*/
|
||||
static int winMemRoundup(int n){
|
||||
return n;
|
||||
}
|
||||
|
||||
/*
|
||||
** Initialize this module.
|
||||
*/
|
||||
static int winMemInit(void *pAppData){
|
||||
winMemData *pWinMemData = (winMemData *)pAppData;
|
||||
|
||||
if( !pWinMemData ) return SQLITE_ERROR;
|
||||
assert( pWinMemData->magic==WINMEM_MAGIC );
|
||||
if( !pWinMemData->hHeap ){
|
||||
pWinMemData->hHeap = HeapCreate(SQLITE_WIN32_HEAP_FLAGS,
|
||||
SQLITE_WIN32_HEAP_INIT_SIZE,
|
||||
SQLITE_WIN32_HEAP_MAX_SIZE);
|
||||
if( !pWinMemData->hHeap ){
|
||||
sqlite3_log(SQLITE_NOMEM,
|
||||
"failed to HeapCreate (%d), flags=%u, initSize=%u, maxSize=%u",
|
||||
GetLastError(), SQLITE_WIN32_HEAP_FLAGS, SQLITE_WIN32_HEAP_INIT_SIZE,
|
||||
SQLITE_WIN32_HEAP_MAX_SIZE);
|
||||
return SQLITE_NOMEM;
|
||||
}
|
||||
pWinMemData->bOwned = TRUE;
|
||||
}
|
||||
assert( pWinMemData->hHeap!=0 );
|
||||
assert( pWinMemData->hHeap!=INVALID_HANDLE_VALUE );
|
||||
#ifdef SQLITE_WIN32_MALLOC_VALIDATE
|
||||
assert( HeapValidate(pWinMemData->hHeap, SQLITE_WIN32_HEAP_FLAGS, NULL) );
|
||||
#endif
|
||||
return SQLITE_OK;
|
||||
}
|
||||
|
||||
/*
|
||||
** Deinitialize this module.
|
||||
*/
|
||||
static void winMemShutdown(void *pAppData){
|
||||
winMemData *pWinMemData = (winMemData *)pAppData;
|
||||
|
||||
if( !pWinMemData ) return;
|
||||
if( pWinMemData->hHeap ){
|
||||
assert( pWinMemData->hHeap!=INVALID_HANDLE_VALUE );
|
||||
#ifdef SQLITE_WIN32_MALLOC_VALIDATE
|
||||
assert( HeapValidate(pWinMemData->hHeap, SQLITE_WIN32_HEAP_FLAGS, NULL) );
|
||||
#endif
|
||||
if( pWinMemData->bOwned ){
|
||||
if( !HeapDestroy(pWinMemData->hHeap) ){
|
||||
sqlite3_log(SQLITE_NOMEM, "failed to HeapDestroy (%d), heap=%p",
|
||||
GetLastError(), (void*)pWinMemData->hHeap);
|
||||
}
|
||||
pWinMemData->bOwned = FALSE;
|
||||
}
|
||||
pWinMemData->hHeap = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
** Populate the low-level memory allocation function pointers in
|
||||
** sqlite3GlobalConfig.m with pointers to the routines in this file. The
|
||||
** arguments specify the block of memory to manage.
|
||||
**
|
||||
** This routine is only called by sqlite3_config(), and therefore
|
||||
** is not required to be threadsafe (it is not).
|
||||
*/
|
||||
const sqlite3_mem_methods *sqlite3MemGetWin32(void){
|
||||
static const sqlite3_mem_methods winMemMethods = {
|
||||
winMemMalloc,
|
||||
winMemFree,
|
||||
winMemRealloc,
|
||||
winMemSize,
|
||||
winMemRoundup,
|
||||
winMemInit,
|
||||
winMemShutdown,
|
||||
&win_mem_data
|
||||
};
|
||||
return &winMemMethods;
|
||||
}
|
||||
|
||||
void sqlite3MemSetDefault(void){
|
||||
sqlite3_config(SQLITE_CONFIG_MALLOC, sqlite3MemGetWin32());
|
||||
}
|
||||
#endif /* SQLITE_WIN32_MALLOC */
|
||||
|
||||
/*
|
||||
** Convert a UTF-8 string to microsoft unicode (UTF-16?).
|
||||
**
|
||||
@@ -1351,11 +1603,18 @@ static int winFileControl(sqlite3_file *id, int op, void *pArg){
|
||||
return SQLITE_OK;
|
||||
}
|
||||
case SQLITE_FCNTL_SIZE_HINT: {
|
||||
sqlite3_int64 sz = *(sqlite3_int64*)pArg;
|
||||
SimulateIOErrorBenign(1);
|
||||
winTruncate(id, sz);
|
||||
SimulateIOErrorBenign(0);
|
||||
return SQLITE_OK;
|
||||
winFile *pFile = (winFile*)id;
|
||||
sqlite3_int64 oldSz;
|
||||
int rc = winFileSize(id, &oldSz);
|
||||
if( rc==SQLITE_OK ){
|
||||
sqlite3_int64 newSz = *(sqlite3_int64*)pArg;
|
||||
if( newSz>oldSz ){
|
||||
SimulateIOErrorBenign(1);
|
||||
rc = winTruncate(id, newSz);
|
||||
SimulateIOErrorBenign(0);
|
||||
}
|
||||
}
|
||||
return rc;
|
||||
}
|
||||
case SQLITE_FCNTL_PERSIST_WAL: {
|
||||
int bPersist = *(int*)pArg;
|
||||
@@ -2191,6 +2450,7 @@ static int winOpen(
|
||||
winFile *pFile = (winFile*)id;
|
||||
void *zConverted; /* Filename in OS encoding */
|
||||
const char *zUtf8Name = zName; /* Filename in UTF-8 encoding */
|
||||
int cnt = 0;
|
||||
|
||||
/* If argument zPath is a NULL pointer, this function is required to open
|
||||
** a temporary file. Use this buffer to store the file name in.
|
||||
@@ -2310,31 +2570,31 @@ static int winOpen(
|
||||
#endif
|
||||
|
||||
if( isNT() ){
|
||||
h = CreateFileW((WCHAR*)zConverted,
|
||||
dwDesiredAccess,
|
||||
dwShareMode,
|
||||
NULL,
|
||||
dwCreationDisposition,
|
||||
dwFlagsAndAttributes,
|
||||
NULL
|
||||
);
|
||||
while( (h = CreateFileW((WCHAR*)zConverted,
|
||||
dwDesiredAccess,
|
||||
dwShareMode, NULL,
|
||||
dwCreationDisposition,
|
||||
dwFlagsAndAttributes,
|
||||
NULL))==INVALID_HANDLE_VALUE &&
|
||||
retryIoerr(&cnt) ){}
|
||||
/* isNT() is 1 if SQLITE_OS_WINCE==1, so this else is never executed.
|
||||
** Since the ASCII version of these Windows API do not exist for WINCE,
|
||||
** it's important to not reference them for WINCE builds.
|
||||
*/
|
||||
#if SQLITE_OS_WINCE==0
|
||||
}else{
|
||||
h = CreateFileA((char*)zConverted,
|
||||
dwDesiredAccess,
|
||||
dwShareMode,
|
||||
NULL,
|
||||
dwCreationDisposition,
|
||||
dwFlagsAndAttributes,
|
||||
NULL
|
||||
);
|
||||
while( (h = CreateFileA((char*)zConverted,
|
||||
dwDesiredAccess,
|
||||
dwShareMode, NULL,
|
||||
dwCreationDisposition,
|
||||
dwFlagsAndAttributes,
|
||||
NULL))==INVALID_HANDLE_VALUE &&
|
||||
retryIoerr(&cnt) ){}
|
||||
#endif
|
||||
}
|
||||
|
||||
logIoerr(cnt);
|
||||
|
||||
OSTRACE(("OPEN %d %s 0x%lx %s\n",
|
||||
h, zName, dwDesiredAccess,
|
||||
h==INVALID_HANDLE_VALUE ? "failed" : "ok"));
|
||||
|
||||
30
src/pager.c
30
src/pager.c
@@ -620,6 +620,8 @@ struct Pager {
|
||||
u8 tempFile; /* zFilename is a temporary file */
|
||||
u8 readOnly; /* True for a read-only database */
|
||||
u8 memDb; /* True to inhibit all file I/O */
|
||||
u8 hasSeenStress; /* pagerStress() called one or more times */
|
||||
u8 isSorter; /* True for a PAGER_SORTER */
|
||||
|
||||
/**************************************************************************
|
||||
** The following block contains those class members that change during
|
||||
@@ -843,6 +845,15 @@ static int assert_pager_state(Pager *p){
|
||||
assert( pagerUseWal(p)==0 );
|
||||
}
|
||||
|
||||
/* A sorter is a temp file that never spills to disk and always has
|
||||
** the doNotSpill flag set
|
||||
*/
|
||||
if( p->isSorter ){
|
||||
assert( p->tempFile );
|
||||
assert( p->doNotSpill );
|
||||
assert( p->fd->pMethods==0 );
|
||||
}
|
||||
|
||||
/* If changeCountDone is set, a RESERVED lock or greater must be held
|
||||
** on the file.
|
||||
*/
|
||||
@@ -3739,6 +3750,7 @@ static int pagerSyncHotJournal(Pager *pPager){
|
||||
int sqlite3PagerClose(Pager *pPager){
|
||||
u8 *pTmp = (u8 *)pPager->pTmpSpace;
|
||||
|
||||
assert( assert_pager_state(pPager) );
|
||||
disable_simulated_io_errors();
|
||||
sqlite3BeginBenignMalloc();
|
||||
/* pPager->errCode = 0; */
|
||||
@@ -4173,6 +4185,7 @@ static int pagerStress(void *p, PgHdr *pPg){
|
||||
** be called in the error state. Nevertheless, we include a NEVER()
|
||||
** test for the error state as a safeguard against future changes.
|
||||
*/
|
||||
pPager->hasSeenStress = 1;
|
||||
if( NEVER(pPager->errCode) ) return SQLITE_OK;
|
||||
if( pPager->doNotSpill ) return SQLITE_OK;
|
||||
if( pPager->doNotSyncSpill && (pPg->flags & PGHDR_NEED_SYNC)!=0 ){
|
||||
@@ -4544,6 +4557,12 @@ int sqlite3PagerOpen(
|
||||
/* pPager->pBusyHandlerArg = 0; */
|
||||
pPager->xReiniter = xReinit;
|
||||
/* memset(pPager->aHash, 0, sizeof(pPager->aHash)); */
|
||||
#ifndef SQLITE_OMIT_MERGE_SORT
|
||||
if( flags & PAGER_SORTER ){
|
||||
pPager->doNotSpill = 1;
|
||||
pPager->isSorter = 1;
|
||||
}
|
||||
#endif
|
||||
|
||||
*ppPager = pPager;
|
||||
return SQLITE_OK;
|
||||
@@ -6088,6 +6107,17 @@ int sqlite3PagerIsMemdb(Pager *pPager){
|
||||
return MEMDB;
|
||||
}
|
||||
|
||||
#ifndef SQLITE_OMIT_MERGE_SORT
|
||||
/*
|
||||
** Return true if the pager has seen a pagerStress callback.
|
||||
*/
|
||||
int sqlite3PagerUnderStress(Pager *pPager){
|
||||
assert( pPager->isSorter );
|
||||
assert( pPager->doNotSpill );
|
||||
return pPager->hasSeenStress;
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
** Check that there are at least nSavepoint savepoints open. If there are
|
||||
** currently less than nSavepoints open, then open one or more savepoints
|
||||
|
||||
@@ -60,6 +60,7 @@ typedef struct PgHdr DbPage;
|
||||
#define PAGER_OMIT_JOURNAL 0x0001 /* Do not use a rollback journal */
|
||||
#define PAGER_NO_READLOCK 0x0002 /* Omit readlocks on readonly files */
|
||||
#define PAGER_MEMORY 0x0004 /* In-memory database */
|
||||
#define PAGER_SORTER 0x0020 /* Accumulator in external merge sort */
|
||||
|
||||
/*
|
||||
** Valid values for the second argument to sqlite3PagerLockingMode().
|
||||
@@ -155,6 +156,9 @@ const char *sqlite3PagerJournalname(Pager*);
|
||||
int sqlite3PagerNosync(Pager*);
|
||||
void *sqlite3PagerTempSpace(Pager*);
|
||||
int sqlite3PagerIsMemdb(Pager*);
|
||||
#ifndef SQLITE_OMIT_MERGE_SORT
|
||||
int sqlite3PagerUnderStress(Pager*);
|
||||
#endif
|
||||
|
||||
/* Functions used to truncate the database file. */
|
||||
void sqlite3PagerTruncateImage(Pager*,Pgno);
|
||||
|
||||
257
src/pcache1.c
257
src/pcache1.c
@@ -24,6 +24,9 @@ typedef struct PgHdr1 PgHdr1;
|
||||
typedef struct PgFreeslot PgFreeslot;
|
||||
typedef struct PGroup PGroup;
|
||||
|
||||
typedef struct PGroupBlock PGroupBlock;
|
||||
typedef struct PGroupBlockList PGroupBlockList;
|
||||
|
||||
/* Each page cache (or PCache) belongs to a PGroup. A PGroup is a set
|
||||
** of one or more PCaches that are able to recycle each others unpinned
|
||||
** pages when they are under memory pressure. A PGroup is an instance of
|
||||
@@ -53,8 +56,66 @@ struct PGroup {
|
||||
int mxPinned; /* nMaxpage + 10 - nMinPage */
|
||||
int nCurrentPage; /* Number of purgeable pages allocated */
|
||||
PgHdr1 *pLruHead, *pLruTail; /* LRU list of unpinned pages */
|
||||
#ifdef SQLITE_PAGECACHE_BLOCKALLOC
|
||||
int isBusy; /* Do not run ReleaseMemory() if true */
|
||||
PGroupBlockList *pBlockList; /* List of block-lists for this group */
|
||||
#endif
|
||||
};
|
||||
|
||||
/*
|
||||
** If SQLITE_PAGECACHE_BLOCKALLOC is defined when the library is built,
|
||||
** each PGroup structure has a linked list of the the following starting
|
||||
** at PGroup.pBlockList. There is one entry for each distinct page-size
|
||||
** currently used by members of the PGroup (i.e. 1024 bytes, 4096 bytes
|
||||
** etc.). Variable PGroupBlockList.nByte is set to the actual allocation
|
||||
** size requested by each pcache, which is the database page-size plus
|
||||
** the various header structures used by the pcache, pager and btree layers.
|
||||
** Usually around (pgsz+200) bytes.
|
||||
**
|
||||
** This size (pgsz+200) bytes is not allocated efficiently by some
|
||||
** implementations of malloc. In particular, some implementations are only
|
||||
** able to allocate blocks of memory chunks of 2^N bytes, where N is some
|
||||
** integer value. Since the page-size is a power of 2, this means we
|
||||
** end up wasting (pgsz-200) bytes in each allocation.
|
||||
**
|
||||
** If SQLITE_PAGECACHE_BLOCKALLOC is defined, the (pgsz+200) byte blocks
|
||||
** are not allocated directly. Instead, blocks of roughly M*(pgsz+200) bytes
|
||||
** are requested from malloc allocator. After a block is returned,
|
||||
** sqlite3MallocSize() is used to determine how many (pgsz+200) byte
|
||||
** allocations can fit in the space returned by malloc(). This value may
|
||||
** be more than M.
|
||||
**
|
||||
** The blocks are stored in a doubly-linked list. Variable PGroupBlock.nEntry
|
||||
** contains the number of allocations that will fit in the aData[] space.
|
||||
** nEntry is limited to the number of bits in bitmask mUsed. If a slot
|
||||
** within aData is in use, the corresponding bit in mUsed is set. Thus
|
||||
** when (mUsed+1==(1 << nEntry)) the block is completely full.
|
||||
**
|
||||
** Each time a slot within a block is freed, the block is moved to the start
|
||||
** of the linked-list. And if a block becomes completely full, then it is
|
||||
** moved to the end of the list. As a result, when searching for a free
|
||||
** slot, only the first block in the list need be examined. If it is full,
|
||||
** then it is guaranteed that all blocks are full.
|
||||
*/
|
||||
struct PGroupBlockList {
|
||||
int nByte; /* Size of each allocation in bytes */
|
||||
PGroupBlock *pFirst; /* First PGroupBlock in list */
|
||||
PGroupBlock *pLast; /* Last PGroupBlock in list */
|
||||
PGroupBlockList *pNext; /* Next block-list attached to group */
|
||||
};
|
||||
|
||||
struct PGroupBlock {
|
||||
Bitmask mUsed; /* Mask of used slots */
|
||||
int nEntry; /* Maximum number of allocations in aData[] */
|
||||
u8 *aData; /* Pointer to data block */
|
||||
PGroupBlock *pNext; /* Next PGroupBlock in list */
|
||||
PGroupBlock *pPrev; /* Previous PGroupBlock in list */
|
||||
PGroupBlockList *pList; /* Owner list */
|
||||
};
|
||||
|
||||
/* Minimum value for PGroupBlock.nEntry */
|
||||
#define PAGECACHE_BLOCKALLOC_MINENTRY 15
|
||||
|
||||
/* Each page cache is an instance of the following object. Every
|
||||
** open database file (including each in-memory database and each
|
||||
** temporary or transient database) has a single page cache which
|
||||
@@ -158,6 +219,17 @@ static SQLITE_WSD struct PCacheGlobal {
|
||||
#define PGHDR1_TO_PAGE(p) (void*)(((char*)p) - p->pCache->szPage)
|
||||
#define PAGE_TO_PGHDR1(c, p) (PgHdr1*)(((char*)p) + c->szPage)
|
||||
|
||||
/*
|
||||
** Blocks used by the SQLITE_PAGECACHE_BLOCKALLOC blocks to store/retrieve
|
||||
** a PGroupBlock pointer based on a pointer to a page buffer.
|
||||
*/
|
||||
#define PAGE_SET_BLOCKPTR(pCache, pPg, pBlock) \
|
||||
( *(PGroupBlock **)&(((u8*)pPg)[sizeof(PgHdr1) + pCache->szPage]) = pBlock )
|
||||
|
||||
#define PAGE_GET_BLOCKPTR(pCache, pPg) \
|
||||
( *(PGroupBlock **)&(((u8*)pPg)[sizeof(PgHdr1) + pCache->szPage]) )
|
||||
|
||||
|
||||
/*
|
||||
** Macros to enter and leave the PCache LRU mutex.
|
||||
*/
|
||||
@@ -283,13 +355,146 @@ static int pcache1MemSize(void *p){
|
||||
}
|
||||
#endif /* SQLITE_ENABLE_MEMORY_MANAGEMENT */
|
||||
|
||||
#ifdef SQLITE_PAGECACHE_BLOCKALLOC
|
||||
/*
|
||||
** The block pBlock belongs to list pList but is not currently linked in.
|
||||
** Insert it into the start of the list.
|
||||
*/
|
||||
static void addBlockToList(PGroupBlockList *pList, PGroupBlock *pBlock){
|
||||
pBlock->pPrev = 0;
|
||||
pBlock->pNext = pList->pFirst;
|
||||
pList->pFirst = pBlock;
|
||||
if( pBlock->pNext ){
|
||||
pBlock->pNext->pPrev = pBlock;
|
||||
}else{
|
||||
assert( pList->pLast==0 );
|
||||
pList->pLast = pBlock;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
** If there are no blocks in the list headed by pList, remove pList
|
||||
** from the pGroup->pBlockList list and free it with sqlite3_free().
|
||||
*/
|
||||
static void freeListIfEmpty(PGroup *pGroup, PGroupBlockList *pList){
|
||||
assert( sqlite3_mutex_held(pGroup->mutex) );
|
||||
if( pList->pFirst==0 ){
|
||||
PGroupBlockList **pp;
|
||||
for(pp=&pGroup->pBlockList; *pp!=pList; pp=&(*pp)->pNext);
|
||||
*pp = (*pp)->pNext;
|
||||
sqlite3_free(pList);
|
||||
}
|
||||
}
|
||||
#endif /* SQLITE_PAGECACHE_BLOCKALLOC */
|
||||
|
||||
/*
|
||||
** Allocate a new page object initially associated with cache pCache.
|
||||
*/
|
||||
static PgHdr1 *pcache1AllocPage(PCache1 *pCache){
|
||||
int nByte = sizeof(PgHdr1) + pCache->szPage;
|
||||
void *pPg = pcache1Alloc(nByte);
|
||||
void *pPg = 0;
|
||||
PgHdr1 *p;
|
||||
|
||||
#ifdef SQLITE_PAGECACHE_BLOCKALLOC
|
||||
PGroup *pGroup = pCache->pGroup;
|
||||
PGroupBlockList *pList;
|
||||
PGroupBlock *pBlock;
|
||||
int i;
|
||||
|
||||
nByte += sizeof(PGroupBlockList *);
|
||||
nByte = ROUND8(nByte);
|
||||
|
||||
for(pList=pGroup->pBlockList; pList; pList=pList->pNext){
|
||||
if( pList->nByte==nByte ) break;
|
||||
}
|
||||
if( pList==0 ){
|
||||
PGroupBlockList *pNew;
|
||||
assert( pGroup->isBusy==0 );
|
||||
assert( sqlite3_mutex_held(pGroup->mutex) );
|
||||
pGroup->isBusy = 1; /* Disable sqlite3PcacheReleaseMemory() */
|
||||
pNew = (PGroupBlockList *)sqlite3MallocZero(sizeof(PGroupBlockList));
|
||||
pGroup->isBusy = 0; /* Reenable sqlite3PcacheReleaseMemory() */
|
||||
if( pNew==0 ){
|
||||
/* malloc() failure. Return early. */
|
||||
return 0;
|
||||
}
|
||||
#ifdef SQLITE_DEBUG
|
||||
for(pList=pGroup->pBlockList; pList; pList=pList->pNext){
|
||||
assert( pList->nByte!=nByte );
|
||||
}
|
||||
#endif
|
||||
pNew->nByte = nByte;
|
||||
pNew->pNext = pGroup->pBlockList;
|
||||
pGroup->pBlockList = pNew;
|
||||
pList = pNew;
|
||||
}
|
||||
|
||||
pBlock = pList->pFirst;
|
||||
if( pBlock==0 || pBlock->mUsed==(((Bitmask)1<<pBlock->nEntry)-1) ){
|
||||
int sz;
|
||||
|
||||
/* Allocate a new block. Try to allocate enough space for the PGroupBlock
|
||||
** structure and MINENTRY allocations of nByte bytes each. If the
|
||||
** allocator returns more memory than requested, then more than MINENTRY
|
||||
** allocations may fit in it. */
|
||||
assert( sqlite3_mutex_held(pGroup->mutex) );
|
||||
pcache1LeaveMutex(pCache->pGroup);
|
||||
sz = sizeof(PGroupBlock) + PAGECACHE_BLOCKALLOC_MINENTRY * nByte;
|
||||
pBlock = (PGroupBlock *)sqlite3Malloc(sz);
|
||||
pcache1EnterMutex(pCache->pGroup);
|
||||
|
||||
if( !pBlock ){
|
||||
freeListIfEmpty(pGroup, pList);
|
||||
return 0;
|
||||
}
|
||||
pBlock->nEntry = (sqlite3MallocSize(pBlock) - sizeof(PGroupBlock)) / nByte;
|
||||
if( pBlock->nEntry>=BMS ){
|
||||
pBlock->nEntry = BMS-1;
|
||||
}
|
||||
pBlock->pList = pList;
|
||||
pBlock->mUsed = 0;
|
||||
pBlock->aData = (u8 *)&pBlock[1];
|
||||
addBlockToList(pList, pBlock);
|
||||
|
||||
sz = sqlite3MallocSize(pBlock);
|
||||
sqlite3_mutex_enter(pcache1.mutex);
|
||||
sqlite3StatusAdd(SQLITE_STATUS_PAGECACHE_OVERFLOW, sz);
|
||||
sqlite3_mutex_leave(pcache1.mutex);
|
||||
}
|
||||
|
||||
for(i=0; pPg==0 && ALWAYS(i<pBlock->nEntry); i++){
|
||||
if( 0==(pBlock->mUsed & ((Bitmask)1<<i)) ){
|
||||
pBlock->mUsed |= ((Bitmask)1<<i);
|
||||
pPg = (void *)&pBlock->aData[pList->nByte * i];
|
||||
}
|
||||
}
|
||||
assert( pPg );
|
||||
PAGE_SET_BLOCKPTR(pCache, pPg, pBlock);
|
||||
|
||||
/* If the block is now full, shift it to the end of the list */
|
||||
if( pBlock->mUsed==(((Bitmask)1<<pBlock->nEntry)-1) && pList->pLast!=pBlock ){
|
||||
assert( pList->pFirst==pBlock );
|
||||
assert( pBlock->pPrev==0 );
|
||||
assert( pList->pLast->pNext==0 );
|
||||
pList->pFirst = pBlock->pNext;
|
||||
pList->pFirst->pPrev = 0;
|
||||
pBlock->pPrev = pList->pLast;
|
||||
pBlock->pNext = 0;
|
||||
pList->pLast->pNext = pBlock;
|
||||
pList->pLast = pBlock;
|
||||
}
|
||||
p = PAGE_TO_PGHDR1(pCache, pPg);
|
||||
if( pCache->bPurgeable ){
|
||||
pCache->pGroup->nCurrentPage++;
|
||||
}
|
||||
#else
|
||||
/* The group mutex must be released before pcache1Alloc() is called. This
|
||||
** is because it may call sqlite3_release_memory(), which assumes that
|
||||
** this mutex is not held. */
|
||||
assert( sqlite3_mutex_held(pCache->pGroup->mutex) );
|
||||
pcache1LeaveMutex(pCache->pGroup);
|
||||
pPg = pcache1Alloc(nByte);
|
||||
pcache1EnterMutex(pCache->pGroup);
|
||||
if( pPg ){
|
||||
p = PAGE_TO_PGHDR1(pCache, pPg);
|
||||
if( pCache->bPurgeable ){
|
||||
@@ -298,6 +503,7 @@ static PgHdr1 *pcache1AllocPage(PCache1 *pCache){
|
||||
}else{
|
||||
p = 0;
|
||||
}
|
||||
#endif
|
||||
return p;
|
||||
}
|
||||
|
||||
@@ -311,10 +517,52 @@ static PgHdr1 *pcache1AllocPage(PCache1 *pCache){
|
||||
static void pcache1FreePage(PgHdr1 *p){
|
||||
if( ALWAYS(p) ){
|
||||
PCache1 *pCache = p->pCache;
|
||||
void *pPg = PGHDR1_TO_PAGE(p);
|
||||
|
||||
#ifdef SQLITE_PAGECACHE_BLOCKALLOC
|
||||
PGroupBlock *pBlock = PAGE_GET_BLOCKPTR(pCache, pPg);
|
||||
PGroupBlockList *pList = pBlock->pList;
|
||||
int i = ((u8 *)pPg - pBlock->aData) / pList->nByte;
|
||||
|
||||
assert( pPg==(void *)&pBlock->aData[i*pList->nByte] );
|
||||
assert( pBlock->mUsed & ((Bitmask)1<<i) );
|
||||
pBlock->mUsed &= ~((Bitmask)1<<i);
|
||||
|
||||
/* Remove the block from the list. If it is completely empty, free it.
|
||||
** Or if it is not completely empty, re-insert it at the start of the
|
||||
** list. */
|
||||
if( pList->pFirst==pBlock ){
|
||||
pList->pFirst = pBlock->pNext;
|
||||
if( pList->pFirst ) pList->pFirst->pPrev = 0;
|
||||
}else{
|
||||
pBlock->pPrev->pNext = pBlock->pNext;
|
||||
}
|
||||
if( pList->pLast==pBlock ){
|
||||
pList->pLast = pBlock->pPrev;
|
||||
if( pList->pLast ) pList->pLast->pNext = 0;
|
||||
}else{
|
||||
pBlock->pNext->pPrev = pBlock->pPrev;
|
||||
}
|
||||
|
||||
if( pBlock->mUsed==0 ){
|
||||
PGroup *pGroup = p->pCache->pGroup;
|
||||
|
||||
int sz = sqlite3MallocSize(pBlock);
|
||||
sqlite3_mutex_enter(pcache1.mutex);
|
||||
sqlite3StatusAdd(SQLITE_STATUS_PAGECACHE_OVERFLOW, -sz);
|
||||
sqlite3_mutex_leave(pcache1.mutex);
|
||||
freeListIfEmpty(pGroup, pList);
|
||||
sqlite3_free(pBlock);
|
||||
}else{
|
||||
addBlockToList(pList, pBlock);
|
||||
}
|
||||
#else
|
||||
assert( sqlite3_mutex_held(p->pCache->pGroup->mutex) );
|
||||
pcache1Free(pPg);
|
||||
#endif
|
||||
if( pCache->bPurgeable ){
|
||||
pCache->pGroup->nCurrentPage--;
|
||||
}
|
||||
pcache1Free(PGHDR1_TO_PAGE(p));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -752,9 +1000,7 @@ static void *pcache1Fetch(sqlite3_pcache *p, unsigned int iKey, int createFlag){
|
||||
*/
|
||||
if( !pPage ){
|
||||
if( createFlag==1 ) sqlite3BeginBenignMalloc();
|
||||
pcache1LeaveMutex(pGroup);
|
||||
pPage = pcache1AllocPage(pCache);
|
||||
pcache1EnterMutex(pGroup);
|
||||
if( createFlag==1 ) sqlite3EndBenignMalloc();
|
||||
}
|
||||
|
||||
@@ -924,6 +1170,9 @@ void sqlite3PCacheSetDefault(void){
|
||||
*/
|
||||
int sqlite3PcacheReleaseMemory(int nReq){
|
||||
int nFree = 0;
|
||||
#ifdef SQLITE_PAGECACHE_BLOCKALLOC
|
||||
if( pcache1.grp.isBusy ) return 0;
|
||||
#endif
|
||||
assert( sqlite3_mutex_notheld(pcache1.grp.mutex) );
|
||||
assert( sqlite3_mutex_notheld(pcache1.mutex) );
|
||||
if( pcache1.pStart==0 ){
|
||||
|
||||
@@ -1205,16 +1205,10 @@ int sqlite3_db_config(sqlite3*, int op, ...);
|
||||
** order to verify that SQLite recovers gracefully from such
|
||||
** conditions.
|
||||
**
|
||||
** The xMalloc and xFree methods must work like the
|
||||
** malloc() and free() functions from the standard C library.
|
||||
** The xRealloc method must work like realloc() from the standard C library
|
||||
** with the exception that if the second argument to xRealloc is zero,
|
||||
** xRealloc must be a no-op - it must not perform any allocation or
|
||||
** deallocation. ^SQLite guarantees that the second argument to
|
||||
** The xMalloc, xRealloc, and xFree methods must work like the
|
||||
** malloc(), realloc() and free() functions from the standard C library.
|
||||
** ^SQLite guarantees that the second argument to
|
||||
** xRealloc is always a value returned by a prior call to xRoundup.
|
||||
** And so in cases where xRoundup always returns a positive number,
|
||||
** xRealloc can perform exactly as the standard library realloc() and
|
||||
** still be in compliance with this specification.
|
||||
**
|
||||
** xSize should return the allocated size of a memory allocation
|
||||
** previously obtained from xMalloc or xRealloc. The allocated size
|
||||
|
||||
@@ -147,19 +147,25 @@
|
||||
** specify which memory allocation subsystem to use.
|
||||
**
|
||||
** SQLITE_SYSTEM_MALLOC // Use normal system malloc()
|
||||
** SQLITE_WIN32_MALLOC // Use Win32 native heap API
|
||||
** SQLITE_MEMDEBUG // Debugging version of system malloc()
|
||||
**
|
||||
** On Windows, if the SQLITE_WIN32_MALLOC_VALIDATE macro is defined and the
|
||||
** assert() macro is enabled, each call into the Win32 native heap subsystem
|
||||
** will cause HeapValidate to be called. If heap validation should fail, an
|
||||
** assertion will be triggered.
|
||||
**
|
||||
** (Historical note: There used to be several other options, but we've
|
||||
** pared it down to just these two.)
|
||||
**
|
||||
** If none of the above are defined, then set SQLITE_SYSTEM_MALLOC as
|
||||
** the default.
|
||||
*/
|
||||
#if defined(SQLITE_SYSTEM_MALLOC)+defined(SQLITE_MEMDEBUG)>1
|
||||
#if defined(SQLITE_SYSTEM_MALLOC)+defined(SQLITE_WIN32_MALLOC)+defined(SQLITE_MEMDEBUG)>1
|
||||
# error "At most one of the following compile-time configuration options\
|
||||
is allows: SQLITE_SYSTEM_MALLOC, SQLITE_MEMDEBUG"
|
||||
is allows: SQLITE_SYSTEM_MALLOC, SQLITE_WIN32_MALLOC, SQLITE_MEMDEBUG"
|
||||
#endif
|
||||
#if defined(SQLITE_SYSTEM_MALLOC)+defined(SQLITE_MEMDEBUG)==0
|
||||
#if defined(SQLITE_SYSTEM_MALLOC)+defined(SQLITE_WIN32_MALLOC)+defined(SQLITE_MEMDEBUG)==0
|
||||
# define SQLITE_SYSTEM_MALLOC 1
|
||||
#endif
|
||||
|
||||
@@ -366,6 +372,14 @@
|
||||
# define SQLITE_TEMP_STORE 1
|
||||
#endif
|
||||
|
||||
/*
|
||||
** If all temporary storage is in-memory, then omit the external merge-sort
|
||||
** logic since it is superfluous.
|
||||
*/
|
||||
#if SQLITE_TEMP_STORE==3 && !defined(SQLITE_OMIT_MERGE_SORT)
|
||||
# define SQLITE_OMIT_MERGE_SORT
|
||||
#endif
|
||||
|
||||
/*
|
||||
** GCC does not define the offsetof() macro so we'll have to do it
|
||||
** ourselves.
|
||||
|
||||
@@ -2327,6 +2327,8 @@ static int DbObjCmd(void *cd, Tcl_Interp *interp, int objc,Tcl_Obj *const*objv){
|
||||
if( choice==DB_ONECOLUMN ){
|
||||
if( rc==TCL_OK ){
|
||||
Tcl_SetObjResult(interp, dbEvalColumnValue(&sEval, 0));
|
||||
}else if( rc==TCL_BREAK ){
|
||||
Tcl_ResetResult(interp);
|
||||
}
|
||||
}else if( rc==TCL_BREAK || rc==TCL_OK ){
|
||||
Tcl_SetObjResult(interp, Tcl_NewBooleanObj(rc==TCL_OK));
|
||||
|
||||
31
src/test1.c
31
src/test1.c
@@ -4991,9 +4991,8 @@ static int file_control_chunksize_test(
|
||||
/*
|
||||
** tclcmd: file_control_sizehint_test DB DBNAME SIZE
|
||||
**
|
||||
** This TCL command runs the sqlite3_file_control interface and
|
||||
** verifies correct operation of the SQLITE_GET_LOCKPROXYFILE and
|
||||
** SQLITE_SET_LOCKPROXYFILE verbs.
|
||||
** This TCL command runs the sqlite3_file_control interface
|
||||
** with SQLITE_FCNTL_SIZE_HINT
|
||||
*/
|
||||
static int file_control_sizehint_test(
|
||||
ClientData clientData, /* Pointer to sqlite3_enable_XXX function */
|
||||
@@ -5645,6 +5644,7 @@ static int test_test_control(
|
||||
** background thread.
|
||||
*/
|
||||
struct win32FileLocker {
|
||||
char *evName; /* Name of event to signal thread startup */
|
||||
HANDLE h; /* Handle of the file to be locked */
|
||||
int delay1; /* Delay before locking */
|
||||
int delay2; /* Delay before unlocking */
|
||||
@@ -5660,6 +5660,13 @@ struct win32FileLocker {
|
||||
*/
|
||||
static void win32_file_locker(void *pAppData){
|
||||
struct win32FileLocker *p = (struct win32FileLocker*)pAppData;
|
||||
if( p->evName ){
|
||||
HANDLE ev = OpenEvent(EVENT_MODIFY_STATE, FALSE, p->evName);
|
||||
if ( ev ){
|
||||
SetEvent(ev);
|
||||
CloseHandle(ev);
|
||||
}
|
||||
}
|
||||
if( p->delay1 ) Sleep(p->delay1);
|
||||
if( LockFile(p->h, 0, 0, 100000000, 0) ){
|
||||
Sleep(p->delay2);
|
||||
@@ -5688,16 +5695,18 @@ static int win32_file_lock(
|
||||
int objc,
|
||||
Tcl_Obj *CONST objv[]
|
||||
){
|
||||
static struct win32FileLocker x = { 0, 0, 0 };
|
||||
static struct win32FileLocker x = { "win32_file_lock", 0, 0, 0, 0, 0 };
|
||||
const char *zFilename;
|
||||
char zBuf[200];
|
||||
int retry = 0;
|
||||
HANDLE ev;
|
||||
DWORD wResult;
|
||||
|
||||
if( objc!=4 && objc!=1 ){
|
||||
Tcl_WrongNumArgs(interp, 1, objv, "FILENAME DELAY1 DELAY2");
|
||||
return TCL_ERROR;
|
||||
}
|
||||
if( objc==1 ){
|
||||
char zBuf[200];
|
||||
sqlite3_snprintf(sizeof(zBuf), zBuf, "%d %d %d %d %d",
|
||||
x.ok, x.err, x.delay1, x.delay2, x.h);
|
||||
Tcl_AppendResult(interp, zBuf, (char*)0);
|
||||
@@ -5721,8 +5730,20 @@ static int win32_file_lock(
|
||||
Tcl_AppendResult(interp, "cannot open file: ", zFilename, (char*)0);
|
||||
return TCL_ERROR;
|
||||
}
|
||||
ev = CreateEvent(NULL, TRUE, FALSE, x.evName);
|
||||
if ( !ev ){
|
||||
Tcl_AppendResult(interp, "cannot create event: ", x.evName, (char*)0);
|
||||
return TCL_ERROR;
|
||||
}
|
||||
_beginthread(win32_file_locker, 0, (void*)&x);
|
||||
Sleep(0);
|
||||
if ( (wResult = WaitForSingleObject(ev, 10000))!=WAIT_OBJECT_0 ){
|
||||
sqlite3_snprintf(sizeof(zBuf), zBuf, "0x%x", wResult);
|
||||
Tcl_AppendResult(interp, "wait failed: ", zBuf, (char*)0);
|
||||
CloseHandle(ev);
|
||||
return TCL_ERROR;
|
||||
}
|
||||
CloseHandle(ev);
|
||||
return TCL_OK;
|
||||
}
|
||||
#endif
|
||||
|
||||
10
src/test6.c
10
src/test6.c
@@ -505,6 +505,16 @@ static int cfCheckReservedLock(sqlite3_file *pFile, int *pResOut){
|
||||
return sqlite3OsCheckReservedLock(((CrashFile *)pFile)->pRealFile, pResOut);
|
||||
}
|
||||
static int cfFileControl(sqlite3_file *pFile, int op, void *pArg){
|
||||
if( op==SQLITE_FCNTL_SIZE_HINT ){
|
||||
CrashFile *pCrash = (CrashFile *)pFile;
|
||||
i64 nByte = *(i64 *)pArg;
|
||||
if( nByte>pCrash->iSize ){
|
||||
if( SQLITE_OK==writeListAppend(pFile, nByte, 0, 0) ){
|
||||
pCrash->iSize = nByte;
|
||||
}
|
||||
}
|
||||
return SQLITE_OK;
|
||||
}
|
||||
return sqlite3OsFileControl(((CrashFile *)pFile)->pRealFile, op, pArg);
|
||||
}
|
||||
|
||||
|
||||
@@ -369,6 +369,12 @@ Tcl_SetVar2(interp, "sqlite_options", "long_double",
|
||||
Tcl_SetVar2(interp, "sqlite_options", "memorymanage", "0", TCL_GLOBAL_ONLY);
|
||||
#endif
|
||||
|
||||
#ifdef SQLITE_OMIT_MERGE_SORT
|
||||
Tcl_SetVar2(interp, "sqlite_options", "mergesort", "0", TCL_GLOBAL_ONLY);
|
||||
#else
|
||||
Tcl_SetVar2(interp, "sqlite_options", "mergesort", "1", TCL_GLOBAL_ONLY);
|
||||
#endif
|
||||
|
||||
#ifdef SQLITE_OMIT_OR_OPTIMIZATION
|
||||
Tcl_SetVar2(interp, "sqlite_options", "or_opt", "0", TCL_GLOBAL_ONLY);
|
||||
#else
|
||||
@@ -561,6 +567,12 @@ Tcl_SetVar2(interp, "sqlite_options", "long_double",
|
||||
Tcl_SetVar2(interp, "sqlite_options", "yytrackmaxstackdepth", "0", TCL_GLOBAL_ONLY);
|
||||
#endif
|
||||
|
||||
#ifdef SQLITE_PAGECACHE_BLOCKALLOC
|
||||
Tcl_SetVar2(interp, "sqlite_options", "blockalloc", "1", TCL_GLOBAL_ONLY);
|
||||
#else
|
||||
Tcl_SetVar2(interp, "sqlite_options", "blockalloc", "0", TCL_GLOBAL_ONLY);
|
||||
#endif
|
||||
|
||||
#define LINKVAR(x) { \
|
||||
static const int cv_ ## x = SQLITE_ ## x; \
|
||||
Tcl_LinkVar(interp, "SQLITE_" #x, (char *)&(cv_ ## x), \
|
||||
|
||||
@@ -1222,7 +1222,7 @@ static int test_dump_memsys3(
|
||||
return TCL_ERROR;
|
||||
}
|
||||
|
||||
switch( (int)clientData ){
|
||||
switch( SQLITE_PTR_TO_INT(clientData) ){
|
||||
case 3: {
|
||||
#ifdef SQLITE_ENABLE_MEMSYS3
|
||||
extern void sqlite3Memsys3Dump(const char*);
|
||||
@@ -1460,7 +1460,7 @@ int Sqlitetest_malloc_Init(Tcl_Interp *interp){
|
||||
};
|
||||
int i;
|
||||
for(i=0; i<sizeof(aObjCmd)/sizeof(aObjCmd[0]); i++){
|
||||
ClientData c = (ClientData)aObjCmd[i].clientData;
|
||||
ClientData c = (ClientData)SQLITE_INT_TO_PTR(aObjCmd[i].clientData);
|
||||
Tcl_CreateObjCommand(interp, aObjCmd[i].zName, aObjCmd[i].xProc, c, 0);
|
||||
}
|
||||
return TCL_OK;
|
||||
|
||||
@@ -39,8 +39,13 @@
|
||||
** URI.
|
||||
**
|
||||
** The multiplex VFS allows databases up to 32 GiB in size. But it splits
|
||||
** the files up into 1 GiB pieces, so that they will work even on filesystems
|
||||
** that do not support large files.
|
||||
** the files up into smaller pieces, so that they will work even on
|
||||
** filesystems that do not support large files. The default chunk size
|
||||
** is 2147418112 bytes (which is 64KiB less than 2GiB) but this can be
|
||||
** changed at compile-time by defining the SQLITE_MULTIPLEX_CHUNK_SIZE
|
||||
** macro. Use the "chunksize=NNNN" query parameter with a URI filename
|
||||
** in order to select an alternative chunk size for individual connections
|
||||
** at run-time.
|
||||
*/
|
||||
#include "sqlite3.h"
|
||||
#include <string.h>
|
||||
|
||||
171
src/test_quota.c
171
src/test_quota.c
@@ -95,6 +95,7 @@ struct quotaFile {
|
||||
quotaGroup *pGroup; /* Quota group to which this file belongs */
|
||||
sqlite3_int64 iSize; /* Current size of this file */
|
||||
int nRef; /* Number of times this file is open */
|
||||
int deleteOnClose; /* True to delete this file when it closes */
|
||||
quotaFile *pNext, **ppPrev; /* Linked list of files in the same group */
|
||||
};
|
||||
|
||||
@@ -164,12 +165,45 @@ static struct {
|
||||
static void quotaEnter(void){ sqlite3_mutex_enter(gQuota.pMutex); }
|
||||
static void quotaLeave(void){ sqlite3_mutex_leave(gQuota.pMutex); }
|
||||
|
||||
/* Count the number of open files in a quotaGroup
|
||||
*/
|
||||
static int quotaGroupOpenFileCount(quotaGroup *pGroup){
|
||||
int N = 0;
|
||||
quotaFile *pFile = pGroup->pFiles;
|
||||
while( pFile ){
|
||||
if( pFile->nRef ) N++;
|
||||
pFile = pFile->pNext;
|
||||
}
|
||||
return N;
|
||||
}
|
||||
|
||||
/* Remove a file from a quota group.
|
||||
*/
|
||||
static void quotaRemoveFile(quotaFile *pFile){
|
||||
quotaGroup *pGroup = pFile->pGroup;
|
||||
pGroup->iSize -= pFile->iSize;
|
||||
*pFile->ppPrev = pFile->pNext;
|
||||
if( pFile->pNext ) pFile->pNext->ppPrev = pFile->ppPrev;
|
||||
sqlite3_free(pFile);
|
||||
}
|
||||
|
||||
/* Remove all files from a quota group. It is always the case that
|
||||
** all files will be closed when this routine is called.
|
||||
*/
|
||||
static void quotaRemoveAllFiles(quotaGroup *pGroup){
|
||||
while( pGroup->pFiles ){
|
||||
assert( pGroup->pFiles->nRef==0 );
|
||||
quotaRemoveFile(pGroup->pFiles);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* If the reference count and threshold for a quotaGroup are both
|
||||
** zero, then destroy the quotaGroup.
|
||||
*/
|
||||
static void quotaGroupDeref(quotaGroup *pGroup){
|
||||
if( pGroup->pFiles==0 && pGroup->iLimit==0 ){
|
||||
if( pGroup->iLimit==0 && quotaGroupOpenFileCount(pGroup)==0 ){
|
||||
quotaRemoveAllFiles(pGroup);
|
||||
*pGroup->ppPrev = pGroup->pNext;
|
||||
if( pGroup->pNext ) pGroup->pNext->ppPrev = pGroup->ppPrev;
|
||||
if( pGroup->xDestroy ) pGroup->xDestroy(pGroup->pArg);
|
||||
@@ -276,6 +310,17 @@ static sqlite3_file *quotaSubOpen(sqlite3_file *pConn){
|
||||
return (sqlite3_file*)&p[1];
|
||||
}
|
||||
|
||||
/* Find a file in a quota group and return a pointer to that file.
|
||||
** Return NULL if the file is not in the group.
|
||||
*/
|
||||
static quotaFile *quotaFindFile(quotaGroup *pGroup, const char *zName){
|
||||
quotaFile *pFile = pGroup->pFiles;
|
||||
while( pFile && strcmp(pFile->zFilename, zName)!=0 ){
|
||||
pFile = pFile->pNext;
|
||||
}
|
||||
return pFile;
|
||||
}
|
||||
|
||||
/************************* VFS Method Wrappers *****************************/
|
||||
/*
|
||||
** This is the xOpen method used for the "quota" VFS.
|
||||
@@ -319,8 +364,7 @@ static int quotaOpen(
|
||||
pSubOpen = quotaSubOpen(pConn);
|
||||
rc = pOrigVfs->xOpen(pOrigVfs, zName, pSubOpen, flags, pOutFlags);
|
||||
if( rc==SQLITE_OK ){
|
||||
for(pFile=pGroup->pFiles; pFile && strcmp(pFile->zFilename, zName);
|
||||
pFile=pFile->pNext){}
|
||||
pFile = quotaFindFile(pGroup, zName);
|
||||
if( pFile==0 ){
|
||||
int nName = strlen(zName);
|
||||
pFile = (quotaFile *)sqlite3_malloc( sizeof(*pFile) + nName + 1 );
|
||||
@@ -337,6 +381,7 @@ static int quotaOpen(
|
||||
pFile->ppPrev = &pGroup->pFiles;
|
||||
pGroup->pFiles = pFile;
|
||||
pFile->pGroup = pGroup;
|
||||
pFile->deleteOnClose = (flags & SQLITE_OPEN_DELETEONCLOSE)!=0;
|
||||
}
|
||||
pFile->nRef++;
|
||||
pQuotaOpen->pFile = pFile;
|
||||
@@ -351,6 +396,49 @@ static int quotaOpen(
|
||||
return rc;
|
||||
}
|
||||
|
||||
/*
|
||||
** This is the xDelete method used for the "quota" VFS.
|
||||
**
|
||||
** If the file being deleted is part of the quota group, then reduce
|
||||
** the size of the quota group accordingly. And remove the file from
|
||||
** the set of files in the quota group.
|
||||
*/
|
||||
static int quotaDelete(
|
||||
sqlite3_vfs *pVfs, /* The quota VFS */
|
||||
const char *zName, /* Name of file to be deleted */
|
||||
int syncDir /* Do a directory sync after deleting */
|
||||
){
|
||||
int rc; /* Result code */
|
||||
quotaFile *pFile; /* Files in the quota */
|
||||
quotaGroup *pGroup; /* The group file belongs to */
|
||||
sqlite3_vfs *pOrigVfs = gQuota.pOrigVfs; /* Real VFS */
|
||||
|
||||
/* Do the actual file delete */
|
||||
rc = pOrigVfs->xDelete(pOrigVfs, zName, syncDir);
|
||||
|
||||
/* If the file just deleted is a member of a quota group, then remove
|
||||
** it from that quota group.
|
||||
*/
|
||||
if( rc==SQLITE_OK ){
|
||||
quotaEnter();
|
||||
pGroup = quotaGroupFind(zName);
|
||||
if( pGroup ){
|
||||
pFile = quotaFindFile(pGroup, zName);
|
||||
if( pFile ){
|
||||
if( pFile->nRef ){
|
||||
pFile->deleteOnClose = 1;
|
||||
}else{
|
||||
quotaRemoveFile(pFile);
|
||||
quotaGroupDeref(pGroup);
|
||||
}
|
||||
}
|
||||
}
|
||||
quotaLeave();
|
||||
}
|
||||
return rc;
|
||||
}
|
||||
|
||||
|
||||
/************************ I/O Method Wrappers *******************************/
|
||||
|
||||
/* xClose requests get passed through to the original VFS. But we
|
||||
@@ -367,11 +455,8 @@ static int quotaClose(sqlite3_file *pConn){
|
||||
pFile->nRef--;
|
||||
if( pFile->nRef==0 ){
|
||||
quotaGroup *pGroup = pFile->pGroup;
|
||||
pGroup->iSize -= pFile->iSize;
|
||||
if( pFile->pNext ) pFile->pNext->ppPrev = pFile->ppPrev;
|
||||
*pFile->ppPrev = pFile->pNext;
|
||||
if( pFile->deleteOnClose ) quotaRemoveFile(pFile);
|
||||
quotaGroupDeref(pGroup);
|
||||
sqlite3_free(pFile);
|
||||
}
|
||||
quotaLeave();
|
||||
return rc;
|
||||
@@ -586,6 +671,7 @@ int sqlite3_quota_initialize(const char *zOrigVfsName, int makeDefault){
|
||||
gQuota.pOrigVfs = pOrigVfs;
|
||||
gQuota.sThisVfs = *pOrigVfs;
|
||||
gQuota.sThisVfs.xOpen = quotaOpen;
|
||||
gQuota.sThisVfs.xDelete = quotaDelete;
|
||||
gQuota.sThisVfs.szOsFile += sizeof(quotaConn);
|
||||
gQuota.sThisVfs.zName = "quota";
|
||||
gQuota.sIoMethodsV1.iVersion = 1;
|
||||
@@ -617,19 +703,20 @@ int sqlite3_quota_initialize(const char *zOrigVfsName, int makeDefault){
|
||||
** All SQLite database connections must be closed before calling this
|
||||
** routine.
|
||||
**
|
||||
** THIS ROUTINE IS NOT THREADSAFE. Call this routine exactly one while
|
||||
** THIS ROUTINE IS NOT THREADSAFE. Call this routine exactly once while
|
||||
** shutting down in order to free all remaining quota groups.
|
||||
*/
|
||||
int sqlite3_quota_shutdown(void){
|
||||
quotaGroup *pGroup;
|
||||
if( gQuota.isInitialized==0 ) return SQLITE_MISUSE;
|
||||
for(pGroup=gQuota.pGroup; pGroup; pGroup=pGroup->pNext){
|
||||
if( pGroup->pFiles ) return SQLITE_MISUSE;
|
||||
if( quotaGroupOpenFileCount(pGroup)>0 ) return SQLITE_MISUSE;
|
||||
}
|
||||
while( gQuota.pGroup ){
|
||||
pGroup = gQuota.pGroup;
|
||||
gQuota.pGroup = pGroup->pNext;
|
||||
pGroup->iLimit = 0;
|
||||
assert( quotaGroupOpenFileCount(pGroup)==0 );
|
||||
quotaGroupDeref(pGroup);
|
||||
}
|
||||
gQuota.isInitialized = 0;
|
||||
@@ -708,6 +795,43 @@ int sqlite3_quota_set(
|
||||
return SQLITE_OK;
|
||||
}
|
||||
|
||||
/*
|
||||
** Bring the named file under quota management. Or if it is already under
|
||||
** management, update its size.
|
||||
*/
|
||||
int sqlite3_quota_file(const char *zFilename){
|
||||
char *zFull;
|
||||
sqlite3_file *fd;
|
||||
int rc;
|
||||
int outFlags = 0;
|
||||
sqlite3_int64 iSize;
|
||||
fd = sqlite3_malloc(gQuota.sThisVfs.szOsFile + gQuota.sThisVfs.mxPathname+1);
|
||||
if( fd==0 ) return SQLITE_NOMEM;
|
||||
zFull = gQuota.sThisVfs.szOsFile + (char*)fd;
|
||||
rc = gQuota.pOrigVfs->xFullPathname(gQuota.pOrigVfs, zFilename,
|
||||
gQuota.sThisVfs.mxPathname+1, zFull);
|
||||
if( rc==SQLITE_OK ){
|
||||
rc = quotaOpen(&gQuota.sThisVfs, zFull, fd,
|
||||
SQLITE_OPEN_READONLY | SQLITE_OPEN_MAIN_DB, &outFlags);
|
||||
}
|
||||
if( rc==SQLITE_OK ){
|
||||
fd->pMethods->xFileSize(fd, &iSize);
|
||||
fd->pMethods->xClose(fd);
|
||||
}else if( rc==SQLITE_CANTOPEN ){
|
||||
quotaGroup *pGroup;
|
||||
quotaFile *pFile;
|
||||
quotaEnter();
|
||||
pGroup = quotaGroupFind(zFull);
|
||||
if( pGroup ){
|
||||
pFile = quotaFindFile(pGroup, zFull);
|
||||
if( pFile ) quotaRemoveFile(pFile);
|
||||
}
|
||||
quotaLeave();
|
||||
}
|
||||
sqlite3_free(fd);
|
||||
return rc;
|
||||
}
|
||||
|
||||
|
||||
/***************************** Test Code ***********************************/
|
||||
#ifdef SQLITE_TEST
|
||||
@@ -884,6 +1008,32 @@ static int test_quota_set(
|
||||
return TCL_OK;
|
||||
}
|
||||
|
||||
/*
|
||||
** tclcmd: sqlite3_quota_file FILENAME
|
||||
*/
|
||||
static int test_quota_file(
|
||||
void * clientData,
|
||||
Tcl_Interp *interp,
|
||||
int objc,
|
||||
Tcl_Obj *CONST objv[]
|
||||
){
|
||||
const char *zFilename; /* File pattern to configure */
|
||||
int rc; /* Value returned by quota_file() */
|
||||
|
||||
/* Process arguments */
|
||||
if( objc!=2 ){
|
||||
Tcl_WrongNumArgs(interp, 1, objv, "FILENAME");
|
||||
return TCL_ERROR;
|
||||
}
|
||||
zFilename = Tcl_GetString(objv[1]);
|
||||
|
||||
/* Invoke sqlite3_quota_file() */
|
||||
rc = sqlite3_quota_file(zFilename);
|
||||
|
||||
Tcl_SetResult(interp, (char *)sqlite3TestErrorName(rc), TCL_STATIC);
|
||||
return TCL_OK;
|
||||
}
|
||||
|
||||
/*
|
||||
** tclcmd: sqlite3_quota_dump
|
||||
*/
|
||||
@@ -917,6 +1067,8 @@ static int test_quota_dump(
|
||||
Tcl_NewWideIntObj(pFile->iSize));
|
||||
Tcl_ListObjAppendElement(interp, pFileTerm,
|
||||
Tcl_NewWideIntObj(pFile->nRef));
|
||||
Tcl_ListObjAppendElement(interp, pFileTerm,
|
||||
Tcl_NewWideIntObj(pFile->deleteOnClose));
|
||||
Tcl_ListObjAppendElement(interp, pGroupTerm, pFileTerm);
|
||||
}
|
||||
Tcl_ListObjAppendElement(interp, pResult, pGroupTerm);
|
||||
@@ -939,6 +1091,7 @@ int Sqlitequota_Init(Tcl_Interp *interp){
|
||||
{ "sqlite3_quota_initialize", test_quota_initialize },
|
||||
{ "sqlite3_quota_shutdown", test_quota_shutdown },
|
||||
{ "sqlite3_quota_set", test_quota_set },
|
||||
{ "sqlite3_quota_file", test_quota_file },
|
||||
{ "sqlite3_quota_dump", test_quota_dump },
|
||||
};
|
||||
int i;
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
/* Solely for the UNUSED_PARAMETER() macro. */
|
||||
#include "sqliteInt.h"
|
||||
|
||||
#ifdef SQLITE_ENABLE_RTREE
|
||||
/*
|
||||
** Type used to cache parameter information for the "circle" r-tree geometry
|
||||
** callback.
|
||||
@@ -230,6 +231,7 @@ static int cube_geom(
|
||||
|
||||
return SQLITE_OK;
|
||||
}
|
||||
#endif /* SQLITE_ENABLE_RTREE */
|
||||
|
||||
static int register_cube_geom(
|
||||
void * clientData,
|
||||
|
||||
@@ -325,6 +325,7 @@ static int ts_pread64(int fd, void *aBuf, size_t nBuf, off_t off){
|
||||
*/
|
||||
static int ts_write(int fd, const void *aBuf, size_t nBuf){
|
||||
if( tsIsFailErrno("write") ){
|
||||
if( tsErrno("write")==EINTR ) orig_write(fd, aBuf, nBuf/2);
|
||||
return -1;
|
||||
}
|
||||
return orig_write(fd, aBuf, nBuf);
|
||||
@@ -671,4 +672,3 @@ int SqlitetestSyscall_Init(Tcl_Interp *interp){
|
||||
return TCL_OK;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
@@ -305,7 +305,7 @@ static int sqlthread_id(
|
||||
Tcl_Obj *CONST objv[]
|
||||
){
|
||||
Tcl_ThreadId id = Tcl_GetCurrentThread();
|
||||
Tcl_SetObjResult(interp, Tcl_NewIntObj((int)id));
|
||||
Tcl_SetObjResult(interp, Tcl_NewIntObj(SQLITE_PTR_TO_INT(id)));
|
||||
UNUSED_PARAMETER(clientData);
|
||||
UNUSED_PARAMETER(objc);
|
||||
UNUSED_PARAMETER(objv);
|
||||
|
||||
@@ -123,6 +123,8 @@ struct Testvfs {
|
||||
#define TESTVFS_TRUNCATE_MASK 0x00002000
|
||||
#define TESTVFS_ACCESS_MASK 0x00004000
|
||||
#define TESTVFS_FULLPATHNAME_MASK 0x00008000
|
||||
#define TESTVFS_READ_MASK 0x00010000
|
||||
|
||||
#define TESTVFS_ALL_MASK 0x0001FFFF
|
||||
|
||||
|
||||
@@ -325,8 +327,22 @@ static int tvfsRead(
|
||||
int iAmt,
|
||||
sqlite_int64 iOfst
|
||||
){
|
||||
TestvfsFd *p = tvfsGetFd(pFile);
|
||||
return sqlite3OsRead(p->pReal, zBuf, iAmt, iOfst);
|
||||
int rc = SQLITE_OK;
|
||||
TestvfsFd *pFd = tvfsGetFd(pFile);
|
||||
Testvfs *p = (Testvfs *)pFd->pVfs->pAppData;
|
||||
if( p->pScript && p->mask&TESTVFS_READ_MASK ){
|
||||
tvfsExecTcl(p, "xRead",
|
||||
Tcl_NewStringObj(pFd->zFilename, -1), pFd->pShmId, 0
|
||||
);
|
||||
tvfsResultCode(p, &rc);
|
||||
}
|
||||
if( rc==SQLITE_OK && p->mask&TESTVFS_READ_MASK && tvfsInjectIoerr(p) ){
|
||||
rc = SQLITE_IOERR;
|
||||
}
|
||||
if( rc==SQLITE_OK ){
|
||||
rc = sqlite3OsRead(pFd->pReal, zBuf, iAmt, iOfst);
|
||||
}
|
||||
return rc;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -1030,6 +1046,7 @@ static int testvfs_obj_cmd(
|
||||
{ "xSync", TESTVFS_SYNC_MASK },
|
||||
{ "xDelete", TESTVFS_DELETE_MASK },
|
||||
{ "xWrite", TESTVFS_WRITE_MASK },
|
||||
{ "xRead", TESTVFS_READ_MASK },
|
||||
{ "xTruncate", TESTVFS_TRUNCATE_MASK },
|
||||
{ "xOpen", TESTVFS_OPEN_MASK },
|
||||
{ "xClose", TESTVFS_CLOSE_MASK },
|
||||
|
||||
70
src/vdbe.c
70
src/vdbe.c
@@ -167,6 +167,13 @@ int sqlite3_found_count = 0;
|
||||
*/
|
||||
#define ExpandBlob(P) (((P)->flags&MEM_Zero)?sqlite3VdbeMemExpandBlob(P):0)
|
||||
|
||||
/* Return true if the cursor was opened using the OP_OpenSorter opcode. */
|
||||
#ifdef SQLITE_OMIT_MERGE_SORT
|
||||
# define isSorter(x) 0
|
||||
#else
|
||||
# define isSorter(x) ((x)->pSorter!=0)
|
||||
#endif
|
||||
|
||||
/*
|
||||
** Argument pMem points at a register that will be passed to a
|
||||
** user-defined function or returned to the user as the result of a query.
|
||||
@@ -3134,7 +3141,7 @@ case OP_OpenWrite: {
|
||||
break;
|
||||
}
|
||||
|
||||
/* Opcode: OpenEphemeral P1 P2 * P4 *
|
||||
/* Opcode: OpenEphemeral P1 P2 * P4 P5
|
||||
**
|
||||
** Open a new cursor P1 to a transient table.
|
||||
** The cursor is always opened read/write even if
|
||||
@@ -3151,6 +3158,11 @@ case OP_OpenWrite: {
|
||||
** to a TEMP table at the SQL level, or to a table opened by
|
||||
** this opcode. Then this opcode was call OpenVirtual. But
|
||||
** that created confusion with the whole virtual-table idea.
|
||||
**
|
||||
** The P5 parameter can be a mask of the BTREE_* flags defined
|
||||
** in btree.h. These flags control aspects of the operation of
|
||||
** the btree. The BTREE_OMIT_JOURNAL and BTREE_SINGLE flags are
|
||||
** added automatically.
|
||||
*/
|
||||
/* Opcode: OpenAutoindex P1 P2 * P4 *
|
||||
**
|
||||
@@ -3159,6 +3171,13 @@ case OP_OpenWrite: {
|
||||
** by this opcode will be used for automatically created transient
|
||||
** indices in joins.
|
||||
*/
|
||||
/* Opcode: OpenSorter P1 P2 * P4 *
|
||||
**
|
||||
** This opcode works like OP_OpenEphemeral except that it opens
|
||||
** a transient index that is specifically designed to sort large
|
||||
** tables using an external merge-sort algorithm.
|
||||
*/
|
||||
case OP_OpenSorter:
|
||||
case OP_OpenAutoindex:
|
||||
case OP_OpenEphemeral: {
|
||||
VdbeCursor *pCx;
|
||||
@@ -3170,6 +3189,7 @@ case OP_OpenEphemeral: {
|
||||
SQLITE_OPEN_TRANSIENT_DB;
|
||||
|
||||
assert( pOp->p1>=0 );
|
||||
assert( (pOp->opcode==OP_OpenSorter)==((pOp->p5 & BTREE_SORTER)!=0) );
|
||||
pCx = allocateCursor(p, pOp->p1, pOp->p2, -1, 1);
|
||||
if( pCx==0 ) goto no_mem;
|
||||
pCx->nullRow = 1;
|
||||
@@ -3203,6 +3223,11 @@ case OP_OpenEphemeral: {
|
||||
}
|
||||
pCx->isOrdered = (pOp->p5!=BTREE_UNORDERED);
|
||||
pCx->isIndex = !pCx->isTable;
|
||||
#ifndef SQLITE_OMIT_MERGE_SORT
|
||||
if( rc==SQLITE_OK && pOp->opcode==OP_OpenSorter ){
|
||||
rc = sqlite3VdbeSorterInit(db, pCx);
|
||||
}
|
||||
#endif
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -4134,6 +4159,13 @@ case OP_RowData: {
|
||||
assert( pC!=0 );
|
||||
assert( pC->nullRow==0 );
|
||||
assert( pC->pseudoTableReg==0 );
|
||||
|
||||
if( isSorter(pC) ){
|
||||
assert( pOp->opcode==OP_RowKey );
|
||||
rc = sqlite3VdbeSorterRowkey(pC, pOut);
|
||||
break;
|
||||
}
|
||||
|
||||
assert( pC->pCursor!=0 );
|
||||
pCrsr = pC->pCursor;
|
||||
assert( sqlite3BtreeCursorIsValid(pCrsr) );
|
||||
@@ -4314,7 +4346,9 @@ case OP_Rewind: { /* jump */
|
||||
pC = p->apCsr[pOp->p1];
|
||||
assert( pC!=0 );
|
||||
res = 1;
|
||||
if( (pCrsr = pC->pCursor)!=0 ){
|
||||
if( isSorter(pC) ){
|
||||
rc = sqlite3VdbeSorterRewind(db, pC, &res);
|
||||
}else if( (pCrsr = pC->pCursor)!=0 ){
|
||||
rc = sqlite3BtreeFirst(pCrsr, &res);
|
||||
pC->atFirst = res==0 ?1:0;
|
||||
pC->deferredMoveto = 0;
|
||||
@@ -4368,15 +4402,20 @@ case OP_Next: { /* jump */
|
||||
if( pC==0 ){
|
||||
break; /* See ticket #2273 */
|
||||
}
|
||||
pCrsr = pC->pCursor;
|
||||
if( pCrsr==0 ){
|
||||
pC->nullRow = 1;
|
||||
break;
|
||||
if( isSorter(pC) ){
|
||||
assert( pOp->opcode==OP_Next );
|
||||
rc = sqlite3VdbeSorterNext(db, pC, &res);
|
||||
}else{
|
||||
pCrsr = pC->pCursor;
|
||||
if( pCrsr==0 ){
|
||||
pC->nullRow = 1;
|
||||
break;
|
||||
}
|
||||
res = 1;
|
||||
assert( pC->deferredMoveto==0 );
|
||||
rc = pOp->opcode==OP_Next ? sqlite3BtreeNext(pCrsr, &res) :
|
||||
sqlite3BtreePrevious(pCrsr, &res);
|
||||
}
|
||||
res = 1;
|
||||
assert( pC->deferredMoveto==0 );
|
||||
rc = pOp->opcode==OP_Next ? sqlite3BtreeNext(pCrsr, &res) :
|
||||
sqlite3BtreePrevious(pCrsr, &res);
|
||||
pC->nullRow = (u8)res;
|
||||
pC->cacheStatus = CACHE_STALE;
|
||||
if( res==0 ){
|
||||
@@ -4420,10 +4459,13 @@ case OP_IdxInsert: { /* in2 */
|
||||
if( rc==SQLITE_OK ){
|
||||
nKey = pIn2->n;
|
||||
zKey = pIn2->z;
|
||||
rc = sqlite3BtreeInsert(pCrsr, zKey, nKey, "", 0, 0, pOp->p3,
|
||||
((pOp->p5 & OPFLAG_USESEEKRESULT) ? pC->seekResult : 0)
|
||||
);
|
||||
assert( pC->deferredMoveto==0 );
|
||||
rc = sqlite3VdbeSorterWrite(db, pC, nKey);
|
||||
if( rc==SQLITE_OK ){
|
||||
rc = sqlite3BtreeInsert(pCrsr, zKey, nKey, "", 0, 0, pOp->p3,
|
||||
((pOp->p5 & OPFLAG_USESEEKRESULT) ? pC->seekResult : 0)
|
||||
);
|
||||
assert( pC->deferredMoveto==0 );
|
||||
}
|
||||
pC->cacheStatus = CACHE_STALE;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -175,9 +175,9 @@ int sqlite3VdbeAddOp4(Vdbe*,int,int,int,int,const char *zP4,int);
|
||||
int sqlite3VdbeAddOp4Int(Vdbe*,int,int,int,int,int);
|
||||
int sqlite3VdbeAddOpList(Vdbe*, int nOp, VdbeOpList const *aOp);
|
||||
void sqlite3VdbeAddParseSchemaOp(Vdbe*,int,char*);
|
||||
void sqlite3VdbeChangeP1(Vdbe*, int addr, int P1);
|
||||
void sqlite3VdbeChangeP2(Vdbe*, int addr, int P2);
|
||||
void sqlite3VdbeChangeP3(Vdbe*, int addr, int P3);
|
||||
void sqlite3VdbeChangeP1(Vdbe*, u32 addr, int P1);
|
||||
void sqlite3VdbeChangeP2(Vdbe*, u32 addr, int P2);
|
||||
void sqlite3VdbeChangeP3(Vdbe*, u32 addr, int P3);
|
||||
void sqlite3VdbeChangeP5(Vdbe*, u8 P5);
|
||||
void sqlite3VdbeJumpHere(Vdbe*, int addr);
|
||||
void sqlite3VdbeChangeToNoop(Vdbe*, int addr, int N);
|
||||
|
||||
@@ -30,6 +30,9 @@ typedef struct VdbeOp Op;
|
||||
*/
|
||||
typedef unsigned char Bool;
|
||||
|
||||
/* Opaque type used by code in vdbesort.c */
|
||||
typedef struct VdbeSorter VdbeSorter;
|
||||
|
||||
/*
|
||||
** A cursor is a pointer into a single BTree within a database file.
|
||||
** The cursor can seek to a BTree entry with a particular key, or
|
||||
@@ -61,6 +64,7 @@ struct VdbeCursor {
|
||||
i64 seqCount; /* Sequence counter */
|
||||
i64 movetoTarget; /* Argument to the deferred sqlite3BtreeMoveto() */
|
||||
i64 lastRowid; /* Last rowid from a Next or NextIdx operation */
|
||||
VdbeSorter *pSorter; /* Sorter object for OP_OpenSorter cursors */
|
||||
|
||||
/* Result of last sqlite3BtreeMoveto() done by an OP_NotExists or
|
||||
** OP_IsUnique opcode on this cursor. */
|
||||
@@ -409,6 +413,22 @@ void sqlite3VdbeMemStoreType(Mem *pMem);
|
||||
void sqlite3VdbePreUpdateHook(
|
||||
Vdbe *, VdbeCursor *, int, const char*, Table *, i64, int);
|
||||
|
||||
#ifdef SQLITE_OMIT_MERGE_SORT
|
||||
# define sqlite3VdbeSorterInit(Y,Z) SQLITE_OK
|
||||
# define sqlite3VdbeSorterWrite(X,Y,Z) SQLITE_OK
|
||||
# define sqlite3VdbeSorterClose(Y,Z)
|
||||
# define sqlite3VdbeSorterRowkey(Y,Z) SQLITE_OK
|
||||
# define sqlite3VdbeSorterRewind(X,Y,Z) SQLITE_OK
|
||||
# define sqlite3VdbeSorterNext(X,Y,Z) SQLITE_OK
|
||||
#else
|
||||
int sqlite3VdbeSorterInit(sqlite3 *, VdbeCursor *);
|
||||
int sqlite3VdbeSorterWrite(sqlite3 *, VdbeCursor *, int);
|
||||
void sqlite3VdbeSorterClose(sqlite3 *, VdbeCursor *);
|
||||
int sqlite3VdbeSorterRowkey(VdbeCursor *, Mem *);
|
||||
int sqlite3VdbeSorterRewind(sqlite3 *, VdbeCursor *, int *);
|
||||
int sqlite3VdbeSorterNext(sqlite3 *, VdbeCursor *, int *);
|
||||
#endif
|
||||
|
||||
#if !defined(SQLITE_OMIT_SHARED_CACHE) && SQLITE_THREADSAFE>0
|
||||
void sqlite3VdbeEnter(Vdbe*);
|
||||
void sqlite3VdbeLeave(Vdbe*);
|
||||
|
||||
@@ -525,10 +525,9 @@ int sqlite3VdbeAddOpList(Vdbe *p, int nOp, VdbeOpList const *aOp){
|
||||
** static array using sqlite3VdbeAddOpList but we want to make a
|
||||
** few minor changes to the program.
|
||||
*/
|
||||
void sqlite3VdbeChangeP1(Vdbe *p, int addr, int val){
|
||||
void sqlite3VdbeChangeP1(Vdbe *p, u32 addr, int val){
|
||||
assert( p!=0 );
|
||||
assert( addr>=0 );
|
||||
if( p->nOp>addr ){
|
||||
if( ((u32)p->nOp)>addr ){
|
||||
p->aOp[addr].p1 = val;
|
||||
}
|
||||
}
|
||||
@@ -537,10 +536,9 @@ void sqlite3VdbeChangeP1(Vdbe *p, int addr, int val){
|
||||
** Change the value of the P2 operand for a specific instruction.
|
||||
** This routine is useful for setting a jump destination.
|
||||
*/
|
||||
void sqlite3VdbeChangeP2(Vdbe *p, int addr, int val){
|
||||
void sqlite3VdbeChangeP2(Vdbe *p, u32 addr, int val){
|
||||
assert( p!=0 );
|
||||
assert( addr>=0 );
|
||||
if( p->nOp>addr ){
|
||||
if( ((u32)p->nOp)>addr ){
|
||||
p->aOp[addr].p2 = val;
|
||||
}
|
||||
}
|
||||
@@ -548,10 +546,9 @@ void sqlite3VdbeChangeP2(Vdbe *p, int addr, int val){
|
||||
/*
|
||||
** Change the value of the P3 operand for a specific instruction.
|
||||
*/
|
||||
void sqlite3VdbeChangeP3(Vdbe *p, int addr, int val){
|
||||
void sqlite3VdbeChangeP3(Vdbe *p, u32 addr, int val){
|
||||
assert( p!=0 );
|
||||
assert( addr>=0 );
|
||||
if( p->nOp>addr ){
|
||||
if( ((u32)p->nOp)>addr ){
|
||||
p->aOp[addr].p3 = val;
|
||||
}
|
||||
}
|
||||
@@ -1566,6 +1563,7 @@ void sqlite3VdbeFreeCursor(Vdbe *p, VdbeCursor *pCx){
|
||||
if( pCx==0 ){
|
||||
return;
|
||||
}
|
||||
sqlite3VdbeSorterClose(p->db, pCx);
|
||||
if( pCx->pBt ){
|
||||
sqlite3BtreeClose(pCx->pBt);
|
||||
/* The pCx->pCursor will be close automatically, if it exists, by
|
||||
|
||||
711
src/vdbesort.c
Normal file
711
src/vdbesort.c
Normal file
@@ -0,0 +1,711 @@
|
||||
/*
|
||||
** 2011 July 9
|
||||
**
|
||||
** 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 contains code for the VdbeSorter object, used in concert with
|
||||
** a VdbeCursor to sort large numbers of keys (as may be required, for
|
||||
** example, by CREATE INDEX statements on tables too large to fit in main
|
||||
** memory).
|
||||
*/
|
||||
|
||||
#include "sqliteInt.h"
|
||||
#include "vdbeInt.h"
|
||||
|
||||
#ifndef SQLITE_OMIT_MERGE_SORT
|
||||
|
||||
typedef struct VdbeSorterIter VdbeSorterIter;
|
||||
|
||||
/*
|
||||
** NOTES ON DATA STRUCTURE USED FOR N-WAY MERGES:
|
||||
**
|
||||
** As keys are added to the sorter, they are written to disk in a series
|
||||
** of sorted packed-memory-arrays (PMAs). The size of each PMA is roughly
|
||||
** the same as the cache-size allowed for temporary databases. In order
|
||||
** to allow the caller to extract keys from the sorter in sorted order,
|
||||
** all PMAs currently stored on disk must be merged together. This comment
|
||||
** describes the data structure used to do so. The structure supports
|
||||
** merging any number of arrays in a single pass with no redundant comparison
|
||||
** operations.
|
||||
**
|
||||
** The aIter[] array contains an iterator for each of the PMAs being merged.
|
||||
** An aIter[] iterator either points to a valid key or else is at EOF. For
|
||||
** the purposes of the paragraphs below, we assume that the array is actually
|
||||
** N elements in size, where N is the smallest power of 2 greater to or equal
|
||||
** to the number of iterators being merged. The extra aIter[] elements are
|
||||
** treated as if they are empty (always at EOF).
|
||||
**
|
||||
** The aTree[] array is also N elements in size. The value of N is stored in
|
||||
** the VdbeSorter.nTree variable.
|
||||
**
|
||||
** The final (N/2) elements of aTree[] contain the results of comparing
|
||||
** pairs of iterator keys together. Element i contains the result of
|
||||
** comparing aIter[2*i-N] and aIter[2*i-N+1]. Whichever key is smaller, the
|
||||
** aTree element is set to the index of it.
|
||||
**
|
||||
** For the purposes of this comparison, EOF is considered greater than any
|
||||
** other key value. If the keys are equal (only possible with two EOF
|
||||
** values), it doesn't matter which index is stored.
|
||||
**
|
||||
** The (N/4) elements of aTree[] that preceed the final (N/2) described
|
||||
** above contains the index of the smallest of each block of 4 iterators.
|
||||
** And so on. So that aTree[1] contains the index of the iterator that
|
||||
** currently points to the smallest key value. aTree[0] is unused.
|
||||
**
|
||||
** Example:
|
||||
**
|
||||
** aIter[0] -> Banana
|
||||
** aIter[1] -> Feijoa
|
||||
** aIter[2] -> Elderberry
|
||||
** aIter[3] -> Currant
|
||||
** aIter[4] -> Grapefruit
|
||||
** aIter[5] -> Apple
|
||||
** aIter[6] -> Durian
|
||||
** aIter[7] -> EOF
|
||||
**
|
||||
** aTree[] = { X, 5 0, 5 0, 3, 5, 6 }
|
||||
**
|
||||
** The current element is "Apple" (the value of the key indicated by
|
||||
** iterator 5). When the Next() operation is invoked, iterator 5 will
|
||||
** be advanced to the next key in its segment. Say the next key is
|
||||
** "Eggplant":
|
||||
**
|
||||
** aIter[5] -> Eggplant
|
||||
**
|
||||
** The contents of aTree[] are updated first by comparing the new iterator
|
||||
** 5 key to the current key of iterator 4 (still "Grapefruit"). The iterator
|
||||
** 5 value is still smaller, so aTree[6] is set to 5. And so on up the tree.
|
||||
** The value of iterator 6 - "Durian" - is now smaller than that of iterator
|
||||
** 5, so aTree[3] is set to 6. Key 0 is smaller than key 6 (Banana<Durian),
|
||||
** so the value written into element 1 of the array is 0. As follows:
|
||||
**
|
||||
** aTree[] = { X, 0 0, 6 0, 3, 5, 6 }
|
||||
**
|
||||
** In other words, each time we advance to the next sorter element, log2(N)
|
||||
** key comparison operations are required, where N is the number of segments
|
||||
** being merged (rounded up to the next power of 2).
|
||||
*/
|
||||
struct VdbeSorter {
|
||||
int nWorking; /* Start a new b-tree after this many pages */
|
||||
int nBtree; /* Current size of b-tree contents as PMA */
|
||||
int nTree; /* Used size of aTree/aIter (power of 2) */
|
||||
VdbeSorterIter *aIter; /* Array of iterators to merge */
|
||||
int *aTree; /* Current state of incremental merge */
|
||||
i64 iWriteOff; /* Current write offset within file pTemp1 */
|
||||
i64 iReadOff; /* Current read offset within file pTemp1 */
|
||||
sqlite3_file *pTemp1; /* PMA file 1 */
|
||||
int nPMA; /* Number of PMAs stored in pTemp1 */
|
||||
};
|
||||
|
||||
/*
|
||||
** The following type is an iterator for a PMA. It caches the current key in
|
||||
** variables nKey/aKey. If the iterator is at EOF, pFile==0.
|
||||
*/
|
||||
struct VdbeSorterIter {
|
||||
i64 iReadOff; /* Current read offset */
|
||||
i64 iEof; /* 1 byte past EOF for this iterator */
|
||||
sqlite3_file *pFile; /* File iterator is reading from */
|
||||
int nAlloc; /* Bytes of space at aAlloc */
|
||||
u8 *aAlloc; /* Allocated space */
|
||||
int nKey; /* Number of bytes in key */
|
||||
u8 *aKey; /* Pointer to current key */
|
||||
};
|
||||
|
||||
/* Minimum allowable value for the VdbeSorter.nWorking variable */
|
||||
#define SORTER_MIN_WORKING 10
|
||||
|
||||
/* Maximum number of segments to merge in a single pass. */
|
||||
#define SORTER_MAX_MERGE_COUNT 16
|
||||
|
||||
/*
|
||||
** Free all memory belonging to the VdbeSorterIter object passed as the second
|
||||
** argument. All structure fields are set to zero before returning.
|
||||
*/
|
||||
static void vdbeSorterIterZero(sqlite3 *db, VdbeSorterIter *pIter){
|
||||
sqlite3DbFree(db, pIter->aAlloc);
|
||||
memset(pIter, 0, sizeof(VdbeSorterIter));
|
||||
}
|
||||
|
||||
/*
|
||||
** Advance iterator pIter to the next key in its PMA. Return SQLITE_OK if
|
||||
** no error occurs, or an SQLite error code if one does.
|
||||
*/
|
||||
static int vdbeSorterIterNext(
|
||||
sqlite3 *db, /* Database handle (for sqlite3DbMalloc() ) */
|
||||
VdbeSorterIter *pIter /* Iterator to advance */
|
||||
){
|
||||
int rc; /* Return Code */
|
||||
int nRead; /* Number of bytes read */
|
||||
int nRec; /* Size of record in bytes */
|
||||
int iOff; /* Size of serialized size varint in bytes */
|
||||
|
||||
nRead = pIter->iEof - pIter->iReadOff;
|
||||
if( nRead>5 ) nRead = 5;
|
||||
if( nRead<=0 ){
|
||||
/* This is an EOF condition */
|
||||
vdbeSorterIterZero(db, pIter);
|
||||
return SQLITE_OK;
|
||||
}
|
||||
|
||||
rc = sqlite3OsRead(pIter->pFile, pIter->aAlloc, nRead, pIter->iReadOff);
|
||||
iOff = getVarint32(pIter->aAlloc, nRec);
|
||||
|
||||
if( rc==SQLITE_OK && (iOff+nRec)>nRead ){
|
||||
int nRead2; /* Number of extra bytes to read */
|
||||
if( (iOff+nRec)>pIter->nAlloc ){
|
||||
int nNew = pIter->nAlloc*2;
|
||||
while( (iOff+nRec)>nNew ) nNew = nNew*2;
|
||||
pIter->aAlloc = sqlite3DbReallocOrFree(db, pIter->aAlloc, nNew);
|
||||
if( !pIter->aAlloc ) return SQLITE_NOMEM;
|
||||
pIter->nAlloc = nNew;
|
||||
}
|
||||
|
||||
nRead2 = iOff + nRec - nRead;
|
||||
rc = sqlite3OsRead(
|
||||
pIter->pFile, &pIter->aAlloc[nRead], nRead2, pIter->iReadOff+nRead
|
||||
);
|
||||
}
|
||||
|
||||
assert( nRec>0 || rc!=SQLITE_OK );
|
||||
pIter->iReadOff += iOff+nRec;
|
||||
pIter->nKey = nRec;
|
||||
pIter->aKey = &pIter->aAlloc[iOff];
|
||||
return rc;
|
||||
}
|
||||
|
||||
/*
|
||||
** Write a single varint, value iVal, to file-descriptor pFile. Return
|
||||
** SQLITE_OK if successful, or an SQLite error code if some error occurs.
|
||||
**
|
||||
** The value of *piOffset when this function is called is used as the byte
|
||||
** offset in file pFile to write to. Before returning, *piOffset is
|
||||
** incremented by the number of bytes written.
|
||||
*/
|
||||
static int vdbeSorterWriteVarint(
|
||||
sqlite3_file *pFile, /* File to write to */
|
||||
i64 iVal, /* Value to write as a varint */
|
||||
i64 *piOffset /* IN/OUT: Write offset in file pFile */
|
||||
){
|
||||
u8 aVarint[9]; /* Buffer large enough for a varint */
|
||||
int nVarint; /* Number of used bytes in varint */
|
||||
int rc; /* Result of write() call */
|
||||
|
||||
nVarint = sqlite3PutVarint(aVarint, iVal);
|
||||
rc = sqlite3OsWrite(pFile, aVarint, nVarint, *piOffset);
|
||||
*piOffset += nVarint;
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
||||
/*
|
||||
** Read a single varint from file-descriptor pFile. Return SQLITE_OK if
|
||||
** successful, or an SQLite error code if some error occurs.
|
||||
**
|
||||
** The value of *piOffset when this function is called is used as the
|
||||
** byte offset in file pFile from whence to read the varint. If successful
|
||||
** (i.e. if no IO error occurs), then *piOffset is set to the offset of
|
||||
** the first byte past the end of the varint before returning. *piVal is
|
||||
** set to the integer value read. If an error occurs, the final values of
|
||||
** both *piOffset and *piVal are undefined.
|
||||
*/
|
||||
static int vdbeSorterReadVarint(
|
||||
sqlite3_file *pFile, /* File to read from */
|
||||
i64 iEof, /* Total number of bytes in file */
|
||||
i64 *piOffset, /* IN/OUT: Read offset in pFile */
|
||||
i64 *piVal /* OUT: Value read from file */
|
||||
){
|
||||
u8 aVarint[9]; /* Buffer large enough for a varint */
|
||||
i64 iOff = *piOffset; /* Offset in file to read from */
|
||||
int nRead = 9; /* Number of bytes to read from file */
|
||||
int rc; /* Return code */
|
||||
|
||||
assert( iEof>iOff );
|
||||
if( (iEof-iOff)<nRead ){
|
||||
nRead = iEof-iOff;
|
||||
}
|
||||
|
||||
rc = sqlite3OsRead(pFile, aVarint, nRead, iOff);
|
||||
if( rc==SQLITE_OK ){
|
||||
*piOffset += getVarint(aVarint, (u64 *)piVal);
|
||||
}
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
||||
/*
|
||||
** Initialize iterator pIter to scan through the PMA stored in file pFile
|
||||
** starting at offset iStart and ending at offset iEof-1. This function
|
||||
** leaves the iterator pointing to the first key in the PMA (or EOF if the
|
||||
** PMA is empty).
|
||||
*/
|
||||
static int vdbeSorterIterInit(
|
||||
sqlite3 *db, /* Database handle */
|
||||
VdbeSorter *pSorter, /* Sorter object */
|
||||
i64 iStart, /* Start offset in pFile */
|
||||
VdbeSorterIter *pIter, /* Iterator to populate */
|
||||
i64 *pnByte /* IN/OUT: Increment this value by PMA size */
|
||||
){
|
||||
int rc;
|
||||
|
||||
assert( pSorter->iWriteOff>iStart );
|
||||
assert( pIter->aAlloc==0 );
|
||||
pIter->pFile = pSorter->pTemp1;
|
||||
pIter->iReadOff = iStart;
|
||||
pIter->nAlloc = 128;
|
||||
pIter->aAlloc = (u8 *)sqlite3DbMallocRaw(db, pIter->nAlloc);
|
||||
if( !pIter->aAlloc ){
|
||||
rc = SQLITE_NOMEM;
|
||||
}else{
|
||||
i64 iEof = pSorter->iWriteOff; /* EOF of file pSorter->pTemp1 */
|
||||
i64 nByte; /* Total size of PMA in bytes */
|
||||
rc = vdbeSorterReadVarint(pSorter->pTemp1, iEof, &pIter->iReadOff, &nByte);
|
||||
*pnByte += nByte;
|
||||
pIter->iEof = pIter->iReadOff + nByte;
|
||||
}
|
||||
if( rc==SQLITE_OK ){
|
||||
rc = vdbeSorterIterNext(db, pIter);
|
||||
}
|
||||
return rc;
|
||||
}
|
||||
|
||||
/*
|
||||
** This function is called to compare two iterator keys when merging
|
||||
** multiple b-tree segments. Parameter iOut is the index of the aTree[]
|
||||
** value to recalculate.
|
||||
*/
|
||||
static int vdbeSorterDoCompare(VdbeCursor *pCsr, int iOut){
|
||||
VdbeSorter *pSorter = pCsr->pSorter;
|
||||
int i1;
|
||||
int i2;
|
||||
int iRes;
|
||||
VdbeSorterIter *p1;
|
||||
VdbeSorterIter *p2;
|
||||
|
||||
assert( iOut<pSorter->nTree && iOut>0 );
|
||||
|
||||
if( iOut>=(pSorter->nTree/2) ){
|
||||
i1 = (iOut - pSorter->nTree/2) * 2;
|
||||
i2 = i1 + 1;
|
||||
}else{
|
||||
i1 = pSorter->aTree[iOut*2];
|
||||
i2 = pSorter->aTree[iOut*2+1];
|
||||
}
|
||||
|
||||
p1 = &pSorter->aIter[i1];
|
||||
p2 = &pSorter->aIter[i2];
|
||||
|
||||
if( p1->pFile==0 ){
|
||||
iRes = i2;
|
||||
}else if( p2->pFile==0 ){
|
||||
iRes = i1;
|
||||
}else{
|
||||
char aSpace[150];
|
||||
UnpackedRecord *r1;
|
||||
|
||||
r1 = sqlite3VdbeRecordUnpack(
|
||||
pCsr->pKeyInfo, p1->nKey, p1->aKey, aSpace, sizeof(aSpace)
|
||||
);
|
||||
if( r1==0 ) return SQLITE_NOMEM;
|
||||
|
||||
if( sqlite3VdbeRecordCompare(p2->nKey, p2->aKey, r1)>=0 ){
|
||||
iRes = i1;
|
||||
}else{
|
||||
iRes = i2;
|
||||
}
|
||||
sqlite3VdbeDeleteUnpackedRecord(r1);
|
||||
}
|
||||
|
||||
pSorter->aTree[iOut] = iRes;
|
||||
return SQLITE_OK;
|
||||
}
|
||||
|
||||
/*
|
||||
** Initialize the temporary index cursor just opened as a sorter cursor.
|
||||
*/
|
||||
int sqlite3VdbeSorterInit(sqlite3 *db, VdbeCursor *pCsr){
|
||||
assert( pCsr->pKeyInfo && pCsr->pBt );
|
||||
pCsr->pSorter = sqlite3DbMallocZero(db, sizeof(VdbeSorter));
|
||||
return (pCsr->pSorter ? SQLITE_OK : SQLITE_NOMEM);
|
||||
}
|
||||
|
||||
/*
|
||||
** Free any cursor components allocated by sqlite3VdbeSorterXXX routines.
|
||||
*/
|
||||
void sqlite3VdbeSorterClose(sqlite3 *db, VdbeCursor *pCsr){
|
||||
VdbeSorter *pSorter = pCsr->pSorter;
|
||||
if( pSorter ){
|
||||
if( pSorter->aIter ){
|
||||
int i;
|
||||
for(i=0; i<pSorter->nTree; i++){
|
||||
vdbeSorterIterZero(db, &pSorter->aIter[i]);
|
||||
}
|
||||
sqlite3DbFree(db, pSorter->aIter);
|
||||
}
|
||||
if( pSorter->pTemp1 ){
|
||||
sqlite3OsCloseFree(pSorter->pTemp1);
|
||||
}
|
||||
sqlite3DbFree(db, pSorter);
|
||||
pCsr->pSorter = 0;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
** Allocate space for a file-handle and open a temporary file. If successful,
|
||||
** set *ppFile to point to the malloc'd file-handle and return SQLITE_OK.
|
||||
** Otherwise, set *ppFile to 0 and return an SQLite error code.
|
||||
*/
|
||||
static int vdbeSorterOpenTempFile(sqlite3 *db, sqlite3_file **ppFile){
|
||||
int dummy;
|
||||
return sqlite3OsOpenMalloc(db->pVfs, 0, ppFile,
|
||||
SQLITE_OPEN_TEMP_JOURNAL |
|
||||
SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE |
|
||||
SQLITE_OPEN_EXCLUSIVE | SQLITE_OPEN_DELETEONCLOSE, &dummy
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
** Write the current contents of the b-tree to a PMA. Return SQLITE_OK
|
||||
** if successful, or an SQLite error code otherwise.
|
||||
**
|
||||
** The format of a PMA is:
|
||||
**
|
||||
** * A varint. This varint contains the total number of bytes of content
|
||||
** in the PMA (not including the varint itself).
|
||||
**
|
||||
** * One or more records packed end-to-end in order of ascending keys.
|
||||
** Each record consists of a varint followed by a blob of data (the
|
||||
** key). The varint is the number of bytes in the blob of data.
|
||||
*/
|
||||
static int vdbeSorterBtreeToPMA(sqlite3 *db, VdbeCursor *pCsr){
|
||||
int rc = SQLITE_OK; /* Return code */
|
||||
VdbeSorter *pSorter = pCsr->pSorter;
|
||||
int res = 0;
|
||||
|
||||
/* sqlite3BtreeFirst() cannot fail because sorter btrees are always held
|
||||
** in memory and so an I/O error is not possible. */
|
||||
rc = sqlite3BtreeFirst(pCsr->pCursor, &res);
|
||||
if( NEVER(rc!=SQLITE_OK) || res ) return rc;
|
||||
assert( pSorter->nBtree>0 );
|
||||
|
||||
/* If the first temporary PMA file has not been opened, open it now. */
|
||||
if( pSorter->pTemp1==0 ){
|
||||
rc = vdbeSorterOpenTempFile(db, &pSorter->pTemp1);
|
||||
assert( rc!=SQLITE_OK || pSorter->pTemp1 );
|
||||
assert( pSorter->iWriteOff==0 );
|
||||
assert( pSorter->nPMA==0 );
|
||||
}
|
||||
|
||||
if( rc==SQLITE_OK ){
|
||||
i64 iWriteOff = pSorter->iWriteOff;
|
||||
void *aMalloc = 0; /* Array used to hold a single record */
|
||||
int nMalloc = 0; /* Allocated size of aMalloc[] in bytes */
|
||||
|
||||
pSorter->nPMA++;
|
||||
for(
|
||||
rc = vdbeSorterWriteVarint(pSorter->pTemp1, pSorter->nBtree, &iWriteOff);
|
||||
rc==SQLITE_OK && res==0;
|
||||
rc = sqlite3BtreeNext(pCsr->pCursor, &res)
|
||||
){
|
||||
i64 nKey; /* Size of this key in bytes */
|
||||
|
||||
/* Write the size of the record in bytes to the output file */
|
||||
(void)sqlite3BtreeKeySize(pCsr->pCursor, &nKey);
|
||||
rc = vdbeSorterWriteVarint(pSorter->pTemp1, nKey, &iWriteOff);
|
||||
|
||||
/* Make sure the aMalloc[] buffer is large enough for the record */
|
||||
if( rc==SQLITE_OK && nKey>nMalloc ){
|
||||
aMalloc = sqlite3DbReallocOrFree(db, aMalloc, nKey);
|
||||
if( !aMalloc ){
|
||||
rc = SQLITE_NOMEM;
|
||||
}else{
|
||||
nMalloc = nKey;
|
||||
}
|
||||
}
|
||||
|
||||
/* Write the record itself to the output file */
|
||||
if( rc==SQLITE_OK ){
|
||||
/* sqlite3BtreeKey() cannot fail because sorter btrees held in memory */
|
||||
rc = sqlite3BtreeKey(pCsr->pCursor, 0, nKey, aMalloc);
|
||||
if( ALWAYS(rc==SQLITE_OK) ){
|
||||
rc = sqlite3OsWrite(pSorter->pTemp1, aMalloc, nKey, iWriteOff);
|
||||
iWriteOff += nKey;
|
||||
}
|
||||
}
|
||||
|
||||
if( rc!=SQLITE_OK ) break;
|
||||
}
|
||||
|
||||
/* This assert verifies that unless an error has occurred, the size of
|
||||
** the PMA on disk is the same as the expected size stored in
|
||||
** pSorter->nBtree. */
|
||||
assert( rc!=SQLITE_OK || pSorter->nBtree==(
|
||||
iWriteOff-pSorter->iWriteOff-sqlite3VarintLen(pSorter->nBtree)
|
||||
));
|
||||
|
||||
pSorter->iWriteOff = iWriteOff;
|
||||
sqlite3DbFree(db, aMalloc);
|
||||
}
|
||||
|
||||
pSorter->nBtree = 0;
|
||||
return rc;
|
||||
}
|
||||
|
||||
/*
|
||||
** This function is called on a sorter cursor by the VDBE before each row
|
||||
** is inserted into VdbeCursor.pCsr. Argument nKey is the size of the key, in
|
||||
** bytes, about to be inserted.
|
||||
**
|
||||
** If it is determined that the temporary b-tree accessed via VdbeCursor.pCsr
|
||||
** is large enough, its contents are written to a sorted PMA on disk and the
|
||||
** tree emptied. This prevents the b-tree (which must be small enough to
|
||||
** fit entirely in the cache in order to support efficient inserts) from
|
||||
** growing too large.
|
||||
**
|
||||
** An SQLite error code is returned if an error occurs. Otherwise, SQLITE_OK.
|
||||
*/
|
||||
int sqlite3VdbeSorterWrite(sqlite3 *db, VdbeCursor *pCsr, int nKey){
|
||||
int rc = SQLITE_OK; /* Return code */
|
||||
VdbeSorter *pSorter = pCsr->pSorter;
|
||||
if( pSorter ){
|
||||
Pager *pPager = sqlite3BtreePager(pCsr->pBt);
|
||||
int nPage; /* Current size of temporary file in pages */
|
||||
|
||||
/* Sorters never spill to disk */
|
||||
assert( sqlite3PagerFile(pPager)->pMethods==0 );
|
||||
|
||||
/* Determine how many pages the temporary b-tree has grown to */
|
||||
sqlite3PagerPagecount(pPager, &nPage);
|
||||
|
||||
/* If pSorter->nWorking is still zero, but the temporary file has been
|
||||
** created in the file-system, then the most recent insert into the
|
||||
** current b-tree segment probably caused the cache to overflow (it is
|
||||
** also possible that sqlite3_release_memory() was called). So set the
|
||||
** size of the working set to a little less than the current size of the
|
||||
** file in pages. */
|
||||
if( pSorter->nWorking==0 && sqlite3PagerUnderStress(pPager) ){
|
||||
pSorter->nWorking = nPage-5;
|
||||
if( pSorter->nWorking<SORTER_MIN_WORKING ){
|
||||
pSorter->nWorking = SORTER_MIN_WORKING;
|
||||
}
|
||||
}
|
||||
|
||||
/* If the number of pages used by the current b-tree segment is greater
|
||||
** than the size of the working set (VdbeSorter.nWorking), start a new
|
||||
** segment b-tree. */
|
||||
if( pSorter->nWorking && nPage>=pSorter->nWorking ){
|
||||
BtCursor *p = pCsr->pCursor;/* Cursor structure to close and reopen */
|
||||
int iRoot; /* Root page of new tree */
|
||||
|
||||
/* Copy the current contents of the b-tree into a PMA in sorted order.
|
||||
** Close the currently open b-tree cursor. */
|
||||
rc = vdbeSorterBtreeToPMA(db, pCsr);
|
||||
sqlite3BtreeCloseCursor(p);
|
||||
|
||||
if( rc==SQLITE_OK ){
|
||||
rc = sqlite3BtreeDropTable(pCsr->pBt, 2, 0);
|
||||
#ifdef SQLITE_DEBUG
|
||||
sqlite3PagerPagecount(pPager, &nPage);
|
||||
assert( rc!=SQLITE_OK || nPage==1 );
|
||||
#endif
|
||||
}
|
||||
if( rc==SQLITE_OK ){
|
||||
rc = sqlite3BtreeCreateTable(pCsr->pBt, &iRoot, BTREE_BLOBKEY);
|
||||
}
|
||||
if( rc==SQLITE_OK ){
|
||||
assert( iRoot==2 );
|
||||
rc = sqlite3BtreeCursor(pCsr->pBt, iRoot, 1, pCsr->pKeyInfo, p);
|
||||
}
|
||||
}
|
||||
|
||||
pSorter->nBtree += sqlite3VarintLen(nKey) + nKey;
|
||||
}
|
||||
return rc;
|
||||
}
|
||||
|
||||
/*
|
||||
** Helper function for sqlite3VdbeSorterRewind().
|
||||
*/
|
||||
static int vdbeSorterInitMerge(
|
||||
sqlite3 *db, /* Database handle */
|
||||
VdbeCursor *pCsr, /* Cursor handle for this sorter */
|
||||
i64 *pnByte /* Sum of bytes in all opened PMAs */
|
||||
){
|
||||
VdbeSorter *pSorter = pCsr->pSorter;
|
||||
int rc = SQLITE_OK; /* Return code */
|
||||
int i; /* Used to iterator through aIter[] */
|
||||
i64 nByte = 0; /* Total bytes in all opened PMAs */
|
||||
|
||||
/* Initialize the iterators. */
|
||||
for(i=0; rc==SQLITE_OK && i<SORTER_MAX_MERGE_COUNT; i++){
|
||||
VdbeSorterIter *pIter = &pSorter->aIter[i];
|
||||
rc = vdbeSorterIterInit(db, pSorter, pSorter->iReadOff, pIter, &nByte);
|
||||
pSorter->iReadOff = pIter->iEof;
|
||||
assert( pSorter->iReadOff<=pSorter->iWriteOff || rc!=SQLITE_OK );
|
||||
if( pSorter->iReadOff>=pSorter->iWriteOff ) break;
|
||||
}
|
||||
|
||||
/* Initialize the aTree[] array. */
|
||||
for(i=pSorter->nTree-1; rc==SQLITE_OK && i>0; i--){
|
||||
rc = vdbeSorterDoCompare(pCsr, i);
|
||||
}
|
||||
|
||||
*pnByte = nByte;
|
||||
return rc;
|
||||
}
|
||||
|
||||
/*
|
||||
** Once the sorter has been populated, this function is called to prepare
|
||||
** for iterating through its contents in sorted order.
|
||||
*/
|
||||
int sqlite3VdbeSorterRewind(sqlite3 *db, VdbeCursor *pCsr, int *pbEof){
|
||||
VdbeSorter *pSorter = pCsr->pSorter;
|
||||
int rc; /* Return code */
|
||||
sqlite3_file *pTemp2 = 0; /* Second temp file to use */
|
||||
i64 iWrite2 = 0; /* Write offset for pTemp2 */
|
||||
int nIter; /* Number of iterators used */
|
||||
int nByte; /* Bytes of space required for aIter/aTree */
|
||||
int N = 2; /* Power of 2 >= nIter */
|
||||
|
||||
assert( pSorter );
|
||||
|
||||
/* Write the current b-tree to a PMA. Close the b-tree cursor. */
|
||||
rc = vdbeSorterBtreeToPMA(db, pCsr);
|
||||
sqlite3BtreeCloseCursor(pCsr->pCursor);
|
||||
if( rc!=SQLITE_OK ) return rc;
|
||||
if( pSorter->nPMA==0 ){
|
||||
*pbEof = 1;
|
||||
return SQLITE_OK;
|
||||
}
|
||||
|
||||
/* Allocate space for aIter[] and aTree[]. */
|
||||
nIter = pSorter->nPMA;
|
||||
if( nIter>SORTER_MAX_MERGE_COUNT ) nIter = SORTER_MAX_MERGE_COUNT;
|
||||
assert( nIter>0 );
|
||||
while( N<nIter ) N += N;
|
||||
nByte = N * (sizeof(int) + sizeof(VdbeSorterIter));
|
||||
pSorter->aIter = (VdbeSorterIter *)sqlite3DbMallocZero(db, nByte);
|
||||
if( !pSorter->aIter ) return SQLITE_NOMEM;
|
||||
pSorter->aTree = (int *)&pSorter->aIter[N];
|
||||
pSorter->nTree = N;
|
||||
|
||||
do {
|
||||
int iNew; /* Index of new, merged, PMA */
|
||||
|
||||
for(iNew=0;
|
||||
rc==SQLITE_OK && iNew*SORTER_MAX_MERGE_COUNT<pSorter->nPMA;
|
||||
iNew++
|
||||
){
|
||||
i64 nWrite; /* Number of bytes in new PMA */
|
||||
|
||||
/* If there are SORTER_MAX_MERGE_COUNT or less PMAs in file pTemp1,
|
||||
** initialize an iterator for each of them and break out of the loop.
|
||||
** These iterators will be incrementally merged as the VDBE layer calls
|
||||
** sqlite3VdbeSorterNext().
|
||||
**
|
||||
** Otherwise, if pTemp1 contains more than SORTER_MAX_MERGE_COUNT PMAs,
|
||||
** initialize interators for SORTER_MAX_MERGE_COUNT of them. These PMAs
|
||||
** are merged into a single PMA that is written to file pTemp2.
|
||||
*/
|
||||
rc = vdbeSorterInitMerge(db, pCsr, &nWrite);
|
||||
assert( rc!=SQLITE_OK || pSorter->aIter[ pSorter->aTree[1] ].pFile );
|
||||
if( rc!=SQLITE_OK || pSorter->nPMA<=SORTER_MAX_MERGE_COUNT ){
|
||||
break;
|
||||
}
|
||||
|
||||
/* Open the second temp file, if it is not already open. */
|
||||
if( pTemp2==0 ){
|
||||
assert( iWrite2==0 );
|
||||
rc = vdbeSorterOpenTempFile(db, &pTemp2);
|
||||
}
|
||||
|
||||
if( rc==SQLITE_OK ){
|
||||
rc = vdbeSorterWriteVarint(pTemp2, nWrite, &iWrite2);
|
||||
}
|
||||
|
||||
if( rc==SQLITE_OK ){
|
||||
int bEof = 0;
|
||||
while( rc==SQLITE_OK && bEof==0 ){
|
||||
int nToWrite;
|
||||
VdbeSorterIter *pIter = &pSorter->aIter[ pSorter->aTree[1] ];
|
||||
assert( pIter->pFile );
|
||||
nToWrite = pIter->nKey + sqlite3VarintLen(pIter->nKey);
|
||||
rc = sqlite3OsWrite(pTemp2, pIter->aAlloc, nToWrite, iWrite2);
|
||||
iWrite2 += nToWrite;
|
||||
if( rc==SQLITE_OK ){
|
||||
rc = sqlite3VdbeSorterNext(db, pCsr, &bEof);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if( pSorter->nPMA<=SORTER_MAX_MERGE_COUNT ){
|
||||
break;
|
||||
}else{
|
||||
sqlite3_file *pTmp = pSorter->pTemp1;
|
||||
pSorter->nPMA = iNew;
|
||||
pSorter->pTemp1 = pTemp2;
|
||||
pTemp2 = pTmp;
|
||||
pSorter->iWriteOff = iWrite2;
|
||||
pSorter->iReadOff = 0;
|
||||
iWrite2 = 0;
|
||||
}
|
||||
}while( rc==SQLITE_OK );
|
||||
|
||||
if( pTemp2 ){
|
||||
sqlite3OsCloseFree(pTemp2);
|
||||
}
|
||||
*pbEof = (pSorter->aIter[pSorter->aTree[1]].pFile==0);
|
||||
return rc;
|
||||
}
|
||||
|
||||
/*
|
||||
** Advance to the next element in the sorter.
|
||||
*/
|
||||
int sqlite3VdbeSorterNext(sqlite3 *db, VdbeCursor *pCsr, int *pbEof){
|
||||
VdbeSorter *pSorter = pCsr->pSorter;
|
||||
int iPrev = pSorter->aTree[1]; /* Index of iterator to advance */
|
||||
int i; /* Index of aTree[] to recalculate */
|
||||
int rc; /* Return code */
|
||||
|
||||
rc = vdbeSorterIterNext(db, &pSorter->aIter[iPrev]);
|
||||
for(i=(pSorter->nTree+iPrev)/2; rc==SQLITE_OK && i>0; i=i/2){
|
||||
rc = vdbeSorterDoCompare(pCsr, i);
|
||||
}
|
||||
|
||||
*pbEof = (pSorter->aIter[pSorter->aTree[1]].pFile==0);
|
||||
return rc;
|
||||
}
|
||||
|
||||
/*
|
||||
** Copy the current sorter key into the memory cell pOut.
|
||||
*/
|
||||
int sqlite3VdbeSorterRowkey(VdbeCursor *pCsr, Mem *pOut){
|
||||
VdbeSorter *pSorter = pCsr->pSorter;
|
||||
VdbeSorterIter *pIter;
|
||||
|
||||
pIter = &pSorter->aIter[ pSorter->aTree[1] ];
|
||||
|
||||
/* Coverage testing note: As things are currently, this call will always
|
||||
** succeed. This is because the memory cell passed by the VDBE layer
|
||||
** happens to be the same one as was used to assemble the keys before they
|
||||
** were passed to the sorter - meaning it is always large enough for the
|
||||
** largest key. But this could change very easily, so we leave the call
|
||||
** to sqlite3VdbeMemGrow() in. */
|
||||
if( NEVER(sqlite3VdbeMemGrow(pOut, pIter->nKey, 0)) ){
|
||||
return SQLITE_NOMEM;
|
||||
}
|
||||
pOut->n = pIter->nKey;
|
||||
MemSetTypeFlag(pOut, MEM_Blob);
|
||||
memcpy(pOut->z, pIter->aKey, pIter->nKey);
|
||||
|
||||
return SQLITE_OK;
|
||||
}
|
||||
|
||||
#endif /* #ifndef SQLITE_OMIT_MERGE_SORT */
|
||||
@@ -67,8 +67,8 @@ do_test 8_3_names-2.1 {
|
||||
file exists test.nal
|
||||
} 1
|
||||
forcedelete test2.db test2.nal test2.db-journal
|
||||
file copy test.db test2.db
|
||||
file copy test.nal test2.nal
|
||||
copy_file test.db test2.db
|
||||
copy_file test.nal test2.nal
|
||||
do_test 8_3_names-2.2 {
|
||||
db eval {
|
||||
COMMIT;
|
||||
@@ -101,8 +101,8 @@ do_test 8_3_names-3.1 {
|
||||
file exists test.nal
|
||||
} 0
|
||||
forcedelete test2.db test2.nal test2.db-journal
|
||||
file copy test.db test2.db
|
||||
file copy test.db-journal test2.db-journal
|
||||
copy_file test.db test2.db
|
||||
copy_file test.db-journal test2.db-journal
|
||||
do_test 8_3_names-3.2 {
|
||||
db eval {
|
||||
COMMIT;
|
||||
|
||||
@@ -221,8 +221,8 @@ do_test alter-1.7 {
|
||||
#
|
||||
ifcapable attach {
|
||||
do_test alter-1.8.1 {
|
||||
file delete -force test2.db
|
||||
file delete -force test2.db-journal
|
||||
forcedelete test2.db
|
||||
forcedelete test2.db-journal
|
||||
execsql {
|
||||
ATTACH 'test2.db' AS aux;
|
||||
}
|
||||
@@ -412,8 +412,8 @@ do_test alter-3.1.8 {
|
||||
|
||||
# Make sure "ON" cannot be used as a database, table or column name without
|
||||
# quoting. Otherwise the sqlite_alter_trigger() function might not work.
|
||||
file delete -force test3.db
|
||||
file delete -force test3.db-journal
|
||||
forcedelete test3.db
|
||||
forcedelete test3.db-journal
|
||||
ifcapable attach {
|
||||
do_test alter-3.2.1 {
|
||||
catchsql {
|
||||
|
||||
@@ -315,8 +315,8 @@ do_test alter2-6.1 {
|
||||
} {2}
|
||||
ifcapable attach {
|
||||
do_test alter2-6.2 {
|
||||
file delete -force test2.db-journal
|
||||
file delete -force test2.db
|
||||
forcedelete test2.db-journal
|
||||
forcedelete test2.db
|
||||
execsql {
|
||||
ATTACH 'test2.db' AS aux;
|
||||
CREATE TABLE aux.t1(a, b);
|
||||
|
||||
@@ -196,7 +196,7 @@ ifcapable schema_version {
|
||||
|
||||
do_test alter3-4.1 {
|
||||
db close
|
||||
file delete -force test.db
|
||||
forcedelete test.db
|
||||
set ::DB [sqlite3 db test.db]
|
||||
execsql {
|
||||
PRAGMA legacy_file_format=ON;
|
||||
@@ -237,8 +237,8 @@ do_test alter3-4.99 {
|
||||
|
||||
ifcapable attach {
|
||||
do_test alter3-5.1 {
|
||||
file delete -force test2.db
|
||||
file delete -force test2.db-journal
|
||||
forcedelete test2.db
|
||||
forcedelete test2.db-journal
|
||||
execsql {
|
||||
CREATE TABLE t1(a, b);
|
||||
INSERT INTO t1 VALUES(1, 'one');
|
||||
|
||||
@@ -178,7 +178,7 @@ ifcapable schema_version {
|
||||
|
||||
do_test alter4-4.1 {
|
||||
db close
|
||||
file delete -force test.db
|
||||
forcedelete test.db
|
||||
set ::DB [sqlite3 db test.db]
|
||||
execsql {
|
||||
CREATE TEMP TABLE t1(a, b);
|
||||
@@ -213,8 +213,8 @@ do_test alter4-4.99 {
|
||||
|
||||
ifcapable attach {
|
||||
do_test alter4-5.1 {
|
||||
file delete -force test2.db
|
||||
file delete -force test2.db-journal
|
||||
forcedelete test2.db
|
||||
forcedelete test2.db-journal
|
||||
execsql {
|
||||
CREATE TEMP TABLE t1(a, b);
|
||||
INSERT INTO t1 VALUES(1, 'one');
|
||||
|
||||
@@ -287,6 +287,64 @@ do_test analyze-4.3 {
|
||||
}
|
||||
} {}
|
||||
|
||||
# Verify that DROP TABLE and DROP INDEX remove entries from the
|
||||
# sqlite_stat1 and sqlite_stat2 tables.
|
||||
#
|
||||
do_test analyze-5.0 {
|
||||
execsql {
|
||||
DELETE FROM t3;
|
||||
DELETE FROM t4;
|
||||
INSERT INTO t3 VALUES(1,2,3,4);
|
||||
INSERT INTO t3 VALUES(5,6,7,8);
|
||||
INSERT INTO t3 SELECT a+8, b+8, c+8, d+8 FROM t3;
|
||||
INSERT INTO t3 SELECT a+16, b+16, c+16, d+16 FROM t3;
|
||||
INSERT INTO t3 SELECT a+32, b+32, c+32, d+32 FROM t3;
|
||||
INSERT INTO t3 SELECT a+64, b+64, c+64, d+64 FROM t3;
|
||||
INSERT INTO t4 SELECT a, b, c FROM t3;
|
||||
ANALYZE;
|
||||
SELECT DISTINCT idx FROM sqlite_stat1 ORDER BY 1;
|
||||
SELECT DISTINCT tbl FROM sqlite_stat1 ORDER BY 1;
|
||||
}
|
||||
} {t3i1 t3i2 t3i3 t4i1 t4i2 t3 t4}
|
||||
ifcapable stat2 {
|
||||
do_test analyze-5.1 {
|
||||
execsql {
|
||||
SELECT DISTINCT idx FROM sqlite_stat2 ORDER BY 1;
|
||||
SELECT DISTINCT tbl FROM sqlite_stat2 ORDER BY 1;
|
||||
}
|
||||
} {t3i1 t3i2 t3i3 t4i1 t4i2 t3 t4}
|
||||
}
|
||||
do_test analyze-5.2 {
|
||||
execsql {
|
||||
DROP INDEX t3i2;
|
||||
SELECT DISTINCT idx FROM sqlite_stat1 ORDER BY 1;
|
||||
SELECT DISTINCT tbl FROM sqlite_stat1 ORDER BY 1;
|
||||
}
|
||||
} {t3i1 t3i3 t4i1 t4i2 t3 t4}
|
||||
ifcapable stat2 {
|
||||
do_test analyze-5.3 {
|
||||
execsql {
|
||||
SELECT DISTINCT idx FROM sqlite_stat2 ORDER BY 1;
|
||||
SELECT DISTINCT tbl FROM sqlite_stat2 ORDER BY 1;
|
||||
}
|
||||
} {t3i1 t3i3 t4i1 t4i2 t3 t4}
|
||||
}
|
||||
do_test analyze-5.4 {
|
||||
execsql {
|
||||
DROP TABLE t3;
|
||||
SELECT DISTINCT idx FROM sqlite_stat1 ORDER BY 1;
|
||||
SELECT DISTINCT tbl FROM sqlite_stat1 ORDER BY 1;
|
||||
}
|
||||
} {t4i1 t4i2 t4}
|
||||
ifcapable stat2 {
|
||||
do_test analyze-5.5 {
|
||||
execsql {
|
||||
SELECT DISTINCT idx FROM sqlite_stat2 ORDER BY 1;
|
||||
SELECT DISTINCT tbl FROM sqlite_stat2 ORDER BY 1;
|
||||
}
|
||||
} {t4i1 t4i2 t4}
|
||||
}
|
||||
|
||||
# This test corrupts the database file so it must be the last test
|
||||
# in the series.
|
||||
#
|
||||
|
||||
@@ -68,7 +68,7 @@ foreach testfile [lsort -dictionary [glob $testdir/*.test]] {
|
||||
|
||||
# Make sure everything is flushed through. This is because [source]ing
|
||||
# the next test file will delete the database file on disk (using
|
||||
# [file delete]). If the asynchronous backend still has the file
|
||||
# [delete_file]). If the asynchronous backend still has the file
|
||||
# open, it will become confused.
|
||||
#
|
||||
flush_async_queue
|
||||
|
||||
@@ -51,7 +51,7 @@ foreach err [list ioerr malloc-transient malloc-persistent] {
|
||||
for {set n 1} {$::go} {incr n} {
|
||||
set ::sqlite_io_error_pending 0
|
||||
sqlite3_memdebug_fail -1
|
||||
file delete -force test.db test.db-journal
|
||||
forcedelete test.db test.db-journal
|
||||
sqlite3 db test.db
|
||||
execsql $::setup_script
|
||||
db close
|
||||
|
||||
@@ -41,8 +41,8 @@ set paths {
|
||||
|
||||
do_test async3-1.0 {
|
||||
file mkdir [file join chocolate banana vanilla]
|
||||
file delete -force chocolate/banana/vanilla/file.db
|
||||
file delete -force chocolate/banana/vanilla/file.db-journal
|
||||
forcedelete chocolate/banana/vanilla/file.db
|
||||
forcedelete chocolate/banana/vanilla/file.db-journal
|
||||
} {}
|
||||
|
||||
do_test async3-1.1 {
|
||||
|
||||
@@ -20,7 +20,7 @@ if {[info commands sqlite3async_initialize] eq ""} {
|
||||
}
|
||||
|
||||
db close
|
||||
file delete -force test2.db
|
||||
forcedelete test2.db
|
||||
sqlite3async_initialize "" 1
|
||||
sqlite3async_control halt never
|
||||
sqlite3 db test.db
|
||||
|
||||
@@ -24,8 +24,8 @@ ifcapable !attach {
|
||||
}
|
||||
|
||||
for {set i 2} {$i<=15} {incr i} {
|
||||
file delete -force test$i.db
|
||||
file delete -force test$i.db-journal
|
||||
forcedelete test$i.db
|
||||
forcedelete test$i.db-journal
|
||||
}
|
||||
|
||||
do_test attach-1.1 {
|
||||
@@ -628,7 +628,7 @@ do_test attach-5.1 {
|
||||
db close
|
||||
sqlite3 db test.db
|
||||
db2 close
|
||||
file delete -force test2.db
|
||||
forcedelete test2.db
|
||||
sqlite3 db2 test2.db
|
||||
catchsql {
|
||||
ATTACH DATABASE 'test.db' AS orig;
|
||||
@@ -725,7 +725,7 @@ if {$tcl_platform(platform)=="unix"} {
|
||||
file attributes cannot-read -permission 0000
|
||||
if {[file writable cannot-read]} {
|
||||
puts "\n**** Tests do not work when run as root ****"
|
||||
file delete -force cannot-read
|
||||
forcedelete cannot-read
|
||||
exit 1
|
||||
}
|
||||
catchsql {
|
||||
@@ -735,7 +735,7 @@ if {$tcl_platform(platform)=="unix"} {
|
||||
do_test attach-6.2.2 {
|
||||
db errorcode
|
||||
} {14}
|
||||
file delete -force cannot-read
|
||||
forcedelete cannot-read
|
||||
}
|
||||
|
||||
# Check the error message if we try to access a database that has
|
||||
@@ -749,12 +749,12 @@ for {set i 2} {$i<=15} {incr i} {
|
||||
catch {db$i close}
|
||||
}
|
||||
db close
|
||||
file delete -force test2.db
|
||||
file delete -force no-such-file
|
||||
forcedelete test2.db
|
||||
forcedelete no-such-file
|
||||
|
||||
ifcapable subquery {
|
||||
do_test attach-7.1 {
|
||||
file delete -force test.db test.db-journal
|
||||
forcedelete test.db test.db-journal
|
||||
sqlite3 db test.db
|
||||
catchsql {
|
||||
DETACH RAISE ( IGNORE ) IN ( SELECT "AAAAAA" . * ORDER BY
|
||||
@@ -777,7 +777,7 @@ do_test attach-8.1 {
|
||||
do_test attach-8.2 {
|
||||
db errorcode
|
||||
} {26}
|
||||
file delete -force test2.db
|
||||
forcedelete test2.db
|
||||
do_test attach-8.3 {
|
||||
sqlite3 db2 test2.db
|
||||
db2 eval {CREATE TABLE t1(x); BEGIN EXCLUSIVE}
|
||||
@@ -789,13 +789,13 @@ do_test attach-8.4 {
|
||||
db errorcode
|
||||
} {5}
|
||||
db2 close
|
||||
file delete -force test2.db
|
||||
forcedelete test2.db
|
||||
|
||||
# Test that it is possible to attach the same database more than
|
||||
# once when not in shared-cache mode. That this is not possible in
|
||||
# shared-cache mode is tested in shared7.test.
|
||||
do_test attach-9.1 {
|
||||
file delete -force test4.db
|
||||
forcedelete test4.db
|
||||
execsql {
|
||||
ATTACH 'test4.db' AS aux1;
|
||||
CREATE TABLE aux1.t1(a, b);
|
||||
|
||||
@@ -33,8 +33,8 @@ do_test attach2-1.1 {
|
||||
CREATE TABLE t1(a,b);
|
||||
CREATE INDEX x1 ON t1(a);
|
||||
}
|
||||
file delete -force test2.db
|
||||
file delete -force test2.db-journal
|
||||
forcedelete test2.db
|
||||
forcedelete test2.db-journal
|
||||
sqlite3 db2 test2.db
|
||||
db2 eval {
|
||||
CREATE TABLE t1(a,b);
|
||||
@@ -327,7 +327,7 @@ do_test attach2-4.15 {
|
||||
|
||||
db close
|
||||
db2 close
|
||||
file delete -force test2.db
|
||||
forcedelete test2.db
|
||||
sqlite3_soft_heap_limit $soft_limit
|
||||
|
||||
# These tests - attach2-5.* - check that the master journal file is deleted
|
||||
@@ -335,7 +335,7 @@ sqlite3_soft_heap_limit $soft_limit
|
||||
#
|
||||
# Update: It's not actually created if a rollback occurs, so that test
|
||||
# doesn't really prove too much.
|
||||
foreach f [glob test.db*] {file delete -force $f}
|
||||
foreach f [glob test.db*] {forcedelete $f}
|
||||
do_test attach2-5.1 {
|
||||
sqlite3 db test.db
|
||||
execsql {
|
||||
|
||||
@@ -35,8 +35,8 @@ execsql {
|
||||
}
|
||||
|
||||
# Create tables t1 and t2 in database file test2.db
|
||||
file delete -force test2.db
|
||||
file delete -force test2.db-journal
|
||||
forcedelete test2.db
|
||||
forcedelete test2.db-journal
|
||||
sqlite3 db2 test2.db
|
||||
execsql {
|
||||
CREATE TABLE t1(a, b);
|
||||
|
||||
@@ -29,8 +29,8 @@ do_malloc_test attachmalloc-1 -tclprep {
|
||||
catch { db close }
|
||||
for {set i 2} {$i<=4} {incr i} {
|
||||
catch { db$i close }
|
||||
file delete -force test$i.db
|
||||
file delete -force test$i.db-journal
|
||||
forcedelete test$i.db
|
||||
forcedelete test$i.db-journal
|
||||
}
|
||||
} -tclbody {
|
||||
if {[catch {sqlite3 db test.db}]} {
|
||||
@@ -48,8 +48,8 @@ do_malloc_test attachmalloc-1 -tclprep {
|
||||
}
|
||||
|
||||
do_malloc_test attachmalloc-2 -tclprep {
|
||||
file delete -force test2.db
|
||||
file delete -force test2.db-journal
|
||||
forcedelete test2.db
|
||||
forcedelete test2.db-journal
|
||||
sqlite3 db2 test2.db
|
||||
db2 eval {
|
||||
CREATE TABLE t1(a, b, c);
|
||||
|
||||
@@ -427,8 +427,8 @@ ifcapable tempdb {
|
||||
#
|
||||
ifcapable tempdb&&attach {
|
||||
do_test autoinc-5.1 {
|
||||
file delete -force test2.db
|
||||
file delete -force test2.db-journal
|
||||
forcedelete test2.db
|
||||
forcedelete test2.db-journal
|
||||
sqlite3 db2 test2.db
|
||||
execsql {
|
||||
CREATE TABLE t4(m INTEGER PRIMARY KEY AUTOINCREMENT, n);
|
||||
@@ -520,7 +520,7 @@ do_test autoinc-7.2 {
|
||||
do_test autoinc-8.1 {
|
||||
catch {db2 close}
|
||||
catch {db close}
|
||||
file delete -force test.db
|
||||
forcedelete test.db
|
||||
sqlite3 db test.db
|
||||
set DB [sqlite3_connection_pointer db]
|
||||
set STMT [sqlite3_prepare $DB {
|
||||
|
||||
@@ -467,7 +467,7 @@ do_test autovacuum-3.3 {
|
||||
|
||||
do_test autovacuum-3.4 {
|
||||
db close
|
||||
file delete -force test.db
|
||||
forcedelete test.db
|
||||
sqlite3 db test.db
|
||||
execsql {
|
||||
PRAGMA auto_vacuum;
|
||||
@@ -502,7 +502,7 @@ do_test autovacuum-4.0 {
|
||||
# Reset everything just in case.
|
||||
#
|
||||
db close
|
||||
file delete -force test.db test.db-journal
|
||||
forcedelete test.db test.db-journal
|
||||
sqlite3 db test.db
|
||||
execsql {
|
||||
PRAGMA auto_vacuum = 1;
|
||||
@@ -599,8 +599,8 @@ do_test autovacuum-6.1 {
|
||||
#
|
||||
do_test autovacuum-7.1 {
|
||||
db close
|
||||
file delete -force test.db
|
||||
file delete -force test.db-journal
|
||||
forcedelete test.db
|
||||
forcedelete test.db-journal
|
||||
sqlite3 db test.db
|
||||
|
||||
execsql {
|
||||
|
||||
@@ -75,7 +75,7 @@ do_ioerr_test autovacuum-ioerr2-3 -sqlprep {
|
||||
DROP TABLE abc2;
|
||||
}
|
||||
|
||||
file delete -force backup.db
|
||||
forcedelete backup.db
|
||||
ifcapable subquery {
|
||||
do_ioerr_test autovacuum-ioerr2-4 -tclprep {
|
||||
if {![file exists backup.db]} {
|
||||
@@ -99,9 +99,9 @@ ifcapable subquery {
|
||||
dbb close
|
||||
}
|
||||
db close
|
||||
file delete -force test.db
|
||||
file delete -force test.db-journal
|
||||
copy_file backup.db test.db
|
||||
forcedelete test.db
|
||||
forcedelete test.db-journal
|
||||
forcecopy backup.db test.db
|
||||
set ::DB [sqlite3 db test.db]
|
||||
execsql {
|
||||
PRAGMA cache_size = 10;
|
||||
|
||||
@@ -61,7 +61,7 @@ foreach bin $binaries {
|
||||
|
||||
proc do_backcompat_test {rv bin1 bin2 script} {
|
||||
|
||||
file delete -force test.db
|
||||
forcedelete test.db
|
||||
|
||||
if {$bin1 != ""} { set ::bc_chan1 [launch_testfixture $bin1] }
|
||||
set ::bc_chan2 [launch_testfixture $bin2]
|
||||
@@ -152,7 +152,7 @@ proc read_file_system {} {
|
||||
proc write_file_system {data} {
|
||||
foreach f {test.db test.db-journal test.db-wal} d $data {
|
||||
if {[string length $d] == 0} {
|
||||
file delete -force $f
|
||||
forcedelete $f
|
||||
} else {
|
||||
write_file $f $d
|
||||
}
|
||||
|
||||
@@ -73,7 +73,7 @@ test_contents backup-1.2 db main db main
|
||||
# Check that it is possible to create and finish backup operations.
|
||||
#
|
||||
do_test backup-1.3.1 {
|
||||
file delete test2.db
|
||||
delete_file test2.db
|
||||
sqlite3 db2 test2.db
|
||||
sqlite3_backup B db2 main db main
|
||||
} {B}
|
||||
@@ -168,8 +168,8 @@ foreach pgsz_dest {512 1024 2048} {
|
||||
foreach nPagePerStep {1 200} {
|
||||
|
||||
# Open the databases.
|
||||
catch { file delete test.db }
|
||||
catch { file delete test2.db }
|
||||
catch { delete_file test.db }
|
||||
catch { delete_file test2.db }
|
||||
eval $zOpenScript
|
||||
|
||||
# Set to true if copying to an in-memory destination. Copying to an
|
||||
@@ -279,8 +279,8 @@ foreach nSrcPg {10 64 65 66 100} {
|
||||
foreach nDestRow {10 100} {
|
||||
foreach nDestPgsz {512 1024 2048 4096} {
|
||||
|
||||
catch { file delete test.db }
|
||||
catch { file delete test2.db }
|
||||
catch { delete_file test.db }
|
||||
catch { delete_file test2.db }
|
||||
sqlite3 db test.db
|
||||
sqlite3 db2 test2.db
|
||||
|
||||
@@ -327,8 +327,8 @@ foreach nDestPgsz {512 1024 2048 4096} {
|
||||
|
||||
#--------------------------------------------------------------------
|
||||
do_test backup-3.$iTest.1 {
|
||||
catch { file delete -force test.db }
|
||||
catch { file delete -force test2.db }
|
||||
catch { forcedelete test.db }
|
||||
catch { forcedelete test2.db }
|
||||
sqlite3 db test.db
|
||||
set iTab 1
|
||||
|
||||
@@ -392,8 +392,8 @@ do_test backup-4.1.4 {
|
||||
} {unknown database aux}
|
||||
|
||||
do_test backup-4.2.1 {
|
||||
catch { file delete -force test3.db }
|
||||
catch { file delete -force test4.db }
|
||||
catch { forcedelete test3.db }
|
||||
catch { forcedelete test4.db }
|
||||
execsql {
|
||||
ATTACH 'test3.db' AS aux1;
|
||||
CREATE TABLE aux1.t1(a, b);
|
||||
@@ -439,7 +439,7 @@ db close
|
||||
db2 close
|
||||
|
||||
do_test backup-4.5.1 {
|
||||
catch { file delete -force test.db }
|
||||
catch { forcedelete test.db }
|
||||
sqlite3 db test.db
|
||||
sqlite3 db2 :memory:
|
||||
execsql {
|
||||
@@ -491,12 +491,12 @@ db2 close
|
||||
# 3) Backing up memory-to-file.
|
||||
#
|
||||
set iTest 0
|
||||
file delete -force bak.db-wal
|
||||
forcedelete bak.db-wal
|
||||
foreach {writer file} {db test.db db3 test.db db :memory:} {
|
||||
incr iTest
|
||||
catch { file delete bak.db }
|
||||
catch { delete_file bak.db }
|
||||
sqlite3 db2 bak.db
|
||||
catch { file delete $file }
|
||||
catch { delete_file $file }
|
||||
sqlite3 db $file
|
||||
sqlite3 db3 $file
|
||||
|
||||
@@ -597,9 +597,9 @@ foreach {writer file} {db test.db db3 test.db db :memory:} {
|
||||
catch {db close}
|
||||
catch {db2 close}
|
||||
catch {db3 close}
|
||||
catch { file delete bak.db }
|
||||
catch { delete_file bak.db }
|
||||
sqlite3 db2 bak.db
|
||||
catch { file delete $file }
|
||||
catch { delete_file $file }
|
||||
sqlite3 db $file
|
||||
sqlite3 db3 $file
|
||||
do_test backup-5.$iTest.5.1 {
|
||||
@@ -644,8 +644,8 @@ foreach {writer file} {db test.db db3 test.db db :memory:} {
|
||||
# Test the sqlite3_backup_remaining() and backup_pagecount() APIs.
|
||||
#
|
||||
do_test backup-6.1 {
|
||||
catch { file delete -force test.db }
|
||||
catch { file delete -force test2.db }
|
||||
catch { forcedelete test.db }
|
||||
catch { forcedelete test2.db }
|
||||
sqlite3 db test.db
|
||||
sqlite3 db2 test2.db
|
||||
execsql {
|
||||
@@ -701,8 +701,8 @@ catch {db2 close}
|
||||
# backup-7.3.*: Destination database is externally locked (return SQLITE_BUSY).
|
||||
#
|
||||
do_test backup-7.0 {
|
||||
catch { file delete -force test.db }
|
||||
catch { file delete -force test2.db }
|
||||
catch { forcedelete test.db }
|
||||
catch { forcedelete test2.db }
|
||||
sqlite3 db2 test2.db
|
||||
sqlite3 db test.db
|
||||
execsql {
|
||||
@@ -754,7 +754,7 @@ integrity_check backup-7.3.6 db2
|
||||
do_test backup-7.3.1 {
|
||||
db2 close
|
||||
db3 close
|
||||
file delete -force test2.db
|
||||
forcedelete test2.db
|
||||
sqlite3 db2 test2.db
|
||||
sqlite3 db3 test2.db
|
||||
|
||||
@@ -783,8 +783,8 @@ catch { db3 close }
|
||||
# These tests reuse the database "test.db" left over from backup-7.*.
|
||||
#
|
||||
do_test backup-8.1 {
|
||||
catch { file delete -force test2.db }
|
||||
catch { file delete -force test3.db }
|
||||
catch { forcedelete test2.db }
|
||||
catch { forcedelete test3.db }
|
||||
sqlite3 db2 test2.db
|
||||
sqlite3 db3 test3.db
|
||||
|
||||
@@ -865,8 +865,8 @@ catch {db2 close}
|
||||
|
||||
ifcapable memorymanage {
|
||||
db close
|
||||
file delete -force test.db
|
||||
file delete -force bak.db
|
||||
forcedelete test.db
|
||||
forcedelete bak.db
|
||||
|
||||
sqlite3 db test.db
|
||||
sqlite3 db2 test.db
|
||||
@@ -918,7 +918,7 @@ ifcapable memorymanage {
|
||||
# 10.2.*: If the db is a file, the backup is not restarted.
|
||||
#
|
||||
db close
|
||||
file delete -force test.db test.db-journal
|
||||
forcedelete test.db test.db-journal
|
||||
foreach {tn file rc} {
|
||||
1 test.db SQLITE_DONE
|
||||
2 :memory: SQLITE_OK
|
||||
@@ -948,7 +948,7 @@ foreach {tn file rc} {
|
||||
} {1}
|
||||
|
||||
do_test backup-10.$tn.3 {
|
||||
file delete -force bak.db bak.db-journal
|
||||
forcedelete bak.db bak.db-journal
|
||||
sqlite3 db2 bak.db
|
||||
sqlite3_backup B db2 main db main
|
||||
B step 50
|
||||
|
||||
@@ -61,7 +61,7 @@ set cksum [dbcksum db main]
|
||||
# is identical to the original.
|
||||
#
|
||||
do_test backup2-2 {
|
||||
file delete -force bu1.db
|
||||
forcedelete bu1.db
|
||||
db backup bu1.db
|
||||
sqlite3 db2 bu1.db
|
||||
dbcksum db2 main
|
||||
@@ -72,7 +72,7 @@ do_test backup2-2 {
|
||||
#
|
||||
do_test backup2-3.1 {
|
||||
db close
|
||||
file delete -force test.db test.db-journal
|
||||
forcedelete test.db test.db-journal
|
||||
sqlite3 db test.db
|
||||
db2 eval {BEGIN EXCLUSIVE}
|
||||
set rc [catch {db restore bu1.db} res]
|
||||
@@ -82,7 +82,7 @@ do_test backup2-3.1 {
|
||||
} {1 {restore failed: source database busy}}
|
||||
do_test backup2-3.2 {
|
||||
db close
|
||||
file delete -force test.db test.db-journal
|
||||
forcedelete test.db test.db-journal
|
||||
sqlite3 db test.db
|
||||
db restore bu1.db
|
||||
dbcksum db main
|
||||
@@ -96,7 +96,7 @@ do_test backup2-4 {
|
||||
} $cksum
|
||||
do_test backup2-5 {
|
||||
db2 close
|
||||
file delete -force bu1.db bu2.db
|
||||
forcedelete bu1.db bu2.db
|
||||
db backup temp bu2.db
|
||||
sqlite3 db2 bu2.db
|
||||
dbcksum db2 main
|
||||
@@ -127,7 +127,7 @@ do_test backup2-7 {
|
||||
# Try to backup database that does not exist
|
||||
#
|
||||
do_test backup2-8 {
|
||||
file delete -force bu1.db
|
||||
forcedelete bu1.db
|
||||
set rc [catch {db backup aux1 bu1.db} res]
|
||||
lappend rc $res
|
||||
} {1 {backup failed: unknown database aux1}}
|
||||
@@ -143,7 +143,7 @@ do_test backup2-9 {
|
||||
#
|
||||
if {$tcl_platform(platform)=="windows"} {
|
||||
do_test backup2-10 {
|
||||
file delete -force bu3.db
|
||||
forcedelete bu3.db
|
||||
file mkdir bu3.db
|
||||
set rc [catch {db restore temp bu3.db} res]
|
||||
lappend rc $res
|
||||
@@ -151,7 +151,7 @@ if {$tcl_platform(platform)=="windows"} {
|
||||
}
|
||||
if {$tcl_platform(platform)!="windows"} {
|
||||
do_test backup2-10 {
|
||||
file delete -force bu3.db
|
||||
forcedelete bu3.db
|
||||
file mkdir bu3.db
|
||||
set rc [catch {db restore temp bu3.db} res]
|
||||
lappend rc $res
|
||||
@@ -172,7 +172,7 @@ do_test backup2-12 {
|
||||
lappend rc $res
|
||||
} {1 {restore failed: unknown database aux1}}
|
||||
do_test backup2-13 {
|
||||
file delete -force bu4.db
|
||||
forcedelete bu4.db
|
||||
set rc [catch {db restore bu4.db} res]
|
||||
lappend rc $res
|
||||
} {1 {cannot open source database: unable to open database file}}
|
||||
@@ -184,6 +184,6 @@ do_test backup2-14 {
|
||||
lappend rc $res
|
||||
} {1 {wrong # args: should be "db restore ?DATABASE? FILENAME"}}
|
||||
|
||||
file delete -force bu1.db bu2.db bu3.db bu4.db
|
||||
forcedelete bu1.db bu2.db bu3.db bu4.db
|
||||
|
||||
finish_test
|
||||
|
||||
@@ -60,7 +60,7 @@ do_test backup_ioerr-1.2 {
|
||||
} {1}
|
||||
do_test backup_ioerr-1.3 {
|
||||
db close
|
||||
file delete -force test.db
|
||||
forcedelete test.db
|
||||
} {}
|
||||
|
||||
# Turn off IO error simulation.
|
||||
@@ -155,8 +155,8 @@ for {set iError 1} {$bStop == 0} {incr iError} {
|
||||
|
||||
catch { ddb close }
|
||||
catch { sdb close }
|
||||
catch { file delete -force test.db }
|
||||
catch { file delete -force bak.db }
|
||||
catch { forcedelete test.db }
|
||||
catch { forcedelete bak.db }
|
||||
|
||||
# Open the source and destination databases.
|
||||
sqlite3 sdb test.db
|
||||
|
||||
@@ -697,7 +697,7 @@ if {![sqlite3 -has-codec]} {
|
||||
# Now test that the library correctly handles bogus entries in the
|
||||
# sqlite_master table (schema corruption).
|
||||
do_test capi3-8.1 {
|
||||
file delete -force test.db test.db-journal
|
||||
forcedelete test.db test.db-journal
|
||||
sqlite3 db test.db
|
||||
execsql {
|
||||
CREATE TABLE t1(a);
|
||||
@@ -722,7 +722,7 @@ if {![sqlite3 -has-codec]} {
|
||||
# Build a 5-field row record. The first field is a string 'table', and
|
||||
# subsequent fields are all NULL.
|
||||
db close
|
||||
file delete -force test.db test.db-journal
|
||||
forcedelete test.db test.db-journal
|
||||
sqlite3 db test.db
|
||||
execsql {
|
||||
CREATE TABLE t1(a);
|
||||
@@ -739,8 +739,8 @@ if {![sqlite3 -has-codec]} {
|
||||
} {1 {malformed database schema (?)}}
|
||||
db close
|
||||
}
|
||||
file delete -force test.db
|
||||
file delete -force test.db-journal
|
||||
forcedelete test.db
|
||||
forcedelete test.db-journal
|
||||
|
||||
|
||||
# Test the english language string equivalents for sqlite error codes
|
||||
|
||||
@@ -670,7 +670,7 @@ if {![sqlite3 -has-codec]} {
|
||||
# Now test that the library correctly handles bogus entries in the
|
||||
# sqlite_master table (schema corruption).
|
||||
do_test capi3c-8.1 {
|
||||
file delete -force test.db test.db-journal
|
||||
forcedelete test.db test.db-journal
|
||||
sqlite3 db test.db
|
||||
execsql {
|
||||
CREATE TABLE t1(a);
|
||||
@@ -695,7 +695,7 @@ if {![sqlite3 -has-codec]} {
|
||||
# Build a 5-field row record. The first field is a string 'table', and
|
||||
# subsequent fields are all NULL.
|
||||
db close
|
||||
file delete -force test.db test.db-journal
|
||||
forcedelete test.db test.db-journal
|
||||
sqlite3 db test.db
|
||||
execsql {
|
||||
CREATE TABLE t1(a);
|
||||
@@ -712,8 +712,8 @@ if {![sqlite3 -has-codec]} {
|
||||
} {1 {malformed database schema (?)}}
|
||||
db close
|
||||
}
|
||||
file delete -force test.db
|
||||
file delete -force test.db-journal
|
||||
forcedelete test.db
|
||||
forcedelete test.db-journal
|
||||
|
||||
|
||||
# Test the english language string equivalents for sqlite error codes
|
||||
|
||||
@@ -44,7 +44,7 @@ do_test collate7-1.4 {
|
||||
} {2}
|
||||
|
||||
do_test collate7-2.1 {
|
||||
file delete -force test.db test.db-journal
|
||||
forcedelete test.db test.db-journal
|
||||
sqlite3 db test.db
|
||||
sqlite3_create_collation_v2 db CASELESS caseless_cmp {incr ::caseless_del}
|
||||
execsql {
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
#
|
||||
# $Id: corrupt.test,v 1.12 2009/07/13 09:41:45 danielk1977 Exp $
|
||||
|
||||
catch {file delete -force test.db test.db-journal test.bu}
|
||||
catch {forcedelete test.db test.db-journal test.bu}
|
||||
|
||||
set testdir [file dirname $argv0]
|
||||
source $testdir/tester.tcl
|
||||
@@ -51,22 +51,10 @@ do_test corrupt-1.1 {
|
||||
} {}
|
||||
integrity_check corrupt-1.2
|
||||
|
||||
# Copy file $from into $to
|
||||
#
|
||||
proc copy_file {from to} {
|
||||
set f [open $from]
|
||||
fconfigure $f -translation binary
|
||||
set t [open $to w]
|
||||
fconfigure $t -translation binary
|
||||
puts -nonewline $t [read $f [file size $from]]
|
||||
close $t
|
||||
close $f
|
||||
}
|
||||
|
||||
# Setup for the tests. Make a backup copy of the good database in test.bu.
|
||||
# Create a string of garbage data that is 256 bytes long.
|
||||
#
|
||||
copy_file test.db test.bu
|
||||
forcecopy test.db test.bu
|
||||
set fsize [file size test.db]
|
||||
set junk "abcdefghijklmnopqrstuvwxyz0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"
|
||||
while {[string length $junk]<256} {append junk $junk}
|
||||
@@ -79,7 +67,7 @@ set junk [string range $junk 0 255]
|
||||
for {set i [expr {1*256}]} {$i<$fsize-256} {incr i 256} {
|
||||
set tn [expr {$i/256}]
|
||||
db close
|
||||
copy_file test.bu test.db
|
||||
forcecopy test.bu test.db
|
||||
set fd [open test.db r+]
|
||||
fconfigure $fd -translation binary
|
||||
seek $fd $i
|
||||
@@ -132,7 +120,7 @@ for {set i [expr {1*256}]} {$i<$fsize-256} {incr i 256} {
|
||||
#
|
||||
do_test corrupt-3.1 {
|
||||
db close
|
||||
copy_file test.bu test.db
|
||||
forcecopy test.bu test.db
|
||||
sqlite3 db test.db
|
||||
list
|
||||
} {}
|
||||
@@ -181,7 +169,7 @@ do_test corrupt-3.6 {
|
||||
|
||||
do_test corrupt-4.1 {
|
||||
db close
|
||||
file delete -force test.db test.db-journal
|
||||
forcedelete test.db test.db-journal
|
||||
sqlite3 db test.db
|
||||
execsql {
|
||||
PRAGMA page_size = 1024;
|
||||
@@ -213,7 +201,7 @@ do_test corrupt-4.2 {
|
||||
|
||||
do_test corrupt-5.1 {
|
||||
db close
|
||||
file delete -force test.db test.db-journal
|
||||
forcedelete test.db test.db-journal
|
||||
sqlite3 db test.db
|
||||
|
||||
execsql { PRAGMA page_size = 1024 }
|
||||
@@ -236,7 +224,7 @@ do_test corrupt-5.2 {
|
||||
# running this testcase under valgrind revealed the problem.
|
||||
do_test corrupt-6.1 {
|
||||
db close
|
||||
file delete -force test.db test.db-journal
|
||||
forcedelete test.db test.db-journal
|
||||
sqlite3 db test.db
|
||||
execsql {
|
||||
PRAGMA page_size = 1024; CREATE TABLE t1(x);
|
||||
@@ -264,7 +252,7 @@ do_test corrupt-6.1 {
|
||||
|
||||
ifcapable oversize_cell_check {
|
||||
db close
|
||||
file delete -force test.db test.db-journal
|
||||
forcedelete test.db test.db-journal
|
||||
sqlite3 db test.db
|
||||
execsql {
|
||||
PRAGMA page_size = 1024; CREATE TABLE t1(x);
|
||||
@@ -317,7 +305,7 @@ ifcapable oversize_cell_check {
|
||||
}
|
||||
|
||||
db close
|
||||
file delete -force test.db test.db-journal
|
||||
forcedelete test.db test.db-journal
|
||||
do_test corrupt-8.1 {
|
||||
sqlite3 db test.db
|
||||
execsql {
|
||||
@@ -335,7 +323,7 @@ do_test corrupt-8.1 {
|
||||
} {1 {database disk image is malformed}}
|
||||
|
||||
db close
|
||||
file delete -force test.db test.db-journal
|
||||
forcedelete test.db test.db-journal
|
||||
do_test corrupt-8.2 {
|
||||
sqlite3 db test.db
|
||||
execsql {
|
||||
|
||||
@@ -41,9 +41,9 @@ do_test corrupt2-1.1 {
|
||||
do_test corrupt2-1.2 {
|
||||
|
||||
# Corrupt the 16 byte magic string at the start of the file
|
||||
file delete -force corrupt.db
|
||||
file delete -force corrupt.db-journal
|
||||
copy_file test.db corrupt.db
|
||||
forcedelete corrupt.db
|
||||
forcedelete corrupt.db-journal
|
||||
forcecopy test.db corrupt.db
|
||||
set f [open corrupt.db RDWR]
|
||||
seek $f 8 start
|
||||
puts $f blah
|
||||
@@ -60,9 +60,9 @@ do_test corrupt2-1.3 {
|
||||
db2 close
|
||||
|
||||
# Corrupt the page-size (bytes 16 and 17 of page 1).
|
||||
file delete -force corrupt.db
|
||||
file delete -force corrupt.db-journal
|
||||
copy_file test.db corrupt.db
|
||||
forcedelete corrupt.db
|
||||
forcedelete corrupt.db-journal
|
||||
forcecopy test.db corrupt.db
|
||||
set f [open corrupt.db RDWR]
|
||||
fconfigure $f -encoding binary
|
||||
seek $f 16 start
|
||||
@@ -80,9 +80,9 @@ do_test corrupt2-1.4 {
|
||||
db2 close
|
||||
|
||||
# Corrupt the free-block list on page 1.
|
||||
file delete -force corrupt.db
|
||||
file delete -force corrupt.db-journal
|
||||
copy_file test.db corrupt.db
|
||||
forcedelete corrupt.db
|
||||
forcedelete corrupt.db-journal
|
||||
forcecopy test.db corrupt.db
|
||||
set f [open corrupt.db RDWR]
|
||||
fconfigure $f -encoding binary
|
||||
seek $f 101 start
|
||||
@@ -100,9 +100,9 @@ do_test corrupt2-1.5 {
|
||||
db2 close
|
||||
|
||||
# Corrupt the free-block list on page 1.
|
||||
file delete -force corrupt.db
|
||||
file delete -force corrupt.db-journal
|
||||
copy_file test.db corrupt.db
|
||||
forcedelete corrupt.db
|
||||
forcedelete corrupt.db-journal
|
||||
forcecopy test.db corrupt.db
|
||||
set f [open corrupt.db RDWR]
|
||||
fconfigure $f -encoding binary
|
||||
seek $f 101 start
|
||||
@@ -123,9 +123,9 @@ db2 close
|
||||
# Corrupt a database by having 2 indices of the same name:
|
||||
do_test corrupt2-2.1 {
|
||||
|
||||
file delete -force corrupt.db
|
||||
file delete -force corrupt.db-journal
|
||||
copy_file test.db corrupt.db
|
||||
forcedelete corrupt.db
|
||||
forcedelete corrupt.db-journal
|
||||
forcecopy test.db corrupt.db
|
||||
|
||||
sqlite3 db2 corrupt.db
|
||||
execsql "
|
||||
@@ -150,8 +150,8 @@ do_test corrupt2-2.1 {
|
||||
db2 close
|
||||
|
||||
do_test corrupt2-3.1 {
|
||||
file delete -force corrupt.db
|
||||
file delete -force corrupt.db-journal
|
||||
forcedelete corrupt.db
|
||||
forcedelete corrupt.db-journal
|
||||
sqlite3 db2 corrupt.db
|
||||
|
||||
execsql "
|
||||
@@ -200,8 +200,8 @@ db2 close
|
||||
|
||||
unset -nocomplain result
|
||||
do_test corrupt2-5.1 {
|
||||
file delete -force corrupt.db
|
||||
file delete -force corrupt.db-journal
|
||||
forcedelete corrupt.db
|
||||
forcedelete corrupt.db-journal
|
||||
sqlite3 db2 corrupt.db
|
||||
|
||||
execsql "
|
||||
@@ -257,8 +257,8 @@ proc corruption_test {args} {
|
||||
array set A $args
|
||||
|
||||
catch {db close}
|
||||
file delete -force corrupt.db
|
||||
file delete -force corrupt.db-journal
|
||||
forcedelete corrupt.db
|
||||
forcedelete corrupt.db-journal
|
||||
|
||||
sqlite3 db corrupt.db
|
||||
db eval $::presql
|
||||
|
||||
@@ -86,7 +86,7 @@ integrity_check corrupt9-1.2
|
||||
# Make sure the corruption is detected.
|
||||
#
|
||||
db close
|
||||
file copy -force test.db test.db-template
|
||||
forcecopy test.db test.db-template
|
||||
|
||||
corrupt_freelist test.db 1
|
||||
sqlite3 db test.db
|
||||
@@ -103,7 +103,7 @@ do_test corrupt9-2.2 {
|
||||
|
||||
|
||||
db close
|
||||
file copy -force test.db-template test.db
|
||||
forcecopy test.db-template test.db
|
||||
corrupt_freelist test.db 2
|
||||
sqlite3 db test.db
|
||||
do_test corrupt9-3.1 {
|
||||
@@ -118,7 +118,7 @@ do_test corrupt9-3.2 {
|
||||
} {1 {database disk image is malformed}}
|
||||
|
||||
db close
|
||||
file copy -force test.db-template test.db
|
||||
forcecopy test.db-template test.db
|
||||
corrupt_freelist test.db 3
|
||||
sqlite3 db test.db
|
||||
do_test corrupt9-4.1 {
|
||||
|
||||
@@ -40,12 +40,12 @@ integrity_check corruptA-1.2
|
||||
# is detected when opening the database file.
|
||||
#
|
||||
db close
|
||||
file copy -force test.db test.db-template
|
||||
forcecopy test.db test.db-template
|
||||
|
||||
set unreadable_version 02
|
||||
ifcapable wal { set unreadable_version 03 }
|
||||
do_test corruptA-2.1 {
|
||||
file copy -force test.db-template test.db
|
||||
forcecopy test.db-template test.db
|
||||
hexio_write test.db 19 $unreadable_version ;# the read format number
|
||||
sqlite3 db test.db
|
||||
catchsql {SELECT * FROM t1}
|
||||
@@ -53,7 +53,7 @@ do_test corruptA-2.1 {
|
||||
|
||||
do_test corruptA-2.2 {
|
||||
db close
|
||||
file copy -force test.db-template test.db
|
||||
forcecopy test.db-template test.db
|
||||
hexio_write test.db 21 41 ;# max embedded payload fraction
|
||||
sqlite3 db test.db
|
||||
catchsql {SELECT * FROM t1}
|
||||
@@ -61,7 +61,7 @@ do_test corruptA-2.2 {
|
||||
|
||||
do_test corruptA-2.3 {
|
||||
db close
|
||||
file copy -force test.db-template test.db
|
||||
forcecopy test.db-template test.db
|
||||
hexio_write test.db 22 1f ;# min embedded payload fraction
|
||||
sqlite3 db test.db
|
||||
catchsql {SELECT * FROM t1}
|
||||
@@ -69,7 +69,7 @@ do_test corruptA-2.3 {
|
||||
|
||||
do_test corruptA-2.4 {
|
||||
db close
|
||||
file copy -force test.db-template test.db
|
||||
forcecopy test.db-template test.db
|
||||
hexio_write test.db 23 21 ;# min leaf payload fraction
|
||||
sqlite3 db test.db
|
||||
catchsql {SELECT * FROM t1}
|
||||
|
||||
@@ -46,7 +46,7 @@ do_test corruptB-1.1 {
|
||||
} {1}
|
||||
integrity_check corruptB-1.2
|
||||
|
||||
file copy -force test.db bak.db
|
||||
forcecopy test.db bak.db
|
||||
|
||||
# Set the right-child of a B-Tree rootpage to refer to the root-page itself.
|
||||
#
|
||||
@@ -65,7 +65,7 @@ do_test corruptB-1.3.2 {
|
||||
#
|
||||
do_test corruptB-1.4.1 {
|
||||
db close
|
||||
file copy -force bak.db test.db
|
||||
forcecopy bak.db test.db
|
||||
set cell_offset [hexio_get_int [hexio_read test.db [expr $offset+12] 2]]
|
||||
hexio_write test.db [expr $offset+$cell_offset] [hexio_render_int32 $::root]
|
||||
} {4}
|
||||
@@ -78,7 +78,7 @@ do_test corruptB-1.4.2 {
|
||||
#
|
||||
do_test corruptB-1.5.1 {
|
||||
db close
|
||||
file copy -force bak.db test.db
|
||||
forcecopy bak.db test.db
|
||||
sqlite3 db test.db
|
||||
execsql {
|
||||
INSERT INTO t1 SELECT randomblob(200) FROM t1;
|
||||
@@ -91,7 +91,7 @@ do_test corruptB-1.5.1 {
|
||||
}
|
||||
} {}
|
||||
|
||||
file copy -force test.db bak.db
|
||||
forcecopy test.db bak.db
|
||||
|
||||
# Set the right-child pointer of the right-child of the root page to point
|
||||
# back to the root page.
|
||||
@@ -112,7 +112,7 @@ do_test corruptB-1.6.2 {
|
||||
#
|
||||
do_test corruptB-1.7.1 {
|
||||
db close
|
||||
file copy -force bak.db test.db
|
||||
forcecopy bak.db test.db
|
||||
set cell_offset [hexio_get_int [hexio_read test.db [expr $c_offset+12] 2]]
|
||||
hexio_write test.db [expr $c_offset+$cell_offset] [hexio_render_int32 $::root]
|
||||
} {4}
|
||||
@@ -140,7 +140,7 @@ do_test corruptB-1.8.2 {
|
||||
#
|
||||
do_test corruptB-1.9.1 {
|
||||
db close
|
||||
file copy -force bak.db test.db
|
||||
forcecopy bak.db test.db
|
||||
set cell_offset [hexio_get_int [hexio_read test.db [expr $c_offset+12] 2]]
|
||||
hexio_write test.db [expr $c_offset+$cell_offset] [hexio_render_int32 $::root]
|
||||
} {4}
|
||||
@@ -153,7 +153,7 @@ do_test corruptB-1.9.2 {
|
||||
|
||||
do_test corruptB-2.1.1 {
|
||||
db close
|
||||
file copy -force bak.db test.db
|
||||
forcecopy bak.db test.db
|
||||
hexio_write test.db [expr $offset+8] [hexio_render_int32 0x6FFFFFFF]
|
||||
} {4}
|
||||
do_test corruptB-2.1.2 {
|
||||
@@ -167,7 +167,7 @@ do_test corruptB-2.1.2 {
|
||||
#
|
||||
do_test corruptB-3.1.1 {
|
||||
db close
|
||||
file copy -force bak.db test.db
|
||||
forcecopy bak.db test.db
|
||||
sqlite3 db test.db
|
||||
set v [string repeat abcdefghij 200]
|
||||
execsql {
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
#
|
||||
# $Id: corruptC.test,v 1.14 2009/07/11 06:55:34 danielk1977 Exp $
|
||||
|
||||
catch {file delete -force test.db test.db-journal test.bu}
|
||||
catch {forcedelete test.db test.db-journal test.bu}
|
||||
|
||||
set testdir [file dirname $argv0]
|
||||
source $testdir/tester.tcl
|
||||
@@ -58,16 +58,10 @@ proc random {range} {
|
||||
return [expr {round(rand()*$range)}]
|
||||
}
|
||||
|
||||
# Copy file $from into $to
|
||||
#
|
||||
proc copy_file {from to} {
|
||||
file copy -force $from $to
|
||||
}
|
||||
|
||||
# Setup for the tests. Make a backup copy of the good database in test.bu.
|
||||
#
|
||||
db close
|
||||
copy_file test.db test.bu
|
||||
forcecopy test.db test.bu
|
||||
sqlite3 db test.db
|
||||
set fsize [file size test.db]
|
||||
|
||||
@@ -92,7 +86,7 @@ expr srand($qseed)
|
||||
# test that a corrupt content offset size is handled (seed 5577)
|
||||
do_test corruptC-2.1 {
|
||||
db close
|
||||
copy_file test.bu test.db
|
||||
forcecopy test.bu test.db
|
||||
|
||||
# insert corrupt byte(s)
|
||||
hexio_write test.db 2053 [format %02x 0x04]
|
||||
@@ -104,7 +98,7 @@ do_test corruptC-2.1 {
|
||||
# test that a corrupt content offset size is handled (seed 5649)
|
||||
do_test corruptC-2.2 {
|
||||
db close
|
||||
copy_file test.bu test.db
|
||||
forcecopy test.bu test.db
|
||||
|
||||
# insert corrupt byte(s)
|
||||
hexio_write test.db 27 [format %02x 0x08]
|
||||
@@ -125,7 +119,7 @@ do_test corruptC-2.2 {
|
||||
# test that a corrupt free cell size is handled (seed 13329)
|
||||
do_test corruptC-2.3 {
|
||||
db close
|
||||
copy_file test.bu test.db
|
||||
forcecopy test.bu test.db
|
||||
|
||||
# insert corrupt byte(s)
|
||||
hexio_write test.db 1094 [format %02x 0x76]
|
||||
@@ -137,7 +131,7 @@ do_test corruptC-2.3 {
|
||||
# test that a corrupt free cell size is handled (seed 169571)
|
||||
do_test corruptC-2.4 {
|
||||
db close
|
||||
copy_file test.bu test.db
|
||||
forcecopy test.bu test.db
|
||||
|
||||
# insert corrupt byte(s)
|
||||
hexio_write test.db 3119 [format %02x 0xdf]
|
||||
@@ -149,7 +143,7 @@ do_test corruptC-2.4 {
|
||||
# test that a corrupt free cell size is handled (seed 169571)
|
||||
do_test corruptC-2.5 {
|
||||
db close
|
||||
copy_file test.bu test.db
|
||||
forcecopy test.bu test.db
|
||||
|
||||
# insert corrupt byte(s)
|
||||
hexio_write test.db 3119 [format %02x 0xdf]
|
||||
@@ -169,7 +163,7 @@ Page 4: btreeInitPage() returns error code 11}}}
|
||||
# test that a corrupt free cell size is handled (seed 169595)
|
||||
do_test corruptC-2.6 {
|
||||
db close
|
||||
copy_file test.bu test.db
|
||||
forcecopy test.bu test.db
|
||||
|
||||
# insert corrupt byte(s)
|
||||
hexio_write test.db 619 [format %02x 0xe2]
|
||||
@@ -182,7 +176,7 @@ do_test corruptC-2.6 {
|
||||
# corruption (seed 178692)
|
||||
do_test corruptC-2.7 {
|
||||
db close
|
||||
copy_file test.bu test.db
|
||||
forcecopy test.bu test.db
|
||||
|
||||
# insert corrupt byte(s)
|
||||
hexio_write test.db 3074 [format %02x 0xa0]
|
||||
@@ -194,7 +188,7 @@ do_test corruptC-2.7 {
|
||||
# corruption (seed 179069)
|
||||
do_test corruptC-2.8 {
|
||||
db close
|
||||
copy_file test.bu test.db
|
||||
forcecopy test.bu test.db
|
||||
|
||||
# insert corrupt byte(s)
|
||||
hexio_write test.db 1393 [format %02x 0x7d]
|
||||
@@ -210,7 +204,7 @@ do_test corruptC-2.8 {
|
||||
# corruption (seed 170434)
|
||||
do_test corruptC-2.9 {
|
||||
db close
|
||||
copy_file test.bu test.db
|
||||
forcecopy test.bu test.db
|
||||
|
||||
# insert corrupt byte(s)
|
||||
hexio_write test.db 2095 [format %02x 0xd6]
|
||||
@@ -222,7 +216,7 @@ do_test corruptC-2.9 {
|
||||
# corruption (seed 186504)
|
||||
do_test corruptC-2.10 {
|
||||
db close
|
||||
copy_file test.bu test.db
|
||||
forcecopy test.bu test.db
|
||||
|
||||
# insert corrupt byte(s)
|
||||
hexio_write test.db 3130 [format %02x 0x02]
|
||||
@@ -234,7 +228,7 @@ do_test corruptC-2.10 {
|
||||
# corruption (seed 1589)
|
||||
do_test corruptC-2.11 {
|
||||
db close
|
||||
copy_file test.bu test.db
|
||||
forcecopy test.bu test.db
|
||||
|
||||
# insert corrupt byte(s)
|
||||
hexio_write test.db 55 [format %02x 0xa7]
|
||||
@@ -246,7 +240,7 @@ do_test corruptC-2.11 {
|
||||
# corruption (seed 14166)
|
||||
do_test corruptC-2.12 {
|
||||
db close
|
||||
copy_file test.bu test.db
|
||||
forcecopy test.bu test.db
|
||||
|
||||
# insert corrupt byte(s)
|
||||
hexio_write test.db 974 [format %02x 0x2e]
|
||||
@@ -258,7 +252,7 @@ do_test corruptC-2.12 {
|
||||
# corruption (seed 218803)
|
||||
do_test corruptC-2.13 {
|
||||
db close
|
||||
copy_file test.bu test.db
|
||||
forcecopy test.bu test.db
|
||||
|
||||
# insert corrupt byte(s)
|
||||
hexio_write test.db 102 [format %02x 0x12]
|
||||
@@ -269,7 +263,7 @@ do_test corruptC-2.13 {
|
||||
|
||||
do_test corruptC-2.14 {
|
||||
db close
|
||||
copy_file test.bu test.db
|
||||
forcecopy test.bu test.db
|
||||
|
||||
sqlite3 db test.db
|
||||
set blob [string repeat abcdefghij 10000]
|
||||
@@ -286,7 +280,7 @@ do_test corruptC-2.14 {
|
||||
#
|
||||
do_test corruptC-2.15 {
|
||||
db close
|
||||
copy_file test.bu test.db
|
||||
forcecopy test.bu test.db
|
||||
hexio_write test.db 986 b9
|
||||
sqlite3 db test.db
|
||||
catchsql {SELECT count(*) FROM sqlite_master;}
|
||||
@@ -300,7 +294,7 @@ for {set tn 0} {$tn<$fsize} {incr tn 1} {
|
||||
|
||||
# setup for test
|
||||
db close
|
||||
copy_file test.bu test.db
|
||||
forcecopy test.bu test.db
|
||||
sqlite3 db test.db
|
||||
|
||||
# Seek to a random location in the file, and write a random single byte
|
||||
|
||||
@@ -85,7 +85,7 @@ do_test corruptD-1.0 {
|
||||
DELETE FROM t1 WHERE a = 30;
|
||||
DELETE FROM t1 WHERE a = 40;
|
||||
}
|
||||
copy_file test.db test.bu
|
||||
forcecopy test.db test.bu
|
||||
} {}
|
||||
|
||||
proc incr_change_counter {} {
|
||||
@@ -96,7 +96,7 @@ proc incr_change_counter {} {
|
||||
|
||||
proc restore_file {} {
|
||||
db close
|
||||
copy_file test.bu test.db
|
||||
forcecopy test.bu test.db
|
||||
sqlite3 db test.db
|
||||
}
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
#
|
||||
# $Id: corruptE.test,v 1.14 2009/07/11 06:55:34 danielk1977 Exp $
|
||||
|
||||
catch {file delete -force test.db test.db-journal test.bu}
|
||||
catch {forcedelete test.db test.db-journal test.bu}
|
||||
|
||||
set testdir [file dirname $argv0]
|
||||
source $testdir/tester.tcl
|
||||
@@ -60,23 +60,17 @@ ifcapable {integrityck} {
|
||||
integrity_check corruptE-1.2
|
||||
}
|
||||
|
||||
# Copy file $from into $to
|
||||
#
|
||||
proc copy_file {from to} {
|
||||
file copy -force $from $to
|
||||
}
|
||||
|
||||
# Setup for the tests. Make a backup copy of the good database in test.bu.
|
||||
#
|
||||
db close
|
||||
copy_file test.db test.bu
|
||||
forcecopy test.db test.bu
|
||||
sqlite3 db test.db
|
||||
set fsize [file size test.db]
|
||||
|
||||
|
||||
do_test corruptE-2.1 {
|
||||
db close
|
||||
copy_file test.bu test.db
|
||||
forcecopy test.bu test.db
|
||||
|
||||
# insert corrupt byte(s)
|
||||
hexio_write test.db 2041 [format %02x 0x2e]
|
||||
@@ -92,7 +86,7 @@ do_test corruptE-2.1 {
|
||||
|
||||
do_test corruptE-2.2 {
|
||||
db close
|
||||
copy_file test.bu test.db
|
||||
forcecopy test.bu test.db
|
||||
|
||||
# insert corrupt byte(s)
|
||||
hexio_write test.db 2047 [format %02x 0x84]
|
||||
@@ -108,7 +102,7 @@ do_test corruptE-2.2 {
|
||||
|
||||
do_test corruptE-2.3 {
|
||||
db close
|
||||
copy_file test.bu test.db
|
||||
forcecopy test.bu test.db
|
||||
|
||||
# insert corrupt byte(s)
|
||||
hexio_write test.db 7420 [format %02x 0xa8]
|
||||
@@ -124,7 +118,7 @@ do_test corruptE-2.3 {
|
||||
|
||||
do_test corruptE-2.4 {
|
||||
db close
|
||||
copy_file test.bu test.db
|
||||
forcecopy test.bu test.db
|
||||
|
||||
# insert corrupt byte(s)
|
||||
hexio_write test.db 10233 [format %02x 0xd0]
|
||||
@@ -165,7 +159,7 @@ set tc 1
|
||||
foreach test $tests {
|
||||
do_test corruptE-3.$tc {
|
||||
db close
|
||||
copy_file test.bu test.db
|
||||
forcecopy test.bu test.db
|
||||
|
||||
# insert corrupt byte(s)
|
||||
hexio_write test.db [lindex $test 0] [format %02x [lindex $test 1]]
|
||||
|
||||
@@ -215,8 +215,8 @@ for {set i 1} {$i < $repeats} {incr i} {
|
||||
#
|
||||
ifcapable attach {
|
||||
do_test crash-4.0 {
|
||||
file delete -force test2.db
|
||||
file delete -force test2.db-journal
|
||||
forcedelete test2.db
|
||||
forcedelete test2.db-journal
|
||||
execsql {
|
||||
ATTACH 'test2.db' AS aux;
|
||||
PRAGMA aux.default_cache_size = 10;
|
||||
@@ -318,7 +318,7 @@ ifcapable attach {
|
||||
# in test crash-5.3 for details.
|
||||
#
|
||||
db close
|
||||
file delete -force test.db
|
||||
forcedelete test.db
|
||||
sqlite3 db test.db
|
||||
do_test crash-5.1 {
|
||||
execsql {
|
||||
|
||||
@@ -73,7 +73,7 @@ foreach {sql res2} [list \
|
||||
for {set ii 0} {$ii < 10} {incr ii} {
|
||||
|
||||
db close
|
||||
file delete -force test.db test.db-journal
|
||||
forcedelete test.db test.db-journal
|
||||
sqlite3 db test.db
|
||||
do_test crash3-1.$tn.1 {
|
||||
execsql {
|
||||
@@ -106,7 +106,7 @@ foreach {sql res2} [list \
|
||||
# This block tests both the IOCAP_SEQUENTIAL and IOCAP_SAFE_APPEND flags.
|
||||
#
|
||||
db close
|
||||
file delete -force test.db test.db-journal
|
||||
forcedelete test.db test.db-journal
|
||||
sqlite3 db test.db
|
||||
do_test crash3-2.0 {
|
||||
execsql {
|
||||
@@ -177,7 +177,7 @@ foreach {::crashfile ::delay ::char} {
|
||||
#
|
||||
for {set ii 0} {$ii < 10} {incr ii} {
|
||||
db close
|
||||
file delete -force test.db test.db-journal
|
||||
forcedelete test.db test.db-journal
|
||||
crashsql -file test.db -char {sequential atomic} {
|
||||
CREATE TABLE abc(a, b, c);
|
||||
}
|
||||
|
||||
@@ -63,7 +63,7 @@ foreach cmd $sql_cmd_list {
|
||||
#
|
||||
for {set cnt 1; set fin 0} {!$fin} {incr cnt} {
|
||||
db close
|
||||
file delete -force test.db test.db-journal
|
||||
forcedelete test.db test.db-journal
|
||||
do_test crash4-1.$cnt.1 {
|
||||
set seed [expr {int(abs(rand()*10000))}]
|
||||
set delay [expr {int($cnt/50)+1}]
|
||||
|
||||
@@ -34,7 +34,7 @@ for {set ii 0} {$ii < 10} {incr ii} {
|
||||
# Set up the database so that it is an auto-vacuum database
|
||||
# containing a single table (root page 3) with a single row.
|
||||
# The row has an overflow page (page 4).
|
||||
file delete -force test.db test.db-journal
|
||||
forcedelete test.db test.db-journal
|
||||
sqlite3 db test.db
|
||||
set c [string repeat 3 1500]
|
||||
db eval {
|
||||
|
||||
@@ -23,7 +23,7 @@ ifcapable !crashtest {
|
||||
|
||||
for {set ii 0} {$ii < 10} {incr ii} {
|
||||
catch {db close}
|
||||
file delete -force test.db test.db-journal
|
||||
forcedelete test.db test.db-journal
|
||||
crashsql -delay 2 -file test.db {
|
||||
PRAGMA auto_vacuum=OFF;
|
||||
PRAGMA page_size=4096;
|
||||
@@ -40,7 +40,7 @@ for {set ii 0} {$ii < 10} {incr ii} {
|
||||
|
||||
for {set ii 0} {$ii < 10} {incr ii} {
|
||||
catch {db close}
|
||||
file delete -force test.db test.db-journal
|
||||
forcedelete test.db test.db-journal
|
||||
sqlite3 db test.db
|
||||
execsql {
|
||||
PRAGMA auto_vacuum=OFF;
|
||||
@@ -66,7 +66,7 @@ proc signature {} {
|
||||
#
|
||||
for {set ii 0} {$ii < 30} {incr ii} {
|
||||
db close
|
||||
file delete -force test.db
|
||||
forcedelete test.db
|
||||
sqlite3 db test.db
|
||||
|
||||
set pagesize [expr 1024 << ($ii % 4)]
|
||||
|
||||
@@ -26,7 +26,7 @@ proc signature {} {
|
||||
foreach f [list test.db test.db-journal] {
|
||||
for {set ii 1} {$ii < 64} {incr ii} {
|
||||
db close
|
||||
file delete test.db
|
||||
delete_file test.db
|
||||
sqlite3 db test.db
|
||||
|
||||
set from_size [expr 1024 << ($ii&3)]
|
||||
|
||||
@@ -243,7 +243,7 @@ do_test crash8-3.11 {
|
||||
#
|
||||
ifcapable pragma {
|
||||
reset_db
|
||||
file delete -force test2.db
|
||||
forcedelete test2.db
|
||||
|
||||
do_test crash8-4.1 {
|
||||
execsql {
|
||||
@@ -336,14 +336,14 @@ ifcapable pragma {
|
||||
} {def}
|
||||
|
||||
do_test crash8-4.10 {
|
||||
file delete $zMasterJournal
|
||||
delete_file $zMasterJournal
|
||||
execsql { SELECT b FROM main.ab WHERE a = 0 }
|
||||
} {jkl}
|
||||
}
|
||||
|
||||
for {set i 1} {$i < 10} {incr i} {
|
||||
catch { db close }
|
||||
file delete -force test.db test.db-journal
|
||||
forcedelete test.db test.db-journal
|
||||
sqlite3 db test.db
|
||||
do_test crash8-5.$i.1 {
|
||||
execsql {
|
||||
@@ -367,7 +367,7 @@ for {set i 1} {$i < 10} {incr i} {
|
||||
} {ok}
|
||||
|
||||
catch { db close }
|
||||
file delete -force test.db test.db-journal
|
||||
forcedelete test.db test.db-journal
|
||||
sqlite3 db test.db
|
||||
do_test crash8-5.$i.2 {
|
||||
execsql {
|
||||
@@ -383,9 +383,9 @@ for {set i 1} {$i < 10} {incr i} {
|
||||
BEGIN;
|
||||
UPDATE t1 SET x = randomblob(900);
|
||||
}
|
||||
file delete -force testX.db testX.db-journal testX.db-wal
|
||||
copy_file test.db testX.db
|
||||
copy_file test.db-journal testX.db-journal
|
||||
forcedelete testX.db testX.db-journal testX.db-wal
|
||||
forcecopy test.db testX.db
|
||||
forcecopy test.db-journal testX.db-journal
|
||||
db close
|
||||
|
||||
crashsql -file test.db -delay [expr ($::i%2) + 1] {
|
||||
|
||||
@@ -27,7 +27,7 @@ ifcapable autovacuum {
|
||||
#
|
||||
for {set av 0} {$av<=$upperBound} {incr av} {
|
||||
db close
|
||||
file delete -force test.db test.db-journal
|
||||
forcedelete test.db test.db-journal
|
||||
sqlite3 db test.db
|
||||
|
||||
# Create a table that spans multiple pages. It is important
|
||||
|
||||
@@ -223,5 +223,16 @@ do_test ctime-2.5.$tc {
|
||||
} ]
|
||||
} {0 {{}}}
|
||||
|
||||
ifcapable blockalloc {
|
||||
do_test ctime-3.1a {
|
||||
db eval {SELECT sqlite_compileoption_used('PAGECACHE_BLOCKALLOC')}
|
||||
} {1}
|
||||
} else {
|
||||
do_test ctime-3.1b {
|
||||
db eval {SELECT sqlite_compileoption_used('PAGECACHE_BLOCKALLOC')}
|
||||
} {0}
|
||||
}
|
||||
|
||||
|
||||
|
||||
finish_test
|
||||
|
||||
@@ -155,7 +155,7 @@ foreach ::lookaside_buffer_size {0 64 120} {
|
||||
|
||||
# Step 1.
|
||||
db close
|
||||
file delete -force test.db
|
||||
forcedelete test.db
|
||||
sqlite3 db test.db
|
||||
sqlite3_db_config_lookaside db 0 $::lookaside_buffer_size 500
|
||||
db cache size 0
|
||||
@@ -287,7 +287,7 @@ foreach ::lookaside_buffer_size {0 64 120} {
|
||||
|
||||
# Step 1.
|
||||
db close
|
||||
file delete -force test.db
|
||||
forcedelete test.db
|
||||
sqlite3 db test.db
|
||||
sqlite3_db_config_lookaside db 0 $::lookaside_buffer_size 500
|
||||
db cache size 1000
|
||||
|
||||
@@ -275,7 +275,7 @@ do_test delete-8.0 {
|
||||
}
|
||||
} {123}
|
||||
db close
|
||||
catch {file delete -force test.db-journal}
|
||||
catch {forcedelete test.db-journal}
|
||||
catch {file attributes test.db -permissions 0444}
|
||||
catch {file attributes test.db -readonly 1}
|
||||
sqlite3 db test.db
|
||||
@@ -312,12 +312,12 @@ do_test delete-8.6 {
|
||||
integrity_check delete-8.7
|
||||
|
||||
# Need to do the following for tcl 8.5 on mac. On that configuration, the
|
||||
# -readonly flag is taken so seriously that a subsequent [file delete -force]
|
||||
# -readonly flag is taken so seriously that a subsequent [forcedelete]
|
||||
# (required before the next test file can be executed) will fail.
|
||||
#
|
||||
catch {file attributes test.db -readonly 0}
|
||||
db close
|
||||
file delete -force test.db test.db-journal
|
||||
forcedelete test.db test.db-journal
|
||||
|
||||
# The following tests verify that SQLite correctly handles the case
|
||||
# where an index B-Tree is being scanned, the rowid column being read
|
||||
|
||||
@@ -297,14 +297,14 @@ do_test descidx1-5.9 {
|
||||
ifcapable legacyformat {
|
||||
do_test descidx1-6.1 {
|
||||
db close
|
||||
file delete -force test.db test.db-journal
|
||||
forcedelete test.db test.db-journal
|
||||
sqlite3 db test.db
|
||||
execsql {PRAGMA legacy_file_format}
|
||||
} {1}
|
||||
} else {
|
||||
do_test descidx1-6.1 {
|
||||
db close
|
||||
file delete -force test.db test.db-journal
|
||||
forcedelete test.db test.db-journal
|
||||
sqlite3 db test.db
|
||||
execsql {PRAGMA legacy_file_format}
|
||||
} {0}
|
||||
@@ -328,7 +328,7 @@ ifcapable vacuum {
|
||||
}
|
||||
do_test descidx1-6.4 {
|
||||
db close
|
||||
file delete -force test.db test.db-journal
|
||||
forcedelete test.db test.db-journal
|
||||
sqlite3 db test.db
|
||||
execsql {PRAGMA legacy_file_format=NO}
|
||||
execsql {PRAGMA legacy_file_format}
|
||||
|
||||
@@ -82,8 +82,8 @@ proc do_diskfull_test {prefix sql} {
|
||||
do_diskfull_test diskfull-2 VACUUM
|
||||
|
||||
# db close
|
||||
# file delete -force test.db
|
||||
# file delete -force test.db-journal
|
||||
# forcedelete test.db
|
||||
# forcedelete test.db-journal
|
||||
# sqlite3 db test.db
|
||||
#
|
||||
# do_test diskfull-3.1 {
|
||||
|
||||
@@ -657,7 +657,7 @@ set sqlite_current_time 0
|
||||
|
||||
# EVIDENCE-OF: R-57598-59332 -- syntax diagram expr
|
||||
#
|
||||
file delete -force test.db2
|
||||
forcedelete test.db2
|
||||
execsql {
|
||||
ATTACH 'test.db2' AS dbname;
|
||||
CREATE TABLE dbname.tblname(cname);
|
||||
@@ -1675,7 +1675,7 @@ db3 close
|
||||
# Test statements related to the EXISTS and NOT EXISTS operators.
|
||||
#
|
||||
catch { db close }
|
||||
file delete -force test.db
|
||||
forcedelete test.db
|
||||
sqlite3 db test.db
|
||||
|
||||
do_execsql_test e_expr-34.1 {
|
||||
@@ -1756,7 +1756,7 @@ foreach {tn e1 e2} {
|
||||
#
|
||||
|
||||
catch { db close }
|
||||
file delete -force test.db
|
||||
forcedelete test.db
|
||||
sqlite3 db test.db
|
||||
do_test e_expr-35.0 {
|
||||
execsql {
|
||||
|
||||
@@ -60,7 +60,7 @@ foreach {DO_MALLOC_TEST enc} {
|
||||
# [foreach] loop is testing with OOM errors, disable the lookaside buffer.
|
||||
#
|
||||
db close
|
||||
file delete -force test.db test.db-journal
|
||||
forcedelete test.db test.db-journal
|
||||
sqlite3 db test.db
|
||||
if {$DO_MALLOC_TEST} { sqlite3_db_config_lookaside db 0 0 0 }
|
||||
db eval "PRAGMA encoding = '$enc'"
|
||||
@@ -637,7 +637,7 @@ read_test 8.2.2 { PRAGMA table_info(t9c) } {0 c\"1 {} 0 {} 0 1 c'2 {} 0 {} 0}
|
||||
#
|
||||
foreach DO_MALLOC_TEST {0 1 2} {
|
||||
db close
|
||||
file delete -force test.db test.db-journal
|
||||
forcedelete test.db test.db-journal
|
||||
sqlite3 db test.db
|
||||
if {$DO_MALLOC_TEST} { sqlite3_db_config_lookaside db 0 0 0 }
|
||||
|
||||
|
||||
@@ -142,7 +142,7 @@ set encodings [list UTF-8 UTF-16le UTF-16be]
|
||||
set sqlite_os_trace 0
|
||||
set i 1
|
||||
foreach enc $encodings {
|
||||
file delete -force test.db
|
||||
forcedelete test.db
|
||||
sqlite3 db test.db
|
||||
db eval "PRAGMA encoding = \"$enc\""
|
||||
execsql $dbcontents
|
||||
@@ -172,13 +172,13 @@ foreach enc $encodings {
|
||||
# encoding to the main database.
|
||||
ifcapable attach {
|
||||
do_test enc2-4.1 {
|
||||
file delete -force test.db
|
||||
forcedelete test.db
|
||||
sqlite3 db test.db
|
||||
db eval "PRAGMA encoding = 'UTF-8'"
|
||||
db eval "CREATE TABLE abc(a, b, c);"
|
||||
} {}
|
||||
do_test enc2-4.2 {
|
||||
file delete -force test2.db
|
||||
forcedelete test2.db
|
||||
sqlite3 db2 test2.db
|
||||
db2 eval "PRAGMA encoding = 'UTF-16'"
|
||||
db2 eval "CREATE TABLE abc(a, b, c);"
|
||||
@@ -206,7 +206,7 @@ proc test_collate {enc lhs rhs} {
|
||||
return $res
|
||||
}
|
||||
|
||||
file delete -force test.db
|
||||
forcedelete test.db
|
||||
sqlite3 db test.db; set DB [sqlite3_connection_pointer db]
|
||||
do_test enc2-5.0 {
|
||||
execsql {
|
||||
@@ -235,7 +235,7 @@ do_test enc2-5.3 {
|
||||
} {one two three four five UTF-16BE}
|
||||
|
||||
db close
|
||||
file delete -force test.db
|
||||
forcedelete test.db
|
||||
sqlite3 db test.db; set DB [sqlite3_connection_pointer db]
|
||||
execsql {pragma encoding = 'UTF-16LE'}
|
||||
do_test enc2-5.4 {
|
||||
@@ -265,7 +265,7 @@ do_test enc2-5.7 {
|
||||
} {one two three four five UTF-8}
|
||||
|
||||
db close
|
||||
file delete -force test.db
|
||||
forcedelete test.db
|
||||
sqlite3 db test.db; set DB [sqlite3_connection_pointer db]
|
||||
execsql {pragma encoding = 'UTF-16BE'}
|
||||
do_test enc2-5.8 {
|
||||
@@ -311,7 +311,7 @@ do_test enc2-5.14 {
|
||||
} test_collate
|
||||
|
||||
db close
|
||||
file delete -force test.db
|
||||
forcedelete test.db
|
||||
|
||||
do_test enc2-5.15 {
|
||||
sqlite3 db test.db; set ::DB [sqlite3_connection_pointer db]
|
||||
@@ -333,7 +333,7 @@ proc test_function {enc arg} {
|
||||
}
|
||||
|
||||
db close
|
||||
file delete -force test.db
|
||||
forcedelete test.db
|
||||
sqlite3 db test.db; set DB [sqlite3_connection_pointer db]
|
||||
execsql {pragma encoding = 'UTF-8'}
|
||||
do_test enc2-6.0 {
|
||||
@@ -366,7 +366,7 @@ do_test enc2-6.3 {
|
||||
} {{UTF-16BE sqlite}}
|
||||
|
||||
db close
|
||||
file delete -force test.db
|
||||
forcedelete test.db
|
||||
sqlite3 db test.db; set DB [sqlite3_connection_pointer db]
|
||||
execsql {pragma encoding = 'UTF-16LE'}
|
||||
do_test enc2-6.3 {
|
||||
@@ -399,7 +399,7 @@ do_test enc2-6.6 {
|
||||
} {{UTF-16BE sqlite}}
|
||||
|
||||
db close
|
||||
file delete -force test.db
|
||||
forcedelete test.db
|
||||
sqlite3 db test.db; set DB [sqlite3_connection_pointer db]
|
||||
execsql {pragma encoding = 'UTF-16BE'}
|
||||
do_test enc2-6.7 {
|
||||
@@ -433,7 +433,7 @@ do_test enc2-6.10 {
|
||||
|
||||
|
||||
db close
|
||||
file delete -force test.db
|
||||
forcedelete test.db
|
||||
|
||||
# The following tests - enc2-7.* - function as follows:
|
||||
#
|
||||
@@ -493,7 +493,7 @@ ifcapable {complete} {
|
||||
|
||||
# Test that the encoding of an empty database may still be set after the
|
||||
# (empty) schema has been initialized.
|
||||
file delete -force test.db
|
||||
forcedelete test.db
|
||||
do_test enc2-9.1 {
|
||||
sqlite3 db test.db
|
||||
execsql {
|
||||
@@ -537,7 +537,7 @@ do_test enc2-9.5 {
|
||||
#
|
||||
do_test enc2-10.1 {
|
||||
db close
|
||||
file delete -force test.db test.db-journal
|
||||
forcedelete test.db test.db-journal
|
||||
sqlite3 db test.db
|
||||
db eval {
|
||||
PRAGMA encoding=UTF16;
|
||||
|
||||
@@ -81,7 +81,7 @@ ifcapable {bloblit && utf16} {
|
||||
#
|
||||
ifcapable {utf16 && shared_cache} {
|
||||
db close
|
||||
file delete -force test8.db test8.db-journal
|
||||
forcedelete test8.db test8.db-journal
|
||||
set ::enable_shared_cache [sqlite3_enable_shared_cache 1]
|
||||
sqlite3 dbaux test8.db
|
||||
sqlite3 db test.db
|
||||
@@ -100,7 +100,7 @@ ifcapable {utf16 && shared_cache} {
|
||||
} dbaux
|
||||
} {1 {attached databases must use the same text encoding as main database}}
|
||||
dbaux close
|
||||
file delete -force test8.db test8.db-journal
|
||||
forcedelete test8.db test8.db-journal
|
||||
sqlite3_enable_shared_cache $::enable_shared_cache
|
||||
}
|
||||
|
||||
|
||||
@@ -43,7 +43,7 @@ set vals [list\
|
||||
set i 1
|
||||
foreach enc $encodings {
|
||||
|
||||
file delete -force test.db
|
||||
forcedelete test.db
|
||||
sqlite3 db test.db
|
||||
db eval "PRAGMA encoding = \"$enc\""
|
||||
|
||||
@@ -93,7 +93,7 @@ foreach enc $encodings {
|
||||
incr i
|
||||
}
|
||||
|
||||
file delete -force test.db
|
||||
forcedelete test.db
|
||||
sqlite3 db test.db
|
||||
|
||||
do_test enc4-4.1 {
|
||||
|
||||
@@ -22,12 +22,12 @@ ifcapable {!pager_pragmas} {
|
||||
return
|
||||
}
|
||||
|
||||
file delete -force test2.db-journal
|
||||
file delete -force test2.db
|
||||
file delete -force test3.db-journal
|
||||
file delete -force test3.db
|
||||
file delete -force test4.db-journal
|
||||
file delete -force test4.db
|
||||
forcedelete test2.db-journal
|
||||
forcedelete test2.db
|
||||
forcedelete test3.db-journal
|
||||
forcedelete test3.db
|
||||
forcedelete test4.db-journal
|
||||
forcedelete test4.db
|
||||
|
||||
#----------------------------------------------------------------------
|
||||
# Test cases exclusive-1.X test the PRAGMA logic.
|
||||
@@ -481,8 +481,8 @@ do_execsql_test exclusive-6.1 {
|
||||
}
|
||||
do_test exclusive-6.2 {
|
||||
forcedelete test2.db test2.db-journal
|
||||
file copy test.db test2.db
|
||||
file copy test.db-journal test2.db-journal
|
||||
copy_file test.db test2.db
|
||||
copy_file test.db-journal test2.db-journal
|
||||
sqlite3 db test2.db
|
||||
} {}
|
||||
|
||||
|
||||
@@ -259,8 +259,8 @@ do_test exclusive2-2.8 {
|
||||
|
||||
db close
|
||||
catch {close $::fd}
|
||||
file delete -force test.db
|
||||
file delete -force test.db-journal
|
||||
forcedelete test.db
|
||||
forcedelete test.db-journal
|
||||
|
||||
do_test exclusive2-3.0 {
|
||||
sqlite3 db test.db
|
||||
|
||||
@@ -79,7 +79,7 @@ ifcapable !wal { set skipwaltests 1 }
|
||||
|
||||
if {!$skipwaltests} {
|
||||
db close
|
||||
file delete -force test.db
|
||||
forcedelete test.db
|
||||
sqlite3 db test.db
|
||||
file_control_chunksize_test db main [expr 32*1024]
|
||||
|
||||
|
||||
@@ -37,5 +37,5 @@ do_test filectrl-1.5 {
|
||||
file_control_lockproxy_test db [pwd]
|
||||
} {}
|
||||
db close
|
||||
file delete -force .test_control_lockproxy.db-conch test.proxy
|
||||
forcedelete .test_control_lockproxy.db-conch test.proxy
|
||||
finish_test
|
||||
|
||||
@@ -23,7 +23,7 @@ source $testdir/tester.tcl
|
||||
do_not_use_codec
|
||||
|
||||
db close
|
||||
file delete -force test.db test.db-journal
|
||||
forcedelete test.db test.db-journal
|
||||
|
||||
# Database begins with valid 16-byte header string.
|
||||
#
|
||||
@@ -63,7 +63,7 @@ ifcapable pager_pragmas {
|
||||
&& $pagesize>$SQLITE_MAX_PAGE_SIZE} continue
|
||||
do_test filefmt-1.5.$pagesize.1 {
|
||||
db close
|
||||
file delete -force test.db
|
||||
forcedelete test.db
|
||||
sqlite3 db test.db
|
||||
db eval "PRAGMA auto_vacuum=OFF"
|
||||
db eval "PRAGMA page_size=$pagesize"
|
||||
@@ -105,7 +105,7 @@ do_test filefmt-1.7 {
|
||||
ifcapable pager_pragmas {
|
||||
do_test filefmt-1.8 {
|
||||
db close
|
||||
file delete -force test.db
|
||||
forcedelete test.db
|
||||
sqlite3 db test.db
|
||||
db eval {PRAGMA page_size=512; CREATE TABLE t1(x)}
|
||||
db close
|
||||
@@ -125,7 +125,7 @@ ifcapable pager_pragmas {
|
||||
# always derives this from the size of the file.
|
||||
#
|
||||
db close
|
||||
file delete -force test.db
|
||||
forcedelete test.db
|
||||
|
||||
set a_string_counter 1
|
||||
proc a_string {n} {
|
||||
@@ -157,7 +157,7 @@ integrity_check filefmt-2.1.5
|
||||
do_test filefmt-2.1.6 { hexio_read test.db 28 4 } {00000010}
|
||||
|
||||
db close
|
||||
file delete -force test.db
|
||||
forcedelete test.db
|
||||
sqlite3 db test.db
|
||||
db func a_string a_string
|
||||
|
||||
|
||||
@@ -19,8 +19,8 @@ ifcapable !fts1 {
|
||||
}
|
||||
|
||||
# Clean up anything left over from a previous pass.
|
||||
file delete -force test2.db
|
||||
file delete -force test2.db-journal
|
||||
forcedelete test2.db
|
||||
forcedelete test2.db-journal
|
||||
sqlite3 db2 test2.db
|
||||
|
||||
db eval {
|
||||
@@ -84,6 +84,6 @@ do_test fts1j-1.3 {
|
||||
catch {db eval {DETACH DATABASE two}}
|
||||
|
||||
catch {db2 close}
|
||||
file delete -force test2.db
|
||||
forcedelete test2.db
|
||||
|
||||
finish_test
|
||||
|
||||
@@ -95,7 +95,7 @@ do_test fts1o-3.6 {
|
||||
# Test that it is possible to rename an fts1 table in an attached
|
||||
# database.
|
||||
#
|
||||
file delete -force test2.db test2.db-journal
|
||||
forcedelete test2.db test2.db-journal
|
||||
|
||||
do_test fts1o-4.1 {
|
||||
execsql {
|
||||
|
||||
@@ -19,8 +19,8 @@ ifcapable !fts2 {
|
||||
}
|
||||
|
||||
# Clean up anything left over from a previous pass.
|
||||
file delete -force test2.db
|
||||
file delete -force test2.db-journal
|
||||
forcedelete test2.db
|
||||
forcedelete test2.db-journal
|
||||
sqlite3 db2 test2.db
|
||||
|
||||
db eval {
|
||||
@@ -84,6 +84,6 @@ do_test fts2j-1.3 {
|
||||
catch {db eval {DETACH DATABASE two}}
|
||||
|
||||
catch {db2 close}
|
||||
file delete -force test2.db
|
||||
forcedelete test2.db
|
||||
|
||||
finish_test
|
||||
|
||||
@@ -109,7 +109,7 @@ do_test fts2o-2.12 {
|
||||
# be run on an initially empty db.
|
||||
#
|
||||
db close
|
||||
file delete -force test.db test.db-journal
|
||||
forcedelete test.db test.db-journal
|
||||
sqlite3 db test.db
|
||||
|
||||
do_test fts2o-3.1 {
|
||||
@@ -134,7 +134,7 @@ do_test fts2o-3.2 {
|
||||
# Test that it is possible to rename an fts2 table in an attached
|
||||
# database.
|
||||
#
|
||||
file delete -force test2.db test2.db-journal
|
||||
forcedelete test2.db test2.db-journal
|
||||
|
||||
do_test fts2o-3.1 {
|
||||
execsql {
|
||||
|
||||
@@ -19,8 +19,8 @@ ifcapable !fts3 {
|
||||
}
|
||||
|
||||
# Clean up anything left over from a previous pass.
|
||||
file delete -force test2.db
|
||||
file delete -force test2.db-journal
|
||||
forcedelete test2.db
|
||||
forcedelete test2.db-journal
|
||||
sqlite3 db2 test2.db
|
||||
|
||||
db eval {
|
||||
@@ -84,6 +84,6 @@ do_test fts3aj-1.3 {
|
||||
catch {db eval {DETACH DATABASE two}}
|
||||
|
||||
catch {db2 close}
|
||||
file delete -force test2.db
|
||||
forcedelete test2.db
|
||||
|
||||
finish_test
|
||||
|
||||
@@ -111,7 +111,7 @@ do_test fts3ao-2.12 {
|
||||
# be run on an initially empty db.
|
||||
#
|
||||
db close
|
||||
file delete -force test.db test.db-journal
|
||||
forcedelete test.db test.db-journal
|
||||
sqlite3 db test.db
|
||||
|
||||
do_test fts3ao-3.1 {
|
||||
@@ -136,7 +136,7 @@ do_test fts3ao-3.2 {
|
||||
# Test that it is possible to rename an fts3 table in an attached
|
||||
# database.
|
||||
#
|
||||
file delete -force test2.db test2.db-journal
|
||||
forcedelete test2.db test2.db-journal
|
||||
|
||||
do_test fts3ao-3.1 {
|
||||
execsql {
|
||||
|
||||
@@ -131,7 +131,7 @@ foreach {DO_MALLOC_TEST enc} {
|
||||
} {
|
||||
|
||||
db close
|
||||
file delete -force test.db
|
||||
forcedelete test.db
|
||||
sqlite3 db test.db
|
||||
sqlite3_db_config_lookaside db 0 0 0
|
||||
db eval "PRAGMA encoding = \"$enc\""
|
||||
|
||||
@@ -1686,7 +1686,7 @@ foreach {q r} [array get fts4aa_res] {
|
||||
#
|
||||
do_test fts4aa-3.0 {
|
||||
db close
|
||||
file delete -force test.db
|
||||
forcedelete test.db
|
||||
sqlite3 db test.db
|
||||
db eval {
|
||||
PRAGMA page_size=65536;
|
||||
|
||||
@@ -47,7 +47,7 @@ proc do_fuzzy_malloc_test {testname args} {
|
||||
|
||||
sqlite3_memdebug_fail -1
|
||||
db close
|
||||
file delete test.db test.db-journal
|
||||
delete_file test.db test.db-journal
|
||||
sqlite3 db test.db
|
||||
set ::prep $::fuzzyopts(-sqlprep)
|
||||
execsql $::prep
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user