1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-08-08 14:02:16 +03:00

Merge latest trunk changes with this branch.

FossilOrigin-Name: 4621b2eef8be6d944f87de097bd11c649fe43333
This commit is contained in:
dan
2015-04-01 18:22:26 +00:00
21 changed files with 293 additions and 90 deletions

View File

@@ -1059,7 +1059,7 @@ install: sqlite3$(BEXE) lib_install sqlite3.h sqlite3.pc ${HAVE_TCL:1=tcl_instal
$(INSTALL) -m 0644 sqlite3.pc $(DESTDIR)$(pkgconfigdir) $(INSTALL) -m 0644 sqlite3.pc $(DESTDIR)$(pkgconfigdir)
pkgIndex.tcl: pkgIndex.tcl:
echo 'package ifneeded sqlite3 $(RELEASE) [list load $(TCLLIBDIR)/libtclsqlite3.so sqlite3]' > $@ echo 'package ifneeded sqlite3 $(RELEASE) [list load $(TCLLIBDIR)/libtclsqlite3$(SHLIB_SUFFIX) sqlite3]' > $@
tcl_install: lib_install libtclsqlite3.la pkgIndex.tcl tcl_install: lib_install libtclsqlite3.la pkgIndex.tcl
$(INSTALL) -d $(DESTDIR)$(TCLLIBDIR) $(INSTALL) -d $(DESTDIR)$(TCLLIBDIR)
$(LTINSTALL) libtclsqlite3.la $(DESTDIR)$(TCLLIBDIR) $(LTINSTALL) libtclsqlite3.la $(DESTDIR)$(TCLLIBDIR)

View File

@@ -331,7 +331,7 @@ SHELL_CCONV_OPTS =
# These are additional compiler options used for the core library. # These are additional compiler options used for the core library.
# #
!IFNDEF CORE_COMPILE_OPTS !IFNDEF CORE_COMPILE_OPTS
!IF $(USE_STDCALL)!=0 !IF $(DYNAMIC_SHELL)!=0
CORE_COMPILE_OPTS = $(CORE_CCONV_OPTS) -DSQLITE_API=__declspec(dllexport) CORE_COMPILE_OPTS = $(CORE_CCONV_OPTS) -DSQLITE_API=__declspec(dllexport)
!ELSE !ELSE
CORE_COMPILE_OPTS = $(CORE_CCONV_OPTS) CORE_COMPILE_OPTS = $(CORE_CCONV_OPTS)
@@ -342,7 +342,7 @@ CORE_COMPILE_OPTS = $(CORE_CCONV_OPTS)
# when linking. # when linking.
# #
!IFNDEF CORE_LINK_DEP !IFNDEF CORE_LINK_DEP
!IF $(USE_STDCALL)!=0 !IF $(DYNAMIC_SHELL)!=0
CORE_LINK_DEP = CORE_LINK_DEP =
!ELSE !ELSE
CORE_LINK_DEP = sqlite3.def CORE_LINK_DEP = sqlite3.def
@@ -352,7 +352,7 @@ CORE_LINK_DEP = sqlite3.def
# These are additional linker options used for the core library. # These are additional linker options used for the core library.
# #
!IFNDEF CORE_LINK_OPTS !IFNDEF CORE_LINK_OPTS
!IF $(USE_STDCALL)!=0 !IF $(DYNAMIC_SHELL)!=0
CORE_LINK_OPTS = CORE_LINK_OPTS =
!ELSE !ELSE
CORE_LINK_OPTS = /DEF:sqlite3.def CORE_LINK_OPTS = /DEF:sqlite3.def
@@ -1158,6 +1158,20 @@ mptester.exe: $(TOP)\mptest\mptest.c $(SHELL_CORE_DEP) $(LIBRESOBJS) sqlite3.h
$(LTLINK) $(SHELL_COMPILE_OPTS) $(TOP)\mptest\mptest.c \ $(LTLINK) $(SHELL_COMPILE_OPTS) $(TOP)\mptest\mptest.c \
/link $(LTLINKOPTS) $(LTLIBPATHS) $(SHELL_LINK_OPTS) $(LIBRESOBJS) $(LIBREADLINE) $(LTLIBS) $(TLIBS) /link $(LTLINKOPTS) $(LTLIBPATHS) $(SHELL_LINK_OPTS) $(LIBRESOBJS) $(LIBREADLINE) $(LTLIBS) $(TLIBS)
MPTEST1 = mptester mptest.db $(TOP)/mptest/crash01.test --repeat 20
MPTEST2 = mptester mptest.db $(TOP)/mptest/multiwrite01.test --repeat 20
mptest: mptester.exe
del /Q mptest.db 2>NUL
$(MPTEST1) --journalmode DELETE
$(MPTEST2) --journalmode WAL
$(MPTEST1) --journalmode WAL
$(MPTEST2) --journalmode PERSIST
$(MPTEST1) --journalmode PERSIST
$(MPTEST2) --journalmode TRUNCATE
$(MPTEST1) --journalmode TRUNCATE
$(MPTEST2) --journalmode DELETE
# This target creates a directory named "tsrc" and fills it with # This target creates a directory named "tsrc" and fills it with
# copies of all of the C source code and header files needed to # copies of all of the C source code and header files needed to
# build on the target system. Some of the C source code and header # build on the target system. Some of the C source code and header

30
configure vendored
View File

@@ -884,6 +884,7 @@ TCL_LIB_SPEC
TCL_STUB_LIB_FILE TCL_STUB_LIB_FILE
TCL_STUB_LIB_FLAG TCL_STUB_LIB_FLAG
TCL_STUB_LIB_SPEC TCL_STUB_LIB_SPEC
TCL_SHLIB_SUFFIX
HAVE_TCL HAVE_TCL
TARGET_READLINE_LIBS TARGET_READLINE_LIBS
TARGET_READLINE_INC TARGET_READLINE_INC
@@ -3724,13 +3725,13 @@ if test "${lt_cv_nm_interface+set}" = set; then
else else
lt_cv_nm_interface="BSD nm" lt_cv_nm_interface="BSD nm"
echo "int some_variable = 0;" > conftest.$ac_ext echo "int some_variable = 0;" > conftest.$ac_ext
(eval echo "\"\$as_me:3727: $ac_compile\"" >&5) (eval echo "\"\$as_me:3728: $ac_compile\"" >&5)
(eval "$ac_compile" 2>conftest.err) (eval "$ac_compile" 2>conftest.err)
cat conftest.err >&5 cat conftest.err >&5
(eval echo "\"\$as_me:3730: $NM \\\"conftest.$ac_objext\\\"\"" >&5) (eval echo "\"\$as_me:3731: $NM \\\"conftest.$ac_objext\\\"\"" >&5)
(eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out)
cat conftest.err >&5 cat conftest.err >&5
(eval echo "\"\$as_me:3733: output\"" >&5) (eval echo "\"\$as_me:3734: output\"" >&5)
cat conftest.out >&5 cat conftest.out >&5
if $GREP 'External.*some_variable' conftest.out > /dev/null; then if $GREP 'External.*some_variable' conftest.out > /dev/null; then
lt_cv_nm_interface="MS dumpbin" lt_cv_nm_interface="MS dumpbin"
@@ -4952,7 +4953,7 @@ ia64-*-hpux*)
;; ;;
*-*-irix6*) *-*-irix6*)
# Find out which ABI we are using. # Find out which ABI we are using.
echo '#line 4955 "configure"' > conftest.$ac_ext echo '#line 4956 "configure"' > conftest.$ac_ext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5 (eval $ac_compile) 2>&5
ac_status=$? ac_status=$?
@@ -6821,11 +6822,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'` -e 's:$: $lt_compiler_flag:'`
(eval echo "\"\$as_me:6824: $lt_compile\"" >&5) (eval echo "\"\$as_me:6825: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err) (eval "$lt_compile" 2>conftest.err)
ac_status=$? ac_status=$?
cat conftest.err >&5 cat conftest.err >&5
echo "$as_me:6828: \$? = $ac_status" >&5 echo "$as_me:6829: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized # The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings other than the usual output. # So say no if there are warnings other than the usual output.
@@ -7160,11 +7161,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'` -e 's:$: $lt_compiler_flag:'`
(eval echo "\"\$as_me:7163: $lt_compile\"" >&5) (eval echo "\"\$as_me:7164: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err) (eval "$lt_compile" 2>conftest.err)
ac_status=$? ac_status=$?
cat conftest.err >&5 cat conftest.err >&5
echo "$as_me:7167: \$? = $ac_status" >&5 echo "$as_me:7168: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized # The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings other than the usual output. # So say no if there are warnings other than the usual output.
@@ -7265,11 +7266,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'` -e 's:$: $lt_compiler_flag:'`
(eval echo "\"\$as_me:7268: $lt_compile\"" >&5) (eval echo "\"\$as_me:7269: $lt_compile\"" >&5)
(eval "$lt_compile" 2>out/conftest.err) (eval "$lt_compile" 2>out/conftest.err)
ac_status=$? ac_status=$?
cat out/conftest.err >&5 cat out/conftest.err >&5
echo "$as_me:7272: \$? = $ac_status" >&5 echo "$as_me:7273: \$? = $ac_status" >&5
if (exit $ac_status) && test -s out/conftest2.$ac_objext if (exit $ac_status) && test -s out/conftest2.$ac_objext
then then
# The compiler can only warn and ignore the option if not recognized # The compiler can only warn and ignore the option if not recognized
@@ -7320,11 +7321,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'` -e 's:$: $lt_compiler_flag:'`
(eval echo "\"\$as_me:7323: $lt_compile\"" >&5) (eval echo "\"\$as_me:7324: $lt_compile\"" >&5)
(eval "$lt_compile" 2>out/conftest.err) (eval "$lt_compile" 2>out/conftest.err)
ac_status=$? ac_status=$?
cat out/conftest.err >&5 cat out/conftest.err >&5
echo "$as_me:7327: \$? = $ac_status" >&5 echo "$as_me:7328: \$? = $ac_status" >&5
if (exit $ac_status) && test -s out/conftest2.$ac_objext if (exit $ac_status) && test -s out/conftest2.$ac_objext
then then
# The compiler can only warn and ignore the option if not recognized # The compiler can only warn and ignore the option if not recognized
@@ -10133,7 +10134,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF cat > conftest.$ac_ext <<_LT_EOF
#line 10136 "configure" #line 10137 "configure"
#include "confdefs.h" #include "confdefs.h"
#if HAVE_DLFCN_H #if HAVE_DLFCN_H
@@ -10229,7 +10230,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF cat > conftest.$ac_ext <<_LT_EOF
#line 10232 "configure" #line 10233 "configure"
#include "confdefs.h" #include "confdefs.h"
#if HAVE_DLFCN_H #if HAVE_DLFCN_H
@@ -12827,6 +12828,7 @@ $as_echo "file not found" >&6; }
fi fi
fi fi
if test "${use_tcl}" = "no" ; then if test "${use_tcl}" = "no" ; then

View File

@@ -430,6 +430,7 @@ if test "${use_tcl}" = "yes" ; then
AC_SUBST(TCL_STUB_LIB_FILE) AC_SUBST(TCL_STUB_LIB_FILE)
AC_SUBST(TCL_STUB_LIB_FLAG) AC_SUBST(TCL_STUB_LIB_FLAG)
AC_SUBST(TCL_STUB_LIB_SPEC) AC_SUBST(TCL_STUB_LIB_SPEC)
AC_SUBST(TCL_SHLIB_SUFFIX)
fi fi
fi fi
if test "${use_tcl}" = "no" ; then if test "${use_tcl}" = "no" ; then

View File

@@ -1108,7 +1108,7 @@ static int fts3InitVtab(
const char **aCol; /* Array of column names */ const char **aCol; /* Array of column names */
sqlite3_tokenizer *pTokenizer = 0; /* Tokenizer for this table */ sqlite3_tokenizer *pTokenizer = 0; /* Tokenizer for this table */
int nIndex; /* Size of aIndex[] array */ int nIndex = 0; /* Size of aIndex[] array */
struct Fts3Index *aIndex = 0; /* Array of indexes for this table */ struct Fts3Index *aIndex = 0; /* Array of indexes for this table */
/* The results of parsing supported FTS4 key=value options: */ /* The results of parsing supported FTS4 key=value options: */

13
main.mk
View File

@@ -408,6 +408,19 @@ mptester$(EXE): sqlite3.c $(TOP)/mptest/mptest.c
$(TCCX) -o $@ -I. $(TOP)/mptest/mptest.c sqlite3.c \ $(TCCX) -o $@ -I. $(TOP)/mptest/mptest.c sqlite3.c \
$(TLIBS) $(THREADLIB) $(TLIBS) $(THREADLIB)
MPTEST1=./mptester$(EXE) mptest.db $(TOP)/mptest/crash01.test --repeat 20
MPTEST2=./mptester$(EXE) mptest.db $(TOP)/mptest/multiwrite01.test --repeat 20
mptest: mptester$(EXE)
rm -f mptest.db
$(MPTEST1) --journalmode DELETE
$(MPTEST2) --journalmode WAL
$(MPTEST1) --journalmode WAL
$(MPTEST2) --journalmode PERSIST
$(MPTEST1) --journalmode PERSIST
$(MPTEST2) --journalmode TRUNCATE
$(MPTEST1) --journalmode TRUNCATE
$(MPTEST2) --journalmode DELETE
sqlite3.o: sqlite3.c sqlite3.o: sqlite3.c
$(TCCX) -I. -c sqlite3.c $(TCCX) -I. -c sqlite3.c

View File

@@ -1,9 +1,9 @@
C When\svacuuming\san\sindex\sthat\suses\sno\scollations\sother\sthan\sBINARY,\sassume\sthat\sthe\sorder\sof\sindex\sentries\swill\snot\sbe\schanged\sby\sthe\sVACUUM. C Merge\slatest\strunk\schanges\swith\sthis\sbranch.
D 2015-04-01T18:20:25.537 D 2015-04-01T18:22:26.384
F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f
F Makefile.in 88a3e6261286db378fdffa1124cad11b3c05f5bb F Makefile.in 00d12636df7a5b08af09116bcd6c7bfd49b8b3b4
F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23
F Makefile.msc 3481e2dd260968742c715542db178c2bdd5db99f F Makefile.msc a8d817fa486d8c88dfbd19ae6a6567d9d350de39
F Makefile.vxworks e1b65dea203f054e71653415bd8f96dcaed47858 F Makefile.vxworks e1b65dea203f054e71653415bd8f96dcaed47858
F README.md d58e3bebc0a4145e0f2a87994015fdb575a8e866 F README.md d58e3bebc0a4145e0f2a87994015fdb575a8e866
F VERSION 319eb1ced4b4d17a67730f2b7b85f15c1346cb60 F VERSION 319eb1ced4b4d17a67730f2b7b85f15c1346cb60
@@ -38,8 +38,8 @@ F autoconf/tea/win/rules.vc c511f222b80064096b705dbeb97060ee1d6b6d63
F config.guess 226d9a188c6196f3033ffc651cbc9dcee1a42977 F config.guess 226d9a188c6196f3033ffc651cbc9dcee1a42977
F config.h.in 42b71ad3fe21c9e88fa59e8458ca1a6bc72eb0c0 F config.h.in 42b71ad3fe21c9e88fa59e8458ca1a6bc72eb0c0
F config.sub 9ebe4c3b3dab6431ece34f16828b594fb420da55 F config.sub 9ebe4c3b3dab6431ece34f16828b594fb420da55
F configure 613b220c2f2c7adcd50eb5ee4144ab581a150b47 x F configure 8b18c2378805a1d8aaca85d293671f450dd3c723 x
F configure.ac 6a8d145aea6d81f0b90013340780e43ed74fd5f4 F configure.ac 0b775d383c536bbaafc1e46dd3cbb81a7ea11aeb
F contrib/sqlitecon.tcl 210a913ad63f9f991070821e599d600bd913e0ad F contrib/sqlitecon.tcl 210a913ad63f9f991070821e599d600bd913e0ad
F doc/lemon.html 334dbf6621b8fb8790297ec1abf3cfa4621709d1 F doc/lemon.html 334dbf6621b8fb8790297ec1abf3cfa4621709d1
F doc/pager-invariants.txt 27fed9a70ddad2088750c4a2b493b63853da2710 F doc/pager-invariants.txt 27fed9a70ddad2088750c4a2b493b63853da2710
@@ -78,7 +78,7 @@ F ext/fts3/README.content fdc666a70d5257a64fee209f97cf89e0e6e32b51
F ext/fts3/README.syntax a19711dc5458c20734b8e485e75fb1981ec2427a F ext/fts3/README.syntax a19711dc5458c20734b8e485e75fb1981ec2427a
F ext/fts3/README.tokenizers e0a8b81383ea60d0334d274fadf305ea14a8c314 F ext/fts3/README.tokenizers e0a8b81383ea60d0334d274fadf305ea14a8c314
F ext/fts3/README.txt 8c18f41574404623b76917b9da66fcb0ab38328d F ext/fts3/README.txt 8c18f41574404623b76917b9da66fcb0ab38328d
F ext/fts3/fts3.c 2a1cf23133d0c75ce296d17440c44115f8413ec7 F ext/fts3/fts3.c d3f6f0e95d366f3c2028d916c36a0844bf805840
F ext/fts3/fts3.h 3a10a0af180d502cecc50df77b1b22df142817fe F ext/fts3/fts3.h 3a10a0af180d502cecc50df77b1b22df142817fe
F ext/fts3/fts3Int.h 394858c12a17740f7a1f6bd372c4606d4425a8d1 F ext/fts3/fts3Int.h 394858c12a17740f7a1f6bd372c4606d4425a8d1
F ext/fts3/fts3_aux.c 5c211e17a64885faeb16b9ba7772f9d5445c2365 F ext/fts3/fts3_aux.c 5c211e17a64885faeb16b9ba7772f9d5445c2365
@@ -152,7 +152,7 @@ F ext/userauth/userauth.c 5fa3bdb492f481bbc1709fc83c91ebd13460c69e
F install-sh 9d4de14ab9fb0facae2f48780b874848cbf2f895 x F install-sh 9d4de14ab9fb0facae2f48780b874848cbf2f895 x
F ltmain.sh 3ff0879076df340d2e23ae905484d8c15d5fdea8 F ltmain.sh 3ff0879076df340d2e23ae905484d8c15d5fdea8
F magic.txt 8273bf49ba3b0c8559cb2774495390c31fd61c60 F magic.txt 8273bf49ba3b0c8559cb2774495390c31fd61c60
F main.mk 04c49c495795b18a7b70053eef285be1e4d43fa4 F main.mk 997eee18387a3e69394f2f948c9c6ccf079655a4
F mkopcodec.awk c2ff431854d702cdd2d779c9c0d1f58fa16fa4ea F mkopcodec.awk c2ff431854d702cdd2d779c9c0d1f58fa16fa4ea
F mkopcodeh.awk c6b3fa301db6ef7ac916b14c60868aeaec1337b5 F mkopcodeh.awk c6b3fa301db6ef7ac916b14c60868aeaec1337b5
F mkso.sh fd21c06b063bb16a5d25deea1752c2da6ac3ed83 F mkso.sh fd21c06b063bb16a5d25deea1752c2da6ac3ed83
@@ -160,7 +160,7 @@ F mptest/config01.test 3c6adcbc50b991866855f1977ff172eb6d901271
F mptest/config02.test 4415dfe36c48785f751e16e32c20b077c28ae504 F mptest/config02.test 4415dfe36c48785f751e16e32c20b077c28ae504
F mptest/crash01.test 61e61469e257df0850df4293d7d4d6c2af301421 F mptest/crash01.test 61e61469e257df0850df4293d7d4d6c2af301421
F mptest/crash02.subtest f4ef05adcd15d60e5d2bd654204f2c008b519df8 F mptest/crash02.subtest f4ef05adcd15d60e5d2bd654204f2c008b519df8
F mptest/mptest.c 1e464f41f1bbc6578d6925043da56170f83aea96 F mptest/mptest.c dae6de83eddac3ef97fc4111632f6066760f939a
F mptest/multiwrite01.test dab5c5f8f9534971efce679152c5146da265222d F mptest/multiwrite01.test dab5c5f8f9534971efce679152c5146da265222d
F spec.template 86a4a43b99ebb3e75e6b9a735d5fd293a24e90ca F spec.template 86a4a43b99ebb3e75e6b9a735d5fd293a24e90ca
F sqlite.pc.in 42b7bf0d02e08b9e77734a47798d1a55a9e0716b F sqlite.pc.in 42b7bf0d02e08b9e77734a47798d1a55a9e0716b
@@ -173,9 +173,9 @@ F src/auth.c b56c78ebe40a2110fd361379f7e8162d23f92240
F src/backup.c ff743689c4d6c5cb55ad42ed9d174b2b3e71f1e3 F src/backup.c ff743689c4d6c5cb55ad42ed9d174b2b3e71f1e3
F src/bitvec.c 19a4ba637bd85f8f63fc8c9bae5ade9fb05ec1cb F src/bitvec.c 19a4ba637bd85f8f63fc8c9bae5ade9fb05ec1cb
F src/btmutex.c 45a968cc85afed9b5e6cf55bf1f42f8d18107f79 F src/btmutex.c 45a968cc85afed9b5e6cf55bf1f42f8d18107f79
F src/btree.c 4f305e554d7d207375c3e29ab0335bd5a473a125 F src/btree.c 2caf598165f3608fde8abac2b243826616ce54b7
F src/btree.h 969adc948e89e449220ff0ff724c94bb2a52e9f1 F src/btree.h 969adc948e89e449220ff0ff724c94bb2a52e9f1
F src/btreeInt.h 2bfefc01875d8da066504c233ec259fcb3b2ef72 F src/btreeInt.h 973a22a6fd61350b454ad614832b1f0a5e25a1e4
F src/build.c 9103f5cd8f4071dc0c44a3312956e53f5b7f52c8 F src/build.c 9103f5cd8f4071dc0c44a3312956e53f5b7f52c8
F src/callback.c 7b44ce59674338ad48b0e84e7b72f935ea4f68b0 F src/callback.c 7b44ce59674338ad48b0e84e7b72f935ea4f68b0
F src/complete.c 198a0066ba60ab06fc00fba1998d870a4d575463 F src/complete.c 198a0066ba60ab06fc00fba1998d870a4d575463
@@ -195,8 +195,8 @@ F src/journal.c b4124532212b6952f42eb2c12fa3c25701d8ba8d
F src/legacy.c ba1863ea58c4c840335a84ec276fc2b25e22bc4e F src/legacy.c ba1863ea58c4c840335a84ec276fc2b25e22bc4e
F src/lempar.c 7274c97d24bb46631e504332ccd3bd1b37841770 F src/lempar.c 7274c97d24bb46631e504332ccd3bd1b37841770
F src/loadext.c 86bd4e2fccd520b748cba52492ab60c4a770f660 F src/loadext.c 86bd4e2fccd520b748cba52492ab60c4a770f660
F src/main.c 569d45ba9eb4fbdd631d53f440bcdb4a35ab1505 F src/main.c 40e333960d53f7d50ee8ce09d40431c87ea653f2
F src/malloc.c e818a0db9ac0898f9dc74002f3a5baca32232d05 F src/malloc.c 6a370b83d54e4bbf6f94021221c2a311cff26a18
F src/mem0.c 6a55ebe57c46ca1a7d98da93aaa07f99f1059645 F src/mem0.c 6a55ebe57c46ca1a7d98da93aaa07f99f1059645
F src/mem1.c abe6ee469b6c5a35c7f22bfeb9c9bac664a1c987 F src/mem1.c abe6ee469b6c5a35c7f22bfeb9c9bac664a1c987
F src/mem2.c f1940d9e91948dd6a908fbb9ce3835c36b5d83c3 F src/mem2.c f1940d9e91948dd6a908fbb9ce3835c36b5d83c3
@@ -215,7 +215,7 @@ F src/os.h 3e57a24e2794a94d3cf2342c6d9a884888cd96bf
F src/os_common.h 92815ed65f805560b66166e3583470ff94478f04 F src/os_common.h 92815ed65f805560b66166e3583470ff94478f04
F src/os_setup.h c9d4553b5aaa6f73391448b265b89bed0b890faa F src/os_setup.h c9d4553b5aaa6f73391448b265b89bed0b890faa
F src/os_unix.c a4dadbc2da41599e99093e91e276c38c17a73b89 F src/os_unix.c a4dadbc2da41599e99093e91e276c38c17a73b89
F src/os_win.c 8223e7db5b7c4a81d8b161098ac3959400434cdb F src/os_win.c 03d27be3a20048ef52a648d5f0a15f5edda9f2a3
F src/os_win.h eb7a47aa17b26b77eb97e4823f20a00b8bda12ca F src/os_win.h eb7a47aa17b26b77eb97e4823f20a00b8bda12ca
F src/pager.c 4120a49ecd37697e28f5ed807f470b9c0b88410c F src/pager.c 4120a49ecd37697e28f5ed807f470b9c0b88410c
F src/pager.h c3476e7c89cdf1c6914e50a11f3714e30b4e0a77 F src/pager.h c3476e7c89cdf1c6914e50a11f3714e30b4e0a77
@@ -231,11 +231,11 @@ F src/random.c ba2679f80ec82c4190062d756f22d0c358180696
F src/resolve.c f4d79e31ffa5820c2e3d1740baa5e9b190425f2b F src/resolve.c f4d79e31ffa5820c2e3d1740baa5e9b190425f2b
F src/rowset.c eccf6af6d620aaa4579bd3b72c1b6395d9e9fa1e F src/rowset.c eccf6af6d620aaa4579bd3b72c1b6395d9e9fa1e
F src/select.c 72ffb62e2879956302140e9f6e6ae88aee36b0e5 F src/select.c 72ffb62e2879956302140e9f6e6ae88aee36b0e5
F src/shell.c 3ae1e53878d2804fe77b8c8f1f6ca287a0e5d80e F src/shell.c 84a1593bd86aaa14f4da8a8f9b16fbc239d262aa
F src/sqlite.h.in 278602140d49575e8708e643161f4263e428a02a F src/sqlite.h.in 278602140d49575e8708e643161f4263e428a02a
F src/sqlite3.rc 992c9f5fb8285ae285d6be28240a7e8d3a7f2bad F src/sqlite3.rc 992c9f5fb8285ae285d6be28240a7e8d3a7f2bad
F src/sqlite3ext.h 17d487c3c91b0b8c584a32fbeb393f6f795eea7d F src/sqlite3ext.h 17d487c3c91b0b8c584a32fbeb393f6f795eea7d
F src/sqliteInt.h df0ee3545220b8687d8640d433d1417b31e1675a F src/sqliteInt.h c0437537f4e69993a923cb0a4e74542a4d128784
F src/sqliteLimit.h 216557999cb45f2e3578ed53ebefe228d779cb46 F src/sqliteLimit.h 216557999cb45f2e3578ed53ebefe228d779cb46
F src/status.c f266ad8a2892d659b74f0f50cb6a88b6e7c12179 F src/status.c f266ad8a2892d659b74f0f50cb6a88b6e7c12179
F src/table.c e7a09215315a978057fb42c640f890160dbcc45e F src/table.c e7a09215315a978057fb42c640f890160dbcc45e
@@ -293,7 +293,7 @@ F src/update.c 3c4ecc282accf12d39edb8d524cf089645e55a13
F src/utf.c fc6b889ba0779b7722634cdeaa25f1930d93820c F src/utf.c fc6b889ba0779b7722634cdeaa25f1930d93820c
F src/util.c 98a7627ca48ad3265b6940915a1d08355eb3fc7e F src/util.c 98a7627ca48ad3265b6940915a1d08355eb3fc7e
F src/vacuum.c 2ddd5cad2a7b9cef7f9e431b8c7771634c6b1701 F src/vacuum.c 2ddd5cad2a7b9cef7f9e431b8c7771634c6b1701
F src/vdbe.c a9d916abb1e22355a81b0e72040917ba33c87ed7 F src/vdbe.c f6647e7426b70826a03e69bd295d18c93ff5ae07
F src/vdbe.h 7e538ecf47dccb307ea2d087c3ddc2dd8d70e79d F src/vdbe.h 7e538ecf47dccb307ea2d087c3ddc2dd8d70e79d
F src/vdbeInt.h 9cbaa84f53ddd2d09a0cf61a94337a3a035d08a0 F src/vdbeInt.h 9cbaa84f53ddd2d09a0cf61a94337a3a035d08a0
F src/vdbeapi.c 583d56b129dd27f12bed518270de9ebe521e6a75 F src/vdbeapi.c 583d56b129dd27f12bed518270de9ebe521e6a75
@@ -340,7 +340,7 @@ F test/async3.test d73a062002376d7edc1fe3edff493edbec1fc2f7
F test/async4.test 1787e3952128aa10238bf39945126de7ca23685a F test/async4.test 1787e3952128aa10238bf39945126de7ca23685a
F test/async5.test 383ab533fdb9f7ad228cc99ee66e1acb34cc0dc0 F test/async5.test 383ab533fdb9f7ad228cc99ee66e1acb34cc0dc0
F test/atof1.test 08a61df9365c341f334a65f4348897312d8f3db7 F test/atof1.test 08a61df9365c341f334a65f4348897312d8f3db7
F test/attach.test 0d112b7713611fdf0340260192749737135fda5f F test/attach.test 437107943f14d131cf5efc2ae5305a94d7cb1d58
F test/attach2.test 0ec5defa340363de6cd50fd595046465e9aaba2d F test/attach2.test 0ec5defa340363de6cd50fd595046465e9aaba2d
F test/attach3.test 359eb65d00102cdfcef6fa4e81dc1648f8f80b27 F test/attach3.test 359eb65d00102cdfcef6fa4e81dc1648f8f80b27
F test/attach4.test 53bf502f17647c6d6c5add46dda6bac8b6f4665c F test/attach4.test 53bf502f17647c6d6c5add46dda6bac8b6f4665c
@@ -433,6 +433,7 @@ F test/corruptF.test be9fde98e4c93648f1ba52b74e5318edc8f59fe4
F test/corruptG.test 1ab3bf97ee7bdba70e0ff3ba2320657df55d1804 F test/corruptG.test 1ab3bf97ee7bdba70e0ff3ba2320657df55d1804
F test/corruptH.test 5dd4fa98c6c1ed33b178f9e8a48c4fdd3cfc9067 F test/corruptH.test 5dd4fa98c6c1ed33b178f9e8a48c4fdd3cfc9067
F test/corruptI.test 221ad8b7f0a9ac6b80fc577e73b5ad8cdea31243 F test/corruptI.test 221ad8b7f0a9ac6b80fc577e73b5ad8cdea31243
F test/corruptJ.test 9e29e7a81ee3b6ac50f77ea7a9e2f3fa03f32d91
F test/cost.test 19d314526616ce4473eb4e4e450fcb94499ce318 F test/cost.test 19d314526616ce4473eb4e4e450fcb94499ce318
F test/count.test 42a251178e32f617eda33f76236a7f79825a50b5 F test/count.test 42a251178e32f617eda33f76236a7f79825a50b5
F test/coveridxscan.test cdb47d01acc4a634a34fd25abe85189e0d0f1e62 F test/coveridxscan.test cdb47d01acc4a634a34fd25abe85189e0d0f1e62
@@ -1181,7 +1182,7 @@ F test/whereK.test f8e3cf26a8513ecc7f514f54df9f0572c046c42b
F test/wherelimit.test 5e9fd41e79bb2b2d588ed999d641d9c965619b31 F test/wherelimit.test 5e9fd41e79bb2b2d588ed999d641d9c965619b31
F test/wild001.test bca33f499866f04c24510d74baf1e578d4e44b1c F test/wild001.test bca33f499866f04c24510d74baf1e578d4e44b1c
F test/win32heap.test ea19770974795cff26e11575e12d422dbd16893c F test/win32heap.test ea19770974795cff26e11575e12d422dbd16893c
F test/win32lock.test 71642fa56e9b06e5cfffe6bad67cb8c1eb2c555a F test/win32lock.test fbf107c91d8f5512be5a5b87c4c42ab9fdd54972
F test/win32longpath.test 169c75a3b2e43481f4a62122510210c67b08f26d F test/win32longpath.test 169c75a3b2e43481f4a62122510210c67b08f26d
F test/with1.test 9df5cd8a62148b3d9ef8597aea563e3863018bcd F test/with1.test 9df5cd8a62148b3d9ef8597aea563e3863018bcd
F test/with2.test ee227a663586aa09771cafd4fa269c5217eaf775 F test/with2.test ee227a663586aa09771cafd4fa269c5217eaf775
@@ -1205,7 +1206,7 @@ F tool/fragck.tcl 5265a95126abcf6ab357f7efa544787e5963f439
F tool/genfkey.README cf68fddd4643bbe3ff8e31b8b6d8b0a1b85e20f4 F tool/genfkey.README cf68fddd4643bbe3ff8e31b8b6d8b0a1b85e20f4
F tool/genfkey.test 4196a8928b78f51d54ef58e99e99401ab2f0a7e5 F tool/genfkey.test 4196a8928b78f51d54ef58e99e99401ab2f0a7e5
F tool/getlock.c f4c39b651370156cae979501a7b156bdba50e7ce F tool/getlock.c f4c39b651370156cae979501a7b156bdba50e7ce
F tool/lemon.c 1864c4fe4a72b1bb28f1792b60504804fe82c5d2 F tool/lemon.c ae5f61e3b164d35955777b20d6febcbaf0950702
F tool/lempar.c 01ca97f87610d1dac6d8cd96ab109ab1130e76dc F tool/lempar.c 01ca97f87610d1dac6d8cd96ab109ab1130e76dc
F tool/logest.c eef612f8adf4d0993dafed0416064cf50d5d33c6 F tool/logest.c eef612f8adf4d0993dafed0416064cf50d5d33c6
F tool/mkautoconfamal.sh d1a2da0e15b2ed33d60af35c7e9d483f13a8eb9f F tool/mkautoconfamal.sh d1a2da0e15b2ed33d60af35c7e9d483f13a8eb9f
@@ -1247,7 +1248,7 @@ F tool/vdbe_profile.tcl 67746953071a9f8f2f668b73fe899074e2c6d8c1
F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4 F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4
F tool/warnings.sh 0abfd78ceb09b7f7c27c688c8e3fe93268a13b32 F tool/warnings.sh 0abfd78ceb09b7f7c27c688c8e3fe93268a13b32
F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f
P 592cdc5d7254be7032aa9c0b03405a74ca060b51 P e403460b96814ac8cb976d58b27939b3bd3c61f9 30011ad2f55cfcacaf23a58ebcc17b17a7b9355e
R d93391642538d3e00eae6a1c718cf53f R 768d1278a2c7aae9e472dc5791f2f6a1
U dan U dan
Z 6ea2b15ffbb091b1ac11e4173c1e9ec7 Z 2045741c9810a18232145862154fc073

View File

@@ -1 +1 @@
e403460b96814ac8cb976d58b27939b3bd3c61f9 4621b2eef8be6d944f87de097bd11c649fe43333

View File

@@ -1312,6 +1312,9 @@ int SQLITE_CDECL main(int argc, char **argv){
GETPID(), iClient); GETPID(), iClient);
}else{ }else{
if( g.iTrace>0 ){ if( g.iTrace>0 ){
printf("BEGIN: %s", argv[0]);
for(i=1; i<argc; i++) printf(" %s", argv[i]);
printf("\n");
printf("With SQLite " SQLITE_VERSION " " SQLITE_SOURCE_ID "\n" ); printf("With SQLite " SQLITE_VERSION " " SQLITE_SOURCE_ID "\n" );
for(i=0; (zCOption = sqlite3_compileoption_get(i))!=0; i++){ for(i=0; (zCOption = sqlite3_compileoption_get(i))!=0; i++){
printf("-DSQLITE_%s\n", zCOption); printf("-DSQLITE_%s\n", zCOption);
@@ -1324,6 +1327,17 @@ int SQLITE_CDECL main(int argc, char **argv){
} }
rc = sqlite3_open_v2(g.zDbFile, &g.db, openFlags, g.zVfs); rc = sqlite3_open_v2(g.zDbFile, &g.db, openFlags, g.zVfs);
if( rc ) fatalError("cannot open [%s]", g.zDbFile); if( rc ) fatalError("cannot open [%s]", g.zDbFile);
if( zJMode ){
#if defined(_WIN32)
if( sqlite3_stricmp(zJMode,"persist")==0
|| sqlite3_stricmp(zJMode,"truncate")==0
){
printf("Changing journal mode to DELETE from %s", zJMode);
zJMode = "DELETE";
}
#endif
runSql("PRAGMA journal_mode=%Q;", zJMode);
}
sqlite3_enable_load_extension(g.db, 1); sqlite3_enable_load_extension(g.db, 1);
sqlite3_busy_handler(g.db, busyHandler, 0); sqlite3_busy_handler(g.db, busyHandler, 0);
sqlite3_create_function(g.db, "vfsname", 0, SQLITE_UTF8, 0, sqlite3_create_function(g.db, "vfsname", 0, SQLITE_UTF8, 0,
@@ -1355,7 +1369,6 @@ int SQLITE_CDECL main(int argc, char **argv){
fatalError("missing script filename"); fatalError("missing script filename");
} }
if( n>1 ) unrecognizedArguments(argv[0], n, argv+2); if( n>1 ) unrecognizedArguments(argv[0], n, argv+2);
if( zJMode ) runSql("PRAGMA journal_mode=%Q;", zJMode);
runSql( runSql(
"DROP TABLE IF EXISTS task;\n" "DROP TABLE IF EXISTS task;\n"
"DROP TABLE IF EXISTS counters;\n" "DROP TABLE IF EXISTS counters;\n"
@@ -1409,6 +1422,9 @@ int SQLITE_CDECL main(int argc, char **argv){
maybeClose(g.pErrLog); maybeClose(g.pErrLog);
if( iClient==0 ){ if( iClient==0 ){
printf("Summary: %d errors out of %d tests\n", g.nError, g.nTest); printf("Summary: %d errors out of %d tests\n", g.nError, g.nTest);
printf("END: %s", argv[0]);
for(i=1; i<argc; i++) printf(" %s", argv[i]);
printf("\n");
} }
return g.nError>0; return g.nError>0;
} }

View File

@@ -1959,16 +1959,18 @@ int sqlite3BtreeOpen(
*/ */
if( isTempDb==0 && (isMemdb==0 || (vfsFlags&SQLITE_OPEN_URI)!=0) ){ if( isTempDb==0 && (isMemdb==0 || (vfsFlags&SQLITE_OPEN_URI)!=0) ){
if( vfsFlags & SQLITE_OPEN_SHAREDCACHE ){ if( vfsFlags & SQLITE_OPEN_SHAREDCACHE ){
int nFilename = sqlite3Strlen30(zFilename)+1;
int nFullPathname = pVfs->mxPathname+1; int nFullPathname = pVfs->mxPathname+1;
char *zFullPathname = sqlite3Malloc(nFullPathname); char *zFullPathname = sqlite3Malloc(MAX(nFullPathname,nFilename));
MUTEX_LOGIC( sqlite3_mutex *mutexShared; ) MUTEX_LOGIC( sqlite3_mutex *mutexShared; )
p->sharable = 1; p->sharable = 1;
if( !zFullPathname ){ if( !zFullPathname ){
sqlite3_free(p); sqlite3_free(p);
return SQLITE_NOMEM; return SQLITE_NOMEM;
} }
if( isMemdb ){ if( isMemdb ){
memcpy(zFullPathname, zFilename, sqlite3Strlen30(zFilename)+1); memcpy(zFullPathname, zFilename, nFilename);
}else{ }else{
rc = sqlite3OsFullPathname(pVfs, zFilename, rc = sqlite3OsFullPathname(pVfs, zFilename,
nFullPathname, zFullPathname); nFullPathname, zFullPathname);
@@ -7983,9 +7985,13 @@ static int clearDatabasePage(
if( pgno>btreePagecount(pBt) ){ if( pgno>btreePagecount(pBt) ){
return SQLITE_CORRUPT_BKPT; return SQLITE_CORRUPT_BKPT;
} }
rc = getAndInitPage(pBt, pgno, &pPage, 0); rc = getAndInitPage(pBt, pgno, &pPage, 0);
if( rc ) return rc; if( rc ) return rc;
if( pPage->bBusy ){
rc = SQLITE_CORRUPT_BKPT;
goto cleardatabasepage_out;
}
pPage->bBusy = 1;
hdr = pPage->hdrOffset; hdr = pPage->hdrOffset;
for(i=0; i<pPage->nCell; i++){ for(i=0; i<pPage->nCell; i++){
pCell = findCell(pPage, i); pCell = findCell(pPage, i);
@@ -8010,6 +8016,7 @@ static int clearDatabasePage(
} }
cleardatabasepage_out: cleardatabasepage_out:
pPage->bBusy = 0;
releasePage(pPage); releasePage(pPage);
return rc; return rc;
} }

View File

@@ -280,6 +280,7 @@ struct MemPage {
u8 hdrOffset; /* 100 for page 1. 0 otherwise */ u8 hdrOffset; /* 100 for page 1. 0 otherwise */
u8 childPtrSize; /* 0 if leaf==1. 4 if leaf==0 */ u8 childPtrSize; /* 0 if leaf==1. 4 if leaf==0 */
u8 max1bytePayload; /* min(maxLocal,127) */ u8 max1bytePayload; /* min(maxLocal,127) */
u8 bBusy; /* Prevent endless loops on corrupt database files */
u16 maxLocal; /* Copy of BtShared.maxLocal or BtShared.maxLeaf */ u16 maxLocal; /* Copy of BtShared.maxLocal or BtShared.maxLeaf */
u16 minLocal; /* Copy of BtShared.minLocal or BtShared.minLeaf */ u16 minLocal; /* Copy of BtShared.minLocal or BtShared.minLeaf */
u16 cellOffset; /* Index in aData of first cell pointer */ u16 cellOffset; /* Index in aData of first cell pointer */

View File

@@ -62,7 +62,7 @@ int sqlite3_threadsafe(void){ return SQLITE_THREADSAFE; }
** I/O active are written using this function. These messages ** I/O active are written using this function. These messages
** are intended for debugging activity only. ** are intended for debugging activity only.
*/ */
/* not-private */ void (*sqlite3IoTrace)(const char*, ...) = 0; SQLITE_API void (SQLITE_CDECL *sqlite3IoTrace)(const char*, ...) = 0;
#endif #endif
/* /*

View File

@@ -162,6 +162,7 @@ void sqlite3_soft_heap_limit(int n){
** Initialize the memory allocation subsystem. ** Initialize the memory allocation subsystem.
*/ */
int sqlite3MallocInit(void){ int sqlite3MallocInit(void){
int rc;
if( sqlite3GlobalConfig.m.xMalloc==0 ){ if( sqlite3GlobalConfig.m.xMalloc==0 ){
sqlite3MemSetDefault(); sqlite3MemSetDefault();
} }
@@ -197,7 +198,9 @@ int sqlite3MallocInit(void){
sqlite3GlobalConfig.szPage = 0; sqlite3GlobalConfig.szPage = 0;
sqlite3GlobalConfig.nPage = 0; sqlite3GlobalConfig.nPage = 0;
} }
return sqlite3GlobalConfig.m.xInit(sqlite3GlobalConfig.m.pAppData); rc = sqlite3GlobalConfig.m.xInit(sqlite3GlobalConfig.m.pAppData);
if( rc!=SQLITE_OK ) memset(&mem0, 0, sizeof(mem0));
return rc;
} }
/* /*

View File

@@ -197,8 +197,10 @@ WINBASEAPI LPVOID WINAPI MapViewOfFile(HANDLE, DWORD, DWORD, DWORD, SIZE_T);
#endif /* SQLITE_OS_WINRT */ #endif /* SQLITE_OS_WINRT */
/* /*
** This file mapping API is common to both Win32 and WinRT. ** These file mapping APIs are common to both Win32 and WinRT.
*/ */
WINBASEAPI BOOL WINAPI FlushViewOfFile(LPCVOID, SIZE_T);
WINBASEAPI BOOL WINAPI UnmapViewOfFile(LPCVOID); WINBASEAPI BOOL WINAPI UnmapViewOfFile(LPCVOID);
#endif /* SQLITE_WIN32_FILEMAPPING_API */ #endif /* SQLITE_WIN32_FILEMAPPING_API */
@@ -1083,6 +1085,15 @@ static struct win_syscall {
#define osUuidCreateSequential \ #define osUuidCreateSequential \
((RPC_STATUS(RPC_ENTRY*)(UUID*))aSyscall[78].pCurrent) ((RPC_STATUS(RPC_ENTRY*)(UUID*))aSyscall[78].pCurrent)
#if !defined(SQLITE_NO_SYNC) && SQLITE_MAX_MMAP_SIZE>0
{ "FlushViewOfFile", (SYSCALL)FlushViewOfFile, 0 },
#else
{ "FlushViewOfFile", (SYSCALL)0, 0 },
#endif
#define osFlushViewOfFile \
((BOOL(WINAPI*)(LPCVOID,SIZE_T))aSyscall[79].pCurrent)
}; /* End of the overrideable system calls */ }; /* End of the overrideable system calls */
/* /*
@@ -1966,11 +1977,11 @@ static int winRetryIoerr(int *pnRetry, DWORD *pError){
/* /*
** Log a I/O error retry episode. ** Log a I/O error retry episode.
*/ */
static void winLogIoerr(int nRetry){ static void winLogIoerr(int nRetry, int lineno){
if( nRetry ){ if( nRetry ){
sqlite3_log(SQLITE_IOERR, sqlite3_log(SQLITE_NOTICE,
"delayed %dms for lock/sharing conflict", "delayed %dms for lock/sharing conflict at line %d",
winIoerrRetryDelay*nRetry*(nRetry+1)/2 winIoerrRetryDelay*nRetry*(nRetry+1)/2, lineno
); );
} }
} }
@@ -2450,7 +2461,8 @@ static int winClose(sqlite3_file *id){
assert( pFile->pShm==0 ); assert( pFile->pShm==0 );
#endif #endif
assert( pFile->h!=NULL && pFile->h!=INVALID_HANDLE_VALUE ); assert( pFile->h!=NULL && pFile->h!=INVALID_HANDLE_VALUE );
OSTRACE(("CLOSE file=%p\n", pFile->h)); OSTRACE(("CLOSE pid=%lu, pFile=%p, file=%p\n",
osGetCurrentProcessId(), pFile, pFile->h));
#if SQLITE_MAX_MMAP_SIZE>0 #if SQLITE_MAX_MMAP_SIZE>0
winUnmapfile(pFile); winUnmapfile(pFile);
@@ -2479,7 +2491,8 @@ static int winClose(sqlite3_file *id){
pFile->h = NULL; pFile->h = NULL;
} }
OpenCounter(-1); OpenCounter(-1);
OSTRACE(("CLOSE file=%p, rc=%s\n", pFile->h, rc ? "ok" : "failed")); OSTRACE(("CLOSE pid=%lu, pFile=%p, file=%p, rc=%s\n",
osGetCurrentProcessId(), pFile, pFile->h, rc ? "ok" : "failed"));
return rc ? SQLITE_OK return rc ? SQLITE_OK
: winLogError(SQLITE_IOERR_CLOSE, osGetLastError(), : winLogError(SQLITE_IOERR_CLOSE, osGetLastError(),
"winClose", pFile->zPath); "winClose", pFile->zPath);
@@ -2507,7 +2520,8 @@ static int winRead(
assert( amt>0 ); assert( amt>0 );
assert( offset>=0 ); assert( offset>=0 );
SimulateIOError(return SQLITE_IOERR_READ); SimulateIOError(return SQLITE_IOERR_READ);
OSTRACE(("READ file=%p, buffer=%p, amount=%d, offset=%lld, lock=%d\n", OSTRACE(("READ pid=%lu, pFile=%p, file=%p, buffer=%p, amount=%d, "
"offset=%lld, lock=%d\n", osGetCurrentProcessId(), pFile,
pFile->h, pBuf, amt, offset, pFile->locktype)); pFile->h, pBuf, amt, offset, pFile->locktype));
#if SQLITE_MAX_MMAP_SIZE>0 #if SQLITE_MAX_MMAP_SIZE>0
@@ -2516,7 +2530,8 @@ static int winRead(
if( offset<pFile->mmapSize ){ if( offset<pFile->mmapSize ){
if( offset+amt <= pFile->mmapSize ){ if( offset+amt <= pFile->mmapSize ){
memcpy(pBuf, &((u8 *)(pFile->pMapRegion))[offset], amt); memcpy(pBuf, &((u8 *)(pFile->pMapRegion))[offset], amt);
OSTRACE(("READ-MMAP file=%p, rc=SQLITE_OK\n", pFile->h)); OSTRACE(("READ-MMAP pid=%lu, pFile=%p, file=%p, rc=SQLITE_OK\n",
osGetCurrentProcessId(), pFile, pFile->h));
return SQLITE_OK; return SQLITE_OK;
}else{ }else{
int nCopy = (int)(pFile->mmapSize - offset); int nCopy = (int)(pFile->mmapSize - offset);
@@ -2530,7 +2545,8 @@ static int winRead(
#if SQLITE_OS_WINCE || defined(SQLITE_WIN32_NO_OVERLAPPED) #if SQLITE_OS_WINCE || defined(SQLITE_WIN32_NO_OVERLAPPED)
if( winSeekFile(pFile, offset) ){ if( winSeekFile(pFile, offset) ){
OSTRACE(("READ file=%p, rc=SQLITE_FULL\n", pFile->h)); OSTRACE(("READ pid=%lu, pFile=%p, file=%p, rc=SQLITE_FULL\n",
osGetCurrentProcessId(), pFile, pFile->h));
return SQLITE_FULL; return SQLITE_FULL;
} }
while( !osReadFile(pFile->h, pBuf, amt, &nRead, 0) ){ while( !osReadFile(pFile->h, pBuf, amt, &nRead, 0) ){
@@ -2544,19 +2560,22 @@ static int winRead(
DWORD lastErrno; DWORD lastErrno;
if( winRetryIoerr(&nRetry, &lastErrno) ) continue; if( winRetryIoerr(&nRetry, &lastErrno) ) continue;
pFile->lastErrno = lastErrno; pFile->lastErrno = lastErrno;
OSTRACE(("READ file=%p, rc=SQLITE_IOERR_READ\n", pFile->h)); OSTRACE(("READ pid=%lu, pFile=%p, file=%p, rc=SQLITE_IOERR_READ\n",
osGetCurrentProcessId(), pFile, pFile->h));
return winLogError(SQLITE_IOERR_READ, pFile->lastErrno, return winLogError(SQLITE_IOERR_READ, pFile->lastErrno,
"winRead", pFile->zPath); "winRead", pFile->zPath);
} }
winLogIoerr(nRetry); winLogIoerr(nRetry, __LINE__);
if( nRead<(DWORD)amt ){ if( nRead<(DWORD)amt ){
/* Unread parts of the buffer must be zero-filled */ /* Unread parts of the buffer must be zero-filled */
memset(&((char*)pBuf)[nRead], 0, amt-nRead); memset(&((char*)pBuf)[nRead], 0, amt-nRead);
OSTRACE(("READ file=%p, rc=SQLITE_IOERR_SHORT_READ\n", pFile->h)); OSTRACE(("READ pid=%lu, pFile=%p, file=%p, rc=SQLITE_IOERR_SHORT_READ\n",
osGetCurrentProcessId(), pFile, pFile->h));
return SQLITE_IOERR_SHORT_READ; return SQLITE_IOERR_SHORT_READ;
} }
OSTRACE(("READ file=%p, rc=SQLITE_OK\n", pFile->h)); OSTRACE(("READ pid=%lu, pFile=%p, file=%p, rc=SQLITE_OK\n",
osGetCurrentProcessId(), pFile, pFile->h));
return SQLITE_OK; return SQLITE_OK;
} }
@@ -2579,7 +2598,8 @@ static int winWrite(
SimulateIOError(return SQLITE_IOERR_WRITE); SimulateIOError(return SQLITE_IOERR_WRITE);
SimulateDiskfullError(return SQLITE_FULL); SimulateDiskfullError(return SQLITE_FULL);
OSTRACE(("WRITE file=%p, buffer=%p, amount=%d, offset=%lld, lock=%d\n", OSTRACE(("WRITE pid=%lu, pFile=%p, file=%p, buffer=%p, amount=%d, "
"offset=%lld, lock=%d\n", osGetCurrentProcessId(), pFile,
pFile->h, pBuf, amt, offset, pFile->locktype)); pFile->h, pBuf, amt, offset, pFile->locktype));
#if SQLITE_MAX_MMAP_SIZE>0 #if SQLITE_MAX_MMAP_SIZE>0
@@ -2588,7 +2608,8 @@ static int winWrite(
if( offset<pFile->mmapSize ){ if( offset<pFile->mmapSize ){
if( offset+amt <= pFile->mmapSize ){ if( offset+amt <= pFile->mmapSize ){
memcpy(&((u8 *)(pFile->pMapRegion))[offset], pBuf, amt); memcpy(&((u8 *)(pFile->pMapRegion))[offset], pBuf, amt);
OSTRACE(("WRITE-MMAP file=%p, rc=SQLITE_OK\n", pFile->h)); OSTRACE(("WRITE-MMAP pid=%lu, pFile=%p, file=%p, rc=SQLITE_OK\n",
osGetCurrentProcessId(), pFile, pFile->h));
return SQLITE_OK; return SQLITE_OK;
}else{ }else{
int nCopy = (int)(pFile->mmapSize - offset); int nCopy = (int)(pFile->mmapSize - offset);
@@ -2651,17 +2672,20 @@ static int winWrite(
if( rc ){ if( rc ){
if( ( pFile->lastErrno==ERROR_HANDLE_DISK_FULL ) if( ( pFile->lastErrno==ERROR_HANDLE_DISK_FULL )
|| ( pFile->lastErrno==ERROR_DISK_FULL )){ || ( pFile->lastErrno==ERROR_DISK_FULL )){
OSTRACE(("WRITE file=%p, rc=SQLITE_FULL\n", pFile->h)); OSTRACE(("WRITE pid=%lu, pFile=%p, file=%p, rc=SQLITE_FULL\n",
osGetCurrentProcessId(), pFile, pFile->h));
return winLogError(SQLITE_FULL, pFile->lastErrno, return winLogError(SQLITE_FULL, pFile->lastErrno,
"winWrite1", pFile->zPath); "winWrite1", pFile->zPath);
} }
OSTRACE(("WRITE file=%p, rc=SQLITE_IOERR_WRITE\n", pFile->h)); OSTRACE(("WRITE pid=%lu, pFile=%p, file=%p, rc=SQLITE_IOERR_WRITE\n",
osGetCurrentProcessId(), pFile, pFile->h));
return winLogError(SQLITE_IOERR_WRITE, pFile->lastErrno, return winLogError(SQLITE_IOERR_WRITE, pFile->lastErrno,
"winWrite2", pFile->zPath); "winWrite2", pFile->zPath);
}else{ }else{
winLogIoerr(nRetry); winLogIoerr(nRetry, __LINE__);
} }
OSTRACE(("WRITE file=%p, rc=SQLITE_OK\n", pFile->h)); OSTRACE(("WRITE pid=%lu, pFile=%p, file=%p, rc=SQLITE_OK\n",
osGetCurrentProcessId(), pFile, pFile->h));
return SQLITE_OK; return SQLITE_OK;
} }
@@ -2675,8 +2699,8 @@ static int winTruncate(sqlite3_file *id, sqlite3_int64 nByte){
assert( pFile ); assert( pFile );
SimulateIOError(return SQLITE_IOERR_TRUNCATE); SimulateIOError(return SQLITE_IOERR_TRUNCATE);
OSTRACE(("TRUNCATE file=%p, size=%lld, lock=%d\n", OSTRACE(("TRUNCATE pid=%lu, pFile=%p, file=%p, size=%lld, lock=%d\n",
pFile->h, nByte, pFile->locktype)); osGetCurrentProcessId(), pFile, pFile->h, nByte, pFile->locktype));
/* If the user has configured a chunk-size for this file, truncate the /* If the user has configured a chunk-size for this file, truncate the
** file so that it consists of an integer number of chunks (i.e. the ** file so that it consists of an integer number of chunks (i.e. the
@@ -2708,7 +2732,8 @@ static int winTruncate(sqlite3_file *id, sqlite3_int64 nByte){
} }
#endif #endif
OSTRACE(("TRUNCATE file=%p, rc=%s\n", pFile->h, sqlite3ErrName(rc))); OSTRACE(("TRUNCATE pid=%lu, pFile=%p, file=%p, rc=%s\n",
osGetCurrentProcessId(), pFile, pFile->h, sqlite3ErrName(rc)));
return rc; return rc;
} }
@@ -2753,8 +2778,9 @@ static int winSync(sqlite3_file *id, int flags){
*/ */
SimulateDiskfullError( return SQLITE_FULL ); SimulateDiskfullError( return SQLITE_FULL );
OSTRACE(("SYNC file=%p, flags=%x, lock=%d\n", OSTRACE(("SYNC pid=%lu, pFile=%p, file=%p, flags=%x, lock=%d\n",
pFile->h, flags, pFile->locktype)); osGetCurrentProcessId(), pFile, pFile->h, flags,
pFile->locktype));
#ifndef SQLITE_TEST #ifndef SQLITE_TEST
UNUSED_PARAMETER(flags); UNUSED_PARAMETER(flags);
@@ -2769,19 +2795,38 @@ static int winSync(sqlite3_file *id, int flags){
** no-op ** no-op
*/ */
#ifdef SQLITE_NO_SYNC #ifdef SQLITE_NO_SYNC
OSTRACE(("SYNC-NOP file=%p, rc=SQLITE_OK\n", pFile->h)); OSTRACE(("SYNC-NOP pid=%lu, pFile=%p, file=%p, rc=SQLITE_OK\n",
osGetCurrentProcessId(), pFile, pFile->h));
return SQLITE_OK; return SQLITE_OK;
#else #else
#if SQLITE_MAX_MMAP_SIZE>0
if( pFile->pMapRegion ){
if( osFlushViewOfFile(pFile->pMapRegion, 0) ){
OSTRACE(("SYNC-MMAP pid=%lu, pFile=%p, pMapRegion=%p, "
"rc=SQLITE_OK\n", osGetCurrentProcessId(),
pFile, pFile->pMapRegion));
}else{
pFile->lastErrno = osGetLastError();
OSTRACE(("SYNC-MMAP pid=%lu, pFile=%p, pMapRegion=%p, "
"rc=SQLITE_IOERR_MMAP\n", osGetCurrentProcessId(),
pFile, pFile->pMapRegion));
return winLogError(SQLITE_IOERR_MMAP, pFile->lastErrno,
"winSync1", pFile->zPath);
}
}
#endif
rc = osFlushFileBuffers(pFile->h); rc = osFlushFileBuffers(pFile->h);
SimulateIOError( rc=FALSE ); SimulateIOError( rc=FALSE );
if( rc ){ if( rc ){
OSTRACE(("SYNC file=%p, rc=SQLITE_OK\n", pFile->h)); OSTRACE(("SYNC pid=%lu, pFile=%p, file=%p, rc=SQLITE_OK\n",
osGetCurrentProcessId(), pFile, pFile->h));
return SQLITE_OK; return SQLITE_OK;
}else{ }else{
pFile->lastErrno = osGetLastError(); pFile->lastErrno = osGetLastError();
OSTRACE(("SYNC file=%p, rc=SQLITE_IOERR_FSYNC\n", pFile->h)); OSTRACE(("SYNC pid=%lu, pFile=%p, file=%p, rc=SQLITE_IOERR_FSYNC\n",
osGetCurrentProcessId(), pFile, pFile->h));
return winLogError(SQLITE_IOERR_FSYNC, pFile->lastErrno, return winLogError(SQLITE_IOERR_FSYNC, pFile->lastErrno,
"winSync", pFile->zPath); "winSync2", pFile->zPath);
} }
#endif #endif
} }
@@ -4752,7 +4797,7 @@ static int winOpen(
} }
} }
#endif #endif
winLogIoerr(cnt); winLogIoerr(cnt, __LINE__);
OSTRACE(("OPEN file=%p, name=%s, access=%lx, rc=%s\n", h, zUtf8Name, OSTRACE(("OPEN file=%p, name=%s, access=%lx, rc=%s\n", h, zUtf8Name,
dwDesiredAccess, (h==INVALID_HANDLE_VALUE) ? "failed" : "ok")); dwDesiredAccess, (h==INVALID_HANDLE_VALUE) ? "failed" : "ok"));
@@ -4936,7 +4981,7 @@ static int winDelete(
if( rc && rc!=SQLITE_IOERR_DELETE_NOENT ){ if( rc && rc!=SQLITE_IOERR_DELETE_NOENT ){
rc = winLogError(SQLITE_IOERR_DELETE, lastErrno, "winDelete", zFilename); rc = winLogError(SQLITE_IOERR_DELETE, lastErrno, "winDelete", zFilename);
}else{ }else{
winLogIoerr(cnt); winLogIoerr(cnt, __LINE__);
} }
sqlite3_free(zConverted); sqlite3_free(zConverted);
OSTRACE(("DELETE name=%s, rc=%s\n", zFilename, sqlite3ErrName(rc))); OSTRACE(("DELETE name=%s, rc=%s\n", zFilename, sqlite3ErrName(rc)));
@@ -4986,7 +5031,7 @@ static int winAccess(
attr = sAttrData.dwFileAttributes; attr = sAttrData.dwFileAttributes;
} }
}else{ }else{
winLogIoerr(cnt); winLogIoerr(cnt, __LINE__);
if( lastErrno!=ERROR_FILE_NOT_FOUND && lastErrno!=ERROR_PATH_NOT_FOUND ){ if( lastErrno!=ERROR_FILE_NOT_FOUND && lastErrno!=ERROR_PATH_NOT_FOUND ){
sqlite3_free(zConverted); sqlite3_free(zConverted);
return winLogError(SQLITE_IOERR_ACCESS, lastErrno, "winAccess", return winLogError(SQLITE_IOERR_ACCESS, lastErrno, "winAccess",
@@ -5555,7 +5600,7 @@ int sqlite3_os_init(void){
/* Double-check that the aSyscall[] array has been constructed /* Double-check that the aSyscall[] array has been constructed
** correctly. See ticket [bb3a86e890c8e96ab] */ ** correctly. See ticket [bb3a86e890c8e96ab] */
assert( ArraySize(aSyscall)==79 ); assert( ArraySize(aSyscall)==80 );
/* get memory map allocation granularity */ /* get memory map allocation granularity */
memset(&winSysInfo, 0, sizeof(SYSTEM_INFO)); memset(&winSysInfo, 0, sizeof(SYSTEM_INFO));

View File

@@ -370,7 +370,7 @@ static FILE *iotrace = 0;
** is written to iotrace. ** is written to iotrace.
*/ */
#ifdef SQLITE_ENABLE_IOTRACE #ifdef SQLITE_ENABLE_IOTRACE
static void iotracePrintf(const char *zFormat, ...){ static void SQLITE_CDECL iotracePrintf(const char *zFormat, ...){
va_list ap; va_list ap;
char *z; char *z;
if( iotrace==0 ) return; if( iotrace==0 ) return;
@@ -3144,7 +3144,7 @@ static int do_meta_command(char *zLine, ShellState *p){
#ifdef SQLITE_ENABLE_IOTRACE #ifdef SQLITE_ENABLE_IOTRACE
if( c=='i' && strncmp(azArg[0], "iotrace", n)==0 ){ if( c=='i' && strncmp(azArg[0], "iotrace", n)==0 ){
extern void (*sqlite3IoTrace)(const char*, ...); SQLITE_API extern void (SQLITE_CDECL *sqlite3IoTrace)(const char*, ...);
if( iotrace && iotrace!=stdout ) fclose(iotrace); if( iotrace && iotrace!=stdout ) fclose(iotrace);
iotrace = 0; iotrace = 0;
if( nArg<2 ){ if( nArg<2 ){
@@ -3803,9 +3803,9 @@ static int do_meta_command(char *zLine, ShellState *p){
azArg[2], azArg[2],
integerValue(azArg[3]), integerValue(azArg[3]),
integerValue(azArg[4])); integerValue(azArg[4]));
fprintf(p->out, "%d (0x%08x)\n", rc, rc);
}else{ }else{
fprintf(stderr,"Usage: .testctrl initmode dbName onoff tnum\n"); fprintf(stderr,"Usage: .testctrl imposter dbName onoff tnum\n");
rc = 1;
} }
break; break;

View File

@@ -3804,7 +3804,7 @@ void sqlite3Put4byte(u8*, u32);
#ifdef SQLITE_ENABLE_IOTRACE #ifdef SQLITE_ENABLE_IOTRACE
# define IOTRACE(A) if( sqlite3IoTrace ){ sqlite3IoTrace A; } # define IOTRACE(A) if( sqlite3IoTrace ){ sqlite3IoTrace A; }
void sqlite3VdbeIOTraceSql(Vdbe*); void sqlite3VdbeIOTraceSql(Vdbe*);
SQLITE_EXTERN void (*sqlite3IoTrace)(const char*,...); SQLITE_API SQLITE_EXTERN void (SQLITE_CDECL *sqlite3IoTrace)(const char*,...);
#else #else
# define IOTRACE(A) # define IOTRACE(A)
# define sqlite3VdbeIOTraceSql(X) # define sqlite3VdbeIOTraceSql(X)

View File

@@ -1920,11 +1920,15 @@ case OP_Ge: { /* same as TK_GE, jump, in1, in3 */
testcase( pIn1->flags & MEM_Int ); testcase( pIn1->flags & MEM_Int );
testcase( pIn1->flags & MEM_Real ); testcase( pIn1->flags & MEM_Real );
sqlite3VdbeMemStringify(pIn1, encoding, 1); sqlite3VdbeMemStringify(pIn1, encoding, 1);
testcase( (flags1&MEM_Dyn) != (pIn1->flags&MEM_Dyn) );
flags1 = (pIn1->flags & ~MEM_TypeMask) | (flags1 & MEM_TypeMask);
} }
if( (pIn3->flags & MEM_Str)==0 && (pIn3->flags & (MEM_Int|MEM_Real))!=0 ){ if( (pIn3->flags & MEM_Str)==0 && (pIn3->flags & (MEM_Int|MEM_Real))!=0 ){
testcase( pIn3->flags & MEM_Int ); testcase( pIn3->flags & MEM_Int );
testcase( pIn3->flags & MEM_Real ); testcase( pIn3->flags & MEM_Real );
sqlite3VdbeMemStringify(pIn3, encoding, 1); sqlite3VdbeMemStringify(pIn3, encoding, 1);
testcase( (flags3&MEM_Dyn) != (pIn3->flags&MEM_Dyn) );
flags3 = (pIn3->flags & ~MEM_TypeMask) | (flags3 & MEM_TypeMask);
} }
} }
assert( pOp->p4type==P4_COLLSEQ || pOp->p4.pColl==0 ); assert( pOp->p4type==P4_COLLSEQ || pOp->p4.pColl==0 );
@@ -1961,7 +1965,9 @@ case OP_Ge: { /* same as TK_GE, jump, in1, in3 */
} }
} }
/* Undo any changes made by applyAffinity() to the input registers. */ /* Undo any changes made by applyAffinity() to the input registers. */
assert( (pIn1->flags & MEM_Dyn) == (flags1 & MEM_Dyn) );
pIn1->flags = flags1; pIn1->flags = flags1;
assert( (pIn3->flags & MEM_Dyn) == (flags3 & MEM_Dyn) );
pIn3->flags = flags3; pIn3->flags = flags3;
break; break;
} }

View File

@@ -859,4 +859,16 @@ do_test attach-10.2 {
}] 9 end }] 9 end
} {4 noname {} 5 inmem {}} } {4 noname {} 5 inmem {}}
# Attach with a very long URI filename.
#
db close
sqlite3 db test.db -uri 1
do_execsql_test attach-11.1 {
ATTACH printf('file:%09000x/x.db?mode=memory&cache=shared',1) AS aux1;
CREATE TABLE aux1.t1(x,y);
INSERT INTO aux1.t1(x,y) VALUES(1,2),(3,4);
SELECT * FROM aux1.t1;
} {1 2 3 4}
finish_test finish_test

80
test/corruptJ.test Normal file
View File

@@ -0,0 +1,80 @@
# 2015-03-30
#
# 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.
#
#***********************************************************************
#
# Corruption consisting of a database page that thinks it is a child
# of itself.
#
set testdir [file dirname $argv0]
source $testdir/tester.tcl
set testprefix corruptJ
if {[permutation]=="mmap"} {
finish_test
return
}
# Do not use a codec for tests in this file, as the database file is
# manipulated directly using tcl scripts (using the [hexio_write] command).
#
do_not_use_codec
database_may_be_corrupt
# Initialize the database.
#
do_execsql_test 1.1 {
PRAGMA page_size=1024;
PRAGMA auto_vacuum=0;
CREATE TABLE t1(a,b);
WITH RECURSIVE c(i) AS (VALUES(1) UNION ALL SELECT i+1 FROM c WHERE i<10)
INSERT INTO t1(a,b) SELECT i, zeroblob(700) FROM c;
} {}
db close
# Corrupt the root page of the t1 table such that the left-child pointer
# for the very first cell points back to the root. Then try to DROP the
# table. The clearDatabasePage() routine should not loop.
#
do_test 1.2 {
hexio_write test.db [expr {2*1024-2}] 02
sqlite3 db test.db
catchsql { DROP TABLE t1 }
} {1 {database disk image is malformed}}
# Similar test using a WITHOUT ROWID table
#
do_test 2.1 {
db close
forcedelete test.db
sqlite3 db test.db
db eval {
PRAGMA page_size=1024;
PRAGMA auto_vacuum=0;
CREATE TABLE t1(a,b,PRIMARY KEY(a,b)) WITHOUT ROWID;
WITH RECURSIVE c(i) AS (VALUES(1) UNION ALL SELECT i+1 FROM c WHERE i<100)
INSERT INTO t1(a,b) SELECT i, zeroblob(200) FROM c;
}
} {}
# The table is three levels deep. Corrupt the left child of an intermediate
# page so that it points back to the root page.
#
do_test 2.2 {
db close
hexio_read test.db [expr {9*1024+391}] 8
} {00000008814D0401}
do_test 2.2b {
hexio_write test.db [expr {9*1024+391}] 00000002
sqlite3 db test.db
catchsql { PRAGMA secure_delete=ON; DROP TABLE t1; }
} {1 {database disk image is malformed}}
finish_test

View File

@@ -64,6 +64,7 @@ while {1} {
if {[info exists ::log] && $::log!=""} { if {[info exists ::log] && $::log!=""} {
do_test win32lock-1.2-$delay1-log1 { do_test win32lock-1.2-$delay1-log1 {
regsub {\d+} $::log # x regsub {\d+} $::log # x
regsub { at line \d+} $x "" x
set x set x
} {{delayed #ms for lock/sharing conflict}} } {{delayed #ms for lock/sharing conflict}}
} }
@@ -112,6 +113,7 @@ while {1} {
if {[info exists ::log] && $::log!=""} { if {[info exists ::log] && $::log!=""} {
do_test win32lock-2.2-$delay1-log1 { do_test win32lock-2.2-$delay1-log1 {
regsub {\d+} $::log # x regsub {\d+} $::log # x
regsub { at line \d+} $x "" x
set x set x
} {{delayed #ms for lock/sharing conflict}} } {{delayed #ms for lock/sharing conflict}}
} }

View File

@@ -1731,7 +1731,7 @@ static char *msort(
char *ep; char *ep;
char *set[LISTSIZE]; char *set[LISTSIZE];
int i; int i;
offset = (unsigned long)next - (unsigned long)list; offset = (unsigned long)((char*)next - (char*)list);
for(i=0; i<LISTSIZE; i++) set[i] = 0; for(i=0; i<LISTSIZE; i++) set[i] = 0;
while( list ){ while( list ){
ep = list; ep = list;
@@ -1875,7 +1875,7 @@ static int handleswitch(int i, FILE *err)
if( *end ){ if( *end ){
if( err ){ if( err ){
fprintf(err,"%sillegal character in floating-point argument.\n",emsg); fprintf(err,"%sillegal character in floating-point argument.\n",emsg);
errline(i,((unsigned long)end)-(unsigned long)argv[i],err); errline(i,(int)((char*)end-(char*)argv[i]),err);
} }
errcnt++; errcnt++;
} }
@@ -1886,7 +1886,7 @@ static int handleswitch(int i, FILE *err)
if( *end ){ if( *end ){
if( err ){ if( err ){
fprintf(err,"%sillegal character in integer argument.\n",emsg); fprintf(err,"%sillegal character in integer argument.\n",emsg);
errline(i,((unsigned long)end)-(unsigned long)argv[i],err); errline(i,(int)((char*)end-(char*)argv[i]),err);
} }
errcnt++; errcnt++;
} }