Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 536a409396 |
@@ -287,7 +287,6 @@ SRC = \
|
||||
$(TOP)/src/vdbetrace.c \
|
||||
$(TOP)/src/vdbeInt.h \
|
||||
$(TOP)/src/vtab.c \
|
||||
$(TOP)/src/vxworks.h \
|
||||
$(TOP)/src/wal.c \
|
||||
$(TOP)/src/wal.h \
|
||||
$(TOP)/src/walker.c \
|
||||
@@ -483,7 +482,6 @@ HDR = \
|
||||
$(TOP)/src/sqliteLimit.h \
|
||||
$(TOP)/src/vdbe.h \
|
||||
$(TOP)/src/vdbeInt.h \
|
||||
$(TOP)/src/vxworks.h \
|
||||
$(TOP)/src/whereInt.h \
|
||||
config.h
|
||||
|
||||
|
||||
@@ -805,7 +805,6 @@ SRC2 = \
|
||||
$(TOP)\src\vdbetrace.c \
|
||||
$(TOP)\src\vdbeInt.h \
|
||||
$(TOP)\src\vtab.c \
|
||||
$(TOP)\src\vxworks.h \
|
||||
$(TOP)\src\wal.c \
|
||||
$(TOP)\src\wal.h \
|
||||
$(TOP)\src\walker.c \
|
||||
@@ -1005,7 +1004,6 @@ HDR = \
|
||||
$(TOP)\src\sqliteLimit.h \
|
||||
$(TOP)\src\vdbe.h \
|
||||
$(TOP)\src\vdbeInt.h \
|
||||
$(TOP)\src\vxworks.h \
|
||||
$(TOP)\src\whereInt.h
|
||||
|
||||
# Header files used by extensions
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#! /bin/sh
|
||||
# Guess values for system-dependent variables and create Makefiles.
|
||||
# Generated by GNU Autoconf 2.62 for sqlite 3.8.9.
|
||||
# Generated by GNU Autoconf 2.62 for sqlite 3.8.8.
|
||||
#
|
||||
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
|
||||
# 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
|
||||
@@ -743,8 +743,8 @@ SHELL=${CONFIG_SHELL-/bin/sh}
|
||||
# Identity of this package.
|
||||
PACKAGE_NAME='sqlite'
|
||||
PACKAGE_TARNAME='sqlite'
|
||||
PACKAGE_VERSION='3.8.9'
|
||||
PACKAGE_STRING='sqlite 3.8.9'
|
||||
PACKAGE_VERSION='3.8.8'
|
||||
PACKAGE_STRING='sqlite 3.8.8'
|
||||
PACKAGE_BUGREPORT=''
|
||||
|
||||
# Factoring default headers for most tests.
|
||||
@@ -1480,7 +1480,7 @@ if test "$ac_init_help" = "long"; then
|
||||
# Omit some internal or obsolete options to make the list less imposing.
|
||||
# This message is too long to be a string in the A/UX 3.1 sh.
|
||||
cat <<_ACEOF
|
||||
\`configure' configures sqlite 3.8.9 to adapt to many kinds of systems.
|
||||
\`configure' configures sqlite 3.8.8 to adapt to many kinds of systems.
|
||||
|
||||
Usage: $0 [OPTION]... [VAR=VALUE]...
|
||||
|
||||
@@ -1545,7 +1545,7 @@ fi
|
||||
|
||||
if test -n "$ac_init_help"; then
|
||||
case $ac_init_help in
|
||||
short | recursive ) echo "Configuration of sqlite 3.8.9:";;
|
||||
short | recursive ) echo "Configuration of sqlite 3.8.8:";;
|
||||
esac
|
||||
cat <<\_ACEOF
|
||||
|
||||
@@ -1659,7 +1659,7 @@ fi
|
||||
test -n "$ac_init_help" && exit $ac_status
|
||||
if $ac_init_version; then
|
||||
cat <<\_ACEOF
|
||||
sqlite configure 3.8.9
|
||||
sqlite configure 3.8.8
|
||||
generated by GNU Autoconf 2.62
|
||||
|
||||
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
|
||||
@@ -1673,7 +1673,7 @@ cat >config.log <<_ACEOF
|
||||
This file contains any messages produced by compilers while
|
||||
running configure, to aid debugging if configure makes a mistake.
|
||||
|
||||
It was created by sqlite $as_me 3.8.9, which was
|
||||
It was created by sqlite $as_me 3.8.8, which was
|
||||
generated by GNU Autoconf 2.62. Invocation command line was
|
||||
|
||||
$ $0 $@
|
||||
@@ -13951,7 +13951,7 @@ exec 6>&1
|
||||
# report actual input values of CONFIG_FILES etc. instead of their
|
||||
# values after options handling.
|
||||
ac_log="
|
||||
This file was extended by sqlite $as_me 3.8.9, which was
|
||||
This file was extended by sqlite $as_me 3.8.8, which was
|
||||
generated by GNU Autoconf 2.62. Invocation command line was
|
||||
|
||||
CONFIG_FILES = $CONFIG_FILES
|
||||
@@ -14004,7 +14004,7 @@ Report bugs to <bug-autoconf@gnu.org>."
|
||||
_ACEOF
|
||||
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
|
||||
ac_cs_version="\\
|
||||
sqlite config.status 3.8.9
|
||||
sqlite config.status 3.8.8
|
||||
configured by $0, generated by GNU Autoconf 2.62,
|
||||
with options \\"`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\"
|
||||
|
||||
|
||||
@@ -1253,7 +1253,7 @@ void sqlite3Fts3Snippet(
|
||||
*/
|
||||
for(iRead=0; iRead<pTab->nColumn; iRead++){
|
||||
SnippetFragment sF = {0, 0, 0, 0};
|
||||
int iS = 0;
|
||||
int iS;
|
||||
if( iCol>=0 && iRead!=iCol ) continue;
|
||||
|
||||
/* Find the best snippet of nFToken tokens in column iRead. */
|
||||
|
||||
+2
-9
@@ -38,7 +38,6 @@ static void compressFunc(
|
||||
unsigned int nIn;
|
||||
unsigned long int nOut;
|
||||
unsigned char x[8];
|
||||
int rc;
|
||||
int i, j;
|
||||
|
||||
pIn = sqlite3_value_blob(argv[0]);
|
||||
@@ -51,12 +50,8 @@ static void compressFunc(
|
||||
for(i=0; i<4 && x[i]==0; i++){}
|
||||
for(j=0; i<=4; i++, j++) pOut[j] = x[i];
|
||||
pOut[j-1] |= 0x80;
|
||||
rc = compress(&pOut[j], &nOut, pIn, nIn);
|
||||
if( rc==Z_OK ){
|
||||
sqlite3_result_blob(context, pOut, nOut+j, sqlite3_free);
|
||||
}else{
|
||||
sqlite3_free(pOut);
|
||||
}
|
||||
compress(&pOut[j], &nOut, pIn, nIn);
|
||||
sqlite3_result_blob(context, pOut, nOut+j, sqlite3_free);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -87,8 +82,6 @@ static void uncompressFunc(
|
||||
rc = uncompress(pOut, &nOut, &pIn[i], nIn-i);
|
||||
if( rc==Z_OK ){
|
||||
sqlite3_result_blob(context, pOut, nOut, sqlite3_free);
|
||||
}else{
|
||||
sqlite3_free(pOut);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -165,7 +165,6 @@ SRC = \
|
||||
$(TOP)/src/vdbetrace.c \
|
||||
$(TOP)/src/vdbeInt.h \
|
||||
$(TOP)/src/vtab.c \
|
||||
$(TOP)/src/vxworks.h \
|
||||
$(TOP)/src/wal.c \
|
||||
$(TOP)/src/wal.h \
|
||||
$(TOP)/src/walker.c \
|
||||
@@ -365,7 +364,6 @@ HDR = \
|
||||
$(TOP)/src/sqliteLimit.h \
|
||||
$(TOP)/src/vdbe.h \
|
||||
$(TOP)/src/vdbeInt.h \
|
||||
$(TOP)/src/vxworks.h \
|
||||
$(TOP)/src/whereInt.h
|
||||
|
||||
# Header files used by extensions
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
C Add\sa\stest\sfor\sthe\schange\son\sthis\sbranch.
|
||||
D 2015-03-17T16:01:29.508
|
||||
C In\sthe\scommand-line\sshell,\schange\sthe\sunits\son\sthe\s".width"\sseparate\sfrom\nbytes\sto\scharacters.
|
||||
D 2015-02-26T14:27:16.982
|
||||
F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f
|
||||
F Makefile.in 2f643d6968dfc0b82d2e546a0525a39079f9e928
|
||||
F Makefile.in 6b9e7677829aa94b9f30949656e27312aefb9a46
|
||||
F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23
|
||||
F Makefile.msc 529e61cd9d29a3934758b4b3a0bb649b6c653481
|
||||
F Makefile.msc edbe2e2a9d27a4a56bd2891808a7c013bc322f6e
|
||||
F Makefile.vxworks e1b65dea203f054e71653415bd8f96dcaed47858
|
||||
F README.md d58e3bebc0a4145e0f2a87994015fdb575a8e866
|
||||
F VERSION 319eb1ced4b4d17a67730f2b7b85f15c1346cb60
|
||||
F VERSION d846487aff892625eb8e75960234e7285f0462fe
|
||||
F aclocal.m4 a5c22d164aff7ed549d53a90fa56d56955281f50
|
||||
F addopcodes.awk 9eb448a552d5c0185cf62c463f9c173cedae3811
|
||||
F art/sqlite370.eps aa97a671332b432a54e1d74ff5e8775be34200c2
|
||||
@@ -38,7 +38,7 @@ F autoconf/tea/win/rules.vc c511f222b80064096b705dbeb97060ee1d6b6d63
|
||||
F config.guess 226d9a188c6196f3033ffc651cbc9dcee1a42977
|
||||
F config.h.in 42b71ad3fe21c9e88fa59e8458ca1a6bc72eb0c0
|
||||
F config.sub 9ebe4c3b3dab6431ece34f16828b594fb420da55
|
||||
F configure 613b220c2f2c7adcd50eb5ee4144ab581a150b47 x
|
||||
F configure b2882796ddebd33ac4e9d4ccf5c5ca11888fc30e x
|
||||
F configure.ac 6a8d145aea6d81f0b90013340780e43ed74fd5f4
|
||||
F contrib/sqlitecon.tcl 210a913ad63f9f991070821e599d600bd913e0ad
|
||||
F doc/lemon.html 334dbf6621b8fb8790297ec1abf3cfa4621709d1
|
||||
@@ -87,7 +87,7 @@ F ext/fts3/fts3_hash.c 29b986e43f4e9dd40110eafa377dc0d63c422c60
|
||||
F ext/fts3/fts3_hash.h 39cf6874dc239d6b4e30479b1975fe5b22a3caaf
|
||||
F ext/fts3/fts3_icu.c e319e108661147bcca8dd511cd562f33a1ba81b5
|
||||
F ext/fts3/fts3_porter.c 3565faf04b626cddf85f03825e86056a4562c009
|
||||
F ext/fts3/fts3_snippet.c 52c2dcf410b1f9af5a44d81a2cf8c68ed1cb5283
|
||||
F ext/fts3/fts3_snippet.c f16ef6425f92339a8fecc87d9aaf2b12355c78e4
|
||||
F ext/fts3/fts3_term.c a521f75132f9a495bdca1bdd45949b3191c52763
|
||||
F ext/fts3/fts3_test.c 8a3a78c4458b2d7c631fcf4b152a5cd656fa7038
|
||||
F ext/fts3/fts3_tokenize_vtab.c becc661223db7898b213f9e8a23d75bac02408c9
|
||||
@@ -108,7 +108,7 @@ F ext/icu/icu.c d415ccf984defeb9df2c0e1afcfaa2f6dc05eacb
|
||||
F ext/icu/sqliteicu.h 728867a802baa5a96de7495e9689a8e01715ef37
|
||||
F ext/misc/amatch.c 27b9b601fb1453084e18a3432ea0240d7af8decb
|
||||
F ext/misc/closure.c 636024302cde41b2bf0c542f81c40c624cfb7012
|
||||
F ext/misc/compress.c 122faa92d25033d6c3f07c39231de074ab3d2e83
|
||||
F ext/misc/compress.c 76e45655f4046e756064ab10c62e18f2eb846b9f
|
||||
F ext/misc/eval.c f971962e92ebb8b0a4e6b62949463ee454d88fa2
|
||||
F ext/misc/fileio.c d4171c815d6543a9edef8308aab2951413cd8d0f
|
||||
F ext/misc/fuzzer.c e3e18f47252c151b5553d7e806f38e757d37c4cc
|
||||
@@ -152,7 +152,7 @@ F ext/userauth/userauth.c 5fa3bdb492f481bbc1709fc83c91ebd13460c69e
|
||||
F install-sh 9d4de14ab9fb0facae2f48780b874848cbf2f895 x
|
||||
F ltmain.sh 3ff0879076df340d2e23ae905484d8c15d5fdea8
|
||||
F magic.txt 8273bf49ba3b0c8559cb2774495390c31fd61c60
|
||||
F main.mk 04c49c495795b18a7b70053eef285be1e4d43fa4
|
||||
F main.mk 0bae136db3f3ce451079ae335124b46163d37020
|
||||
F mkopcodec.awk c2ff431854d702cdd2d779c9c0d1f58fa16fa4ea
|
||||
F mkopcodeh.awk c6b3fa301db6ef7ac916b14c60868aeaec1337b5
|
||||
F mkso.sh fd21c06b063bb16a5d25deea1752c2da6ac3ed83
|
||||
@@ -185,7 +185,7 @@ F src/delete.c 37964e6c1d73ff49cbea9ff690c9605fb15f600e
|
||||
F src/expr.c 3ef111b88ae2941b84b6b6ea4be8d501ba1af0cb
|
||||
F src/fault.c 160a0c015b6c2629d3899ed2daf63d75754a32bb
|
||||
F src/fkey.c e0444b61bed271a76840cbe6182df93a9baa3f12
|
||||
F src/func.c 44512c557d6d4a40e51f3980c5854ae3e92862d6
|
||||
F src/func.c f7f0f44b0a2cb568a9c42b1b07e613380ee0b9c6
|
||||
F src/global.c 4f77cadbc5427d00139ba43d0f3979804cbb700e
|
||||
F src/hash.c 4263fbc955f26c2e8cdc0cf214bc42435aa4e4f5
|
||||
F src/hash.h c8f3c31722cf3277d03713909761e152a5b81094
|
||||
@@ -195,7 +195,7 @@ F src/journal.c b4124532212b6952f42eb2c12fa3c25701d8ba8d
|
||||
F src/legacy.c ba1863ea58c4c840335a84ec276fc2b25e22bc4e
|
||||
F src/lempar.c 7274c97d24bb46631e504332ccd3bd1b37841770
|
||||
F src/loadext.c 86bd4e2fccd520b748cba52492ab60c4a770f660
|
||||
F src/main.c fa997fa27d95febc16d57095299384b667a7f762
|
||||
F src/main.c 80edeba383aac89f72498b2572a115e21d0ecbbd
|
||||
F src/malloc.c 740db54387204c9a2eb67c6d98e68b08e9ef4eab
|
||||
F src/mem0.c 6a55ebe57c46ca1a7d98da93aaa07f99f1059645
|
||||
F src/mem1.c abe6ee469b6c5a35c7f22bfeb9c9bac664a1c987
|
||||
@@ -214,32 +214,32 @@ F src/os.c 8fd25588eeba74068d41102d26810e216999b6c8
|
||||
F src/os.h 3e57a24e2794a94d3cf2342c6d9a884888cd96bf
|
||||
F src/os_common.h 92815ed65f805560b66166e3583470ff94478f04
|
||||
F src/os_setup.h c9d4553b5aaa6f73391448b265b89bed0b890faa
|
||||
F src/os_unix.c cc903ecc6ebda90ef703d043ddaa7f33de0cab0f
|
||||
F src/os_unix.c c06b1b263d52e14473ccc619422af6b64570a3b8
|
||||
F src/os_win.c 8223e7db5b7c4a81d8b161098ac3959400434cdb
|
||||
F src/os_win.h eb7a47aa17b26b77eb97e4823f20a00b8bda12ca
|
||||
F src/pager.c 4120a49ecd37697e28f5ed807f470b9c0b88410c
|
||||
F src/pager.h c3476e7c89cdf1c6914e50a11f3714e30b4e0a77
|
||||
F src/parse.y 0f8e7d60f0ab3cb53d270adef69259ac307d83a8
|
||||
F src/pcache.c 10539fb959849ad6efff80050541cab3d25089d4
|
||||
F src/pcache.c d210cf90d04365a74f85d21374dded65af67b0cb
|
||||
F src/pcache.h b44658c9c932d203510279439d891a2a83e12ba8
|
||||
F src/pcache1.c 1e77432b40b7d3288327d9cdf399dcdfd2b6d3bf
|
||||
F src/pragma.c ac4f3f856b4234e85f55b0f069698a4766011100
|
||||
F src/pragma.c ea0be138a99784b14e87bd4522fea40e7b979e9c
|
||||
F src/pragma.h 09c89bca58e9a44de2116cc8272b8d454657129f
|
||||
F src/prepare.c 173a5a499138451b2561614ecb87d78f9f4644b9
|
||||
F src/printf.c 8da9a2687a396daa19860f4dc90975d319304744
|
||||
F src/random.c ba2679f80ec82c4190062d756f22d0c358180696
|
||||
F src/resolve.c f4d79e31ffa5820c2e3d1740baa5e9b190425f2b
|
||||
F src/rowset.c eccf6af6d620aaa4579bd3b72c1b6395d9e9fa1e
|
||||
F src/select.c 94e016b6733b1d39a2f4c8d431155b4c2897d907
|
||||
F src/shell.c cce82ca26392578a4a1ee927dfe55ea3411c7c92
|
||||
F src/sqlite.h.in 4eb59d93caec4b60eada51d3211087746187edef
|
||||
F src/select.c e46cef4c224549b439384c88fc7f57ba064dad54
|
||||
F src/shell.c c8a769c563b41b16196dfef675b008ba543a492f
|
||||
F src/sqlite.h.in 62d3997824038cc32335b04aaa18cc8f4c19e9be
|
||||
F src/sqlite3.rc 992c9f5fb8285ae285d6be28240a7e8d3a7f2bad
|
||||
F src/sqlite3ext.h 17d487c3c91b0b8c584a32fbeb393f6f795eea7d
|
||||
F src/sqliteInt.h fae682c2b4dfbe489b134d74521c41c088f16ab1
|
||||
F src/sqliteLimit.h 216557999cb45f2e3578ed53ebefe228d779cb46
|
||||
F src/sqliteInt.h 57a405ae6d2ed10fff52de376d18f21e04d96609
|
||||
F src/sqliteLimit.h 164b0e6749d31e0daa1a4589a169d31c0dec7b3d
|
||||
F src/status.c 81712116e826b0089bb221b018929536b2b5406f
|
||||
F src/table.c e7a09215315a978057fb42c640f890160dbcc45e
|
||||
F src/tclsqlite.c b290774586f022e16e04ba8ed2f0b8edd86b5b77
|
||||
F src/tclsqlite.c b8014393a96a9781bb635c8b1f52fc9b77a2bfcf
|
||||
F src/test1.c 90fbedce75330d48d99eadb7d5f4223e86969585
|
||||
F src/test2.c 577961fe48961b2f2e5c8b56ee50c3f459d3359d
|
||||
F src/test3.c 64d2afdd68feac1bb5e2ffb8226c8c639f798622
|
||||
@@ -254,7 +254,7 @@ F src/test_autoext.c dea8a01a7153b9adc97bd26161e4226329546e12
|
||||
F src/test_backup.c 2e6e6a081870150f20c526a2e9d0d29cda47d803
|
||||
F src/test_blob.c 1f2e3e25255b731c4fcf15ee7990d06347cb6c09
|
||||
F src/test_btree.c 2e9978eca99a9a4bfa8cae949efb00886860a64f
|
||||
F src/test_config.c c2d3ff6c129d50183900c7eff14158ff7e9b3f03
|
||||
F src/test_config.c e7b2e1634324d746aa5e1c7e0929470e8be27953
|
||||
F src/test_demovfs.c 0de72c2c89551629f58486fde5734b7d90758852
|
||||
F src/test_devsym.c e7498904e72ba7491d142d5c83b476c4e76993bc
|
||||
F src/test_fs.c ced436e3d4b8e4681328409b8081051ce614e28f
|
||||
@@ -266,7 +266,7 @@ F src/test_intarray.h 9dc57417fb65bc7835cc18548852cc08cc062202
|
||||
F src/test_journal.c 5360fbe1d1e4416ca36290562fd5a2e3f70f32aa
|
||||
F src/test_loadext.c a5251f956ab6af21e138dc1f9c0399394a510cb4
|
||||
F src/test_malloc.c b9495384e74923aefde8311de974bf9b0f5ba570
|
||||
F src/test_multiplex.c 61edf02530f7511a0529352cd8139ead3af4c401
|
||||
F src/test_multiplex.c 72c0ad1e97af3d6d19975bbd81813072b40c7290
|
||||
F src/test_multiplex.h c08e4e8f8651f0c5e0509b138ff4d5b43ed1f5d3
|
||||
F src/test_mutex.c 293042d623ebba969160f471a82aa1551626454f
|
||||
F src/test_onefile.c 0396f220561f3b4eedc450cef26d40c593c69a25
|
||||
@@ -283,7 +283,7 @@ F src/test_superlock.c 06797157176eb7085027d9dd278c0d7a105e3ec9
|
||||
F src/test_syscall.c 2e21ca7f7dc54a028f1967b63f1e76155c356f9b
|
||||
F src/test_tclvar.c f4dc67d5f780707210d6bb0eb6016a431c04c7fa
|
||||
F src/test_thread.c af391ec03d23486dffbcc250b7e58e073f172af9
|
||||
F src/test_vfs.c b7e6831e6fcf04c5090accff30640ec5c9630739
|
||||
F src/test_vfs.c 5a14c63da9579ba148138c1fb233100f2eb58ebb
|
||||
F src/test_vfstrace.c bab9594adc976cbe696ff3970728830b4c5ed698
|
||||
F src/test_wsd.c 41cadfd9d97fe8e3e4e44f61a4a8ccd6f7ca8fe9
|
||||
F src/threads.c 6bbcc9fe50c917864d48287b4792d46d6e873481
|
||||
@@ -293,22 +293,21 @@ F src/update.c 3c4ecc282accf12d39edb8d524cf089645e55a13
|
||||
F src/utf.c fc6b889ba0779b7722634cdeaa25f1930d93820c
|
||||
F src/util.c 98a7627ca48ad3265b6940915a1d08355eb3fc7e
|
||||
F src/vacuum.c 9460b9de7b2d4e34b0d374894aa6c8a0632be8ec
|
||||
F src/vdbe.c 94cbc2115075b1a562a2a702c29ba48e74f85d34
|
||||
F src/vdbe.c ddfc977981cd6324668aa6b114045eb1c677421a
|
||||
F src/vdbe.h 6fc69d9c5e146302c56e163cb4b31d1ee64a18c3
|
||||
F src/vdbeInt.h bb56fd199d8af1a2c1b9639ee2f70724b4338e3a
|
||||
F src/vdbeapi.c dac0d0d8009a8aa549cd77d9c29da44c0344f0c4
|
||||
F src/vdbeapi.c 3d88089b10f71750b019a806224f0277d371a072
|
||||
F src/vdbeaux.c 97911edb61074b871ec4aa2d6bb779071643dee5
|
||||
F src/vdbeblob.c 4f2e8e075d238392df98c5e03a64342465b03f90
|
||||
F src/vdbemem.c 31d8eabb0cd78bfeab4e5124c7363c3e9e54db9f
|
||||
F src/vdbesort.c 6d64c5448b64851b99931ede980addc3af70d5e2
|
||||
F src/vdbetrace.c 7e4222955e07dd707a2f360c0eb73452be1cb010
|
||||
F src/vtab.c 699f2b8d509cfe379c33dde33827875d5b030e01
|
||||
F src/vxworks.h c18586c8edc1bddbc15c004fa16aeb1e1342b4fb
|
||||
F src/wal.c 878c8e1a51cb2ec45c395d26b7d5cd9e1a098e4a
|
||||
F src/wal.c 39303f2c9db02a4e422cd8eb2c8760420c6a51fe
|
||||
F src/wal.h df01efe09c5cb8c8e391ff1715cca294f89668a4
|
||||
F src/walker.c c253b95b4ee44b21c406e2a1052636c31ea27804
|
||||
F src/where.c eb141b075776e9864d38f279333e2472a8653202
|
||||
F src/whereInt.h cbe4aa57326998d89e7698ca65bb7c28541d483c
|
||||
F src/where.c a50d5082b0fecd2bcf1725cdd012732d9d1e9d5c
|
||||
F src/whereInt.h d3633e9b592103241b74b0ec76185f3e5b8b62e0
|
||||
F test/8_3_names.test ebbb5cd36741350040fd28b432ceadf495be25b2
|
||||
F test/aggerror.test a867e273ef9e3d7919f03ef4f0e8c0d2767944f2
|
||||
F test/aggnested.test b35b4cd69fc913f90d39a575e171e1116c3a4bb7
|
||||
@@ -321,7 +320,7 @@ F test/alter4.test c461150723ac957f3b2214aa0b11552cd72023ec
|
||||
F test/altermalloc.test e81ac9657ed25c6c5bb09bebfa5a047cd8e4acfc
|
||||
F test/amatch1.test b5ae7065f042b7f4c1c922933f4700add50cdb9f
|
||||
F test/analyze.test 1772936d66471c65221e437b6d1999c3a03166c4
|
||||
F test/analyze3.test 75b9e42ea1e4edc919250450dc5762186965d4e6
|
||||
F test/analyze3.test bf41f0f680dd1e0d44eed5e769531e93a5320275
|
||||
F test/analyze4.test eff2df19b8dd84529966420f29ea52edc6b56213
|
||||
F test/analyze5.test 765c4e284aa69ca172772aa940946f55629bc8c4
|
||||
F test/analyze6.test f1c552ce39cca4ec922a7e4e0e5d0203d6b3281f
|
||||
@@ -348,7 +347,7 @@ F test/auth.test 855233ef26eb3601b6886567ea4e326c72959360
|
||||
F test/auth2.test 264c6af53cad9aba5218c68bbe18036e39007bfa
|
||||
F test/auth3.test 5cfa94ed90c6617c42b7ba4b133fd79678b251c7
|
||||
F test/autoinc.test c58912526998a39e11f66b533e23cfabea7f25b7
|
||||
F test/autoindex1.test 7008c9f604141fdabe31b7bb95b5ff31b518251f
|
||||
F test/autoindex1.test 6ff78b94f43a59616c06c11c55b12935173506d7
|
||||
F test/autoindex2.test af7e595c6864cc6ef5fc38d5db579a3e34940cb8
|
||||
F test/autoindex3.test a3be0d1a53a7d2edff208a5e442312957047e972
|
||||
F test/autoindex4.test 49d3cd791a9baa16fb461d7ea3de80d019a819cf
|
||||
@@ -387,7 +386,7 @@ F test/btreefault.test c2bcb542685eea44621275cfedbd8a13f65201e3
|
||||
F test/busy.test 76b4887f8b9160ba903c1ac22e8ff406ad6ae2f0
|
||||
F test/cache.test 13bc046b26210471ca6f2889aceb1ea52dc717de
|
||||
F test/capi2.test 011c16da245fdc0106a2785035de6b242c05e738
|
||||
F test/capi3.test bf6f0308bbbba1e770dac13aa08e5c2ac61c7324
|
||||
F test/capi3.test f0718f4f90d0efdc980119bfbdf1d7f1541ee5ef
|
||||
F test/capi3b.test efb2b9cfd127efa84433cd7a2d72ce0454ae0dc4
|
||||
F test/capi3c.test fdc0d67a2cb8e8fc400d5b7735e330161ea057a2
|
||||
F test/capi3d.test a82b6321c50a1cfc848e386fa2c851893606f68c
|
||||
@@ -471,7 +470,7 @@ F test/e_dropview.test 0c9f7f60989164a70a67a9d9c26d1083bc808306
|
||||
F test/e_expr.test 8f5fdd7261e2d746813b0c6a1c0e34824ad3c5ad
|
||||
F test/e_fkey.test a1783fe1f759e1990e6a11adfcf0702dac4d0707
|
||||
F test/e_fts3.test 5c02288842e4f941896fd44afdef564dd5fc1459
|
||||
F test/e_insert.test 0e63edc037afe738bb81a626a676811ed7862c90
|
||||
F test/e_insert.test 7b2fa9cd1456f83474d6c5d27db3abaeb8be2023
|
||||
F test/e_reindex.test 396b7b4f0a66863b4e95116a67d93b227193e589
|
||||
F test/e_resolve.test dcce9308fb13b934ce29591105d031d3e14fbba6
|
||||
F test/e_select.test 52692ff3849541e828ad4661fe3773a9b8711763
|
||||
@@ -480,7 +479,7 @@ F test/e_totalchanges.test b12ee5809d3e63aeb83238dd501a7bca7fd72c10
|
||||
F test/e_update.test 312cb8f5ccfe41515a6bb092f8ea562a9bd54d52
|
||||
F test/e_uri.test 5ae33760fb2039c61aa2d90886f1664664173585
|
||||
F test/e_vacuum.test 5bfbdc21b65c0abf24398d0ba31dc88d93ca77a9
|
||||
F test/e_wal.test ae9a593207a77d711443ee69ffe081fda9243625
|
||||
F test/e_wal.test 0967f0b8f1dfda871dc7b9b5574198f1f4f7d69a
|
||||
F test/e_walauto.test ca70cf75c07a6cb1874ced101dd426da76625649
|
||||
F test/e_walckpt.test 65e29b6631e51f210f83e4ff11571e647ba93608
|
||||
F test/e_walhook.test da3ea8b3483d1af72190337bda50155a91a4b664
|
||||
@@ -504,7 +503,7 @@ F test/fkey1.test e1d1fa84cde579185ea01358436839703e415a5b
|
||||
F test/fkey2.test 1db212cda86b0d3ce72714001f7b6381c321341c
|
||||
F test/fkey3.test 76d475c80b84ee7a5d062e56ccb6ea68882e2b49
|
||||
F test/fkey4.test 86446017011273aad8f9a99c1a65019e7bd9ca9d
|
||||
F test/fkey5.test 56bcb5a6e8b725b17febc267fb041a6695e86853
|
||||
F test/fkey5.test 488601fbda8350619b3029487e56830447056fd2
|
||||
F test/fkey6.test abb59f866c1b44926fd02d1fdd217d831fe04f48
|
||||
F test/fkey7.test 72e915890ee4a005daaf3002cb208e8fe973ac13
|
||||
F test/fkey8.test 8f08203458321e6c19a263829de4cfc936274ab0
|
||||
@@ -639,7 +638,7 @@ F test/in3.test 3cbf58c87f4052cee3a58b37b6389777505aa0c0
|
||||
F test/in4.test d2b38cba404bc4320f4fe1b595b3d163f212c068
|
||||
F test/in5.test 1de657472fa9ac2924be25c2c959ac5ca1aae554
|
||||
F test/incrblob.test e81846d214f3637622620fbde7cd526781cfe328
|
||||
F test/incrblob2.test a5ce5ed1d0b01e2ed347245a21170372528af0a5
|
||||
F test/incrblob2.test 0d8821730a84f90af78a9dd547fe7a2480a06240
|
||||
F test/incrblob3.test d8d036fde015d4a159cd3cbae9d29003b37227a4
|
||||
F test/incrblob4.test f26502a5697893e5acea268c910f16478c2f0fab
|
||||
F test/incrblob_err.test af1f12ba60d220c9752073ff2bda2ad59e88960d
|
||||
@@ -654,8 +653,8 @@ F test/index3.test 55a90cff99834305e8141df7afaef39674b57062
|
||||
F test/index4.test ab92e736d5946840236cd61ac3191f91a7856bf6
|
||||
F test/index5.test 25b0b451aceed4ac5f7d49f856f6de7257470b3e
|
||||
F test/index6.test 3ae54e53c53f2adcacda269237d8e52bdb05a481
|
||||
F test/index7.test 3d54dce09344c4530ea39a458aa304da044c887a
|
||||
F test/indexedby.test 5f527a78bae74c61b8046ae3037f9dfb0bf0c353
|
||||
F test/index7.test 917cf1e1c7439bb155abbeabec511b28945e157b
|
||||
F test/indexedby.test b2f22f3e693a53813aa3f50b812eb609ba6df1ec
|
||||
F test/indexfault.test 31d4ab9a7d2f6e9616933eb079722362a883eb1d
|
||||
F test/init.test 15c823093fdabbf7b531fe22cf037134d09587a7
|
||||
F test/insert.test 38742b5e9601c8f8d76e9b7555f7270288c2d371
|
||||
@@ -689,27 +688,26 @@ F test/jrnlmode3.test 556b447a05be0e0963f4311e95ab1632b11c9eaa
|
||||
F test/keyword1.test 37ef6bba5d2ed5b07ecdd6810571de2956599dff
|
||||
F test/lastinsert.test 42e948fd6442f07d60acbd15d33fb86473e0ef63
|
||||
F test/laststmtchanges.test ae613f53819206b3222771828d024154d51db200
|
||||
F test/like.test 4f2a71d36a536233727f71995fef900756705e56
|
||||
F test/like.test e191e536d0fcd722a6b965e7cd1ee0bfd12a5991
|
||||
F test/like2.test 3b2ee13149ba4a8a60b59756f4e5d345573852da
|
||||
F test/like3.test 7b0525a39e4f25c4fd113de7e2e28eb712dcdedf
|
||||
F test/limit.test 0c99a27a87b14c646a9d583c7c89fd06c352663e
|
||||
F test/limit.test 3d7df19c35ac672a11f7de406cd3205d592babbb
|
||||
F test/loadext.test 648cb95f324d1775c54a55c12271b2d1156b633b
|
||||
F test/loadext2.test 0408380b57adca04004247179837a18e866a74f7
|
||||
F test/lock.test b984ab9034e7389be0d863fe4e64cbbc4d2028f5
|
||||
F test/lock.test 87af515b0c4cf928576d0f89946d67d7c265dfb4
|
||||
F test/lock2.test 5242d8ac4e2d59c403aebff606af449b455aceff
|
||||
F test/lock3.test f271375930711ae044080f4fe6d6eda930870d00
|
||||
F test/lock4.test e175ae13865bc87680607563bafba21f31a26f12
|
||||
F test/lock5.test c6c5e0ebcb21c61a572870cc86c0cb9f14cede38
|
||||
F test/lock6.test ad5b387a3a8096afd3c68a55b9535056431b0cf5
|
||||
F test/lock7.test 49f1eaff1cdc491cc5dee3669f3c671d9f172431
|
||||
F test/lock_common.tcl 7ffb45accf6ee91c736df9bafe0806a44358f035
|
||||
F test/lock_common.tcl 0c270b121d40959fa2f3add382200c27045b3d95
|
||||
F test/lookaside.test 93f07bac140c5bb1d49f3892d2684decafdc7af2
|
||||
F test/main.test 16131264ea0c2b93b95201f0c92958e85f2ba11a
|
||||
F test/make-where7.tcl 05c16b5d4f5d6512881dfec560cb793915932ef9
|
||||
F test/malloc.test 96939d2d1a6f39667bbebe5bc27c6525f2ab614e
|
||||
F test/malloc3.test e3b32c724b5a124b57cb0ed177f675249ad0c66a
|
||||
F test/malloc4.test 957337613002b7058a85116493a262f679f3a261
|
||||
F test/malloc5.test 79182b8bffd6d62f77b1a5a8ba8e6bf0e5053b8e
|
||||
F test/malloc5.test fafce0aa9157060445cd1a56ad50fc79d82f28c3
|
||||
F test/malloc6.test 2f039d9821927eacae43e1831f815e157659a151
|
||||
F test/malloc7.test 7c68a32942858bc715284856c5507446bba88c3a
|
||||
F test/malloc8.test 9b7a3f8cb9cf0b12fff566e80a980b1767bd961d
|
||||
@@ -754,7 +752,7 @@ F test/mmapfault.test d4c9eff9cd8c2dc14bc43e71e042f175b0a26fe3
|
||||
F test/multiplex.test efd015ca0b5b4a57dc9535b8feb1273eebeadb60
|
||||
F test/multiplex2.test 580ca5817c7edbe4cc68fa150609c9473393003a
|
||||
F test/multiplex3.test d228f59eac91839a977eac19f21d053f03e4d101
|
||||
F test/multiplex4.test e8ae4c4bd70606a5727743241f13b5701990abe4
|
||||
F test/multiplex4.test d3e8a5a522c51cbf3ed1c5b0bd496be02c29d7b1
|
||||
F test/mutex1.test 78b2b9bb320e51d156c4efdb71b99b051e7a4b41
|
||||
F test/mutex2.test bfeaeac2e73095b2ac32285d2756e3a65e681660
|
||||
F test/nan.test e9648b9d007c7045242af35e11a984d4b169443a
|
||||
@@ -789,8 +787,8 @@ F test/pcache.test b09104b03160aca0d968d99e8cd2c5b1921a993d
|
||||
F test/pcache2.test a83efe2dec0d392f814bfc998def1d1833942025
|
||||
F test/percentile.test 4243af26b8f3f4555abe166f723715a1f74c77ff
|
||||
F test/permutations.test f9cc1dd987986c9d4949211c7a4ed55ec9aecba1
|
||||
F test/pragma.test ad99d05e411c7687302124be56f3b362204be041
|
||||
F test/pragma2.test f624a496a95ee878e81e59961eade66d5c00c028
|
||||
F test/pragma.test 6cf0f0ce4618e841457aa42745afda55ddbc95fe
|
||||
F test/pragma2.test aea7b3d82c76034a2df2b38a13745172ddc0bc13
|
||||
F test/pragma3.test 6f849ccffeee7e496d2f2b5e74152306c0b8757c
|
||||
F test/printf.test ec9870c4dce8686a37818e0bf1aba6e6a1863552
|
||||
F test/printf2.test b4acd4bf8734243257f01ddefa17c4fb090acc8a
|
||||
@@ -804,7 +802,7 @@ F test/quota2.test 7dc12e08b11cbc4c16c9ba2aa2e040ea8d8ab4b8
|
||||
F test/quote.test 215897dbe8de1a6f701265836d6601cc6ed103e6
|
||||
F test/randexpr1.tcl 40dec52119ed3a2b8b2a773bce24b63a3a746459
|
||||
F test/randexpr1.test eda062a97e60f9c38ae8d806b03b0ddf23d796df
|
||||
F test/rdonly.test 64e2696c322e3538df0b1ed624e21f9a23ed9ff8
|
||||
F test/rdonly.test dd30a4858d8e0fbad2304c2bd74a33d4df36412a
|
||||
F test/regexp1.test 497ea812f264d12b6198d6e50a76be4a1973a9d8
|
||||
F test/reindex.test 44edd3966b474468b823d481eafef0c305022254
|
||||
F test/releasetest.tcl 13f401c10dd4fe1a2fb811ae6ed27fd7d1300d3c
|
||||
@@ -834,7 +832,7 @@ F test/securedel2.test 2d54c28e46eb1fd6902089958b20b1b056c6f1c5
|
||||
F test/select1.test fc2a61f226a649393664ad54bc5376631801517c
|
||||
F test/select2.test 352480e0e9c66eda9c3044e412abdf5be0215b56
|
||||
F test/select3.test 2ce595f8fb8e2ac10071d3b4e424cadd4634a054
|
||||
F test/select4.test e20e8ce47b558de80616102ef273704cf0d48a3b
|
||||
F test/select4.test 8c5a60d439e2df824aed56223566877a883c5c84
|
||||
F test/select5.test e758b8ef94f69b111df4cb819008856655dcd535
|
||||
F test/select6.test 39eac4a5c03650b2b473c532882273283ee8b7a0
|
||||
F test/select7.test 7fd2ef598cfabb6b9ff6ac13973b91d0527df49d
|
||||
@@ -867,7 +865,7 @@ F test/shell4.test 8a9c08976291e6c6c808b4d718f4a8b299f339f5
|
||||
F test/shell5.test c04e9f9f948305706b88377c464c7f08ce7479f9
|
||||
F test/shortread1.test bb591ef20f0fd9ed26d0d12e80eee6d7ac8897a3
|
||||
F test/show_speedtest1_rtree.tcl 32e6c5f073d7426148a6936a0408f4b5b169aba5
|
||||
F test/shrink.test 06deac10d591186017466ce67d10645150bfdeec
|
||||
F test/shrink.test 8c70f62b6e8eb4d54533de6d65bd06b1b9a17868
|
||||
F test/sidedelete.test f0ad71abe6233e3b153100f3b8d679b19a488329
|
||||
F test/skipscan1.test 2ddfe5d168462170c4487f534e2a99fb006b2076
|
||||
F test/skipscan2.test d1d1450952b7275f0b0a3a981f0230532743951a
|
||||
@@ -875,11 +873,11 @@ F test/skipscan3.test ec5bab3f81c7038b43450e7b3062e04a198bdbb5
|
||||
F test/skipscan5.test 67817a4b6857c47e0e33ba3e506da6f23ef68de2
|
||||
F test/skipscan6.test 5866039d03a56f5bd0b3d172a012074a1d90a15b
|
||||
F test/soak.test 0b5b6375c9f4110c828070b826b3b4b0bb65cd5f
|
||||
F test/softheap1.test 843cd84db9891b2d01b9ab64cef3e9020f98d087
|
||||
F test/softheap1.test 40562fe6cac6d9827b7b42b86d45aedf12c15e24
|
||||
F test/sort.test 3f492e5b7be1d3f756728d2ff6edf4f6091e84cb
|
||||
F test/sort2.test 37afbc03f5559f2eb0f18940b55d38dfbb5172ac
|
||||
F test/sort3.test 6178ade30810ac9166fcdf14b7065e49c0f534e2
|
||||
F test/sort4.test 5c34d9623a4ae5921d956dfa2b70e77ed0fc6e5c
|
||||
F test/sort4.test d5e8903194ae551551349ce25dc8d0b40ca2b9c3
|
||||
F test/sort5.test a448240a42b49239edc00f85d6d7ac7a1b261e1f
|
||||
F test/sortfault.test d4ccf606a0c77498e2beb542764fd9394acb4d66
|
||||
F test/speed1.test f2974a91d79f58507ada01864c0e323093065452
|
||||
@@ -892,7 +890,7 @@ F test/speed4p.explain 6b5f104ebeb34a038b2f714150f51d01143e59aa
|
||||
F test/speed4p.test 0e51908951677de5a969b723e03a27a1c45db38b
|
||||
F test/speedtest1.c 2b416dca3a155fcaa849540b2e7fc1df12896c23
|
||||
F test/spellfix.test 24f676831acddd2f4056a598fd731a72c6311f49
|
||||
F test/sqllimits1.test e05786eaed7950ff6a2d00031d001d8a26131e68
|
||||
F test/sqllimits1.test 9014524e7ab16e2a4976b13397db4c29cc29c6d9
|
||||
F test/stat.test 76fd746b85459e812a0193410fb599f0531f22de
|
||||
F test/stmt.test 25d64e3dbf9a3ce89558667d7f39d966fe2a71b9
|
||||
F test/subquery.test 666fdecceac258f5fd84bed09a64e49d9f37edd9
|
||||
@@ -1139,7 +1137,6 @@ F test/wal9.test 378e76a9ad09cd9bee06c172ad3547b0129a6750
|
||||
F test/wal_common.tcl a98f17fba96206122eff624db0ab13ec377be4fe
|
||||
F test/walbak.test b9f68e39646375c2b877be906babcc15d38b4877
|
||||
F test/walbig.test f437473a16cfb314867c6b5d1dbcd519e73e3434
|
||||
F test/walblock.test f1290524714232c109fb0b14db28f14d81c3ddd0
|
||||
F test/walcksum.test 9afeb96240296c08c72fc524d199c912cfe34daa
|
||||
F test/walcrash.test 451d79e528add5c42764cea74aa2750754171b25
|
||||
F test/walcrash2.test a0edab4e5390f03b99a790de89aad15d6ec70b36
|
||||
@@ -1160,7 +1157,7 @@ F test/where4.test d8420ceeb8323a41ceff1f1841fc528e824e1ecf
|
||||
F test/where5.test fdf66f96d29a064b63eb543e28da4dfdccd81ad2
|
||||
F test/where6.test 5da5a98cec820d488e82708301b96cb8c18a258b
|
||||
F test/where7.test 5a4b0abc207d71da4deecd734ad8579e8dd40aa8
|
||||
F test/where8.test 2eafe74e01cc10355985874e1ff868ac03dbae5e
|
||||
F test/where8.test 806f1dcec4088be2b826b33f757fe6e17c3236a1
|
||||
F test/where8m.test da346596e19d54f0aba35ebade032a7c47d79739
|
||||
F test/where9.test 729c3ba9b47e8f9f1aab96bae7dad2a524f1d1a2
|
||||
F test/whereA.test 4d253178d135ec46d1671e440cd8f2b916aa6e6b
|
||||
@@ -1209,7 +1206,7 @@ F tool/mkopts.tcl 66ac10d240cc6e86abd37dc908d50382f84ff46e
|
||||
F tool/mkpragmatab.tcl 94f196c9961e0ca3513e29f57125a3197808be2d
|
||||
F tool/mkspeedsql.tcl a1a334d288f7adfe6e996f2e712becf076745c97
|
||||
F tool/mksqlite3c-noext.tcl 9ef48e1748dce7b844f67e2450ff9dfeb0fb4ab5
|
||||
F tool/mksqlite3c.tcl 95ab31eda659e7ffb091e04bd83178f260d8edfd
|
||||
F tool/mksqlite3c.tcl 6b8e572a90eb4e0086e3ba90d88b76c085919863
|
||||
F tool/mksqlite3h.tcl ba24038056f51fde07c0079c41885ab85e2cff12
|
||||
F tool/mksqlite3internalh.tcl eb994013e833359137eb53a55acdad0b5ae1049b
|
||||
F tool/mkvsix.tcl 52a4c613707ac34ae9c226e5ccc69cb948556105
|
||||
@@ -1242,7 +1239,10 @@ F tool/vdbe_profile.tcl 67746953071a9f8f2f668b73fe899074e2c6d8c1
|
||||
F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4
|
||||
F tool/warnings.sh 0abfd78ceb09b7f7c27c688c8e3fe93268a13b32
|
||||
F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f
|
||||
P c6e6d5f4e06c3ac0bfb620c0c728fbc7230c4a02
|
||||
R 15a95b25b03827505e198326f8e27a62
|
||||
U dan
|
||||
Z 12b0ab91b3a13b6777d198c7ff155c7d
|
||||
P 4bee8295e36fb61f903210b6d052ee9b8fb3b6d0
|
||||
R 143a1a32cdae3a721c8dd7822db13dda
|
||||
T *branch * cli-char-width
|
||||
T *sym-cli-char-width *
|
||||
T -sym-trunk *
|
||||
U drh
|
||||
Z 9e05d9065c7895cfbe90dd1f0cc9db4d
|
||||
|
||||
+1
-1
@@ -1 +1 @@
|
||||
e22dde187eb0b389d6d93e2e39a26fd0f4e6196e
|
||||
b1a9e2916f5b4adef91c34563f71b98e79a10c12
|
||||
@@ -1650,11 +1650,6 @@ void sqlite3RegisterLikeFunctions(sqlite3 *db, int caseSensitive){
|
||||
** then set aWc[0] through aWc[2] to the wildcard characters and
|
||||
** return TRUE. If the function is not a LIKE-style function then
|
||||
** return FALSE.
|
||||
**
|
||||
** *pIsNocase is set to true if uppercase and lowercase are equivalent for
|
||||
** the function (default for LIKE). If the function makes the distinction
|
||||
** between uppercase and lowercase (as does GLOB) then *pIsNocase is set to
|
||||
** false.
|
||||
*/
|
||||
int sqlite3IsLikeFunction(sqlite3 *db, Expr *pExpr, int *pIsNocase, char *aWc){
|
||||
FuncDef *pDef;
|
||||
|
||||
+17
-35
@@ -340,28 +340,26 @@ int sqlite3_config(int op, ...){
|
||||
*/
|
||||
#if defined(SQLITE_THREADSAFE) && SQLITE_THREADSAFE>0 /* IMP: R-54466-46756 */
|
||||
case SQLITE_CONFIG_SINGLETHREAD: {
|
||||
/* EVIDENCE-OF: R-02748-19096 This option sets the threading mode to
|
||||
** Single-thread. */
|
||||
sqlite3GlobalConfig.bCoreMutex = 0; /* Disable mutex on core */
|
||||
sqlite3GlobalConfig.bFullMutex = 0; /* Disable mutex on connections */
|
||||
/* Disable all mutexing */
|
||||
sqlite3GlobalConfig.bCoreMutex = 0;
|
||||
sqlite3GlobalConfig.bFullMutex = 0;
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
#if defined(SQLITE_THREADSAFE) && SQLITE_THREADSAFE>0 /* IMP: R-20520-54086 */
|
||||
case SQLITE_CONFIG_MULTITHREAD: {
|
||||
/* EVIDENCE-OF: R-14374-42468 This option sets the threading mode to
|
||||
** Multi-thread. */
|
||||
sqlite3GlobalConfig.bCoreMutex = 1; /* Enable mutex on core */
|
||||
sqlite3GlobalConfig.bFullMutex = 0; /* Disable mutex on connections */
|
||||
/* Disable mutexing of database connections */
|
||||
/* Enable mutexing of core data structures */
|
||||
sqlite3GlobalConfig.bCoreMutex = 1;
|
||||
sqlite3GlobalConfig.bFullMutex = 0;
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
#if defined(SQLITE_THREADSAFE) && SQLITE_THREADSAFE>0 /* IMP: R-59593-21810 */
|
||||
case SQLITE_CONFIG_SERIALIZED: {
|
||||
/* EVIDENCE-OF: R-41220-51800 This option sets the threading mode to
|
||||
** Serialized. */
|
||||
sqlite3GlobalConfig.bCoreMutex = 1; /* Enable mutex on core */
|
||||
sqlite3GlobalConfig.bFullMutex = 1; /* Enable mutex on connections */
|
||||
/* Enable all mutexing */
|
||||
sqlite3GlobalConfig.bCoreMutex = 1;
|
||||
sqlite3GlobalConfig.bFullMutex = 1;
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
@@ -473,8 +471,7 @@ int sqlite3_config(int op, ...){
|
||||
case SQLITE_CONFIG_HEAP: {
|
||||
/* EVIDENCE-OF: R-19854-42126 There are three arguments to
|
||||
** SQLITE_CONFIG_HEAP: An 8-byte aligned pointer to the memory, the
|
||||
** number of bytes in the memory buffer, and the minimum allocation size.
|
||||
*/
|
||||
** number of bytes in the memory buffer, and the minimum allocation size. */
|
||||
sqlite3GlobalConfig.pHeap = va_arg(ap, void*);
|
||||
sqlite3GlobalConfig.nHeap = va_arg(ap, int);
|
||||
sqlite3GlobalConfig.mnReq = va_arg(ap, int);
|
||||
@@ -579,9 +576,7 @@ int sqlite3_config(int op, ...){
|
||||
** compile-time maximum mmap size set by the SQLITE_MAX_MMAP_SIZE
|
||||
** compile-time option.
|
||||
*/
|
||||
if( mxMmap<0 || mxMmap>SQLITE_MAX_MMAP_SIZE ){
|
||||
mxMmap = SQLITE_MAX_MMAP_SIZE;
|
||||
}
|
||||
if( mxMmap<0 || mxMmap>SQLITE_MAX_MMAP_SIZE ) mxMmap = SQLITE_MAX_MMAP_SIZE;
|
||||
if( szMmap<0 ) szMmap = SQLITE_DEFAULT_MMAP_SIZE;
|
||||
if( szMmap>mxMmap) szMmap = mxMmap;
|
||||
sqlite3GlobalConfig.mxMmap = mxMmap;
|
||||
@@ -2425,19 +2420,7 @@ int sqlite3ParseUri(
|
||||
if( !zFile ) return SQLITE_NOMEM;
|
||||
|
||||
iIn = 5;
|
||||
#ifdef SQLITE_ALLOW_URI_AUTHORITY
|
||||
if( strncmp(zUri+5, "///", 3)==0 ){
|
||||
iIn = 7;
|
||||
/* The following condition causes URIs with five leading / characters
|
||||
** like file://///host/path to be converted into UNCs like //host/path.
|
||||
** The correct URI for that UNC has only two or four leading / characters
|
||||
** file://host/path or file:////host/path. But 5 leading slashes is a
|
||||
** common error, we are told, so we handle it as a special case. */
|
||||
if( strncmp(zUri+7, "///", 3)==0 ){ iIn++; }
|
||||
}else if( strncmp(zUri+5, "//localhost/", 12)==0 ){
|
||||
iIn = 16;
|
||||
}
|
||||
#else
|
||||
#ifndef SQLITE_ALLOW_URI_AUTHORITY
|
||||
/* Discard the scheme and authority segments of the URI. */
|
||||
if( zUri[5]=='/' && zUri[6]=='/' ){
|
||||
iIn = 7;
|
||||
@@ -2880,8 +2863,7 @@ static int openDatabase(
|
||||
opendb_out:
|
||||
sqlite3_free(zOpen);
|
||||
if( db ){
|
||||
assert( db->mutex!=0 || isThreadsafe==0
|
||||
|| sqlite3GlobalConfig.bFullMutex==0 );
|
||||
assert( db->mutex!=0 || isThreadsafe==0 || sqlite3GlobalConfig.bFullMutex==0 );
|
||||
sqlite3_mutex_leave(db->mutex);
|
||||
}
|
||||
rc = sqlite3_errcode(db);
|
||||
@@ -3626,7 +3608,7 @@ int sqlite3_test_control(int op, ...){
|
||||
break;
|
||||
}
|
||||
|
||||
/* sqlite3_test_control(SQLITE_TESTCTRL_IMPOSTER, db, dbName, onOff, tnum);
|
||||
/* sqlite3_test_control(SQLITE_TESTCTRL_IMPOSTER, db, dbName, onOff, tnum);
|
||||
**
|
||||
** This test control is used to create imposter tables. "db" is a pointer
|
||||
** to the database connection. dbName is the database name (ex: "main" or
|
||||
@@ -3635,8 +3617,8 @@ int sqlite3_test_control(int op, ...){
|
||||
** table should connect.
|
||||
**
|
||||
** Enable imposter mode only when the schema has already been parsed. Then
|
||||
** run a single CREATE TABLE statement to construct the imposter table in
|
||||
** the parsed schema. Then turn imposter mode back off again.
|
||||
** run a single CREATE TABLE statement to construct the imposter table in the
|
||||
** parsed schema. Then turn imposter mode back off again.
|
||||
**
|
||||
** If onOff==0 and tnum>0 then reset the schema for all databases, causing
|
||||
** the schema to be reparsed the next time it is needed. This has the
|
||||
|
||||
+79
-85
@@ -71,6 +71,18 @@
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/*
|
||||
** Define the OS_VXWORKS pre-processor macro to 1 if building on
|
||||
** vxworks, or 0 otherwise.
|
||||
*/
|
||||
#ifndef OS_VXWORKS
|
||||
# if defined(__RTP__) || defined(_WRS_KERNEL)
|
||||
# define OS_VXWORKS 1
|
||||
# else
|
||||
# define OS_VXWORKS 0
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/*
|
||||
** standard include files.
|
||||
*/
|
||||
@@ -85,19 +97,18 @@
|
||||
# include <sys/mman.h>
|
||||
#endif
|
||||
|
||||
#if SQLITE_ENABLE_LOCKING_STYLE
|
||||
#if SQLITE_ENABLE_LOCKING_STYLE || OS_VXWORKS
|
||||
# include <sys/ioctl.h>
|
||||
# include <sys/file.h>
|
||||
# include <sys/param.h>
|
||||
# if OS_VXWORKS
|
||||
# include <semaphore.h>
|
||||
# include <limits.h>
|
||||
# else
|
||||
# include <sys/file.h>
|
||||
# include <sys/param.h>
|
||||
# endif
|
||||
#endif /* SQLITE_ENABLE_LOCKING_STYLE */
|
||||
|
||||
#if OS_VXWORKS
|
||||
# include <sys/ioctl.h>
|
||||
# include <semaphore.h>
|
||||
# include <limits.h>
|
||||
#endif /* OS_VXWORKS */
|
||||
|
||||
#if defined(__APPLE__) || SQLITE_ENABLE_LOCKING_STYLE
|
||||
#if defined(__APPLE__) || (SQLITE_ENABLE_LOCKING_STYLE && !OS_VXWORKS)
|
||||
# include <sys/mount.h>
|
||||
#endif
|
||||
|
||||
@@ -138,10 +149,6 @@
|
||||
*/
|
||||
#define MAX_PATHNAME 512
|
||||
|
||||
/* Always cast the getpid() return type for compatibility with
|
||||
** kernel modules in VxWorks. */
|
||||
#define osGetpid(X) (pid_t)getpid()
|
||||
|
||||
/*
|
||||
** Only set the lastErrno if the error code is a real error and not
|
||||
** a normal expected return code of SQLITE_BUSY or SQLITE_OK
|
||||
@@ -230,7 +237,7 @@ struct unixFile {
|
||||
** method was called. If xOpen() is called from a different process id,
|
||||
** indicating that a fork() has occurred, the PRNG will be reset.
|
||||
*/
|
||||
static pid_t randomnessPid = 0;
|
||||
static int randomnessPid = 0;
|
||||
|
||||
/*
|
||||
** Allowed values for the unixFile.ctrlFlags bitmask:
|
||||
@@ -248,7 +255,6 @@ static pid_t randomnessPid = 0;
|
||||
#define UNIXFILE_URI 0x40 /* Filename might have query parameters */
|
||||
#define UNIXFILE_NOLOCK 0x80 /* Do no file locking */
|
||||
#define UNIXFILE_WARNED 0x0100 /* verifyDbFile() warnings issued */
|
||||
#define UNIXFILE_BLOCK 0x0200 /* Next SHM lock might block */
|
||||
|
||||
/*
|
||||
** Include code that is common to all os_*.c files
|
||||
@@ -379,7 +385,7 @@ static struct unix_syscall {
|
||||
{ "read", (sqlite3_syscall_ptr)read, 0 },
|
||||
#define osRead ((ssize_t(*)(int,void*,size_t))aSyscall[8].pCurrent)
|
||||
|
||||
#if defined(USE_PREAD) || SQLITE_ENABLE_LOCKING_STYLE
|
||||
#if defined(USE_PREAD) || (SQLITE_ENABLE_LOCKING_STYLE && !OS_VXWORKS)
|
||||
{ "pread", (sqlite3_syscall_ptr)pread, 0 },
|
||||
#else
|
||||
{ "pread", (sqlite3_syscall_ptr)0, 0 },
|
||||
@@ -396,7 +402,7 @@ static struct unix_syscall {
|
||||
{ "write", (sqlite3_syscall_ptr)write, 0 },
|
||||
#define osWrite ((ssize_t(*)(int,const void*,size_t))aSyscall[11].pCurrent)
|
||||
|
||||
#if defined(USE_PREAD) || SQLITE_ENABLE_LOCKING_STYLE
|
||||
#if defined(USE_PREAD) || (SQLITE_ENABLE_LOCKING_STYLE && !OS_VXWORKS)
|
||||
{ "pwrite", (sqlite3_syscall_ptr)pwrite, 0 },
|
||||
#else
|
||||
{ "pwrite", (sqlite3_syscall_ptr)0, 0 },
|
||||
@@ -1535,8 +1541,7 @@ static int unixLock(sqlite3_file *id, int eFileLock){
|
||||
assert( pFile );
|
||||
OSTRACE(("LOCK %d %s was %s(%s,%d) pid=%d (unix)\n", pFile->h,
|
||||
azFileLock(eFileLock), azFileLock(pFile->eFileLock),
|
||||
azFileLock(pFile->pInode->eFileLock), pFile->pInode->nShared,
|
||||
osGetpid()));
|
||||
azFileLock(pFile->pInode->eFileLock), pFile->pInode->nShared , getpid()));
|
||||
|
||||
/* If there is already a lock of this type or more restrictive on the
|
||||
** unixFile, do nothing. Don't use the end_lock: exit path, as
|
||||
@@ -1744,7 +1749,7 @@ static int posixUnlock(sqlite3_file *id, int eFileLock, int handleNFSUnlock){
|
||||
assert( pFile );
|
||||
OSTRACE(("UNLOCK %d %d was %d(%d,%d) pid=%d (unix)\n", pFile->h, eFileLock,
|
||||
pFile->eFileLock, pFile->pInode->eFileLock, pFile->pInode->nShared,
|
||||
osGetpid()));
|
||||
getpid()));
|
||||
|
||||
assert( eFileLock<=SHARED_LOCK );
|
||||
if( pFile->eFileLock<=eFileLock ){
|
||||
@@ -2171,7 +2176,7 @@ static int dotlockUnlock(sqlite3_file *id, int eFileLock) {
|
||||
|
||||
assert( pFile );
|
||||
OSTRACE(("UNLOCK %d %d was %d pid=%d (dotlock)\n", pFile->h, eFileLock,
|
||||
pFile->eFileLock, osGetpid()));
|
||||
pFile->eFileLock, getpid()));
|
||||
assert( eFileLock<=SHARED_LOCK );
|
||||
|
||||
/* no-op if possible */
|
||||
@@ -2234,9 +2239,10 @@ static int dotlockClose(sqlite3_file *id) {
|
||||
** still works when you do this, but concurrency is reduced since
|
||||
** only a single process can be reading the database at a time.
|
||||
**
|
||||
** Omit this section if SQLITE_ENABLE_LOCKING_STYLE is turned off
|
||||
** Omit this section if SQLITE_ENABLE_LOCKING_STYLE is turned off or if
|
||||
** compiling for VXWORKS.
|
||||
*/
|
||||
#if SQLITE_ENABLE_LOCKING_STYLE
|
||||
#if SQLITE_ENABLE_LOCKING_STYLE && !OS_VXWORKS
|
||||
|
||||
/*
|
||||
** Retry flock() calls that fail with EINTR
|
||||
@@ -2389,7 +2395,7 @@ static int flockUnlock(sqlite3_file *id, int eFileLock) {
|
||||
|
||||
assert( pFile );
|
||||
OSTRACE(("UNLOCK %d %d was %d pid=%d (flock)\n", pFile->h, eFileLock,
|
||||
pFile->eFileLock, osGetpid()));
|
||||
pFile->eFileLock, getpid()));
|
||||
assert( eFileLock<=SHARED_LOCK );
|
||||
|
||||
/* no-op if possible */
|
||||
@@ -2450,7 +2456,7 @@ static int flockClose(sqlite3_file *id) {
|
||||
** to a non-zero value otherwise *pResOut is set to zero. The return value
|
||||
** is set to SQLITE_OK unless an I/O error occurs during lock checking.
|
||||
*/
|
||||
static int semXCheckReservedLock(sqlite3_file *id, int *pResOut) {
|
||||
static int semCheckReservedLock(sqlite3_file *id, int *pResOut) {
|
||||
int rc = SQLITE_OK;
|
||||
int reserved = 0;
|
||||
unixFile *pFile = (unixFile*)id;
|
||||
@@ -2517,7 +2523,7 @@ static int semXCheckReservedLock(sqlite3_file *id, int *pResOut) {
|
||||
** This routine will only increase a lock. Use the sqlite3OsUnlock()
|
||||
** routine to lower a locking level.
|
||||
*/
|
||||
static int semXLock(sqlite3_file *id, int eFileLock) {
|
||||
static int semLock(sqlite3_file *id, int eFileLock) {
|
||||
unixFile *pFile = (unixFile*)id;
|
||||
sem_t *pSem = pFile->pInode->pSem;
|
||||
int rc = SQLITE_OK;
|
||||
@@ -2550,14 +2556,14 @@ static int semXLock(sqlite3_file *id, int eFileLock) {
|
||||
** If the locking level of the file descriptor is already at or below
|
||||
** the requested locking level, this routine is a no-op.
|
||||
*/
|
||||
static int semXUnlock(sqlite3_file *id, int eFileLock) {
|
||||
static int semUnlock(sqlite3_file *id, int eFileLock) {
|
||||
unixFile *pFile = (unixFile*)id;
|
||||
sem_t *pSem = pFile->pInode->pSem;
|
||||
|
||||
assert( pFile );
|
||||
assert( pSem );
|
||||
OSTRACE(("UNLOCK %d %d was %d pid=%d (sem)\n", pFile->h, eFileLock,
|
||||
pFile->eFileLock, osGetpid()));
|
||||
pFile->eFileLock, getpid()));
|
||||
assert( eFileLock<=SHARED_LOCK );
|
||||
|
||||
/* no-op if possible */
|
||||
@@ -2587,10 +2593,10 @@ static int semXUnlock(sqlite3_file *id, int eFileLock) {
|
||||
/*
|
||||
** Close a file.
|
||||
*/
|
||||
static int semXClose(sqlite3_file *id) {
|
||||
static int semClose(sqlite3_file *id) {
|
||||
if( id ){
|
||||
unixFile *pFile = (unixFile*)id;
|
||||
semXUnlock(id, NO_LOCK);
|
||||
semUnlock(id, NO_LOCK);
|
||||
assert( pFile );
|
||||
unixEnterMutex();
|
||||
releaseInodeInfo(pFile);
|
||||
@@ -2771,7 +2777,7 @@ static int afpLock(sqlite3_file *id, int eFileLock){
|
||||
assert( pFile );
|
||||
OSTRACE(("LOCK %d %s was %s(%s,%d) pid=%d (afp)\n", pFile->h,
|
||||
azFileLock(eFileLock), azFileLock(pFile->eFileLock),
|
||||
azFileLock(pInode->eFileLock), pInode->nShared , osGetpid()));
|
||||
azFileLock(pInode->eFileLock), pInode->nShared , getpid()));
|
||||
|
||||
/* If there is already a lock of this type or more restrictive on the
|
||||
** unixFile, do nothing. Don't use the afp_end_lock: exit path, as
|
||||
@@ -2957,7 +2963,7 @@ static int afpUnlock(sqlite3_file *id, int eFileLock) {
|
||||
assert( pFile );
|
||||
OSTRACE(("UNLOCK %d %d was %d(%d,%d) pid=%d (afp)\n", pFile->h, eFileLock,
|
||||
pFile->eFileLock, pFile->pInode->eFileLock, pFile->pInode->nShared,
|
||||
osGetpid()));
|
||||
getpid()));
|
||||
|
||||
assert( eFileLock<=SHARED_LOCK );
|
||||
if( pFile->eFileLock<=eFileLock ){
|
||||
@@ -3996,9 +4002,7 @@ static int unixDeviceCharacteristics(sqlite3_file *id){
|
||||
** Instead, it should be called via macro osGetpagesize().
|
||||
*/
|
||||
static int unixGetpagesize(void){
|
||||
#if OS_VXWORKS
|
||||
return 1024;
|
||||
#elif defined(_BSD_SOURCE)
|
||||
#if defined(_BSD_SOURCE)
|
||||
return getpagesize();
|
||||
#else
|
||||
return (int)sysconf(_SC_PAGESIZE);
|
||||
@@ -4091,17 +4095,15 @@ struct unixShm {
|
||||
** otherwise.
|
||||
*/
|
||||
static int unixShmSystemLock(
|
||||
unixFile *pFile, /* Open connection to the WAL file */
|
||||
unixShmNode *pShmNode, /* Apply locks to this open shared-memory segment */
|
||||
int lockType, /* F_UNLCK, F_RDLCK, or F_WRLCK */
|
||||
int ofst, /* First byte of the locking range */
|
||||
int n /* Number of bytes to lock */
|
||||
){
|
||||
unixShmNode *pShmNode; /* Apply locks to this open shared-memory segment */
|
||||
struct flock f; /* The posix advisory locking structure */
|
||||
int rc = SQLITE_OK; /* Result code form fcntl() */
|
||||
struct flock f; /* The posix advisory locking structure */
|
||||
int rc = SQLITE_OK; /* Result code form fcntl() */
|
||||
|
||||
/* Access to the unixShmNode object is serialized by the caller */
|
||||
pShmNode = pFile->pInode->pShmNode;
|
||||
assert( sqlite3_mutex_held(pShmNode->mutex) || pShmNode->nRef==0 );
|
||||
|
||||
/* Shared locks never span more than one byte */
|
||||
@@ -4111,7 +4113,6 @@ static int unixShmSystemLock(
|
||||
assert( n>=1 && n<SQLITE_SHM_NLOCK );
|
||||
|
||||
if( pShmNode->h>=0 ){
|
||||
int lkType;
|
||||
/* Initialize the locking parameters */
|
||||
memset(&f, 0, sizeof(f));
|
||||
f.l_type = lockType;
|
||||
@@ -4119,10 +4120,8 @@ static int unixShmSystemLock(
|
||||
f.l_start = ofst;
|
||||
f.l_len = n;
|
||||
|
||||
lkType = (pFile->ctrlFlags & UNIXFILE_BLOCK)!=0 ? F_SETLKW : F_SETLK;
|
||||
rc = osFcntl(pShmNode->h, lkType, &f);
|
||||
rc = osFcntl(pShmNode->h, F_SETLK, &f);
|
||||
rc = (rc!=(-1)) ? SQLITE_OK : SQLITE_BUSY;
|
||||
pFile->ctrlFlags &= ~UNIXFILE_BLOCK;
|
||||
}
|
||||
|
||||
/* Update the global lock state and do debug tracing */
|
||||
@@ -4332,13 +4331,13 @@ static int unixOpenSharedMemory(unixFile *pDbFd){
|
||||
** If not, truncate the file to zero length.
|
||||
*/
|
||||
rc = SQLITE_OK;
|
||||
if( unixShmSystemLock(pDbFd, F_WRLCK, UNIX_SHM_DMS, 1)==SQLITE_OK ){
|
||||
if( unixShmSystemLock(pShmNode, F_WRLCK, UNIX_SHM_DMS, 1)==SQLITE_OK ){
|
||||
if( robust_ftruncate(pShmNode->h, 0) ){
|
||||
rc = unixLogError(SQLITE_IOERR_SHMOPEN, "ftruncate", zShmFilename);
|
||||
}
|
||||
}
|
||||
if( rc==SQLITE_OK ){
|
||||
rc = unixShmSystemLock(pDbFd, F_RDLCK, UNIX_SHM_DMS, 1);
|
||||
rc = unixShmSystemLock(pShmNode, F_RDLCK, UNIX_SHM_DMS, 1);
|
||||
}
|
||||
if( rc ) goto shm_open_err;
|
||||
}
|
||||
@@ -4570,7 +4569,7 @@ static int unixShmLock(
|
||||
|
||||
/* Unlock the system-level locks */
|
||||
if( (mask & allMask)==0 ){
|
||||
rc = unixShmSystemLock(pDbFd, F_UNLCK, ofst+UNIX_SHM_BASE, n);
|
||||
rc = unixShmSystemLock(pShmNode, F_UNLCK, ofst+UNIX_SHM_BASE, n);
|
||||
}else{
|
||||
rc = SQLITE_OK;
|
||||
}
|
||||
@@ -4598,7 +4597,7 @@ static int unixShmLock(
|
||||
/* Get shared locks at the system level, if necessary */
|
||||
if( rc==SQLITE_OK ){
|
||||
if( (allShared & mask)==0 ){
|
||||
rc = unixShmSystemLock(pDbFd, F_RDLCK, ofst+UNIX_SHM_BASE, n);
|
||||
rc = unixShmSystemLock(pShmNode, F_RDLCK, ofst+UNIX_SHM_BASE, n);
|
||||
}else{
|
||||
rc = SQLITE_OK;
|
||||
}
|
||||
@@ -4623,7 +4622,7 @@ static int unixShmLock(
|
||||
** also mark the local connection as being locked.
|
||||
*/
|
||||
if( rc==SQLITE_OK ){
|
||||
rc = unixShmSystemLock(pDbFd, F_WRLCK, ofst+UNIX_SHM_BASE, n);
|
||||
rc = unixShmSystemLock(pShmNode, F_WRLCK, ofst+UNIX_SHM_BASE, n);
|
||||
if( rc==SQLITE_OK ){
|
||||
assert( (p->sharedMask & mask)==0 );
|
||||
p->exclMask |= mask;
|
||||
@@ -4632,7 +4631,7 @@ static int unixShmLock(
|
||||
}
|
||||
sqlite3_mutex_leave(pShmNode->mutex);
|
||||
OSTRACE(("SHM-LOCK shmid-%d, pid-%d got %03x,%03x\n",
|
||||
p->id, osGetpid(), p->sharedMask, p->exclMask));
|
||||
p->id, getpid(), p->sharedMask, p->exclMask));
|
||||
return rc;
|
||||
}
|
||||
|
||||
@@ -5035,7 +5034,7 @@ IOMETHODS(
|
||||
0 /* xShmMap method */
|
||||
)
|
||||
|
||||
#if SQLITE_ENABLE_LOCKING_STYLE
|
||||
#if SQLITE_ENABLE_LOCKING_STYLE && !OS_VXWORKS
|
||||
IOMETHODS(
|
||||
flockIoFinder, /* Finder function name */
|
||||
flockIoMethods, /* sqlite3_io_methods object name */
|
||||
@@ -5053,10 +5052,10 @@ IOMETHODS(
|
||||
semIoFinder, /* Finder function name */
|
||||
semIoMethods, /* sqlite3_io_methods object name */
|
||||
1, /* shared memory is disabled */
|
||||
semXClose, /* xClose method */
|
||||
semXLock, /* xLock method */
|
||||
semXUnlock, /* xUnlock method */
|
||||
semXCheckReservedLock, /* xCheckReservedLock method */
|
||||
semClose, /* xClose method */
|
||||
semLock, /* xLock method */
|
||||
semUnlock, /* xUnlock method */
|
||||
semCheckReservedLock, /* xCheckReservedLock method */
|
||||
0 /* xShmMap method */
|
||||
)
|
||||
#endif
|
||||
@@ -5180,13 +5179,15 @@ static const sqlite3_io_methods
|
||||
|
||||
#endif /* defined(__APPLE__) && SQLITE_ENABLE_LOCKING_STYLE */
|
||||
|
||||
#if OS_VXWORKS
|
||||
/*
|
||||
** This "finder" function for VxWorks checks to see if posix advisory
|
||||
** locking works. If it does, then that is what is used. If it does not
|
||||
** work, then fallback to named semaphore locking.
|
||||
#if OS_VXWORKS && SQLITE_ENABLE_LOCKING_STYLE
|
||||
/*
|
||||
** This "finder" function attempts to determine the best locking strategy
|
||||
** for the database file "filePath". It then returns the sqlite3_io_methods
|
||||
** object that implements that strategy.
|
||||
**
|
||||
** This is for VXWorks only.
|
||||
*/
|
||||
static const sqlite3_io_methods *vxworksIoFinderImpl(
|
||||
static const sqlite3_io_methods *autolockIoFinderImpl(
|
||||
const char *filePath, /* name of the database file */
|
||||
unixFile *pNew /* the open file object */
|
||||
){
|
||||
@@ -5212,9 +5213,9 @@ static const sqlite3_io_methods *vxworksIoFinderImpl(
|
||||
}
|
||||
}
|
||||
static const sqlite3_io_methods
|
||||
*(*const vxworksIoFinder)(const char*,unixFile*) = vxworksIoFinderImpl;
|
||||
*(*const autolockIoFinder)(const char*,unixFile*) = autolockIoFinderImpl;
|
||||
|
||||
#endif /* OS_VXWORKS */
|
||||
#endif /* OS_VXWORKS && SQLITE_ENABLE_LOCKING_STYLE */
|
||||
|
||||
/*
|
||||
** An abstract type for a pointer to an IO method finder function:
|
||||
@@ -5727,8 +5728,8 @@ static int unixOpen(
|
||||
** the same instant might all reset the PRNG. But multiple resets
|
||||
** are harmless.
|
||||
*/
|
||||
if( randomnessPid!=osGetpid() ){
|
||||
randomnessPid = osGetpid();
|
||||
if( randomnessPid!=getpid() ){
|
||||
randomnessPid = getpid();
|
||||
sqlite3_randomness(0,0);
|
||||
}
|
||||
|
||||
@@ -6119,7 +6120,7 @@ static int unixRandomness(sqlite3_vfs *NotUsed, int nBuf, char *zBuf){
|
||||
** tests repeatable.
|
||||
*/
|
||||
memset(zBuf, 0, nBuf);
|
||||
randomnessPid = osGetpid();
|
||||
randomnessPid = getpid();
|
||||
#if !defined(SQLITE_TEST)
|
||||
{
|
||||
int fd, got;
|
||||
@@ -6440,7 +6441,7 @@ static int proxyGetLockPath(const char *dbPath, char *lPath, size_t maxLen){
|
||||
{
|
||||
if( !confstr(_CS_DARWIN_USER_TEMP_DIR, lPath, maxLen) ){
|
||||
OSTRACE(("GETLOCKPATH failed %s errno=%d pid=%d\n",
|
||||
lPath, errno, osGetpid()));
|
||||
lPath, errno, getpid()));
|
||||
return SQLITE_IOERR_LOCK;
|
||||
}
|
||||
len = strlcat(lPath, "sqliteplocks", maxLen);
|
||||
@@ -6462,7 +6463,7 @@ static int proxyGetLockPath(const char *dbPath, char *lPath, size_t maxLen){
|
||||
}
|
||||
lPath[i+len]='\0';
|
||||
strlcat(lPath, ":auto:", maxLen);
|
||||
OSTRACE(("GETLOCKPATH proxy lock path=%s pid=%d\n", lPath, osGetpid()));
|
||||
OSTRACE(("GETLOCKPATH proxy lock path=%s pid=%d\n", lPath, getpid()));
|
||||
return SQLITE_OK;
|
||||
}
|
||||
|
||||
@@ -6489,7 +6490,7 @@ static int proxyCreateLockPath(const char *lockPath){
|
||||
if( err!=EEXIST ) {
|
||||
OSTRACE(("CREATELOCKPATH FAILED creating %s, "
|
||||
"'%s' proxy lock path=%s pid=%d\n",
|
||||
buf, strerror(err), lockPath, osGetpid()));
|
||||
buf, strerror(err), lockPath, getpid()));
|
||||
return err;
|
||||
}
|
||||
}
|
||||
@@ -6498,7 +6499,7 @@ static int proxyCreateLockPath(const char *lockPath){
|
||||
}
|
||||
buf[i] = lockPath[i];
|
||||
}
|
||||
OSTRACE(("CREATELOCKPATH proxy lock path=%s pid=%d\n", lockPath, osGetpid()));
|
||||
OSTRACE(("CREATELOCKPATH proxy lock path=%s pid=%d\n", lockPath, getpid()));
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -6803,8 +6804,7 @@ static int proxyTakeConch(unixFile *pFile){
|
||||
int forceNewLockPath = 0;
|
||||
|
||||
OSTRACE(("TAKECONCH %d for %s pid=%d\n", conchFile->h,
|
||||
(pCtx->lockProxyPath ? pCtx->lockProxyPath : ":auto:"),
|
||||
osGetpid()));
|
||||
(pCtx->lockProxyPath ? pCtx->lockProxyPath : ":auto:"), getpid()));
|
||||
|
||||
rc = proxyGetHostID(myHostID, &pError);
|
||||
if( (rc&0xff)==SQLITE_IOERR ){
|
||||
@@ -7014,7 +7014,7 @@ static int proxyReleaseConch(unixFile *pFile){
|
||||
conchFile = pCtx->conchFile;
|
||||
OSTRACE(("RELEASECONCH %d for %s pid=%d\n", conchFile->h,
|
||||
(pCtx->lockProxyPath ? pCtx->lockProxyPath : ":auto:"),
|
||||
osGetpid()));
|
||||
getpid()));
|
||||
if( pCtx->conchHeld>0 ){
|
||||
rc = conchFile->pMethod->xUnlock((sqlite3_file*)conchFile, NO_LOCK);
|
||||
}
|
||||
@@ -7156,7 +7156,7 @@ static int proxyTransformUnixFile(unixFile *pFile, const char *path) {
|
||||
}
|
||||
|
||||
OSTRACE(("TRANSPROXY %d for %s pid=%d\n", pFile->h,
|
||||
(lockPath ? lockPath : ":auto:"), osGetpid()));
|
||||
(lockPath ? lockPath : ":auto:"), getpid()));
|
||||
|
||||
pCtx = sqlite3_malloc( sizeof(*pCtx) );
|
||||
if( pCtx==0 ){
|
||||
@@ -7228,10 +7228,6 @@ static int proxyTransformUnixFile(unixFile *pFile, const char *path) {
|
||||
*/
|
||||
static int proxyFileControl(sqlite3_file *id, int op, void *pArg){
|
||||
switch( op ){
|
||||
case SQLITE_FCNTL_WAL_BLOCK: {
|
||||
id->ctrlFlags |= UNIXFILE_BLOCK;
|
||||
return SQLITE_OK;
|
||||
}
|
||||
case SQLITE_FCNTL_GET_LOCKPROXYFILE: {
|
||||
unixFile *pFile = (unixFile*)id;
|
||||
if( pFile->pMethod == &proxyIoMethods ){
|
||||
@@ -7501,10 +7497,8 @@ int sqlite3_os_init(void){
|
||||
** array cannot be const.
|
||||
*/
|
||||
static sqlite3_vfs aVfs[] = {
|
||||
#if SQLITE_ENABLE_LOCKING_STYLE && defined(__APPLE__)
|
||||
#if SQLITE_ENABLE_LOCKING_STYLE && (OS_VXWORKS || defined(__APPLE__))
|
||||
UNIXVFS("unix", autolockIoFinder ),
|
||||
#elif OS_VXWORKS
|
||||
UNIXVFS("unix", vxworksIoFinder ),
|
||||
#else
|
||||
UNIXVFS("unix", posixIoFinder ),
|
||||
#endif
|
||||
@@ -7514,12 +7508,12 @@ int sqlite3_os_init(void){
|
||||
#if OS_VXWORKS
|
||||
UNIXVFS("unix-namedsem", semIoFinder ),
|
||||
#endif
|
||||
#if SQLITE_ENABLE_LOCKING_STYLE || OS_VXWORKS
|
||||
UNIXVFS("unix-posix", posixIoFinder ),
|
||||
#endif
|
||||
#if SQLITE_ENABLE_LOCKING_STYLE
|
||||
UNIXVFS("unix-posix", posixIoFinder ),
|
||||
#if !OS_VXWORKS
|
||||
UNIXVFS("unix-flock", flockIoFinder ),
|
||||
#endif
|
||||
#endif
|
||||
#if SQLITE_ENABLE_LOCKING_STYLE && defined(__APPLE__)
|
||||
UNIXVFS("unix-afp", afpIoFinder ),
|
||||
UNIXVFS("unix-nfs", nfsIoFinder ),
|
||||
|
||||
+1
-9
@@ -114,20 +114,12 @@ static void pcacheUnpin(PgHdr *p){
|
||||
}
|
||||
|
||||
/*
|
||||
** Compute the number of pages of cache requested. p->szCache is the
|
||||
** cache size requested by the "PRAGMA cache_size" statement.
|
||||
**
|
||||
**
|
||||
** Compute the number of pages of cache requested.
|
||||
*/
|
||||
static int numberOfCachePages(PCache *p){
|
||||
if( p->szCache>=0 ){
|
||||
/* IMPLEMENTATION-OF: R-42059-47211 If the argument N is positive then the
|
||||
** suggested cache size is set to N. */
|
||||
return p->szCache;
|
||||
}else{
|
||||
/* IMPLEMENTATION-OF: R-61436-13639 If the argument N is negative, then
|
||||
** the number of cache pages is adjusted to use approximately abs(N*1024)
|
||||
** bytes of memory. */
|
||||
return (int)((-1024*(i64)p->szCache)/(p->szPage+p->szExtra));
|
||||
}
|
||||
}
|
||||
|
||||
+14
-42
@@ -317,17 +317,6 @@ void sqlite3Pragma(
|
||||
/* Send an SQLITE_FCNTL_PRAGMA file-control to the underlying VFS
|
||||
** connection. If it returns SQLITE_OK, then assume that the VFS
|
||||
** handled the pragma and generate a no-op prepared statement.
|
||||
**
|
||||
** IMPLEMENTATION-OF: R-12238-55120 Whenever a PRAGMA statement is parsed,
|
||||
** an SQLITE_FCNTL_PRAGMA file control is sent to the open sqlite3_file
|
||||
** object corresponding to the database file to which the pragma
|
||||
** statement refers.
|
||||
**
|
||||
** IMPLEMENTATION-OF: R-29875-31678 The argument to the SQLITE_FCNTL_PRAGMA
|
||||
** file control is an array of pointers to strings (char**) in which the
|
||||
** second element of the array is the name of the pragma and the third
|
||||
** element is the argument to the pragma or NULL if the pragma has no
|
||||
** argument.
|
||||
*/
|
||||
aFcntl[0] = 0;
|
||||
aFcntl[1] = zLeft;
|
||||
@@ -1088,27 +1077,17 @@ void sqlite3Pragma(
|
||||
pIdx = sqlite3FindIndex(db, zRight, zDb);
|
||||
if( pIdx ){
|
||||
int i;
|
||||
int mx;
|
||||
if( pPragma->iArg ){
|
||||
/* PRAGMA index_xinfo (newer version with more rows and columns) */
|
||||
mx = pIdx->nColumn;
|
||||
pParse->nMem = 6;
|
||||
}else{
|
||||
/* PRAGMA index_info (legacy version) */
|
||||
mx = pIdx->nKeyCol;
|
||||
pParse->nMem = 3;
|
||||
}
|
||||
int mx = pPragma->iArg ? pIdx->nColumn : pIdx->nKeyCol;
|
||||
pTab = pIdx->pTable;
|
||||
sqlite3VdbeSetNumCols(v, pParse->nMem);
|
||||
sqlite3VdbeSetNumCols(v, 6);
|
||||
pParse->nMem = 6;
|
||||
sqlite3CodeVerifySchema(pParse, iDb);
|
||||
sqlite3VdbeSetColName(v, 0, COLNAME_NAME, "seqno", SQLITE_STATIC);
|
||||
sqlite3VdbeSetColName(v, 1, COLNAME_NAME, "cid", SQLITE_STATIC);
|
||||
sqlite3VdbeSetColName(v, 2, COLNAME_NAME, "name", SQLITE_STATIC);
|
||||
if( pPragma->iArg ){
|
||||
sqlite3VdbeSetColName(v, 3, COLNAME_NAME, "desc", SQLITE_STATIC);
|
||||
sqlite3VdbeSetColName(v, 4, COLNAME_NAME, "coll", SQLITE_STATIC);
|
||||
sqlite3VdbeSetColName(v, 5, COLNAME_NAME, "key", SQLITE_STATIC);
|
||||
}
|
||||
sqlite3VdbeSetColName(v, 3, COLNAME_NAME, "desc", SQLITE_STATIC);
|
||||
sqlite3VdbeSetColName(v, 4, COLNAME_NAME, "coll", SQLITE_STATIC);
|
||||
sqlite3VdbeSetColName(v, 5, COLNAME_NAME, "key", SQLITE_STATIC);
|
||||
for(i=0; i<mx; i++){
|
||||
i16 cnum = pIdx->aiColumn[i];
|
||||
sqlite3VdbeAddOp2(v, OP_Integer, i, 1);
|
||||
@@ -1118,12 +1097,10 @@ void sqlite3Pragma(
|
||||
}else{
|
||||
sqlite3VdbeAddOp4(v, OP_String8, 0, 3, 0, pTab->aCol[cnum].zName, 0);
|
||||
}
|
||||
if( pPragma->iArg ){
|
||||
sqlite3VdbeAddOp2(v, OP_Integer, pIdx->aSortOrder[i], 4);
|
||||
sqlite3VdbeAddOp4(v, OP_String8, 0, 5, 0, pIdx->azColl[i], 0);
|
||||
sqlite3VdbeAddOp2(v, OP_Integer, i<pIdx->nKeyCol, 6);
|
||||
}
|
||||
sqlite3VdbeAddOp2(v, OP_ResultRow, 1, pParse->nMem);
|
||||
sqlite3VdbeAddOp2(v, OP_Integer, pIdx->aSortOrder[i], 4);
|
||||
sqlite3VdbeAddOp4(v, OP_String8, 0, 5, 0, pIdx->azColl[i], 0);
|
||||
sqlite3VdbeAddOp2(v, OP_Integer, i<pIdx->nKeyCol, 6);
|
||||
sqlite3VdbeAddOp2(v, OP_ResultRow, 1, 6);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1825,9 +1802,8 @@ void sqlite3Pragma(
|
||||
/*
|
||||
** PRAGMA shrink_memory
|
||||
**
|
||||
** IMPLEMENTATION-OF: R-23445-46109 This pragma causes the database
|
||||
** connection on which it is invoked to free up as much memory as it
|
||||
** can, by calling sqlite3_db_release_memory().
|
||||
** This pragma attempts to free as much memory as possible from the
|
||||
** current database connection.
|
||||
*/
|
||||
case PragTyp_SHRINK_MEMORY: {
|
||||
sqlite3_db_release_memory(db);
|
||||
@@ -1856,12 +1832,8 @@ void sqlite3Pragma(
|
||||
** PRAGMA soft_heap_limit
|
||||
** PRAGMA soft_heap_limit = N
|
||||
**
|
||||
** IMPLEMENTATION-OF: R-26343-45930 This pragma invokes the
|
||||
** sqlite3_soft_heap_limit64() interface with the argument N, if N is
|
||||
** specified and is a non-negative integer.
|
||||
** IMPLEMENTATION-OF: R-64451-07163 The soft_heap_limit pragma always
|
||||
** returns the same integer that would be returned by the
|
||||
** sqlite3_soft_heap_limit64(-1) C-language function.
|
||||
** Call sqlite3_soft_heap_limit64(N). Return the result. If N is omitted,
|
||||
** use -1.
|
||||
*/
|
||||
case PragTyp_SOFT_HEAP_LIMIT: {
|
||||
sqlite3_int64 N;
|
||||
|
||||
+11
-8
@@ -563,17 +563,20 @@ static void pushOntoSorter(
|
||||
}
|
||||
sqlite3VdbeAddOp2(v, op, pSort->iECursor, regRecord);
|
||||
if( pSelect->iLimit ){
|
||||
int addr;
|
||||
int addr1, addr2;
|
||||
int iLimit;
|
||||
if( pSelect->iOffset ){
|
||||
iLimit = pSelect->iOffset+1;
|
||||
}else{
|
||||
iLimit = pSelect->iLimit;
|
||||
}
|
||||
addr = sqlite3VdbeAddOp3(v, OP_IfNotZero, iLimit, 0, -1); VdbeCoverage(v);
|
||||
addr1 = sqlite3VdbeAddOp1(v, OP_IfZero, iLimit); VdbeCoverage(v);
|
||||
sqlite3VdbeAddOp2(v, OP_AddImm, iLimit, -1);
|
||||
addr2 = sqlite3VdbeAddOp0(v, OP_Goto);
|
||||
sqlite3VdbeJumpHere(v, addr1);
|
||||
sqlite3VdbeAddOp1(v, OP_Last, pSort->iECursor);
|
||||
sqlite3VdbeAddOp1(v, OP_Delete, pSort->iECursor);
|
||||
sqlite3VdbeJumpHere(v, addr);
|
||||
sqlite3VdbeJumpHere(v, addr2);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -970,7 +973,7 @@ static void selectInnerLoop(
|
||||
** the output for us.
|
||||
*/
|
||||
if( pSort==0 && p->iLimit ){
|
||||
sqlite3VdbeAddOp2(v, OP_DecrJumpZero, p->iLimit, iBreak); VdbeCoverage(v);
|
||||
sqlite3VdbeAddOp3(v, OP_IfZero, p->iLimit, iBreak, -1); VdbeCoverage(v);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1823,7 +1826,7 @@ static void computeLimitRegisters(Parse *pParse, Select *p, int iBreak){
|
||||
sqlite3ExprCode(pParse, p->pLimit, iLimit);
|
||||
sqlite3VdbeAddOp1(v, OP_MustBeInt, iLimit); VdbeCoverage(v);
|
||||
VdbeComment((v, "LIMIT counter"));
|
||||
sqlite3VdbeAddOp2(v, OP_IfNot, iLimit, iBreak); VdbeCoverage(v);
|
||||
sqlite3VdbeAddOp2(v, OP_IfZero, iLimit, iBreak); VdbeCoverage(v);
|
||||
}
|
||||
if( p->pOffset ){
|
||||
p->iOffset = iOffset = ++pParse->nMem;
|
||||
@@ -2042,7 +2045,7 @@ static void generateWithRecursiveQuery(
|
||||
selectInnerLoop(pParse, p, p->pEList, iCurrent,
|
||||
0, 0, pDest, addrCont, addrBreak);
|
||||
if( regLimit ){
|
||||
sqlite3VdbeAddOp2(v, OP_DecrJumpZero, regLimit, addrBreak);
|
||||
sqlite3VdbeAddOp3(v, OP_IfZero, regLimit, addrBreak, -1);
|
||||
VdbeCoverage(v);
|
||||
}
|
||||
sqlite3VdbeResolveLabel(v, addrCont);
|
||||
@@ -2267,7 +2270,7 @@ static int multiSelect(
|
||||
p->iLimit = pPrior->iLimit;
|
||||
p->iOffset = pPrior->iOffset;
|
||||
if( p->iLimit ){
|
||||
addr = sqlite3VdbeAddOp1(v, OP_IfNot, p->iLimit); VdbeCoverage(v);
|
||||
addr = sqlite3VdbeAddOp1(v, OP_IfZero, p->iLimit); VdbeCoverage(v);
|
||||
VdbeComment((v, "Jump ahead if LIMIT reached"));
|
||||
}
|
||||
explainSetInteger(iSub2, pParse->iNextSelectId);
|
||||
@@ -2668,7 +2671,7 @@ static int generateOutputSubroutine(
|
||||
/* Jump to the end of the loop if the LIMIT is reached.
|
||||
*/
|
||||
if( p->iLimit ){
|
||||
sqlite3VdbeAddOp2(v, OP_DecrJumpZero, p->iLimit, iBreak); VdbeCoverage(v);
|
||||
sqlite3VdbeAddOp3(v, OP_IfZero, p->iLimit, iBreak, -1); VdbeCoverage(v);
|
||||
}
|
||||
|
||||
/* Generate the subroutine return
|
||||
|
||||
+68
-65
@@ -24,13 +24,6 @@
|
||||
#include "msvc.h"
|
||||
#endif
|
||||
|
||||
/*
|
||||
** No support for loadable extensions in VxWorks.
|
||||
*/
|
||||
#if defined(_WRS_KERNEL) && !SQLITE_OMIT_LOAD_EXTENSION
|
||||
# define SQLITE_OMIT_LOAD_EXTENSION 1
|
||||
#endif
|
||||
|
||||
/*
|
||||
** Enable large-file support for fopen() and friends on unix.
|
||||
*/
|
||||
@@ -114,15 +107,10 @@
|
||||
*/
|
||||
extern int isatty(int);
|
||||
|
||||
#if !defined(__RTP__) && !defined(_WRS_KERNEL)
|
||||
/* popen and pclose are not C89 functions and so are sometimes omitted from
|
||||
** the <stdio.h> header */
|
||||
extern FILE *popen(const char*,const char*);
|
||||
extern int pclose(FILE*);
|
||||
#else
|
||||
# define SQLITE_OMIT_POPEN 1
|
||||
#endif
|
||||
|
||||
/* popen and pclose are not C89 functions and so are sometimes omitted from
|
||||
** the <stdio.h> header */
|
||||
extern FILE *popen(const char*,const char*);
|
||||
extern int pclose(FILE*);
|
||||
#endif
|
||||
|
||||
#if defined(_WIN32_WCE)
|
||||
@@ -177,19 +165,11 @@ static sqlite3_int64 timeOfDay(void){
|
||||
return t;
|
||||
}
|
||||
|
||||
#if !defined(_WIN32) && !defined(WIN32) && !defined(__minux)
|
||||
#if !defined(_WIN32) && !defined(WIN32) && !defined(_WRS_KERNEL) \
|
||||
&& !defined(__minux)
|
||||
#include <sys/time.h>
|
||||
#include <sys/resource.h>
|
||||
|
||||
/* VxWorks does not support getrusage() as far as we can determine */
|
||||
#if defined(_WRS_KERNEL) || defined(__RTP__)
|
||||
struct rusage {
|
||||
struct timeval ru_utime; /* user CPU time used */
|
||||
struct timeval ru_stime; /* system CPU time used */
|
||||
};
|
||||
#define getrusage(A,B) memset(B,0,sizeof(*B))
|
||||
#endif
|
||||
|
||||
/* Saved resource information for the beginning of an operation */
|
||||
static struct rusage sBegin; /* CPU time at start */
|
||||
static sqlite3_int64 iBegin; /* Wall-clock time at start */
|
||||
@@ -215,8 +195,8 @@ static double timeDiff(struct timeval *pStart, struct timeval *pEnd){
|
||||
*/
|
||||
static void endTimer(void){
|
||||
if( enableTimer ){
|
||||
sqlite3_int64 iEnd = timeOfDay();
|
||||
struct rusage sEnd;
|
||||
sqlite3_int64 iEnd = timeOfDay();
|
||||
getrusage(RUSAGE_SELF, &sEnd);
|
||||
printf("Run Time: real %.3f user %f sys %f\n",
|
||||
(iEnd - iBegin)*0.001,
|
||||
@@ -808,6 +788,48 @@ static void interrupt_handler(int NotUsed){
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
** Return the length of a string in characters. Multibyte UTF8 characters
|
||||
** count as a single character.
|
||||
*/
|
||||
static int strlenChar(const char *z){
|
||||
int n = 0;
|
||||
while( *z ){
|
||||
if( (0xc0&*(z++))!=0x80 ) n++;
|
||||
}
|
||||
return n;
|
||||
}
|
||||
|
||||
/*
|
||||
** Print abs(w) characters of string "z" on FILE "out".
|
||||
**
|
||||
** w is in units of characters, not bytes!
|
||||
**
|
||||
** The output is always exactly abs(w) characters wide. If z contains
|
||||
** more than abs(w) characters, it is truncated. If z contains fewer
|
||||
** than abs(w) characters it is padded with spaces. Spaces are added
|
||||
** on the right if w>0 (left justification) or on the left if w<0
|
||||
** (right justification).
|
||||
*/
|
||||
static void outputFixedWidth(FILE *out, int w, const char *z){
|
||||
int n = strlenChar(z);
|
||||
int absw = w<0 ? -w : w;
|
||||
int i;
|
||||
|
||||
if( n<=absw ){
|
||||
if( w<0 ) for(i=absw-n; i>0; i--) putc(' ', out);
|
||||
fputs(z, out);
|
||||
if( w>0 ) for(i=absw-n; i>0; i--) putc(' ', out);
|
||||
}else{
|
||||
for(i=n=0; z[i]; i++){
|
||||
if( (z[i]&0xc0)==0x80 ) continue;
|
||||
if( n==absw ) break;
|
||||
n++;
|
||||
}
|
||||
fwrite(z, 1, i, out);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
** This is the callback routine that the shell
|
||||
** invokes for each row of a query result.
|
||||
@@ -848,22 +870,17 @@ static int shell_callback(
|
||||
w = 0;
|
||||
}
|
||||
if( w==0 ){
|
||||
w = strlen30(azCol[i] ? azCol[i] : "");
|
||||
w = strlenChar(azCol[i] ? azCol[i] : "");
|
||||
if( w<10 ) w = 10;
|
||||
n = strlen30(azArg && azArg[i] ? azArg[i] : p->nullValue);
|
||||
n = strlenChar(azArg && azArg[i] ? azArg[i] : p->nullValue);
|
||||
if( w<n ) w = n;
|
||||
}
|
||||
if( i<ArraySize(p->actualWidth) ){
|
||||
p->actualWidth[i] = w;
|
||||
}
|
||||
if( p->showHeader ){
|
||||
if( w<0 ){
|
||||
fprintf(p->out,"%*.*s%s",-w,-w,azCol[i],
|
||||
i==nArg-1 ? p->rowSeparator : " ");
|
||||
}else{
|
||||
fprintf(p->out,"%-*.*s%s",w,w,azCol[i],
|
||||
i==nArg-1 ? p->rowSeparator : " ");
|
||||
}
|
||||
outputFixedWidth(p->out, w, azCol[i]);
|
||||
fprintf(p->out, "%s", i==nArg-1 ? p->rowSeparator : " ");
|
||||
}
|
||||
}
|
||||
if( p->showHeader ){
|
||||
@@ -890,7 +907,7 @@ static int shell_callback(
|
||||
w = 10;
|
||||
}
|
||||
if( p->mode==MODE_Explain && azArg[i] && strlen30(azArg[i])>w ){
|
||||
w = strlen30(azArg[i]);
|
||||
w = strlenChar(azArg[i]);
|
||||
}
|
||||
if( i==1 && p->aiIndent && p->pStmt ){
|
||||
if( p->iIndent<p->nIndent ){
|
||||
@@ -898,15 +915,8 @@ static int shell_callback(
|
||||
}
|
||||
p->iIndent++;
|
||||
}
|
||||
if( w<0 ){
|
||||
fprintf(p->out,"%*.*s%s",-w,-w,
|
||||
azArg[i] ? azArg[i] : p->nullValue,
|
||||
i==nArg-1 ? p->rowSeparator : " ");
|
||||
}else{
|
||||
fprintf(p->out,"%-*.*s%s",w,w,
|
||||
azArg[i] ? azArg[i] : p->nullValue,
|
||||
i==nArg-1 ? p->rowSeparator : " ");
|
||||
}
|
||||
outputFixedWidth(p->out, w, azArg[i] ? azArg[i] : p->nullValue);
|
||||
fprintf(p->out, "%s", i==nArg-1 ? p->rowSeparator : " ");
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -2459,9 +2469,7 @@ static void tryToClone(ShellState *p, const char *zNewDb){
|
||||
*/
|
||||
static void output_reset(ShellState *p){
|
||||
if( p->outfile[0]=='|' ){
|
||||
#ifndef SQLITE_OMIT_POPEN
|
||||
pclose(p->out);
|
||||
#endif
|
||||
}else{
|
||||
output_file_close(p->out);
|
||||
}
|
||||
@@ -2954,14 +2962,9 @@ static int do_meta_command(char *zLine, ShellState *p){
|
||||
sCtx.zFile = zFile;
|
||||
sCtx.nLine = 1;
|
||||
if( sCtx.zFile[0]=='|' ){
|
||||
#ifdef SQLITE_OMIT_POPEN
|
||||
fprintf(stderr, "Error: pipes are not supporte in this OS\n");
|
||||
return 1;
|
||||
#else
|
||||
sCtx.in = popen(sCtx.zFile+1, "r");
|
||||
sCtx.zFile = "<pipe>";
|
||||
xCloser = pclose;
|
||||
#endif
|
||||
}else{
|
||||
sCtx.in = fopen(sCtx.zFile, "rb");
|
||||
xCloser = fclose;
|
||||
@@ -3284,11 +3287,6 @@ static int do_meta_command(char *zLine, ShellState *p){
|
||||
}
|
||||
output_reset(p);
|
||||
if( zFile[0]=='|' ){
|
||||
#ifdef SQLITE_OMIT_POPEN
|
||||
fprintf(stderr,"Error: pipes are not supported in this OS\n");
|
||||
rc = 1;
|
||||
p->out = stdout;
|
||||
#else
|
||||
p->out = popen(zFile + 1, "w");
|
||||
if( p->out==0 ){
|
||||
fprintf(stderr,"Error: cannot open pipe \"%s\"\n", zFile + 1);
|
||||
@@ -3297,7 +3295,6 @@ static int do_meta_command(char *zLine, ShellState *p){
|
||||
}else{
|
||||
sqlite3_snprintf(sizeof(p->outfile), p->outfile, "%s", zFile);
|
||||
}
|
||||
#endif
|
||||
}else{
|
||||
p->out = output_file_open(zFile);
|
||||
if( p->out==0 ){
|
||||
@@ -4222,7 +4219,7 @@ static char *find_home_dir(void){
|
||||
**
|
||||
** Returns the number of errors.
|
||||
*/
|
||||
static void process_sqliterc(
|
||||
static int process_sqliterc(
|
||||
ShellState *p, /* Configuration data */
|
||||
const char *sqliterc_override /* Name of config file. NULL to use default */
|
||||
){
|
||||
@@ -4230,13 +4227,15 @@ static void process_sqliterc(
|
||||
const char *sqliterc = sqliterc_override;
|
||||
char *zBuf = 0;
|
||||
FILE *in = NULL;
|
||||
int rc = 0;
|
||||
|
||||
if (sqliterc == NULL) {
|
||||
home_dir = find_home_dir();
|
||||
if( home_dir==0 ){
|
||||
fprintf(stderr, "-- warning: cannot find home directory;"
|
||||
" cannot read ~/.sqliterc\n");
|
||||
return;
|
||||
#if !defined(__RTP__) && !defined(_WRS_KERNEL)
|
||||
fprintf(stderr,"%s: Error: cannot locate your home directory\n", Argv0);
|
||||
#endif
|
||||
return 1;
|
||||
}
|
||||
sqlite3_initialize();
|
||||
zBuf = sqlite3_mprintf("%s/.sqliterc",home_dir);
|
||||
@@ -4247,10 +4246,11 @@ static void process_sqliterc(
|
||||
if( stdin_is_interactive ){
|
||||
fprintf(stderr,"-- Loading resources from %s\n",sqliterc);
|
||||
}
|
||||
process_input(p,in);
|
||||
rc = process_input(p,in);
|
||||
fclose(in);
|
||||
}
|
||||
sqlite3_free(zBuf);
|
||||
return rc;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -4526,7 +4526,10 @@ int main(int argc, char **argv){
|
||||
** is given on the command line, look for a file named ~/.sqliterc and
|
||||
** try to process it.
|
||||
*/
|
||||
process_sqliterc(&data,zInitFile);
|
||||
rc = process_sqliterc(&data,zInitFile);
|
||||
if( rc>0 ){
|
||||
return rc;
|
||||
}
|
||||
|
||||
/* Make a second pass through the command-line argument and set
|
||||
** options. This second pass is delayed until after the initialization
|
||||
|
||||
+19
-30
@@ -751,16 +751,14 @@ struct sqlite3_io_methods {
|
||||
** of the [sqlite3_io_methods] object and for the [sqlite3_file_control()]
|
||||
** interface.
|
||||
**
|
||||
** <ul>
|
||||
** <li>[[SQLITE_FCNTL_LOCKSTATE]]
|
||||
** The [SQLITE_FCNTL_LOCKSTATE] opcode is used for debugging. This
|
||||
** opcode causes the xFileControl method to write the current state of
|
||||
** the lock (one of [SQLITE_LOCK_NONE], [SQLITE_LOCK_SHARED],
|
||||
** [SQLITE_LOCK_RESERVED], [SQLITE_LOCK_PENDING], or [SQLITE_LOCK_EXCLUSIVE])
|
||||
** into an integer that the pArg argument points to. This capability
|
||||
** is used during testing and is only available when the SQLITE_TEST
|
||||
** compile-time option is used.
|
||||
**
|
||||
** is used during testing and only needs to be supported when SQLITE_TEST
|
||||
** is defined.
|
||||
** <ul>
|
||||
** <li>[[SQLITE_FCNTL_SIZE_HINT]]
|
||||
** The [SQLITE_FCNTL_SIZE_HINT] opcode is used by SQLite to give the VFS
|
||||
** layer a hint of how large the database file will grow to be during the
|
||||
@@ -885,9 +883,7 @@ struct sqlite3_io_methods {
|
||||
** [PRAGMA] processing continues. ^If the [SQLITE_FCNTL_PRAGMA]
|
||||
** file control returns [SQLITE_OK], then the parser assumes that the
|
||||
** VFS has handled the PRAGMA itself and the parser generates a no-op
|
||||
** prepared statement if result string is NULL, or that returns a copy
|
||||
** of the result string if the string is non-NULL.
|
||||
** ^If the [SQLITE_FCNTL_PRAGMA] file control returns
|
||||
** prepared statement. ^If the [SQLITE_FCNTL_PRAGMA] file control returns
|
||||
** any result code other than [SQLITE_OK] or [SQLITE_NOTFOUND], that means
|
||||
** that the VFS encountered an error while handling the [PRAGMA] and the
|
||||
** compilation of the PRAGMA fails with an error. ^The [SQLITE_FCNTL_PRAGMA]
|
||||
@@ -945,13 +941,6 @@ struct sqlite3_io_methods {
|
||||
** pointed to by the pArg argument. This capability is used during testing
|
||||
** and only needs to be supported when SQLITE_TEST is defined.
|
||||
**
|
||||
** <li>[[SQLITE_FCNTL_WAL_BLOCK]]
|
||||
** The [SQLITE_FCNTL_WAL_BLOCK] is a single to the VFS layer that it might
|
||||
** be advantageous to block on the next WAL lock if the lock is not immediately
|
||||
** available. The WAL subsystem issues this ioctl() during some rare
|
||||
** circumstances in order to fix a problem with priority inversion.
|
||||
** Applications should <em>not</em> use this file-control.
|
||||
**
|
||||
** </ul>
|
||||
*/
|
||||
#define SQLITE_FCNTL_LOCKSTATE 1
|
||||
@@ -976,7 +965,6 @@ struct sqlite3_io_methods {
|
||||
#define SQLITE_FCNTL_SYNC 21
|
||||
#define SQLITE_FCNTL_COMMIT_PHASETWO 22
|
||||
#define SQLITE_FCNTL_WIN32_SET_HANDLE 23
|
||||
#define SQLITE_FCNTL_WAL_BLOCK 24
|
||||
|
||||
/* deprecated names */
|
||||
#define SQLITE_GET_LOCKPROXYFILE SQLITE_FCNTL_GET_LOCKPROXYFILE
|
||||
@@ -1754,6 +1742,7 @@ struct sqlite3_mem_methods {
|
||||
** compiled for Windows with the [SQLITE_WIN32_MALLOC] pre-processor macro
|
||||
** defined. ^SQLITE_CONFIG_WIN32_HEAPSIZE takes a 32-bit unsigned integer value
|
||||
** that specifies the maximum size of the created heap.
|
||||
** </dl>
|
||||
**
|
||||
** [[SQLITE_CONFIG_PCACHE_HDRSZ]]
|
||||
** <dt>SQLITE_CONFIG_PCACHE_HDRSZ
|
||||
@@ -4229,8 +4218,8 @@ int sqlite3_create_function_v2(
|
||||
** These functions are [deprecated]. In order to maintain
|
||||
** backwards compatibility with older code, these functions continue
|
||||
** to be supported. However, new applications should avoid
|
||||
** the use of these functions. To encourage programmers to avoid
|
||||
** these functions, we will not explain what they do.
|
||||
** the use of these functions. To help encourage people to avoid
|
||||
** using these functions, we are not going to tell you what they do.
|
||||
*/
|
||||
#ifndef SQLITE_OMIT_DEPRECATED
|
||||
SQLITE_DEPRECATED int sqlite3_aggregate_count(sqlite3_context*);
|
||||
@@ -6992,20 +6981,20 @@ typedef struct sqlite3_backup sqlite3_backup;
|
||||
** is not a permanent error and does not affect the return value of
|
||||
** sqlite3_backup_finish().
|
||||
**
|
||||
** [[sqlite3_backup_remaining()]] [[sqlite3_backup_pagecount()]]
|
||||
** [[sqlite3_backup__remaining()]] [[sqlite3_backup_pagecount()]]
|
||||
** <b>sqlite3_backup_remaining() and sqlite3_backup_pagecount()</b>
|
||||
**
|
||||
** ^The sqlite3_backup_remaining() routine returns the number of pages still
|
||||
** to be backed up at the conclusion of the most recent sqlite3_backup_step().
|
||||
** ^The sqlite3_backup_pagecount() routine returns the total number of pages
|
||||
** in the source database at the conclusion of the most recent
|
||||
** sqlite3_backup_step().
|
||||
** ^(The values returned by these functions are only updated by
|
||||
** sqlite3_backup_step(). If the source database is modified in a way that
|
||||
** changes the size of the source database or the number of pages remaining,
|
||||
** those changes are not reflected in the output of sqlite3_backup_pagecount()
|
||||
** and sqlite3_backup_remaining() until after the next
|
||||
** sqlite3_backup_step().)^
|
||||
** ^Each call to sqlite3_backup_step() sets two values inside
|
||||
** the [sqlite3_backup] object: the number of pages still to be backed
|
||||
** up and the total number of pages in the source database file.
|
||||
** The sqlite3_backup_remaining() and sqlite3_backup_pagecount() interfaces
|
||||
** retrieve these two values, respectively.
|
||||
**
|
||||
** ^The values returned by these functions are only updated by
|
||||
** sqlite3_backup_step(). ^If the source database is modified during a backup
|
||||
** operation, then the values are not updated to account for any extra
|
||||
** pages that need to be updated or the size of the source database file
|
||||
** changing.
|
||||
**
|
||||
** <b>Concurrent Usage of Database Handles</b>
|
||||
**
|
||||
|
||||
+1
-6
@@ -23,11 +23,6 @@
|
||||
*/
|
||||
#include "msvc.h"
|
||||
|
||||
/*
|
||||
** Special setup for VxWorks
|
||||
*/
|
||||
#include "vxworks.h"
|
||||
|
||||
/*
|
||||
** These #defines should enable >2GB file support on POSIX if the
|
||||
** underlying operating system supports it. If the OS lacks
|
||||
@@ -2255,7 +2250,7 @@ struct SrcList {
|
||||
#define WHERE_OMIT_OPEN_CLOSE 0x0010 /* Table cursors are already open */
|
||||
#define WHERE_FORCE_TABLE 0x0020 /* Do not use an index-only search */
|
||||
#define WHERE_ONETABLE_ONLY 0x0040 /* Only code the 1st table in pTabList */
|
||||
#define WHERE_NO_AUTOINDEX 0x0080 /* Disallow automatic indexes */
|
||||
/* 0x0080 // not currently used */
|
||||
#define WHERE_GROUPBY 0x0100 /* pOrderBy is really a GROUP BY */
|
||||
#define WHERE_DISTINCTBY 0x0200 /* pOrderby is really a DISTINCT clause */
|
||||
#define WHERE_WANT_DISTINCT 0x0400 /* All output needs to be distinct */
|
||||
|
||||
+5
-7
@@ -98,17 +98,15 @@
|
||||
#endif
|
||||
|
||||
/*
|
||||
** The suggested maximum number of in-memory pages to use for
|
||||
** the main database table and for temporary tables.
|
||||
**
|
||||
** IMPLEMENTATION-OF: R-31093-59126 The default suggested cache size
|
||||
** is 2000 pages.
|
||||
** IMPLEMENTATION-OF: R-48205-43578 The default suggested cache size can be
|
||||
** altered using the SQLITE_DEFAULT_CACHE_SIZE compile-time options.
|
||||
** The maximum number of in-memory pages to use for the main database
|
||||
** table and for temporary tables. The SQLITE_DEFAULT_CACHE_SIZE
|
||||
*/
|
||||
#ifndef SQLITE_DEFAULT_CACHE_SIZE
|
||||
# define SQLITE_DEFAULT_CACHE_SIZE 2000
|
||||
#endif
|
||||
#ifndef SQLITE_DEFAULT_TEMP_CACHE_SIZE
|
||||
# define SQLITE_DEFAULT_TEMP_CACHE_SIZE 500
|
||||
#endif
|
||||
|
||||
/*
|
||||
** The default number of frames to accumulate in the log file before
|
||||
|
||||
+1
-1
@@ -3429,7 +3429,7 @@ static void MD5DigestToBase10x8(unsigned char digest[16], char zDigest[50]){
|
||||
for(i=j=0; i<16; i+=2){
|
||||
x = digest[i]*256 + digest[i+1];
|
||||
if( i>0 ) zDigest[j++] = '-';
|
||||
sqlite3_snprintf(50-j, &zDigest[j], "%05u", x);
|
||||
sqlite3_snprintf(16-j, &zDigest[j], "%05u", x);
|
||||
j += 5;
|
||||
}
|
||||
zDigest[j] = 0;
|
||||
|
||||
@@ -650,6 +650,7 @@ Tcl_SetVar2(interp, "sqlite_options", "mergesort", "1", TCL_GLOBAL_ONLY);
|
||||
LINKVAR( MAX_PAGE_COUNT );
|
||||
LINKVAR( MAX_LIKE_PATTERN_LENGTH );
|
||||
LINKVAR( MAX_TRIGGER_DEPTH );
|
||||
LINKVAR( DEFAULT_TEMP_CACHE_SIZE );
|
||||
LINKVAR( DEFAULT_CACHE_SIZE );
|
||||
LINKVAR( DEFAULT_PAGE_SIZE );
|
||||
LINKVAR( DEFAULT_FILE_FORMAT );
|
||||
|
||||
@@ -1004,13 +1004,6 @@ static int multiplexFileControl(sqlite3_file *pConn, int op, void *pArg){
|
||||
break;
|
||||
case SQLITE_FCNTL_PRAGMA: {
|
||||
char **aFcntl = (char**)pArg;
|
||||
/*
|
||||
** EVIDENCE-OF: R-29875-31678 The argument to the SQLITE_FCNTL_PRAGMA
|
||||
** file control is an array of pointers to strings (char**) in which the
|
||||
** second element of the array is the name of the pragma and the third
|
||||
** element is the argument to the pragma or NULL if the pragma has no
|
||||
** argument.
|
||||
*/
|
||||
if( aFcntl[1] && sqlite3_stricmp(aFcntl[1],"multiplex_truncate")==0 ){
|
||||
if( aFcntl[2] && aFcntl[2][0] ){
|
||||
if( sqlite3_stricmp(aFcntl[2], "on")==0
|
||||
@@ -1022,12 +1015,6 @@ static int multiplexFileControl(sqlite3_file *pConn, int op, void *pArg){
|
||||
pGroup->bTruncate = 0;
|
||||
}
|
||||
}
|
||||
/* EVIDENCE-OF: R-27806-26076 The handler for an SQLITE_FCNTL_PRAGMA
|
||||
** file control can optionally make the first element of the char**
|
||||
** argument point to a string obtained from sqlite3_mprintf() or the
|
||||
** equivalent and that string will become the result of the pragma
|
||||
** or the error message if the pragma fails.
|
||||
*/
|
||||
aFcntl[0] = sqlite3_mprintf(pGroup->bTruncate ? "on" : "off");
|
||||
rc = SQLITE_OK;
|
||||
break;
|
||||
|
||||
+7
-6
@@ -967,15 +967,16 @@ static void tvfsShmBarrier(sqlite3_file *pFile){
|
||||
TestvfsFd *pFd = tvfsGetFd(pFile);
|
||||
Testvfs *p = (Testvfs *)(pFd->pVfs->pAppData);
|
||||
|
||||
if( p->pScript && p->mask&TESTVFS_SHMBARRIER_MASK ){
|
||||
const char *z = pFd->pShm ? pFd->pShm->zFile : "";
|
||||
tvfsExecTcl(p, "xShmBarrier", Tcl_NewStringObj(z, -1), pFd->pShmId, 0, 0);
|
||||
}
|
||||
|
||||
if( p->isFullshm ){
|
||||
sqlite3OsShmBarrier(pFd->pReal);
|
||||
return;
|
||||
}
|
||||
|
||||
if( p->pScript && p->mask&TESTVFS_SHMBARRIER_MASK ){
|
||||
tvfsExecTcl(p, "xShmBarrier",
|
||||
Tcl_NewStringObj(pFd->pShm->zFile, -1), pFd->pShmId, 0, 0
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
static int tvfsShmUnmap(
|
||||
@@ -1531,7 +1532,7 @@ static int testvfs_cmd(
|
||||
return TCL_OK;
|
||||
|
||||
bad_args:
|
||||
Tcl_WrongNumArgs(interp, 1, objv, "VFSNAME ?-noshm BOOL? ?-fullshm BOOL? ?-default BOOL? ?-mxpathname INT? ?-szosfile INT? ?-iversion INT?");
|
||||
Tcl_WrongNumArgs(interp, 1, objv, "VFSNAME ?-noshm BOOL? ?-default BOOL? ?-mxpathname INT? ?-szosfile INT? ?-iversion INT?");
|
||||
return TCL_ERROR;
|
||||
}
|
||||
|
||||
|
||||
+12
-67
@@ -1015,7 +1015,7 @@ case OP_Real: { /* same as TK_FLOAT, out2-prerelease */
|
||||
** Synopsis: r[P2]='P4'
|
||||
**
|
||||
** P4 points to a nul terminated UTF-8 string. This opcode is transformed
|
||||
** into a String opcode before it is executed for the first time. During
|
||||
** into a String before it is executed for the first time. During
|
||||
** this transformation, the length of string P4 is computed and stored
|
||||
** as the P1 parameter.
|
||||
*/
|
||||
@@ -1047,15 +1047,10 @@ case OP_String8: { /* same as TK_STRING, out2-prerelease */
|
||||
/* Fall through to the next case, OP_String */
|
||||
}
|
||||
|
||||
/* Opcode: String P1 P2 P3 P4 P5
|
||||
/* Opcode: String P1 P2 * P4 *
|
||||
** Synopsis: r[P2]='P4' (len=P1)
|
||||
**
|
||||
** The string value P4 of length P1 (bytes) is stored in register P2.
|
||||
**
|
||||
** If P5!=0 and the content of register P3 is greater than zero, then
|
||||
** the datatype of the register P2 is converted to BLOB. The content is
|
||||
** the same sequence of bytes, it is merely interpreted as a BLOB instead
|
||||
** of a string, as if it had been CAST.
|
||||
*/
|
||||
case OP_String: { /* out2-prerelease */
|
||||
assert( pOp->p4.z!=0 );
|
||||
@@ -1064,13 +1059,6 @@ case OP_String: { /* out2-prerelease */
|
||||
pOut->n = pOp->p1;
|
||||
pOut->enc = encoding;
|
||||
UPDATE_MAX_BLOBSIZE(pOut);
|
||||
if( pOp->p5 ){
|
||||
assert( pOp->p3>0 );
|
||||
assert( pOp->p3<=(p->nMem-p->nCursor) );
|
||||
pIn3 = &aMem[pOp->p3];
|
||||
assert( pIn3->flags & MEM_Int );
|
||||
if( pIn3->u.i ) pOut->flags = MEM_Blob|MEM_Static|MEM_Term;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -3062,12 +3050,7 @@ case OP_Transaction: {
|
||||
p->nStmtDefImmCons = db->nDeferredImmCons;
|
||||
}
|
||||
|
||||
/* Gather the schema version number for checking:
|
||||
** IMPLEMENTATION-OF: R-32195-19465 The schema version is used by SQLite
|
||||
** each time a query is executed to ensure that the internal cache of the
|
||||
** schema used when compiling the SQL query matches the schema of the
|
||||
** database against which the compiled query is actually executed.
|
||||
*/
|
||||
/* Gather the schema version number for checking */
|
||||
sqlite3BtreeGetMeta(pBt, BTREE_SCHEMA_VERSION, (u32 *)&iMeta);
|
||||
iGen = db->aDb[pOp->p1].pSchema->iGeneration;
|
||||
}else{
|
||||
@@ -5585,12 +5568,10 @@ case OP_MemMax: { /* in2 */
|
||||
/* Opcode: IfPos P1 P2 * * *
|
||||
** Synopsis: if r[P1]>0 goto P2
|
||||
**
|
||||
** Register P1 must contain an integer.
|
||||
** If the value of register P1 is 1 or greater, jump to P2 and
|
||||
** add the literal value P3 to register P1.
|
||||
** If the value of register P1 is 1 or greater, jump to P2.
|
||||
**
|
||||
** If the initial value of register P1 is less than 1, then the
|
||||
** value is unchanged and control passes through to the next instruction.
|
||||
** It is illegal to use this instruction on a register that does
|
||||
** not contain an integer. An assertion fault will result if you try.
|
||||
*/
|
||||
case OP_IfPos: { /* jump, in1 */
|
||||
pIn1 = &aMem[pOp->p1];
|
||||
@@ -5619,34 +5600,16 @@ case OP_IfNeg: { /* jump, in1 */
|
||||
break;
|
||||
}
|
||||
|
||||
/* Opcode: IfNotZero P1 P2 P3 * *
|
||||
** Synopsis: if r[P1]!=0 then r[P1]+=P3, goto P2
|
||||
/* Opcode: IfZero P1 P2 P3 * *
|
||||
** Synopsis: r[P1]+=P3, if r[P1]==0 goto P2
|
||||
**
|
||||
** Register P1 must contain an integer. If the content of register P1 is
|
||||
** initially nonzero, then add P3 to P1 and jump to P2. If register P1 is
|
||||
** initially zero, leave it unchanged and fall through.
|
||||
** The register P1 must contain an integer. Add literal P3 to the
|
||||
** value in register P1. If the result is exactly 0, jump to P2.
|
||||
*/
|
||||
case OP_IfNotZero: { /* jump, in1 */
|
||||
case OP_IfZero: { /* jump, in1 */
|
||||
pIn1 = &aMem[pOp->p1];
|
||||
assert( pIn1->flags&MEM_Int );
|
||||
VdbeBranchTaken(pIn1->u.i<0, 2);
|
||||
if( pIn1->u.i ){
|
||||
pIn1->u.i += pOp->p3;
|
||||
pc = pOp->p2 - 1;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
/* Opcode: DecrJumpZero P1 P2 * * *
|
||||
** Synopsis: if (--r[P1])==0 goto P2
|
||||
**
|
||||
** Register P1 must hold an integer. Decrement the value in register P1
|
||||
** then jump to P2 if the new value is exactly zero.
|
||||
*/
|
||||
case OP_DecrJumpZero: { /* jump, in1 */
|
||||
pIn1 = &aMem[pOp->p1];
|
||||
assert( pIn1->flags&MEM_Int );
|
||||
pIn1->u.i--;
|
||||
pIn1->u.i += pOp->p3;
|
||||
VdbeBranchTaken(pIn1->u.i==0, 2);
|
||||
if( pIn1->u.i==0 ){
|
||||
pc = pOp->p2 - 1;
|
||||
@@ -5654,24 +5617,6 @@ case OP_DecrJumpZero: { /* jump, in1 */
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
/* Opcode: JumpZeroIncr P1 P2 * * *
|
||||
** Synopsis: if (r[P1]++)==0 ) goto P2
|
||||
**
|
||||
** The register P1 must contain an integer. If register P1 is initially
|
||||
** zero, then jump to P2. Increment register P1 regardless of whether or
|
||||
** not the jump is taken.
|
||||
*/
|
||||
case OP_JumpZeroIncr: { /* jump, in1 */
|
||||
pIn1 = &aMem[pOp->p1];
|
||||
assert( pIn1->flags&MEM_Int );
|
||||
VdbeBranchTaken(pIn1->u.i==0, 2);
|
||||
if( (pIn1->u.i++)==0 ){
|
||||
pc = pOp->p2 - 1;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
/* Opcode: AggStep * P2 P3 P4 P5
|
||||
** Synopsis: accum=r[P3] step(r[P2@P5])
|
||||
**
|
||||
|
||||
@@ -170,10 +170,6 @@ const void *sqlite3_value_text16le(sqlite3_value *pVal){
|
||||
return sqlite3ValueText(pVal, SQLITE_UTF16LE);
|
||||
}
|
||||
#endif /* SQLITE_OMIT_UTF16 */
|
||||
/* EVIDENCE-OF: R-12793-43283 Every value in SQLite has one of five
|
||||
** fundamental datatypes: 64-bit signed integer 64-bit IEEE floating
|
||||
** point number string BLOB NULL
|
||||
*/
|
||||
int sqlite3_value_type(sqlite3_value* pVal){
|
||||
static const u8 aType[] = {
|
||||
SQLITE_BLOB, /* 0x00 */
|
||||
|
||||
@@ -1,29 +0,0 @@
|
||||
/*
|
||||
** 2015-03-02
|
||||
**
|
||||
** 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 that is specific to Wind River's VxWorks
|
||||
*/
|
||||
#if defined(__RTP__) || defined(_WRS_KERNEL)
|
||||
/* This is VxWorks. Set up things specially for that OS
|
||||
*/
|
||||
#include <vxWorks.h>
|
||||
#include <pthread.h> /* amalgamator: dontcache */
|
||||
#define OS_VXWORKS 1
|
||||
#define SQLITE_OS_OTHER 0
|
||||
#define SQLITE_HOMEGROWN_RECURSIVE_MUTEX 1
|
||||
#define SQLITE_OMIT_LOAD_EXTENSION 1
|
||||
#define SQLITE_ENABLE_LOCKING_STYLE 0
|
||||
#define HAVE_UTIME 1
|
||||
#else
|
||||
/* This is not VxWorks. */
|
||||
#define OS_VXWORKS 0
|
||||
#endif /* defined(_WRS_KERNEL) */
|
||||
@@ -788,10 +788,9 @@ static void walUnlockShared(Wal *pWal, int lockIdx){
|
||||
SQLITE_SHM_UNLOCK | SQLITE_SHM_SHARED);
|
||||
WALTRACE(("WAL%p: release SHARED-%s\n", pWal, walLockName(lockIdx)));
|
||||
}
|
||||
static int walLockExclusive(Wal *pWal, int lockIdx, int n, int fBlock){
|
||||
static int walLockExclusive(Wal *pWal, int lockIdx, int n){
|
||||
int rc;
|
||||
if( pWal->exclusiveMode ) return SQLITE_OK;
|
||||
if( fBlock ) sqlite3OsFileControl(pWal->pDbFd, SQLITE_FCNTL_WAL_BLOCK, 0);
|
||||
rc = sqlite3OsShmLock(pWal->pDbFd, lockIdx, n,
|
||||
SQLITE_SHM_LOCK | SQLITE_SHM_EXCLUSIVE);
|
||||
WALTRACE(("WAL%p: acquire EXCLUSIVE-%s cnt=%d %s\n", pWal,
|
||||
@@ -1077,7 +1076,7 @@ static int walIndexRecover(Wal *pWal){
|
||||
assert( pWal->writeLock );
|
||||
iLock = WAL_ALL_BUT_WRITE + pWal->ckptLock;
|
||||
nLock = SQLITE_SHM_NLOCK - iLock;
|
||||
rc = walLockExclusive(pWal, iLock, nLock, 0);
|
||||
rc = walLockExclusive(pWal, iLock, nLock);
|
||||
if( rc ){
|
||||
return rc;
|
||||
}
|
||||
@@ -1611,7 +1610,7 @@ static int walBusyLock(
|
||||
){
|
||||
int rc;
|
||||
do {
|
||||
rc = walLockExclusive(pWal, lockIdx, n, 0);
|
||||
rc = walLockExclusive(pWal, lockIdx, n);
|
||||
}while( xBusy && rc==SQLITE_BUSY && xBusy(pBusyArg) );
|
||||
return rc;
|
||||
}
|
||||
@@ -2044,7 +2043,7 @@ static int walIndexReadHdr(Wal *pWal, int *pChanged){
|
||||
walUnlockShared(pWal, WAL_WRITE_LOCK);
|
||||
rc = SQLITE_READONLY_RECOVERY;
|
||||
}
|
||||
}else if( SQLITE_OK==(rc = walLockExclusive(pWal, WAL_WRITE_LOCK, 1, 1)) ){
|
||||
}else if( SQLITE_OK==(rc = walLockExclusive(pWal, WAL_WRITE_LOCK, 1)) ){
|
||||
pWal->writeLock = 1;
|
||||
if( SQLITE_OK==(rc = walIndexPage(pWal, 0, &page0)) ){
|
||||
badHdr = walIndexTryHdr(pWal, pChanged);
|
||||
@@ -2250,7 +2249,7 @@ static int walTryBeginRead(Wal *pWal, int *pChanged, int useWal, int cnt){
|
||||
&& (mxReadMark<pWal->hdr.mxFrame || mxI==0)
|
||||
){
|
||||
for(i=1; i<WAL_NREADER; i++){
|
||||
rc = walLockExclusive(pWal, WAL_READ_LOCK(i), 1, 0);
|
||||
rc = walLockExclusive(pWal, WAL_READ_LOCK(i), 1);
|
||||
if( rc==SQLITE_OK ){
|
||||
mxReadMark = pInfo->aReadMark[i] = pWal->hdr.mxFrame;
|
||||
mxI = i;
|
||||
@@ -2506,7 +2505,7 @@ int sqlite3WalBeginWriteTransaction(Wal *pWal){
|
||||
/* Only one writer allowed at a time. Get the write lock. Return
|
||||
** SQLITE_BUSY if unable.
|
||||
*/
|
||||
rc = walLockExclusive(pWal, WAL_WRITE_LOCK, 1, 0);
|
||||
rc = walLockExclusive(pWal, WAL_WRITE_LOCK, 1);
|
||||
if( rc ){
|
||||
return rc;
|
||||
}
|
||||
@@ -2651,7 +2650,7 @@ static int walRestartLog(Wal *pWal){
|
||||
if( pInfo->nBackfill>0 ){
|
||||
u32 salt1;
|
||||
sqlite3_randomness(4, &salt1);
|
||||
rc = walLockExclusive(pWal, WAL_READ_LOCK(1), WAL_NREADER-1, 0);
|
||||
rc = walLockExclusive(pWal, WAL_READ_LOCK(1), WAL_NREADER-1);
|
||||
if( rc==SQLITE_OK ){
|
||||
/* If all readers are using WAL_READ_LOCK(0) (in other words if no
|
||||
** readers are currently using the WAL), then the transactions
|
||||
@@ -2976,7 +2975,7 @@ int sqlite3WalCheckpoint(
|
||||
|
||||
/* IMPLEMENTATION-OF: R-62028-47212 All calls obtain an exclusive
|
||||
** "checkpoint" lock on the database file. */
|
||||
rc = walLockExclusive(pWal, WAL_CKPT_LOCK, 1, 0);
|
||||
rc = walLockExclusive(pWal, WAL_CKPT_LOCK, 1);
|
||||
if( rc ){
|
||||
/* EVIDENCE-OF: R-10421-19736 If any other process is running a
|
||||
** checkpoint operation at the same time, the lock cannot be obtained and
|
||||
|
||||
+19
-143
@@ -202,7 +202,7 @@ static void whereClauseClear(WhereClause *pWC){
|
||||
** calling this routine. Such pointers may be reinitialized by referencing
|
||||
** the pWC->a[] array.
|
||||
*/
|
||||
static int whereClauseInsert(WhereClause *pWC, Expr *p, u16 wtFlags){
|
||||
static int whereClauseInsert(WhereClause *pWC, Expr *p, u8 wtFlags){
|
||||
WhereTerm *pTerm;
|
||||
int idx;
|
||||
testcase( wtFlags & TERM_VIRTUAL );
|
||||
@@ -627,11 +627,7 @@ static void exprAnalyzeAll(
|
||||
** so and false if not.
|
||||
**
|
||||
** In order for the operator to be optimizible, the RHS must be a string
|
||||
** literal that does not begin with a wildcard. The LHS must be a column
|
||||
** that may only be NULL, a string, or a BLOB, never a number. (This means
|
||||
** that virtual tables cannot participate in the LIKE optimization.) If the
|
||||
** collating sequence for the column on the LHS must be appropriate for
|
||||
** the operator.
|
||||
** literal that does not begin with a wildcard.
|
||||
*/
|
||||
static int isLikeOrGlob(
|
||||
Parse *pParse, /* Parsing and code generating context */
|
||||
@@ -660,7 +656,7 @@ static int isLikeOrGlob(
|
||||
pLeft = pList->a[1].pExpr;
|
||||
if( pLeft->op!=TK_COLUMN
|
||||
|| sqlite3ExprAffinity(pLeft)!=SQLITE_AFF_TEXT
|
||||
|| IsVirtual(pLeft->pTab) /* Value might be numeric */
|
||||
|| IsVirtual(pLeft->pTab)
|
||||
){
|
||||
/* IMP: R-02065-49465 The left-hand side of the LIKE or GLOB operator must
|
||||
** be the name of an indexed column with TEXT affinity. */
|
||||
@@ -1109,7 +1105,7 @@ static void exprAnalyze(
|
||||
Bitmask extraRight = 0; /* Extra dependencies on LEFT JOIN */
|
||||
Expr *pStr1 = 0; /* RHS of LIKE/GLOB operator */
|
||||
int isComplete = 0; /* RHS of LIKE/GLOB ends with wildcard */
|
||||
int noCase = 0; /* uppercase equivalent to lowercase */
|
||||
int noCase = 0; /* LIKE/GLOB distinguishes case */
|
||||
int op; /* Top-level operator. pExpr->op */
|
||||
Parse *pParse = pWInfo->pParse; /* Parsing context */
|
||||
sqlite3 *db = pParse->db; /* Database connection */
|
||||
@@ -1247,15 +1243,12 @@ static void exprAnalyze(
|
||||
/* Add constraints to reduce the search space on a LIKE or GLOB
|
||||
** operator.
|
||||
**
|
||||
** A like pattern of the form "x LIKE 'aBc%'" is changed into constraints
|
||||
** A like pattern of the form "x LIKE 'abc%'" is changed into constraints
|
||||
**
|
||||
** x>='ABC' AND x<'abd' AND x LIKE 'aBc%'
|
||||
** x>='abc' AND x<'abd' AND x LIKE 'abc%'
|
||||
**
|
||||
** The last character of the prefix "abc" is incremented to form the
|
||||
** termination condition "abd". If case is not significant (the default
|
||||
** for LIKE) then the lower-bound is made all uppercase and the upper-
|
||||
** bound is made all lowercase so that the bounds also work when comparing
|
||||
** BLOBs.
|
||||
** termination condition "abd".
|
||||
*/
|
||||
if( pWC->op==TK_AND
|
||||
&& isLikeOrGlob(pParse, pExpr, &pStr1, &isComplete, &noCase)
|
||||
@@ -1267,25 +1260,9 @@ static void exprAnalyze(
|
||||
int idxNew1;
|
||||
int idxNew2;
|
||||
Token sCollSeqName; /* Name of collating sequence */
|
||||
const u16 wtFlags = TERM_LIKEOPT | TERM_VIRTUAL | TERM_DYNAMIC;
|
||||
|
||||
pLeft = pExpr->x.pList->a[1].pExpr;
|
||||
pStr2 = sqlite3ExprDup(db, pStr1, 0);
|
||||
|
||||
/* Convert the lower bound to upper-case and the upper bound to
|
||||
** lower-case (upper-case is less than lower-case in ASCII) so that
|
||||
** the range constraints also work for BLOBs
|
||||
*/
|
||||
if( noCase && !pParse->db->mallocFailed ){
|
||||
int i;
|
||||
char c;
|
||||
pTerm->wtFlags |= TERM_LIKE;
|
||||
for(i=0; (c = pStr1->u.zToken[i])!=0; i++){
|
||||
pStr1->u.zToken[i] = sqlite3Toupper(c);
|
||||
pStr2->u.zToken[i] = sqlite3Tolower(c);
|
||||
}
|
||||
}
|
||||
|
||||
if( !db->mallocFailed ){
|
||||
u8 c, *pC; /* Last character before the first wildcard */
|
||||
pC = (u8*)&pStr2->u.zToken[sqlite3Strlen30(pStr2->u.zToken)-1];
|
||||
@@ -1305,11 +1282,11 @@ static void exprAnalyze(
|
||||
sCollSeqName.z = noCase ? "NOCASE" : "BINARY";
|
||||
sCollSeqName.n = 6;
|
||||
pNewExpr1 = sqlite3ExprDup(db, pLeft, 0);
|
||||
pNewExpr1 = sqlite3PExpr(pParse, TK_GE,
|
||||
pNewExpr1 = sqlite3PExpr(pParse, TK_GE,
|
||||
sqlite3ExprAddCollateToken(pParse,pNewExpr1,&sCollSeqName),
|
||||
pStr1, 0);
|
||||
transferJoinMarkings(pNewExpr1, pExpr);
|
||||
idxNew1 = whereClauseInsert(pWC, pNewExpr1, wtFlags);
|
||||
idxNew1 = whereClauseInsert(pWC, pNewExpr1, TERM_VIRTUAL|TERM_DYNAMIC);
|
||||
testcase( idxNew1==0 );
|
||||
exprAnalyze(pSrc, pWC, idxNew1);
|
||||
pNewExpr2 = sqlite3ExprDup(db, pLeft, 0);
|
||||
@@ -1317,7 +1294,7 @@ static void exprAnalyze(
|
||||
sqlite3ExprAddCollateToken(pParse,pNewExpr2,&sCollSeqName),
|
||||
pStr2, 0);
|
||||
transferJoinMarkings(pNewExpr2, pExpr);
|
||||
idxNew2 = whereClauseInsert(pWC, pNewExpr2, wtFlags);
|
||||
idxNew2 = whereClauseInsert(pWC, pNewExpr2, TERM_VIRTUAL|TERM_DYNAMIC);
|
||||
testcase( idxNew2==0 );
|
||||
exprAnalyze(pSrc, pWC, idxNew2);
|
||||
pTerm = &pWC->a[idxTerm];
|
||||
@@ -2492,43 +2469,20 @@ static int whereInScanEst(
|
||||
** but joins might run a little slower. The trick is to disable as much
|
||||
** as we can without disabling too much. If we disabled in (1), we'd get
|
||||
** the wrong answer. See ticket #813.
|
||||
**
|
||||
** If all the children of a term are disabled, then that term is also
|
||||
** automatically disabled. In this way, terms get disabled if derived
|
||||
** virtual terms are tested first. For example:
|
||||
**
|
||||
** x GLOB 'abc*' AND x>='abc' AND x<'acd'
|
||||
** \___________/ \______/ \_____/
|
||||
** parent child1 child2
|
||||
**
|
||||
** Only the parent term was in the original WHERE clause. The child1
|
||||
** and child2 terms were added by the LIKE optimization. If both of
|
||||
** the virtual child terms are valid, then testing of the parent can be
|
||||
** skipped.
|
||||
**
|
||||
** Usually the parent term is marked as TERM_CODED. But if the parent
|
||||
** term was originally TERM_LIKE, then the parent gets TERM_LIKECOND instead.
|
||||
** The TERM_LIKECOND marking indicates that the term should be coded inside
|
||||
** a conditional such that is only evaluated on the second pass of a
|
||||
** LIKE-optimization loop, when scanning BLOBs instead of strings.
|
||||
*/
|
||||
static void disableTerm(WhereLevel *pLevel, WhereTerm *pTerm){
|
||||
int nLoop = 0;
|
||||
while( pTerm
|
||||
if( pTerm
|
||||
&& (pTerm->wtFlags & TERM_CODED)==0
|
||||
&& (pLevel->iLeftJoin==0 || ExprHasProperty(pTerm->pExpr, EP_FromJoin))
|
||||
&& (pLevel->notReady & pTerm->prereqAll)==0
|
||||
){
|
||||
if( nLoop && (pTerm->wtFlags & TERM_LIKE)!=0 ){
|
||||
pTerm->wtFlags |= TERM_LIKECOND;
|
||||
}else{
|
||||
pTerm->wtFlags |= TERM_CODED;
|
||||
pTerm->wtFlags |= TERM_CODED;
|
||||
if( pTerm->iParent>=0 ){
|
||||
WhereTerm *pOther = &pTerm->pWC->a[pTerm->iParent];
|
||||
if( (--pOther->nChild)==0 ){
|
||||
disableTerm(pLevel, pOther);
|
||||
}
|
||||
}
|
||||
if( pTerm->iParent<0 ) break;
|
||||
pTerm = &pTerm->pWC->a[pTerm->iParent];
|
||||
pTerm->nChild--;
|
||||
if( pTerm->nChild!=0 ) break;
|
||||
nLoop++;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3012,34 +2966,7 @@ static void addScanStatus(
|
||||
# define addScanStatus(a, b, c, d) ((void)d)
|
||||
#endif
|
||||
|
||||
/*
|
||||
** If the most recently coded instruction is a constant range contraint
|
||||
** that originated from the LIKE optimization, then change the P3 to be
|
||||
** pLoop->iLikeRepCntr and set P5.
|
||||
**
|
||||
** The LIKE optimization trys to evaluate "x LIKE 'abc%'" as a range
|
||||
** expression: "x>='ABC' AND x<'abd'". But this requires that the range
|
||||
** scan loop run twice, once for strings and a second time for BLOBs.
|
||||
** The OP_String opcodes on the second pass convert the upper and lower
|
||||
** bound string contants to blobs. This routine makes the necessary changes
|
||||
** to the OP_String opcodes for that to happen.
|
||||
*/
|
||||
static void whereLikeOptimizationStringFixup(
|
||||
Vdbe *v, /* prepared statement under construction */
|
||||
WhereLevel *pLevel, /* The loop that contains the LIKE operator */
|
||||
WhereTerm *pTerm /* The upper or lower bound just coded */
|
||||
){
|
||||
if( pTerm->wtFlags & TERM_LIKEOPT ){
|
||||
VdbeOp *pOp;
|
||||
assert( pLevel->iLikeRepCntr>0 );
|
||||
pOp = sqlite3VdbeGetOp(v, -1);
|
||||
assert( pOp!=0 );
|
||||
assert( pOp->opcode==OP_String8
|
||||
|| pTerm->pWC->pWInfo->pParse->db->mallocFailed );
|
||||
pOp->p3 = pLevel->iLikeRepCntr;
|
||||
pOp->p5 = 1;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
** Generate code for the start of the iLevel-th loop in the WHERE clause
|
||||
@@ -3369,25 +3296,10 @@ static Bitmask codeOneLoopStart(
|
||||
if( pLoop->wsFlags & WHERE_BTM_LIMIT ){
|
||||
pRangeStart = pLoop->aLTerm[j++];
|
||||
nExtraReg = 1;
|
||||
/* Like optimization range constraints always occur in pairs */
|
||||
assert( (pRangeStart->wtFlags & TERM_LIKEOPT)==0 ||
|
||||
(pLoop->wsFlags & WHERE_TOP_LIMIT)!=0 );
|
||||
}
|
||||
if( pLoop->wsFlags & WHERE_TOP_LIMIT ){
|
||||
pRangeEnd = pLoop->aLTerm[j++];
|
||||
nExtraReg = 1;
|
||||
if( (pRangeEnd->wtFlags & TERM_LIKEOPT)!=0 ){
|
||||
assert( pRangeStart!=0 ); /* LIKE opt constraints */
|
||||
assert( pRangeStart->wtFlags & TERM_LIKEOPT ); /* occur in pairs */
|
||||
pLevel->iLikeRepCntr = ++pParse->nMem;
|
||||
testcase( bRev );
|
||||
testcase( pIdx->aSortOrder[nEq]==SQLITE_SO_DESC );
|
||||
sqlite3VdbeAddOp2(v, OP_Integer,
|
||||
bRev ^ (pIdx->aSortOrder[nEq]==SQLITE_SO_DESC),
|
||||
pLevel->iLikeRepCntr);
|
||||
VdbeComment((v, "LIKE loop counter"));
|
||||
pLevel->addrLikeRep = sqlite3VdbeCurrentAddr(v);
|
||||
}
|
||||
if( pRangeStart==0
|
||||
&& (j = pIdx->aiColumn[nEq])>=0
|
||||
&& pIdx->pTable->aCol[j].notNull==0
|
||||
@@ -3430,7 +3342,6 @@ static Bitmask codeOneLoopStart(
|
||||
if( pRangeStart ){
|
||||
Expr *pRight = pRangeStart->pExpr->pRight;
|
||||
sqlite3ExprCode(pParse, pRight, regBase+nEq);
|
||||
whereLikeOptimizationStringFixup(v, pLevel, pRangeStart);
|
||||
if( (pRangeStart->wtFlags & TERM_VNULL)==0
|
||||
&& sqlite3ExprCanBeNull(pRight)
|
||||
){
|
||||
@@ -3476,7 +3387,6 @@ static Bitmask codeOneLoopStart(
|
||||
Expr *pRight = pRangeEnd->pExpr->pRight;
|
||||
sqlite3ExprCacheRemove(pParse, regBase+nEq, 1);
|
||||
sqlite3ExprCode(pParse, pRight, regBase+nEq);
|
||||
whereLikeOptimizationStringFixup(v, pLevel, pRangeEnd);
|
||||
if( (pRangeEnd->wtFlags & TERM_VNULL)==0
|
||||
&& sqlite3ExprCanBeNull(pRight)
|
||||
){
|
||||
@@ -3704,8 +3614,7 @@ static Bitmask codeOneLoopStart(
|
||||
*/
|
||||
wctrlFlags = WHERE_OMIT_OPEN_CLOSE
|
||||
| WHERE_FORCE_TABLE
|
||||
| WHERE_ONETABLE_ONLY
|
||||
| WHERE_NO_AUTOINDEX;
|
||||
| WHERE_ONETABLE_ONLY;
|
||||
for(ii=0; ii<pOrWc->nTerm; ii++){
|
||||
WhereTerm *pOrTerm = &pOrWc->a[ii];
|
||||
if( pOrTerm->leftCursor==iCur || (pOrTerm->eOperator & WO_AND)!=0 ){
|
||||
@@ -3867,7 +3776,6 @@ static Bitmask codeOneLoopStart(
|
||||
*/
|
||||
for(pTerm=pWC->a, j=pWC->nTerm; j>0; j--, pTerm++){
|
||||
Expr *pE;
|
||||
int skipLikeAddr = 0;
|
||||
testcase( pTerm->wtFlags & TERM_VIRTUAL );
|
||||
testcase( pTerm->wtFlags & TERM_CODED );
|
||||
if( pTerm->wtFlags & (TERM_VIRTUAL|TERM_CODED) ) continue;
|
||||
@@ -3882,13 +3790,7 @@ static Bitmask codeOneLoopStart(
|
||||
if( pLevel->iLeftJoin && !ExprHasProperty(pE, EP_FromJoin) ){
|
||||
continue;
|
||||
}
|
||||
if( pTerm->wtFlags & TERM_LIKECOND ){
|
||||
assert( pLevel->iLikeRepCntr>0 );
|
||||
skipLikeAddr = sqlite3VdbeAddOp1(v, OP_IfNot, pLevel->iLikeRepCntr);
|
||||
VdbeCoverage(v);
|
||||
}
|
||||
sqlite3ExprIfFalse(pParse, pE, addrCont, SQLITE_JUMPIFNULL);
|
||||
if( skipLikeAddr ) sqlite3VdbeJumpHere(v, skipLikeAddr);
|
||||
pTerm->wtFlags |= TERM_CODED;
|
||||
}
|
||||
|
||||
@@ -4553,10 +4455,6 @@ static int whereLoopAddBtreeIndex(
|
||||
}
|
||||
if( pTerm->prereqRight & pNew->maskSelf ) continue;
|
||||
|
||||
/* Do not allow the upper bound of a LIKE optimization range constraint
|
||||
** to mix with a lower range bound from some other source */
|
||||
if( pTerm->wtFlags & TERM_LIKEOPT && pTerm->eOperator==WO_LT ) continue;
|
||||
|
||||
pNew->wsFlags = saved_wsFlags;
|
||||
pNew->u.btree.nEq = saved_nEq;
|
||||
pNew->nLTerm = saved_nLTerm;
|
||||
@@ -4600,17 +4498,6 @@ static int whereLoopAddBtreeIndex(
|
||||
pNew->wsFlags |= WHERE_COLUMN_RANGE|WHERE_BTM_LIMIT;
|
||||
pBtm = pTerm;
|
||||
pTop = 0;
|
||||
if( pTerm->wtFlags & TERM_LIKEOPT ){
|
||||
/* Range contraints that come from the LIKE optimization are
|
||||
** always used in pairs. */
|
||||
pTop = &pTerm[1];
|
||||
assert( (pTop-(pTerm->pWC->a))<pTerm->pWC->nTerm );
|
||||
assert( pTop->wtFlags & TERM_LIKEOPT );
|
||||
assert( pTop->eOperator==WO_LT );
|
||||
if( whereLoopResize(db, pNew, pNew->nLTerm+1) ) break; /* OOM */
|
||||
pNew->aLTerm[pNew->nLTerm++] = pTop;
|
||||
pNew->wsFlags |= WHERE_TOP_LIMIT;
|
||||
}
|
||||
}else{
|
||||
assert( eOp & (WO_LT|WO_LE) );
|
||||
testcase( eOp & WO_LT );
|
||||
@@ -4921,7 +4808,6 @@ static int whereLoopAddBtree(
|
||||
#ifndef SQLITE_OMIT_AUTOMATIC_INDEX
|
||||
/* Automatic indexes */
|
||||
if( !pBuilder->pOrSet
|
||||
&& (pWInfo->wctrlFlags & WHERE_NO_AUTOINDEX)==0
|
||||
&& (pWInfo->pParse->db->flags & SQLITE_AutoIndex)!=0
|
||||
&& pSrc->pIndex==0
|
||||
&& !pSrc->viaCoroutine
|
||||
@@ -6707,16 +6593,6 @@ void sqlite3WhereEnd(WhereInfo *pWInfo){
|
||||
sqlite3VdbeJumpHere(v, pLevel->addrSkip);
|
||||
sqlite3VdbeJumpHere(v, pLevel->addrSkip-2);
|
||||
}
|
||||
if( pLevel->addrLikeRep ){
|
||||
int op;
|
||||
if( sqlite3VdbeGetOp(v, pLevel->addrLikeRep-1)->p1 ){
|
||||
op = OP_DecrJumpZero;
|
||||
}else{
|
||||
op = OP_JumpZeroIncr;
|
||||
}
|
||||
sqlite3VdbeAddOp2(v, op, pLevel->iLikeRepCntr, pLevel->addrLikeRep);
|
||||
VdbeCoverage(v);
|
||||
}
|
||||
if( pLevel->iLeftJoin ){
|
||||
addr = sqlite3VdbeAddOp1(v, OP_IfPos, pLevel->iLeftJoin); VdbeCoverage(v);
|
||||
assert( (pLoop->wsFlags & WHERE_IDX_ONLY)==0
|
||||
|
||||
+1
-6
@@ -69,8 +69,6 @@ struct WhereLevel {
|
||||
int addrCont; /* Jump here to continue with the next loop cycle */
|
||||
int addrFirst; /* First instruction of interior of the loop */
|
||||
int addrBody; /* Beginning of the body of this loop */
|
||||
int iLikeRepCntr; /* LIKE range processing counter register */
|
||||
int addrLikeRep; /* LIKE range processing address */
|
||||
u8 iFrom; /* Which entry in the FROM clause */
|
||||
u8 op, p3, p5; /* Opcode, P3 & P5 of the opcode that ends the loop */
|
||||
int p1, p2; /* Operands of the opcode used to ends the loop */
|
||||
@@ -255,7 +253,7 @@ struct WhereTerm {
|
||||
} u;
|
||||
LogEst truthProb; /* Probability of truth for this expression */
|
||||
u16 eOperator; /* A WO_xx value describing <op> */
|
||||
u16 wtFlags; /* TERM_xxx bit flags. See below */
|
||||
u8 wtFlags; /* TERM_xxx bit flags. See below */
|
||||
u8 nChild; /* Number of children that must disable us */
|
||||
WhereClause *pWC; /* The clause this term is part of */
|
||||
Bitmask prereqRight; /* Bitmask of tables used by pExpr->pRight */
|
||||
@@ -277,9 +275,6 @@ struct WhereTerm {
|
||||
#else
|
||||
# define TERM_VNULL 0x00 /* Disabled if not using stat3 */
|
||||
#endif
|
||||
#define TERM_LIKEOPT 0x100 /* Virtual terms from the LIKE optimization */
|
||||
#define TERM_LIKECOND 0x200 /* Conditionally this LIKE operator term */
|
||||
#define TERM_LIKE 0x400 /* The original LIKE operator */
|
||||
|
||||
/*
|
||||
** An instance of the WhereScan object is used as an iterator for locating
|
||||
|
||||
+12
-12
@@ -281,35 +281,35 @@ do_eqp_test analyze3-2.3 {
|
||||
|
||||
do_test analyze3-2.4 {
|
||||
sf_execsql { SELECT count(*) FROM t1 WHERE b LIKE 'a%' }
|
||||
} {102 0 100}
|
||||
} {101 0 100}
|
||||
do_test analyze3-2.5 {
|
||||
sf_execsql { SELECT count(*) FROM t1 WHERE b LIKE '%a' }
|
||||
} {999 999 100}
|
||||
|
||||
do_test analyze3-2.6 {
|
||||
do_test analyze3-2.4 {
|
||||
set like "a%"
|
||||
sf_execsql { SELECT count(*) FROM t1 WHERE b LIKE $like }
|
||||
} {102 0 100}
|
||||
do_test analyze3-2.7 {
|
||||
} {101 0 100}
|
||||
do_test analyze3-2.5 {
|
||||
set like "%a"
|
||||
sf_execsql { SELECT count(*) FROM t1 WHERE b LIKE $like }
|
||||
} {999 999 100}
|
||||
do_test analyze3-2.8 {
|
||||
do_test analyze3-2.6 {
|
||||
set like "a"
|
||||
sf_execsql { SELECT count(*) FROM t1 WHERE b LIKE $like }
|
||||
} {102 0 0}
|
||||
do_test analyze3-2.9 {
|
||||
} {101 0 0}
|
||||
do_test analyze3-2.7 {
|
||||
set like "ab"
|
||||
sf_execsql { SELECT count(*) FROM t1 WHERE b LIKE $like }
|
||||
} {12 0 0}
|
||||
do_test analyze3-2.10 {
|
||||
} {11 0 0}
|
||||
do_test analyze3-2.8 {
|
||||
set like "abc"
|
||||
sf_execsql { SELECT count(*) FROM t1 WHERE b LIKE $like }
|
||||
} {3 0 1}
|
||||
do_test analyze3-2.11 {
|
||||
} {2 0 1}
|
||||
do_test analyze3-2.9 {
|
||||
set like "a_c"
|
||||
sf_execsql { SELECT count(*) FROM t1 WHERE b LIKE $like }
|
||||
} {102 0 10}
|
||||
} {101 0 10}
|
||||
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
|
||||
@@ -11,9 +11,6 @@
|
||||
# This file implements regression tests for SQLite library. The
|
||||
# focus of this script is testing automatic index creation logic.
|
||||
#
|
||||
# EVIDENCE-OF: R-34271-33106 PRAGMA automatic_index; PRAGMA
|
||||
# automatic_index = boolean; Query, set, or clear the automatic indexing
|
||||
# capability.
|
||||
|
||||
set testdir [file dirname $argv0]
|
||||
source $testdir/tester.tcl
|
||||
|
||||
+1
-13
@@ -452,21 +452,9 @@ proc check_data {STMT test types ints doubles strings} {
|
||||
# types
|
||||
do_test $test.1 {
|
||||
set types [list]
|
||||
foreach i $idxlist {
|
||||
set x [sqlite3_column_type $STMT $i]
|
||||
# EVIDENCE-OF: R-12793-43283 Every value in SQLite has one of five
|
||||
# fundamental datatypes: 64-bit signed integer 64-bit IEEE floating
|
||||
# point number string BLOB NULL
|
||||
if {[lsearch {INTEGER FLOAT TEXT BLOB NULL} $x]<0} {
|
||||
set types ERROR
|
||||
break
|
||||
} else {
|
||||
lappend types $x
|
||||
}
|
||||
}
|
||||
foreach i $idxlist {lappend types [sqlite3_column_type $STMT $i]}
|
||||
set types
|
||||
} $types
|
||||
|
||||
|
||||
# Integers
|
||||
do_test $test.2 {
|
||||
|
||||
+3
-3
@@ -348,9 +348,9 @@ do_insert_tests e_insert-3.2 {
|
||||
6.2 "SELECT * FROM a1" {{} {} {} {}}
|
||||
}
|
||||
|
||||
# EVIDENCE-OF: R-03235-45250 The "REPLACE" and "INSERT OR action" forms
|
||||
# specify an alternative constraint conflict resolution algorithm to use
|
||||
# during this one INSERT command.
|
||||
# EVIDENCE-OF: R-46928-50290 The optional conflict-clause allows the
|
||||
# specification of an alternative constraint conflict resolution
|
||||
# algorithm to use during this one INSERT command.
|
||||
#
|
||||
# EVIDENCE-OF: R-23110-47146 the parser allows the use of the single
|
||||
# keyword REPLACE as an alias for "INSERT OR REPLACE".
|
||||
|
||||
+4
-5
@@ -200,11 +200,10 @@ do_test 3.4.2 {
|
||||
db close
|
||||
|
||||
|
||||
# EVIDENCE-OF: R-45540-25505 To prevent older versions of SQLite (prior
|
||||
# to version 3.7.0, 2010-07-22) from trying to recover a WAL-mode
|
||||
# database (and making matters worse) the database file format version
|
||||
# numbers (bytes 18 and 19 in the database header) are increased from 1
|
||||
# to 2 in WAL mode.
|
||||
# EVIDENCE-OF: R-22428-28959 To prevent older versions of SQLite from
|
||||
# trying to recover a WAL-mode database (and making matters worse) the
|
||||
# database file format version numbers (bytes 18 and 19 in the database
|
||||
# header) are increased from 1 to 2 in WAL mode.
|
||||
#
|
||||
reset_db
|
||||
do_execsql_test 4.1.1 { CREATE TABLE t1(x, y) }
|
||||
|
||||
+2
-27
@@ -12,13 +12,8 @@
|
||||
#
|
||||
# This file tests the PRAGMA foreign_key_check command.
|
||||
#
|
||||
# EVIDENCE-OF: R-01427-50262 PRAGMA database.foreign_key_check; PRAGMA
|
||||
# database.foreign_key_check(table-name);
|
||||
#
|
||||
# EVIDENCE-OF: R-23918-17301 The foreign_key_check pragma checks the
|
||||
# database, or the table called "table-name", for foreign key
|
||||
# constraints that are violated and returns one row of output for each
|
||||
# violation.
|
||||
# EVIDENCE-OF: R-05426-18119 PRAGMA foreign_key_check; PRAGMA
|
||||
# foreign_key_check(table-name);
|
||||
|
||||
set testdir [file dirname $argv0]
|
||||
source $testdir/tester.tcl
|
||||
@@ -79,16 +74,6 @@ do_test fkey5-1.2 {
|
||||
PRAGMA foreign_key_check;
|
||||
}
|
||||
} {c1 87 p1 0 c1 90 p1 0}
|
||||
do_test fkey5-1.2b {
|
||||
db eval {
|
||||
PRAGMA main.foreign_key_check;
|
||||
}
|
||||
} {c1 87 p1 0 c1 90 p1 0}
|
||||
do_test fkey5-1.2c {
|
||||
db eval {
|
||||
PRAGMA temp.foreign_key_check;
|
||||
}
|
||||
} {}
|
||||
do_test fkey5-1.3 {
|
||||
db eval {
|
||||
PRAGMA foreign_key_check(c1);
|
||||
@@ -99,16 +84,6 @@ do_test fkey5-1.4 {
|
||||
PRAGMA foreign_key_check(c2);
|
||||
}
|
||||
} {}
|
||||
do_test fkey5-1.5 {
|
||||
db eval {
|
||||
PRAGMA main.foreign_key_check(c2);
|
||||
}
|
||||
} {}
|
||||
do_test fkey5-1.6 {
|
||||
catchsql {
|
||||
PRAGMA temp.foreign_key_check(c2);
|
||||
}
|
||||
} {1 {no such table: temp.c2}}
|
||||
|
||||
# EVIDENCE-OF: R-45728-08709 There are four columns in each result row.
|
||||
#
|
||||
|
||||
+2
-12
@@ -324,21 +324,11 @@ do_test incrblob2-6.2 {
|
||||
sqlite3_blob_read $rdHandle 0 2
|
||||
} {AB}
|
||||
|
||||
if {$::tcl_platform(pointerSize)>=8} {
|
||||
do_test incrblob2-6.2b {
|
||||
set rc [catch {
|
||||
# Prior to 2015-02-07, the following caused a segfault due to
|
||||
# integer overflow.
|
||||
sqlite3_blob_read $rdHandle 2147483647 2147483647
|
||||
} errmsg]
|
||||
lappend rc $errmsg
|
||||
} {1 SQLITE_ERROR}
|
||||
}
|
||||
do_test incrblob2-6.2c {
|
||||
do_test incrblob2-6.2b {
|
||||
set rc [catch {
|
||||
# Prior to 2015-02-07, the following caused a segfault due to
|
||||
# integer overflow.
|
||||
sqlite3_blob_read $rdHandle 2147483647 100
|
||||
sqlite3_blob_read $rdHandle 2147483647 2147483647
|
||||
} errmsg]
|
||||
lappend rc $errmsg
|
||||
} {1 SQLITE_ERROR}
|
||||
|
||||
@@ -21,31 +21,6 @@ ifcapable !vtab {
|
||||
return
|
||||
}
|
||||
|
||||
# Capture the output of a pragma in a TEMP table.
|
||||
#
|
||||
proc capture_pragma {db tabname sql} {
|
||||
$db eval "DROP TABLE IF EXISTS temp.$tabname"
|
||||
set once 1
|
||||
$db eval $sql x {
|
||||
if {$once} {
|
||||
set once 0
|
||||
set ins "INSERT INTO $tabname VALUES"
|
||||
set crtab "CREATE TEMP TABLE $tabname "
|
||||
set sep "("
|
||||
foreach col $x(*) {
|
||||
append ins ${sep}\$x($col)
|
||||
append crtab ${sep}\"$col\"
|
||||
set sep ,
|
||||
}
|
||||
append ins )
|
||||
append crtab )
|
||||
$db eval $crtab
|
||||
}
|
||||
$db eval $ins
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
load_static_extension db wholenumber;
|
||||
do_test index7-1.1 {
|
||||
# Able to parse and manage partial indices
|
||||
@@ -62,15 +37,6 @@ do_test index7-1.1 {
|
||||
}
|
||||
} {14 20 ok}
|
||||
|
||||
# (The "partial" column of the PRAGMA index_list output is...)
|
||||
# EVIDENCE-OF: R-34457-09668 "1" if the index is a partial index and "0"
|
||||
# if not.
|
||||
#
|
||||
do_test index7-1.1a {
|
||||
capture_pragma db out {PRAGMA index_list(t1)}
|
||||
db eval {SELECT "name", "partial", '|' FROM out ORDER BY "name"}
|
||||
} {sqlite_autoindex_t1_1 0 | t1a 1 | t1b 1 |}
|
||||
|
||||
# Make sure the count(*) optimization works correctly with
|
||||
# partial indices. Ticket [a5c8ed66cae16243be6] 2013-10-03.
|
||||
#
|
||||
|
||||
+3
-46
@@ -1,4 +1,4 @@
|
||||
# 2008-10-04
|
||||
# 2008 October 4
|
||||
#
|
||||
# The author disclaims copyright to this source code. In place of
|
||||
# a legal notice, here is a blessing:
|
||||
@@ -9,6 +9,7 @@
|
||||
#
|
||||
#***********************************************************************
|
||||
#
|
||||
# $Id: indexedby.test,v 1.5 2009/03/22 20:36:19 drh Exp $
|
||||
|
||||
set testdir [file dirname $argv0]
|
||||
source $testdir/tester.tcl
|
||||
@@ -57,45 +58,20 @@ do_execsql_test indexedby-1.4 {
|
||||
# attached to a table in the FROM clause, but not to a sub-select or
|
||||
# SQL view. Also test that specifying an index that does not exist or
|
||||
# is attached to a different table is detected as an error.
|
||||
#
|
||||
# EVIDENCE-OF: R-63761-48810 -- syntax diagram qualified-table-name
|
||||
#
|
||||
# EVIDENCE-OF: R-58230-57098 The "INDEXED BY index-name" phrase
|
||||
# specifies that the named index must be used in order to look up values
|
||||
# on the preceding table.
|
||||
#
|
||||
do_test indexedby-2.1 {
|
||||
execsql { SELECT * FROM t1 NOT INDEXED WHERE a = 'one' AND b = 'two'}
|
||||
} {}
|
||||
do_test indexedby-2.1b {
|
||||
execsql { SELECT * FROM main.t1 NOT INDEXED WHERE a = 'one' AND b = 'two'}
|
||||
} {}
|
||||
do_test indexedby-2.2 {
|
||||
execsql { SELECT * FROM t1 INDEXED BY i1 WHERE a = 'one' AND b = 'two'}
|
||||
} {}
|
||||
do_test indexedby-2.2b {
|
||||
execsql { SELECT * FROM main.t1 INDEXED BY i1 WHERE a = 'one' AND b = 'two'}
|
||||
} {}
|
||||
do_test indexedby-2.3 {
|
||||
execsql { SELECT * FROM t1 INDEXED BY i2 WHERE a = 'one' AND b = 'two'}
|
||||
} {}
|
||||
# EVIDENCE-OF: R-44699-55558 The INDEXED BY clause does not give the
|
||||
# optimizer hints about which index to use; it gives the optimizer a
|
||||
# requirement of which index to use.
|
||||
# EVIDENCE-OF: R-15800-25719 If index-name does not exist or cannot be
|
||||
# used for the query, then the preparation of the SQL statement fails.
|
||||
#
|
||||
|
||||
do_test indexedby-2.4 {
|
||||
catchsql { SELECT * FROM t1 INDEXED BY i3 WHERE a = 'one' AND b = 'two'}
|
||||
} {1 {no such index: i3}}
|
||||
|
||||
# EVIDENCE-OF: R-62112-42456 If the query optimizer is unable to use the
|
||||
# index specified by the INDEX BY clause, then the query will fail with
|
||||
# an error.
|
||||
do_test indexedby-2.4.1 {
|
||||
catchsql { SELECT b FROM t1 INDEXED BY i1 WHERE b = 'two' }
|
||||
} {1 {no query solution}}
|
||||
|
||||
do_test indexedby-2.5 {
|
||||
catchsql { SELECT * FROM t1 INDEXED BY i5 WHERE a = 'one' AND b = 'two'}
|
||||
} {1 {no such index: i5}}
|
||||
@@ -106,26 +82,11 @@ do_test indexedby-2.7 {
|
||||
catchsql { SELECT * FROM v1 INDEXED BY i1 WHERE a = 'one' }
|
||||
} {1 {no such index: i1}}
|
||||
|
||||
|
||||
# Tests for single table cases.
|
||||
#
|
||||
# EVIDENCE-OF: R-37002-28871 The "NOT INDEXED" clause specifies that no
|
||||
# index shall be used when accessing the preceding table, including
|
||||
# implied indices create by UNIQUE and PRIMARY KEY constraints. However,
|
||||
# the rowid can still be used to look up entries even when "NOT INDEXED"
|
||||
# is specified.
|
||||
#
|
||||
do_execsql_test indexedby-3.1 {
|
||||
EXPLAIN QUERY PLAN SELECT * FROM t1 WHERE a = 'one' AND b = 'two'
|
||||
} {/SEARCH TABLE t1 USING INDEX/}
|
||||
do_execsql_test indexedby-3.1.1 {
|
||||
EXPLAIN QUERY PLAN SELECT * FROM t1 NOT INDEXED WHERE a = 'one' AND b = 'two'
|
||||
} {0 0 0 {SCAN TABLE t1}}
|
||||
do_execsql_test indexedby-3.1.2 {
|
||||
EXPLAIN QUERY PLAN SELECT * FROM t1 NOT INDEXED WHERE rowid=1
|
||||
} {/SEARCH TABLE t1 USING INTEGER PRIMARY KEY .rowid=/}
|
||||
|
||||
|
||||
do_execsql_test indexedby-3.2 {
|
||||
EXPLAIN QUERY PLAN
|
||||
SELECT * FROM t1 INDEXED BY i1 WHERE a = 'one' AND b = 'two'
|
||||
@@ -223,10 +184,6 @@ do_execsql_test indexedby-6.2 {
|
||||
EXPLAIN QUERY PLAN SELECT * FROM t1 NOT INDEXED WHERE b = 10 ORDER BY rowid
|
||||
} {0 0 0 {SCAN TABLE t1}}
|
||||
|
||||
# EVIDENCE-OF: R-40297-14464 The INDEXED BY phrase forces the SQLite
|
||||
# query planner to use a particular named index on a DELETE, SELECT, or
|
||||
# UPDATE statement.
|
||||
#
|
||||
# Test that "INDEXED BY" can be used in a DELETE statement.
|
||||
#
|
||||
do_execsql_test indexedby-7.1 {
|
||||
|
||||
+2
-2
@@ -749,7 +749,7 @@ ifcapable like_opt&&!icu {
|
||||
count {
|
||||
SELECT a FROM t10 WHERE f LIKE '12%' ORDER BY +a;
|
||||
}
|
||||
} {12 123 scan 4 like 0}
|
||||
} {12 123 scan 3 like 0}
|
||||
do_test like-10.6 {
|
||||
count {
|
||||
SELECT a FROM t10 WHERE a LIKE '12%' ORDER BY +a;
|
||||
@@ -790,7 +790,7 @@ ifcapable like_opt&&!icu {
|
||||
count {
|
||||
SELECT a FROM t10b WHERE f GLOB '12*' ORDER BY +a;
|
||||
}
|
||||
} {12 123 scan 4 like 0}
|
||||
} {12 123 scan 3 like 0}
|
||||
do_test like-10.15 {
|
||||
count {
|
||||
SELECT a FROM t10b WHERE a GLOB '12*' ORDER BY +a;
|
||||
|
||||
-112
@@ -1,112 +0,0 @@
|
||||
# 2015-03-06
|
||||
#
|
||||
# The author disclaims copyright to this source code. In place of
|
||||
# a legal notice, here is a blessing:
|
||||
#
|
||||
# May you do good and not evil.
|
||||
# May you find forgiveness for yourself and forgive others.
|
||||
# May you share freely, never taking more than you give.
|
||||
#
|
||||
#***********************************************************************
|
||||
#
|
||||
# This file implements regression tests for SQLite library. The
|
||||
# focus of this file is testing the LIKE and GLOB operators and
|
||||
# in particular the optimizations that occur to help those operators
|
||||
# run faster and that those optimizations work correctly when there
|
||||
# are both strings and blobs being tested.
|
||||
#
|
||||
# Ticket 05f43be8fdda9fbd948d374319b99b054140bc36 shows that the following
|
||||
# SQL was not working correctly:
|
||||
#
|
||||
# CREATE TABLE t1(x TEXT UNIQUE COLLATE nocase);
|
||||
# INSERT INTO t1(x) VALUES(x'616263');
|
||||
# SELECT 'query-1', x FROM t1 WHERE x LIKE 'a%';
|
||||
# SELECT 'query-2', x FROM t1 WHERE +x LIKE 'a%';
|
||||
#
|
||||
# This script verifies that it works right now.
|
||||
#
|
||||
|
||||
set testdir [file dirname $argv0]
|
||||
source $testdir/tester.tcl
|
||||
|
||||
do_execsql_test like3-1.1 {
|
||||
PRAGMA encoding=UTF8;
|
||||
CREATE TABLE t1(a,b TEXT COLLATE nocase);
|
||||
INSERT INTO t1(a,b)
|
||||
VALUES(1,'abc'),
|
||||
(2,'ABX'),
|
||||
(3,'BCD'),
|
||||
(4,x'616263'),
|
||||
(5,x'414258'),
|
||||
(6,x'424344');
|
||||
CREATE INDEX t1ba ON t1(b,a);
|
||||
|
||||
SELECT a, b FROM t1 WHERE b LIKE 'aB%' ORDER BY +a;
|
||||
} {1 abc 2 ABX 4 abc 5 ABX}
|
||||
do_execsql_test like3-1.2 {
|
||||
SELECT a, b FROM t1 WHERE +b LIKE 'aB%' ORDER BY +a;
|
||||
} {1 abc 2 ABX 4 abc 5 ABX}
|
||||
|
||||
do_execsql_test like3-2.0 {
|
||||
CREATE TABLE t2(a, b TEXT);
|
||||
INSERT INTO t2 SELECT a, b FROM t1;
|
||||
CREATE INDEX t2ba ON t2(b,a);
|
||||
SELECT a, b FROM t2 WHERE b GLOB 'ab*' ORDER BY +a;
|
||||
} {1 abc 4 abc}
|
||||
do_execsql_test like3-2.1 {
|
||||
SELECT a, b FROM t2 WHERE +b GLOB 'ab*' ORDER BY +a;
|
||||
} {1 abc 4 abc}
|
||||
do_execsql_test like3-2.2 {
|
||||
SELECT a, b FROM t2 WHERE b>=x'6162' AND b GLOB 'ab*'
|
||||
} {4 abc}
|
||||
do_execsql_test like3-2.3 {
|
||||
SELECT a, b FROM t2 WHERE +b>=x'6162' AND +b GLOB 'ab*'
|
||||
} {4 abc}
|
||||
do_execsql_test like3-2.4 {
|
||||
SELECT a, b FROM t2 WHERE b GLOB 'ab*' AND b>=x'6162'
|
||||
} {4 abc}
|
||||
do_execsql_test like3-2.5 {
|
||||
SELECT a, b FROM t2 WHERE +b GLOB 'ab*' AND +b>=x'6162'
|
||||
} {4 abc}
|
||||
|
||||
do_execsql_test like3-3.0 {
|
||||
CREATE TABLE t3(x TEXT PRIMARY KEY COLLATE nocase);
|
||||
INSERT INTO t3(x) VALUES('aaa'),('abc'),('abd'),('abe'),('acz');
|
||||
INSERT INTO t3(x) SELECT CAST(x AS blob) FROM t3;
|
||||
SELECT quote(x) FROM t3 WHERE x LIKE 'ab%' ORDER BY x;
|
||||
} {'abc' 'abd' 'abe' X'616263' X'616264' X'616265'}
|
||||
do_execsql_test like3-3.1 {
|
||||
SELECT quote(x) FROM t3 WHERE x LIKE 'ab%' ORDER BY x DESC;
|
||||
} {X'616265' X'616264' X'616263' 'abe' 'abd' 'abc'}
|
||||
do_execsql_test like3-3.1ck {
|
||||
SELECT quote(x) FROM t3 WHERE x LIKE 'ab%' ORDER BY +x DESC;
|
||||
} {X'616265' X'616264' X'616263' 'abe' 'abd' 'abc'}
|
||||
do_execsql_test like3-3.2 {
|
||||
SELECT quote(x) FROM t3 WHERE x LIKE 'ab%' ORDER BY x ASC;
|
||||
} {'abc' 'abd' 'abe' X'616263' X'616264' X'616265'}
|
||||
do_execsql_test like3-3.2ck {
|
||||
SELECT quote(x) FROM t3 WHERE x LIKE 'ab%' ORDER BY +x ASC;
|
||||
} {'abc' 'abd' 'abe' X'616263' X'616264' X'616265'}
|
||||
|
||||
do_execsql_test like3-4.0 {
|
||||
CREATE TABLE t4(x TEXT COLLATE nocase);
|
||||
CREATE INDEX t4x ON t4(x DESC);
|
||||
INSERT INTO t4(x) SELECT x FROM t3;
|
||||
SELECT quote(x) FROM t4 WHERE x LIKE 'ab%' ORDER BY x;
|
||||
} {'abc' 'abd' 'abe' X'616263' X'616264' X'616265'}
|
||||
do_execsql_test like3-4.1 {
|
||||
SELECT quote(x) FROM t4 WHERE x LIKE 'ab%' ORDER BY x DESC;
|
||||
} {X'616265' X'616264' X'616263' 'abe' 'abd' 'abc'}
|
||||
do_execsql_test like3-4.1ck {
|
||||
SELECT quote(x) FROM t4 WHERE x LIKE 'ab%' ORDER BY +x DESC;
|
||||
} {X'616265' X'616264' X'616263' 'abe' 'abd' 'abc'}
|
||||
do_execsql_test like3-4.2 {
|
||||
SELECT quote(x) FROM t4 WHERE x LIKE 'ab%' ORDER BY x ASC;
|
||||
} {'abc' 'abd' 'abe' X'616263' X'616264' X'616265'}
|
||||
do_execsql_test like3-4.2ck {
|
||||
SELECT quote(x) FROM t4 WHERE x LIKE 'ab%' ORDER BY +x ASC;
|
||||
} {'abc' 'abd' 'abe' X'616263' X'616264' X'616265'}
|
||||
|
||||
|
||||
|
||||
finish_test
|
||||
@@ -251,12 +251,6 @@ do_test limit-6.8 {
|
||||
# Make sure LIMIT works well with compound SELECT statements.
|
||||
# Ticket #393
|
||||
#
|
||||
# EVIDENCE-OF: R-13512-64012 In a compound SELECT, only the last or
|
||||
# right-most simple SELECT may contain a LIMIT clause.
|
||||
#
|
||||
# EVIDENCE-OF: R-03782-50113 In a compound SELECT, the LIMIT clause
|
||||
# applies to the entire compound, not just the final SELECT.
|
||||
#
|
||||
ifcapable compound {
|
||||
do_test limit-7.1.1 {
|
||||
catchsql {
|
||||
|
||||
@@ -241,9 +241,6 @@ execsql {ROLLBACK}
|
||||
|
||||
# Test the built-in busy timeout handler
|
||||
#
|
||||
# EVIDENCE-OF: R-23579-05241 PRAGMA busy_timeout; PRAGMA busy_timeout =
|
||||
# milliseconds; Query or change the setting of the busy timeout.
|
||||
#
|
||||
do_test lock-2.8 {
|
||||
db2 timeout 400
|
||||
execsql BEGIN
|
||||
|
||||
+14
-44
@@ -86,51 +86,21 @@ proc launch_testfixture {{prg ""}} {
|
||||
# Execute a command in a child testfixture process, connected by two-way
|
||||
# channel $chan. Return the result of the command, or an error message.
|
||||
#
|
||||
proc testfixture {chan cmd args} {
|
||||
|
||||
if {[llength $args] == 0} {
|
||||
fconfigure $chan -blocking 1
|
||||
puts $chan $cmd
|
||||
puts $chan OVER
|
||||
|
||||
set r ""
|
||||
while { 1 } {
|
||||
set line [gets $chan]
|
||||
if { $line == "OVER" } {
|
||||
set res [lindex $r 1]
|
||||
if { [lindex $r 0] } { error $res }
|
||||
return $res
|
||||
}
|
||||
if {[eof $chan]} {
|
||||
return "ERROR: Child process hung up"
|
||||
}
|
||||
append r $line
|
||||
}
|
||||
return $r
|
||||
} else {
|
||||
set ::tfnb($chan) ""
|
||||
fconfigure $chan -blocking 0 -buffering none
|
||||
puts $chan $cmd
|
||||
puts $chan OVER
|
||||
fileevent $chan readable [list testfixture_script_cb $chan [lindex $args 0]]
|
||||
return ""
|
||||
}
|
||||
}
|
||||
|
||||
proc testfixture_script_cb {chan script} {
|
||||
if {[eof $chan]} {
|
||||
append ::tfnb($chan) "ERROR: Child process hung up"
|
||||
set line "OVER"
|
||||
} else {
|
||||
proc testfixture {chan cmd} {
|
||||
puts $chan $cmd
|
||||
puts $chan OVER
|
||||
set r ""
|
||||
while { 1 } {
|
||||
set line [gets $chan]
|
||||
}
|
||||
|
||||
if { $line == "OVER" } {
|
||||
uplevel #0 $script [list [lindex $::tfnb($chan) 1]]
|
||||
unset ::tfnb($chan)
|
||||
fileevent $chan readable ""
|
||||
} else {
|
||||
append ::tfnb($chan) $line
|
||||
if { $line == "OVER" } {
|
||||
set res [lindex $r 1]
|
||||
if { [lindex $r 0] } { error $res }
|
||||
return $res
|
||||
}
|
||||
if {[eof $chan]} {
|
||||
return "ERROR: Child process hung up"
|
||||
}
|
||||
append r $line
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+6
-23
@@ -71,23 +71,6 @@ do_test malloc5-1.3 {
|
||||
expr $::pgalloc > 0
|
||||
} {1}
|
||||
|
||||
# The sizes of memory allocations from system malloc() might vary,
|
||||
# depending on the memory allocator algorithms used. The following
|
||||
# routine is designed to support answers that fall within a range
|
||||
# of values while also supplying easy-to-understand "expected" values
|
||||
# when errors occur.
|
||||
#
|
||||
proc value_in_range {target x args} {
|
||||
set v [lindex $args 0]
|
||||
if {$v!=""} {
|
||||
if {$v<$target*$x} {return $v}
|
||||
if {$v>$target/$x} {return $v}
|
||||
}
|
||||
return "number between [expr {int($target*$x)}] and [expr {int($target/$x)}]"
|
||||
}
|
||||
set mrange 0.98 ;# plus or minus 2%
|
||||
|
||||
|
||||
do_test malloc5-1.4 {
|
||||
# Commit the transaction and open a new one. Read 1 page into the cache.
|
||||
# Because the page is not dirty, it is eligible for collection even
|
||||
@@ -98,16 +81,16 @@ do_test malloc5-1.4 {
|
||||
BEGIN;
|
||||
SELECT * FROM abc;
|
||||
}
|
||||
value_in_range $::pgalloc $::mrange [sqlite3_release_memory]
|
||||
} [value_in_range $::pgalloc $::mrange]
|
||||
sqlite3_release_memory
|
||||
} $::pgalloc
|
||||
|
||||
do_test malloc5-1.5 {
|
||||
# Conclude the transaction opened in the previous [do_test] block. This
|
||||
# causes another page (page 1) to become eligible for recycling.
|
||||
#
|
||||
execsql { COMMIT }
|
||||
value_in_range $::pgalloc $::mrange [sqlite3_release_memory]
|
||||
} [value_in_range $::pgalloc $::mrange]
|
||||
sqlite3_release_memory
|
||||
} $::pgalloc
|
||||
|
||||
do_test malloc5-1.6 {
|
||||
# Manipulate the cache so that it contains two unused pages. One requires
|
||||
@@ -118,8 +101,8 @@ do_test malloc5-1.6 {
|
||||
SELECT * FROM abc;
|
||||
CREATE TABLE def(d, e, f);
|
||||
}
|
||||
value_in_range $::pgalloc $::mrange [sqlite3_release_memory 500]
|
||||
} [value_in_range $::pgalloc $::mrange]
|
||||
sqlite3_release_memory 500
|
||||
} $::pgalloc
|
||||
|
||||
do_test malloc5-1.7 {
|
||||
# Database should not be locked this time.
|
||||
|
||||
@@ -59,14 +59,6 @@ do_test multiplex4-1.1 {
|
||||
multiplex_file_list mx4test
|
||||
} {mx4test.db}
|
||||
|
||||
# NB: The PRAGMA multiplex_truncate command is implemented using the
|
||||
# SQLITE_FCNTL_PRAGMA file-control...
|
||||
#
|
||||
# EVIDENCE-OF: R-12238-55120 Whenever a PRAGMA statement is parsed, an
|
||||
# SQLITE_FCNTL_PRAGMA file control is sent to the open sqlite3_file
|
||||
# object corresponding to the database file to which the pragma
|
||||
# statement refers.
|
||||
#
|
||||
do_test multiplex4-1.2 {
|
||||
db eval {PRAGMA multiplex_truncate}
|
||||
} {on}
|
||||
@@ -92,16 +84,6 @@ do_test multiplex4-1.9 {
|
||||
db eval {PRAGMA multiplex_truncate=0}
|
||||
} {off}
|
||||
|
||||
# EVIDENCE-OF: R-26188-08449 If the SQLITE_FCNTL_PRAGMA file control
|
||||
# returns SQLITE_OK, then the parser assumes that the VFS has handled
|
||||
# the PRAGMA itself and the parser generates a no-op prepared statement
|
||||
# if result string is NULL, or that returns a copy of the result string
|
||||
# if the string is non-NULL.
|
||||
#
|
||||
do_test multiplex4-1.9-explain {
|
||||
db eval {EXPLAIN PRAGMA multiplex_truncate=0;}
|
||||
} {/String8 \d \d \d off/}
|
||||
|
||||
do_test multiplex4-1.10 {
|
||||
db eval {
|
||||
INSERT INTO t1(x) VALUES(randomblob(250000));
|
||||
|
||||
+11
-116
@@ -83,11 +83,7 @@ delete_file test.db test.db-journal
|
||||
delete_file test3.db test3.db-journal
|
||||
sqlite3 db test.db; set DB [sqlite3_connection_pointer db]
|
||||
|
||||
# EVIDENCE-OF: R-24197-42751 PRAGMA database.cache_size; PRAGMA
|
||||
# database.cache_size = pages; PRAGMA database.cache_size = -kibibytes;
|
||||
# Query or change the suggested maximum number of database disk pages
|
||||
# that SQLite will hold in memory at once per open database file.
|
||||
#
|
||||
|
||||
ifcapable pager_pragmas {
|
||||
set DFLT_CACHE_SZ [db one {PRAGMA default_cache_size}]
|
||||
set TEMP_CACHE_SZ [db one {PRAGMA temp.default_cache_size}]
|
||||
@@ -99,8 +95,6 @@ do_test pragma-1.1 {
|
||||
}
|
||||
} [list $DFLT_CACHE_SZ $DFLT_CACHE_SZ 2]
|
||||
do_test pragma-1.2 {
|
||||
# EVIDENCE-OF: R-42059-47211 If the argument N is positive then the
|
||||
# suggested cache size is set to N.
|
||||
execsql {
|
||||
PRAGMA synchronous=OFF;
|
||||
PRAGMA cache_size=1234;
|
||||
@@ -668,37 +662,6 @@ do_test pragma-6.5.1 {
|
||||
}
|
||||
db eval {SELECT seqno, cid, name FROM out ORDER BY seqno}
|
||||
} {0 0 a 1 1 b}
|
||||
|
||||
# EVIDENCE-OF: R-23114-21695 The auxiliary index-columns are not shown
|
||||
# by the index_info pragma, but they are listed by the index_xinfo
|
||||
# pragma.
|
||||
#
|
||||
do_test pragma-6.5.1b {
|
||||
capture_pragma db out {PRAGMA index_xinfo(t3i1)}
|
||||
db eval {SELECT seqno, cid, name FROM out ORDER BY seqno}
|
||||
} {0 0 a 1 1 b 2 -1 {}}
|
||||
|
||||
|
||||
# EVIDENCE-OF: R-62725-03366 PRAGMA database.index_info(index-name);
|
||||
# This pragma returns one row for each key column in the named index.
|
||||
#
|
||||
# (The first column of output from PRAGMA index_info is...)
|
||||
# EVIDENCE-OF: R-34186-52914 The rank of the column within the index. (0
|
||||
# means left-most.)
|
||||
#
|
||||
# (The second column of output from PRAGMA index_info is...)
|
||||
# EVIDENCE-OF: R-65019-08383 The rank of the column within the table
|
||||
# being indexed.
|
||||
#
|
||||
# (The third column of output from PRAGMA index_info is...)
|
||||
# EVIDENCE-OF: R-09773-34266 The name of the column being indexed.
|
||||
#
|
||||
do_execsql_test pragma-6.5.1c {
|
||||
CREATE INDEX t3i2 ON t3(b,a);
|
||||
PRAGMA index_info='t3i2';
|
||||
DROP INDEX t3i2;
|
||||
} {0 1 b 1 0 a}
|
||||
|
||||
do_test pragma-6.5.2 {
|
||||
execsql {
|
||||
pragma index_info(t3i1_bogus);
|
||||
@@ -756,9 +719,6 @@ do_test pragma-6.7 {
|
||||
# Miscellaneous tests
|
||||
#
|
||||
ifcapable schema_pragmas {
|
||||
# EVIDENCE-OF: R-63500-32024 PRAGMA database.index_list(table-name);
|
||||
# This pragma returns one row for each index associated with the given
|
||||
# table.
|
||||
do_test pragma-7.1.1 {
|
||||
# Make sure a pragma knows to read the schema if it needs to
|
||||
db close
|
||||
@@ -1350,23 +1310,18 @@ ifcapable pager_pragmas {
|
||||
db close
|
||||
forcedelete test.db
|
||||
sqlite3 db test.db
|
||||
|
||||
# EVIDENCE-OF: R-13905-26312 PRAGMA database.page_count; Return the
|
||||
# total number of pages in the database file.
|
||||
#
|
||||
|
||||
do_test pragma-14.1 {
|
||||
execsql { pragma auto_vacuum = 0 }
|
||||
execsql { pragma page_count; pragma main.page_count }
|
||||
} {0 0}
|
||||
execsql { pragma page_count }
|
||||
} {0}
|
||||
|
||||
do_test pragma-14.2 {
|
||||
execsql {
|
||||
CREATE TABLE abc(a, b, c);
|
||||
PRAGMA page_count;
|
||||
PRAGMA main.page_count;
|
||||
PRAGMA temp.page_count;
|
||||
}
|
||||
} {2 2 0}
|
||||
} {2}
|
||||
do_test pragma-14.2uc {
|
||||
execsql {pragma PAGE_COUNT}
|
||||
} {2}
|
||||
@@ -1775,90 +1730,30 @@ do_test 23.1 {
|
||||
CREATE TABLE t1(a INTEGER PRIMARY KEY,b,c,d);
|
||||
CREATE INDEX i1 ON t1(b,c);
|
||||
CREATE INDEX i2 ON t1(c,d);
|
||||
CREATE INDEX i2x ON t1(d COLLATE nocase, c DESC);
|
||||
CREATE TABLE t2(x INTEGER REFERENCES t1);
|
||||
}
|
||||
db2 eval {SELECT name FROM sqlite_master}
|
||||
} {t1 i1 i2 i2x t2}
|
||||
} {t1 i1 i2 t2}
|
||||
do_test 23.2a {
|
||||
db eval {
|
||||
DROP INDEX i2;
|
||||
CREATE INDEX i2 ON t1(c,d,b);
|
||||
}
|
||||
capture_pragma db2 out {PRAGMA index_info(i2)}
|
||||
db2 eval {SELECT cid, name, '|' FROM out ORDER BY seqno}
|
||||
} {2 c | 3 d | 1 b |}
|
||||
|
||||
# EVIDENCE-OF: R-44874-46325 PRAGMA database.index_xinfo(index-name);
|
||||
# This pragma returns information about every column in an index.
|
||||
#
|
||||
# EVIDENCE-OF: R-45970-35618 Unlike this index_info pragma, this pragma
|
||||
# returns information about every column in the index, not just the key
|
||||
# columns.
|
||||
#
|
||||
db2 eval {SELECT cid, name, "desc", coll, "key", '|' FROM out ORDER BY seqno}
|
||||
} {2 c 0 BINARY 1 | 3 d 0 BINARY 1 | 1 b 0 BINARY 1 |}
|
||||
do_test 23.2b {
|
||||
breakpoint;
|
||||
capture_pragma db2 out {PRAGMA index_xinfo(i2)}
|
||||
db2 eval {SELECT cid, name, "desc", coll, "key", '|' FROM out ORDER BY seqno}
|
||||
} {2 c 0 BINARY 1 | 3 d 0 BINARY 1 | 1 b 0 BINARY 1 | -1 {} 0 BINARY 0 |}
|
||||
|
||||
# (The first column of output from PRAGMA index_xinfo is...)
|
||||
# EVIDENCE-OF: R-00197-14279 The rank of the column within the index. (0
|
||||
# means left-most. Key columns come before auxiliary columns.)
|
||||
#
|
||||
# (The second column of output from PRAGMA index_xinfo is...)
|
||||
# EVIDENCE-OF: R-40889-06838 The rank of the column within the table
|
||||
# being indexed, or -1 if the index-column is the rowid of the table
|
||||
# being indexed.
|
||||
#
|
||||
# (The third column of output from PRAGMA index_xinfo is...)
|
||||
# EVIDENCE-OF: R-22751-28901 The name of the column being indexed, or
|
||||
# NULL if the index-column is the rowid of the table being indexed.
|
||||
#
|
||||
# (The fourth column of output from PRAGMA index_xinfo is...)
|
||||
# EVIDENCE-OF: R-11847-09179 1 if the index-column is sorted in reverse
|
||||
# (DESC) order by the index and 0 otherwise.
|
||||
#
|
||||
# (The fifth column of output from PRAGMA index_xinfo is...)
|
||||
# EVIDENCE-OF: R-15313-19540 The name for the collating sequence used to
|
||||
# compare values in the index-column.
|
||||
#
|
||||
# (The sixth column of output from PRAGMA index_xinfo is...)
|
||||
# EVIDENCE-OF: R-14310-64553 1 if the index-column is a key column and 0
|
||||
# if the index-column is an auxiliary column.
|
||||
#
|
||||
do_test 23.2c {
|
||||
db2 eval {PRAGMA index_xinfo(i2)}
|
||||
} {0 2 c 0 BINARY 1 1 3 d 0 BINARY 1 2 1 b 0 BINARY 1 3 -1 {} 0 BINARY 0}
|
||||
do_test 23.2d {
|
||||
db2 eval {PRAGMA index_xinfo(i2x)}
|
||||
} {0 3 d 0 nocase 1 1 2 c 1 BINARY 1 2 -1 {} 0 BINARY 0}
|
||||
|
||||
# EVIDENCE-OF: R-63500-32024 PRAGMA database.index_list(table-name);
|
||||
# This pragma returns one row for each index associated with the given
|
||||
# table.
|
||||
#
|
||||
# (The first column of output from PRAGMA index_list is...)
|
||||
# EVIDENCE-OF: R-02753-24748 A sequence number assigned to each index
|
||||
# for internal tracking purposes.
|
||||
#
|
||||
# (The second column of output from PRAGMA index_list is...)
|
||||
# EVIDENCE-OF: R-35496-03635 The name of the index.
|
||||
#
|
||||
# (The third column of output from PRAGMA index_list is...)
|
||||
# EVIDENCE-OF: R-57301-64506 "1" if the index is UNIQUE and "0" if not.
|
||||
#
|
||||
# (The fourth column of output from PRAGMA index_list is...)
|
||||
# EVIDENCE-OF: R-36609-39554 "c" if the index was created by a CREATE
|
||||
# INDEX statement, "u" if the index was created by a UNIQUE constraint,
|
||||
# or "pk" if the index was created by a PRIMARY KEY constraint.
|
||||
#
|
||||
do_test 23.3 {
|
||||
db eval {
|
||||
CREATE INDEX i3 ON t1(d,b,c);
|
||||
}
|
||||
capture_pragma db2 out {PRAGMA index_list(t1)}
|
||||
db2 eval {SELECT seq, name, "unique", origin, '|' FROM out ORDER BY seq}
|
||||
} {0 i3 0 c | 1 i2 0 c | 2 i2x 0 c | 3 i1 0 c |}
|
||||
db2 eval {SELECT name, "unique", origin FROM out ORDER BY seq}
|
||||
} {i3 0 c i2 0 c i1 0 c}
|
||||
do_test 23.4 {
|
||||
db eval {
|
||||
ALTER TABLE t1 ADD COLUMN e;
|
||||
|
||||
@@ -39,10 +39,6 @@ delete_file test3.db test3.db-journal
|
||||
sqlite3 db test.db; set DB [sqlite3_connection_pointer db]
|
||||
db eval {PRAGMA auto_vacuum=0}
|
||||
|
||||
|
||||
# EVIDENCE-OF: R-17887-14874 PRAGMA database.freelist_count; Return the
|
||||
# number of unused pages in the database file.
|
||||
#
|
||||
do_test pragma2-1.1 {
|
||||
execsql {
|
||||
PRAGMA freelist_count;
|
||||
|
||||
@@ -32,11 +32,6 @@ do_test rdonly-1.1 {
|
||||
SELECT * FROM t1;
|
||||
}
|
||||
} {1}
|
||||
|
||||
# EVIDENCE-OF: R-29639-16887 The sqlite3_db_readonly(D,N) interface
|
||||
# returns 1 if the database N of connection D is read-only, 0 if it is
|
||||
# read/write, or -1 if N is not the name of a database on connection D.
|
||||
#
|
||||
do_test rdonly-1.1.1 {
|
||||
sqlite3_db_readonly db main
|
||||
} {0}
|
||||
|
||||
@@ -105,10 +105,6 @@ ifcapable subquery {
|
||||
}
|
||||
} {0 1 2 2 3 3 3 3}
|
||||
}
|
||||
|
||||
# EVIDENCE-OF: R-02644-22131 In a compound SELECT statement, only the
|
||||
# last or right-most simple SELECT may have an ORDER BY clause.
|
||||
#
|
||||
do_test select4-1.3 {
|
||||
set v [catch {execsql {
|
||||
SELECT DISTINCT log FROM t1 ORDER BY log
|
||||
|
||||
@@ -24,9 +24,6 @@ do_test shrink-1.1 {
|
||||
INSERT INTO t1 VALUES(randomblob(1000000),1);
|
||||
}
|
||||
set ::baseline sqlite3_memory_used
|
||||
# EVIDENCE-OF: R-58814-63508 The sqlite3_db_release_memory(D) interface
|
||||
# attempts to free as much heap memory as possible from database
|
||||
# connection D.
|
||||
sqlite3_db_release_memory db
|
||||
expr {$::baseline > [sqlite3_memory_used]+500000}
|
||||
} {1}
|
||||
|
||||
@@ -24,14 +24,6 @@ ifcapable !integrityck {
|
||||
return
|
||||
}
|
||||
|
||||
# EVIDENCE-OF: R-26343-45930 This pragma invokes the
|
||||
# sqlite3_soft_heap_limit64() interface with the argument N, if N is
|
||||
# specified and is a non-negative integer.
|
||||
#
|
||||
# EVIDENCE-OF: R-64451-07163 The soft_heap_limit pragma always returns
|
||||
# the same integer that would be returned by the
|
||||
# sqlite3_soft_heap_limit64(-1) C-language function.
|
||||
#
|
||||
do_test softheap1-1.0 {
|
||||
execsql {PRAGMA soft_heap_limit}
|
||||
} [sqlite3_soft_heap_limit -1]
|
||||
|
||||
+1
-14
@@ -25,20 +25,7 @@ sqlite3 db test.db
|
||||
|
||||
|
||||
# Configure the sorter to use 3 background threads.
|
||||
#
|
||||
# EVIDENCE-OF: R-19249-32353 SQLITE_LIMIT_WORKER_THREADS The maximum
|
||||
# number of auxiliary worker threads that a single prepared statement
|
||||
# may start.
|
||||
#
|
||||
do_test sort4-init001 {
|
||||
db eval {PRAGMA threads=5}
|
||||
sqlite3_limit db SQLITE_LIMIT_WORKER_THREADS -1
|
||||
} {5}
|
||||
do_test sort4-init002 {
|
||||
sqlite3_limit db SQLITE_LIMIT_WORKER_THREADS 3
|
||||
db eval {PRAGMA threads}
|
||||
} {3}
|
||||
|
||||
db eval {PRAGMA threads=3}
|
||||
|
||||
# Minimum number of seconds to run for. If the value is 0, each test
|
||||
# is run exactly once. Otherwise, tests are repeated until the timeout
|
||||
|
||||
@@ -250,9 +250,6 @@ do_test sqllimits1-4.10.1 {
|
||||
# Test cases sqllimits1-5.* test that the SQLITE_MAX_LENGTH limit
|
||||
# is enforced.
|
||||
#
|
||||
# EVIDENCE-OF: R-61987-00541 SQLITE_LIMIT_LENGTH The maximum size of any
|
||||
# string or BLOB or table row, in bytes.
|
||||
#
|
||||
db close
|
||||
sqlite3 db test.db
|
||||
set LARGESIZE 99999
|
||||
@@ -409,9 +406,6 @@ unset strvalue
|
||||
# Test cases sqllimits1-6.* test that the SQLITE_MAX_SQL_LENGTH limit
|
||||
# is enforced.
|
||||
#
|
||||
# EVIDENCE-OF: R-09808-17554 SQLITE_LIMIT_SQL_LENGTH The maximum length
|
||||
# of an SQL statement, in bytes.
|
||||
#
|
||||
do_test sqllimits1-6.1 {
|
||||
sqlite3_limit db SQLITE_LIMIT_SQL_LENGTH 50000
|
||||
set sql "SELECT 1 WHERE 1==1"
|
||||
@@ -573,11 +567,6 @@ do_test sqllimits1-7.7.4 {
|
||||
#--------------------------------------------------------------------
|
||||
# Test cases sqllimits1-8.* test the SQLITE_MAX_COLUMN limit.
|
||||
#
|
||||
# EVIDENCE-OF: R-43996-29471 SQLITE_LIMIT_COLUMN The maximum number of
|
||||
# columns in a table definition or in the result set of a SELECT or the
|
||||
# maximum number of columns in an index or in an ORDER BY or GROUP BY
|
||||
# clause.
|
||||
#
|
||||
set SQLITE_LIMIT_COLUMN 200
|
||||
sqlite3_limit db SQLITE_LIMIT_COLUMN $SQLITE_LIMIT_COLUMN
|
||||
do_test sqllimits1-8.1 {
|
||||
@@ -681,9 +670,6 @@ do_test sqllimits1-8.11 {
|
||||
# limit is enforced. The limit refers to the number of terms in
|
||||
# the expression.
|
||||
#
|
||||
# EVIDENCE-OF: R-12723-08526 SQLITE_LIMIT_EXPR_DEPTH The maximum depth
|
||||
# of the parse tree on any expression.
|
||||
#
|
||||
if {$SQLITE_MAX_EXPR_DEPTH==0} {
|
||||
puts -nonewline stderr "WARNING: Compile with -DSQLITE_MAX_EXPR_DEPTH to run "
|
||||
puts stderr "tests sqllimits1-9.X"
|
||||
@@ -743,9 +729,6 @@ if 0 {
|
||||
# Test the SQLITE_LIMIT_FUNCTION_ARG limit works. Test case names
|
||||
# match the pattern "sqllimits1-11.*".
|
||||
#
|
||||
# EVIDENCE-OF: R-59001-45278 SQLITE_LIMIT_FUNCTION_ARG The maximum
|
||||
# number of arguments on a function.
|
||||
#
|
||||
for {set max 5} {$max<=$SQLITE_MAX_FUNCTION_ARG} {incr max} {
|
||||
do_test sqllimits1-11.$max.1 {
|
||||
set vals [list]
|
||||
@@ -779,9 +762,6 @@ for {set max 5} {$max<=$SQLITE_MAX_FUNCTION_ARG} {incr max} {
|
||||
#--------------------------------------------------------------------
|
||||
# Test cases sqllimits1-12.*: Test the SQLITE_MAX_ATTACHED limit.
|
||||
#
|
||||
# EVIDENCE-OF: R-41778-26203 SQLITE_LIMIT_ATTACHED The maximum number of
|
||||
# attached databases.
|
||||
#
|
||||
ifcapable attach {
|
||||
do_test sqllimits1-12.1 {
|
||||
set max $::SQLITE_MAX_ATTACHED
|
||||
@@ -805,9 +785,6 @@ ifcapable attach {
|
||||
# Test cases sqllimits1-13.*: Check that the SQLITE_MAX_VARIABLE_NUMBER
|
||||
# limit works.
|
||||
#
|
||||
# EVIDENCE-OF: R-42363-29104 SQLITE_LIMIT_VARIABLE_NUMBER The maximum
|
||||
# index number of any parameter in an SQL statement.
|
||||
#
|
||||
do_test sqllimits1-13.1 {
|
||||
set max $::SQLITE_MAX_VARIABLE_NUMBER
|
||||
catchsql "SELECT ?[expr {$max+1}] FROM t1"
|
||||
@@ -829,9 +806,6 @@ do_test sqllimits1-13.2 {
|
||||
# implementation by overriding the like() scalar function bypasses
|
||||
# this limitation.
|
||||
#
|
||||
# EVIDENCE-OF: R-12940-37052 SQLITE_LIMIT_LIKE_PATTERN_LENGTH The
|
||||
# maximum length of the pattern argument to the LIKE or GLOB operators.
|
||||
#
|
||||
# These tests check that the limit is not incorrectly applied to
|
||||
# the left-hand-side of the LIKE operator (the string being tested
|
||||
# against the pattern).
|
||||
|
||||
@@ -1,117 +0,0 @@
|
||||
# 2015 Mar 17
|
||||
#
|
||||
# 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.
|
||||
#
|
||||
#***********************************************************************
|
||||
#
|
||||
|
||||
set testdir [file dirname $argv0]
|
||||
source $testdir/tester.tcl
|
||||
source $testdir/lock_common.tcl
|
||||
source $testdir/wal_common.tcl
|
||||
|
||||
ifcapable !wal {finish_test ; return }
|
||||
if {$::tcl_platform(platform)!="unix"} { finish_test ; return }
|
||||
set testprefix walblock
|
||||
|
||||
catch { db close }
|
||||
testvfs tvfs -fullshm 1
|
||||
foreach f [glob test.db*] { forcedelete $f }
|
||||
|
||||
sqlite3 db test.db -vfs tvfs
|
||||
do_execsql_test 1.1.0 {
|
||||
CREATE TABLE t1(x, y);
|
||||
INSERT INTO t1 VALUES(1, 2);
|
||||
INSERT INTO t1 VALUES(3, 4);
|
||||
INSERT INTO t1 VALUES(5, 6);
|
||||
PRAGMA journal_mode = wal;
|
||||
INSERT INTO t1 VALUES(7, 8);
|
||||
} {wal}
|
||||
|
||||
do_test 1.1.1 {
|
||||
lsort [glob test.db*]
|
||||
} {test.db test.db-shm test.db-wal}
|
||||
|
||||
do_test 1.1.2 {
|
||||
set C [launch_testfixture]
|
||||
testfixture $C {
|
||||
sqlite3 db test.db
|
||||
db eval { SELECT * FROM t1 }
|
||||
}
|
||||
} {1 2 3 4 5 6 7 8}
|
||||
|
||||
do_test 1.1.3 {
|
||||
set ::out [list]
|
||||
testfixture $C {
|
||||
db eval { SELECT * FROM t1 }
|
||||
} [list set ::out]
|
||||
set ::out
|
||||
} {}
|
||||
|
||||
do_test 1.1.4 {
|
||||
vwait ::out
|
||||
set ::out
|
||||
} {1 2 3 4 5 6 7 8}
|
||||
|
||||
#
|
||||
# Test that if a read client cannot read the wal-index header because a
|
||||
# write client is in the middle of updating it, the reader blocks until
|
||||
# the writer finishes.
|
||||
#
|
||||
# 1. Open a write transaction using client [db] in this process.
|
||||
#
|
||||
# 2. Attempt to commit the write transaction. Intercept the xShmBarrier()
|
||||
# call made by the writer between updating the two copies of the
|
||||
# wal-index header.
|
||||
#
|
||||
# 3. Within the xShmBarrier() callback, make an asynchronous request to
|
||||
# the other process to read from the database. It should block, as it
|
||||
# cannot get read the wal-index header.
|
||||
#
|
||||
# 4. Still in xShmBarrier(), wait for 5 seconds. Check that the other
|
||||
# process has not answered the request.
|
||||
#
|
||||
# 5: Finish committing the transaction. Then wait for 0.5 seconds more.
|
||||
# Ensure that the second process has by this stage read the database
|
||||
# and that the snapshot it read included the transaction committed in
|
||||
# step (4).
|
||||
#
|
||||
do_execsql_test 1.2.1 {
|
||||
BEGIN;
|
||||
INSERT INTO t1 VALUES(9, 10);
|
||||
} {}
|
||||
|
||||
tvfs script barrier_callback
|
||||
tvfs filter xShmBarrier
|
||||
proc barrier_callback {method args} {
|
||||
set ::out ""
|
||||
testfixture $::C { db eval { SELECT * FROM t1 } } {set ::out}
|
||||
|
||||
do_test "1.2.2.(blocking 5 seconds)" {
|
||||
set ::continue 0
|
||||
after 5000 {set ::continue 1}
|
||||
vwait ::continue
|
||||
set ::out
|
||||
} {}
|
||||
}
|
||||
|
||||
execsql COMMIT
|
||||
|
||||
do_test "1.2.3.(blocking 0.5 seconds)" {
|
||||
set ::continue 0
|
||||
after 500 {set ::continue 1}
|
||||
vwait ::continue
|
||||
set ::out
|
||||
} {1 2 3 4 5 6 7 8 9 10}
|
||||
|
||||
|
||||
finish_test
|
||||
|
||||
|
||||
|
||||
|
||||
+2
-2
@@ -66,11 +66,11 @@ do_test where8-1.3 {
|
||||
|
||||
do_test where8-1.4 {
|
||||
execsql_status2 { SELECT c FROM t1 WHERE a > 8 OR b GLOB 't*' }
|
||||
} {IX X III II 0 0 10}
|
||||
} {IX X III II 0 0 9}
|
||||
|
||||
do_test where8-1.5 {
|
||||
execsql_status2 { SELECT c FROM t1 WHERE a > 8 OR b GLOB 'f*' }
|
||||
} {IX X V IV 0 0 10}
|
||||
} {IX X V IV 0 0 9}
|
||||
|
||||
do_test where8-1.6 {
|
||||
execsql_status { SELECT c FROM t1 WHERE a = 1 OR b = 'three' ORDER BY rowid }
|
||||
|
||||
@@ -119,7 +119,6 @@ foreach hdr {
|
||||
sqliteLimit.h
|
||||
vdbe.h
|
||||
vdbeInt.h
|
||||
vxworks.h
|
||||
wal.h
|
||||
whereInt.h
|
||||
} {
|
||||
|
||||
Reference in New Issue
Block a user