Compare commits
7 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 3d3be5bf0e | |||
| 7769550aec | |||
| c62f1026c3 | |||
| 9d46f26ce5 | |||
| 511eb67522 | |||
| 332ed080d7 | |||
| 047800eadd |
@@ -1,6 +1,6 @@
|
||||
#! /bin/sh
|
||||
# Guess values for system-dependent variables and create Makefiles.
|
||||
# Generated by GNU Autoconf 2.69 for sqlite 3.9.1.
|
||||
# Generated by GNU Autoconf 2.69 for sqlite 3.9.2.
|
||||
#
|
||||
#
|
||||
# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc.
|
||||
@@ -726,8 +726,8 @@ MAKEFLAGS=
|
||||
# Identity of this package.
|
||||
PACKAGE_NAME='sqlite'
|
||||
PACKAGE_TARNAME='sqlite'
|
||||
PACKAGE_VERSION='3.9.1'
|
||||
PACKAGE_STRING='sqlite 3.9.1'
|
||||
PACKAGE_VERSION='3.9.2'
|
||||
PACKAGE_STRING='sqlite 3.9.2'
|
||||
PACKAGE_BUGREPORT=''
|
||||
PACKAGE_URL=''
|
||||
|
||||
@@ -1459,7 +1459,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.9.1 to adapt to many kinds of systems.
|
||||
\`configure' configures sqlite 3.9.2 to adapt to many kinds of systems.
|
||||
|
||||
Usage: $0 [OPTION]... [VAR=VALUE]...
|
||||
|
||||
@@ -1524,7 +1524,7 @@ fi
|
||||
|
||||
if test -n "$ac_init_help"; then
|
||||
case $ac_init_help in
|
||||
short | recursive ) echo "Configuration of sqlite 3.9.1:";;
|
||||
short | recursive ) echo "Configuration of sqlite 3.9.2:";;
|
||||
esac
|
||||
cat <<\_ACEOF
|
||||
|
||||
@@ -1644,7 +1644,7 @@ fi
|
||||
test -n "$ac_init_help" && exit $ac_status
|
||||
if $ac_init_version; then
|
||||
cat <<\_ACEOF
|
||||
sqlite configure 3.9.1
|
||||
sqlite configure 3.9.2
|
||||
generated by GNU Autoconf 2.69
|
||||
|
||||
Copyright (C) 2012 Free Software Foundation, Inc.
|
||||
@@ -2063,7 +2063,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.9.1, which was
|
||||
It was created by sqlite $as_me 3.9.2, which was
|
||||
generated by GNU Autoconf 2.69. Invocation command line was
|
||||
|
||||
$ $0 $@
|
||||
@@ -11142,7 +11142,7 @@ else
|
||||
fi
|
||||
|
||||
if test "${use_debug}" = "yes" ; then
|
||||
TARGET_DEBUG="-DSQLITE_DEBUG=1"
|
||||
TARGET_DEBUG="-DSQLITE_DEBUG=1 -DSQLITE_ENABLE_SELECTTRACE -DSQLITE_ENABLE_WHERETRACE -O0"
|
||||
else
|
||||
TARGET_DEBUG="-DNDEBUG"
|
||||
fi
|
||||
@@ -11989,7 +11989,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
|
||||
# report actual input values of CONFIG_FILES etc. instead of their
|
||||
# values after options handling.
|
||||
ac_log="
|
||||
This file was extended by sqlite $as_me 3.9.1, which was
|
||||
This file was extended by sqlite $as_me 3.9.2, which was
|
||||
generated by GNU Autoconf 2.69. Invocation command line was
|
||||
|
||||
CONFIG_FILES = $CONFIG_FILES
|
||||
@@ -12055,7 +12055,7 @@ _ACEOF
|
||||
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
|
||||
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
|
||||
ac_cs_version="\\
|
||||
sqlite config.status 3.9.1
|
||||
sqlite config.status 3.9.2
|
||||
configured by $0, generated by GNU Autoconf 2.69,
|
||||
with options \\"\$ac_cs_config\\"
|
||||
|
||||
|
||||
+1
-1
@@ -532,7 +532,7 @@ AC_SEARCH_LIBS(fdatasync, [rt])
|
||||
AC_ARG_ENABLE(debug, AC_HELP_STRING([--enable-debug],[enable debugging & verbose explain]),
|
||||
[use_debug=$enableval],[use_debug=no])
|
||||
if test "${use_debug}" = "yes" ; then
|
||||
TARGET_DEBUG="-DSQLITE_DEBUG=1"
|
||||
TARGET_DEBUG="-DSQLITE_DEBUG=1 -DSQLITE_ENABLE_SELECTTRACE -DSQLITE_ENABLE_WHERETRACE -O0"
|
||||
else
|
||||
TARGET_DEBUG="-DNDEBUG"
|
||||
fi
|
||||
|
||||
+3
-6
@@ -3319,7 +3319,7 @@ static int fts3ColumnMethod(
|
||||
}else if( iCol==p->nColumn ){
|
||||
/* The extra column whose name is the same as the table.
|
||||
** Return a blob which is a pointer to the cursor. */
|
||||
sqlite3_result_blob(pCtx, &pCsr, sizeof(pCsr), SQLITE_TRANSIENT);
|
||||
sqlite3_result_pointer(pCtx, pCsr);
|
||||
}else if( iCol==p->nColumn+2 && pCsr->pExpr ){
|
||||
sqlite3_result_int64(pCtx, pCsr->iLangid);
|
||||
}else{
|
||||
@@ -3531,16 +3531,13 @@ static int fts3FunctionArg(
|
||||
sqlite3_value *pVal, /* argv[0] passed to function */
|
||||
Fts3Cursor **ppCsr /* OUT: Store cursor handle here */
|
||||
){
|
||||
Fts3Cursor *pRet;
|
||||
if( sqlite3_value_type(pVal)!=SQLITE_BLOB
|
||||
|| sqlite3_value_bytes(pVal)!=sizeof(Fts3Cursor *)
|
||||
){
|
||||
Fts3Cursor *pRet = (Fts3Cursor*)sqlite3_value_pointer(pVal);
|
||||
if( pRet==0 ){
|
||||
char *zErr = sqlite3_mprintf("illegal first argument to %s", zFunc);
|
||||
sqlite3_result_error(pContext, zErr, -1);
|
||||
sqlite3_free(zErr);
|
||||
return SQLITE_ERROR;
|
||||
}
|
||||
memcpy(&pRet, sqlite3_value_blob(pVal), sizeof(Fts3Cursor *));
|
||||
*ppCsr = pRet;
|
||||
return SQLITE_OK;
|
||||
}
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
C Version\s3.9.1
|
||||
D 2015-10-16T17:31:12.550
|
||||
C Enable\sthe\s".wheretrace"\sand\s".selecttrace"\soptions\sin\sthe\sshell\swhen\nconfigure\sis\srun\susing\s--enable-debug.\s\sThis\smirrors\sa\ssimilar\schange\nthat\shas\salready\soccurred\son\strunk.
|
||||
D 2018-02-02T16:46:41.480
|
||||
F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f
|
||||
F Makefile.in f0088ff0d2ac949fce6de7c00f13a99ac5bdb663
|
||||
F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23
|
||||
F Makefile.msc 0ed934b4ae6a5ec0b9d7e770104864f8372414ab
|
||||
F Makefile.vxworks e1b65dea203f054e71653415bd8f96dcaed47858
|
||||
F README.md 8ecc12493ff9f820cdea6520a9016001cb2e59b7
|
||||
F VERSION a47917b59f38b632b3a8662d14fd20f94956bdd0
|
||||
F VERSION 36a3ce894ac495d8cb9006319eced49e72998587
|
||||
F aclocal.m4 a5c22d164aff7ed549d53a90fa56d56955281f50
|
||||
F addopcodes.awk 9eb448a552d5c0185cf62c463f9c173cedae3811
|
||||
F art/sqlite370.eps aa97a671332b432a54e1d74ff5e8775be34200c2
|
||||
@@ -38,8 +38,8 @@ F autoconf/tea/win/rules.vc c511f222b80064096b705dbeb97060ee1d6b6d63
|
||||
F config.guess 226d9a188c6196f3033ffc651cbc9dcee1a42977
|
||||
F config.h.in 42b71ad3fe21c9e88fa59e8458ca1a6bc72eb0c0
|
||||
F config.sub 9ebe4c3b3dab6431ece34f16828b594fb420da55
|
||||
F configure 436b5d81c66f62d5069cdf306a74845fff9e6f9f x
|
||||
F configure.ac 1e87304e51af110950c48a1eea6ffc7a577f600e
|
||||
F configure 88b3b01a8050e19e7d5bafc0baa989c9d177ee4e1017faf3a9846060badd5474 x
|
||||
F configure.ac 7acb42566064f2908fae511dae8000eaae812a7c1247e1e3227cae1ba0d9da9e
|
||||
F contrib/sqlitecon.tcl 210a913ad63f9f991070821e599d600bd913e0ad
|
||||
F doc/lemon.html 334dbf6621b8fb8790297ec1abf3cfa4621709d1
|
||||
F doc/pager-invariants.txt 27fed9a70ddad2088750c4a2b493b63853da2710
|
||||
@@ -78,7 +78,7 @@ F ext/fts3/README.content fdc666a70d5257a64fee209f97cf89e0e6e32b51
|
||||
F ext/fts3/README.syntax a19711dc5458c20734b8e485e75fb1981ec2427a
|
||||
F ext/fts3/README.tokenizers e0a8b81383ea60d0334d274fadf305ea14a8c314
|
||||
F ext/fts3/README.txt 8c18f41574404623b76917b9da66fcb0ab38328d
|
||||
F ext/fts3/fts3.c e028eb13432f108d2e22cded019fc980700e4e00
|
||||
F ext/fts3/fts3.c c936a1563f41025a3e8192735776b2f9c45f5f9821293eb0b885df9cee0f0cee
|
||||
F ext/fts3/fts3.h 3a10a0af180d502cecc50df77b1b22df142817fe
|
||||
F ext/fts3/fts3Int.h c84125c666ee54cef6efce6ff64abb0d0e2f4535
|
||||
F ext/fts3/fts3_aux.c 9edc3655fcb287f0467d0a4b886a01c6185fe9f1
|
||||
@@ -288,7 +288,7 @@ F src/btmutex.c 45a968cc85afed9b5e6cf55bf1f42f8d18107f79
|
||||
F src/btree.c 0b74bc28b2dc907cba03b5b4b3b81584273be699
|
||||
F src/btree.h 40189aefdc2b830d25c8b58fd7d56538481bfdd7
|
||||
F src/btreeInt.h 8177c9ab90d772d6d2c6c517e05bed774b7c92c0
|
||||
F src/build.c d6162335d690396dfc5c4bd59e8b2b0c14ba6285
|
||||
F src/build.c ca574d33ffb1763cfd2979383f4d507095bfbe19
|
||||
F src/callback.c 7b44ce59674338ad48b0e84e7b72f935ea4f68b0
|
||||
F src/complete.c addcd8160b081131005d5bc2d34adf20c1c5c92f
|
||||
F src/ctime.c 509ef9c64d1321f42448f111da86400b1799218a
|
||||
@@ -345,7 +345,7 @@ F src/resolve.c 1954a0f01bf65d78d7d559aea3d5c67f33376d91
|
||||
F src/rowset.c eccf6af6d620aaa4579bd3b72c1b6395d9e9fa1e
|
||||
F src/select.c 0bc9cd2e1cacfdc9cdc9a83884cc100f166e80a4
|
||||
F src/shell.c d25df04168d6ba5a4fa05bdbf859df667f9eb621
|
||||
F src/sqlite.h.in dc35357824c6bb84a04acd4e99dee3e07299a8c6
|
||||
F src/sqlite.h.in 332fccab62c1d932de51ebdfe57ddbce6e04f1c7589b6d088d031840f464009a
|
||||
F src/sqlite3.rc 992c9f5fb8285ae285d6be28240a7e8d3a7f2bad
|
||||
F src/sqlite3ext.h 4b66e3e3435da4b4c8c83696d0349f0c503b3924
|
||||
F src/sqliteInt.h e21cc96bc24161df7373f6b24367cf580496889d
|
||||
@@ -408,8 +408,8 @@ F src/util.c fc612367108b74573c5fd13a85d0a23027f438bd
|
||||
F src/vacuum.c 2ddd5cad2a7b9cef7f9e431b8c7771634c6b1701
|
||||
F src/vdbe.c 1e0bf8d6a2308ce916d444ef399921407fd5d972
|
||||
F src/vdbe.h 4bc88bd0e06f8046ee6ab7487c0015e85ad949ad
|
||||
F src/vdbeInt.h 8b867eac234e28627ffcace3cd4b4b79bbec664b
|
||||
F src/vdbeapi.c 020681b943e77766b32ae1cddf86d7831b7374ca
|
||||
F src/vdbeInt.h 7209dc7293ef58d7a306db3ee93e63f76ab33e943ea01124b2e645023a2787d4
|
||||
F src/vdbeapi.c 4ebb5e6ad10c2ed285d126a6684999cabda6837dbc4e29a754eb9ce3eb451ecb
|
||||
F src/vdbeaux.c fd00b489ab3f44f2dca1e4344faf289b7bfcf649
|
||||
F src/vdbeblob.c 565fabd302f5fca3bdf3d56cac330483616a39b6
|
||||
F src/vdbemem.c 19b3036aa4d676e7103b0fb5efd6327da455f915
|
||||
@@ -420,7 +420,7 @@ F src/vxworks.h c18586c8edc1bddbc15c004fa16aeb1e1342b4fb
|
||||
F src/wal.c 18b0ed49830cf04fe2d68224b41838a73ac6cd24
|
||||
F src/wal.h df01efe09c5cb8c8e391ff1715cca294f89668a4
|
||||
F src/walker.c 2e14d17f592d176b6dc879c33fbdec4fbccaa2ba
|
||||
F src/where.c 4c4646675e794ac71e701289edefd7cd81bac844
|
||||
F src/where.c e3724b7b31d1e13869308ed4125305364f7d823a
|
||||
F src/whereInt.h 7892bb54cf9ca0ae5c7e6094491b94c9286dc647
|
||||
F src/wherecode.c cdfff200d065e7fb1af827b3274ed46b10a91d65
|
||||
F src/whereexpr.c e63244ca06c503e5f3c5b7f3c9aea0db826089ed
|
||||
@@ -470,7 +470,7 @@ F test/autoindex1.test 14b63a9f1e405fe6d5bfc8c8d00249c2ebaf13ea
|
||||
F test/autoindex2.test af7e595c6864cc6ef5fc38d5db579a3e34940cb8
|
||||
F test/autoindex3.test a3be0d1a53a7d2edff208a5e442312957047e972
|
||||
F test/autoindex4.test 49d3cd791a9baa16fb461d7ea3de80d019a819cf
|
||||
F test/autoindex5.test 6f487290ce2a667c24517191651bfb8c7d86b6dc
|
||||
F test/autoindex5.test 96f084a5e6024ea07cace5888df3223f3ea86990
|
||||
F test/autovacuum.test 941892505d2c0f410a0cb5970dfa1c7c4e5f6e74
|
||||
F test/autovacuum_ioerr2.test 8a367b224183ad801e0e24dcb7d1501f45f244b4
|
||||
F test/avtrans.test 0252654f4295ddda3b2cce0e894812259e655a85
|
||||
@@ -783,7 +783,7 @@ F test/incrvacuum3.test 75256fb1377e7c39ef2de62bfc42bbff67be295a
|
||||
F test/incrvacuum_ioerr.test 6ae2f783424e47a0033304808fe27789cf93e635
|
||||
F test/index.test fe3c7a1aad82af92623747e9c3f3aa94ccd51238
|
||||
F test/index2.test f835d5e13ca163bd78c4459ca15fd2e4ed487407
|
||||
F test/index3.test fa3e49bbaa4f38091c9c742e36a1abe67c4ef1fc
|
||||
F test/index3.test 81bc47890b8abfb181bc35f8d10b56c069803386
|
||||
F test/index4.test ab92e736d5946840236cd61ac3191f91a7856bf6
|
||||
F test/index5.test 8621491915800ec274609e42e02a97d67e9b13e7
|
||||
F test/index6.test 7102ec371414c42dfb1d5ca37eb4519aa9edc23a
|
||||
@@ -1390,10 +1390,7 @@ F tool/vdbe_profile.tcl 67746953071a9f8f2f668b73fe899074e2c6d8c1
|
||||
F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4
|
||||
F tool/warnings.sh 48bd54594752d5be3337f12c72f28d2080cb630b
|
||||
F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f
|
||||
P 746fcd2fd412ddc27071827fb20eb6df0741dfb1
|
||||
R d66bf398f8de1fb81851cd37ab3877c3
|
||||
T +bgcolor * #d0c0ff
|
||||
T +sym-release *
|
||||
T +sym-version-3.9.1 *
|
||||
P 69906880cee1f246cce494672402e0c7f29bd4ec19c437d26d603870d2bd625d
|
||||
R 1c9ff6f9f2a51b4e10808de5fcbea36c
|
||||
U drh
|
||||
Z 1827cdee71f363c0f73376b432ed6e27
|
||||
Z c934654d63304f50d0c8486eb20a3584
|
||||
|
||||
+1
-1
@@ -1 +1 @@
|
||||
767c1727fec4ce11b83f25b3f1bfcfe68a2c8b02
|
||||
c4f798b21224215091542657c0eec9921e7160c71ab4e7b1dad35e06ca186eca
|
||||
+25
-24
@@ -1271,6 +1271,30 @@ void sqlite3AddDefaultValue(Parse *pParse, ExprSpan *pSpan){
|
||||
sqlite3ExprDelete(db, pSpan->pExpr);
|
||||
}
|
||||
|
||||
/*
|
||||
** Backwards Compatibility Hack:
|
||||
**
|
||||
** Historical versions of SQLite accepted strings as column names in
|
||||
** indexes and PRIMARY KEY constraints and in UNIQUE constraints. Example:
|
||||
**
|
||||
** CREATE TABLE xyz(a,b,c,d,e,PRIMARY KEY('a'),UNIQUE('b','c' COLLATE trim)
|
||||
** CREATE INDEX abc ON xyz('c','d' DESC,'e' COLLATE nocase DESC);
|
||||
**
|
||||
** This is goofy. But to preserve backwards compatibility we continue to
|
||||
** accept it. This routine does the necessary conversion. It converts
|
||||
** the expression given in its argument from a TK_STRING into a TK_ID
|
||||
** if the expression is just a TK_STRING with an optional COLLATE clause.
|
||||
** If the epxression is anything other than TK_STRING, the expression is
|
||||
** unchanged.
|
||||
*/
|
||||
static void sqlite3StringToId(Expr *p){
|
||||
if( p->op==TK_STRING ){
|
||||
p->op = TK_ID;
|
||||
}else if( p->op==TK_COLLATE && p->pLeft->op==TK_STRING ){
|
||||
p->pLeft->op = TK_ID;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
** Designate the PRIMARY KEY for the table. pList is a list of names
|
||||
** of columns that form the primary key. If pList is NULL, then the
|
||||
@@ -1317,6 +1341,7 @@ void sqlite3AddPrimaryKey(
|
||||
for(i=0; i<nTerm; i++){
|
||||
Expr *pCExpr = sqlite3ExprSkipCollate(pList->a[i].pExpr);
|
||||
assert( pCExpr!=0 );
|
||||
sqlite3StringToId(pCExpr);
|
||||
if( pCExpr->op==TK_ID ){
|
||||
const char *zCName = pCExpr->u.zToken;
|
||||
for(iCol=0; iCol<pTab->nCol; iCol++){
|
||||
@@ -2855,30 +2880,6 @@ Index *sqlite3AllocateIndexObject(
|
||||
return p;
|
||||
}
|
||||
|
||||
/*
|
||||
** Backwards Compatibility Hack:
|
||||
**
|
||||
** Historical versions of SQLite accepted strings as column names in
|
||||
** indexes and PRIMARY KEY constraints and in UNIQUE constraints. Example:
|
||||
**
|
||||
** CREATE TABLE xyz(a,b,c,d,e,PRIMARY KEY('a'),UNIQUE('b','c' COLLATE trim)
|
||||
** CREATE INDEX abc ON xyz('c','d' DESC,'e' COLLATE nocase DESC);
|
||||
**
|
||||
** This is goofy. But to preserve backwards compatibility we continue to
|
||||
** accept it. This routine does the necessary conversion. It converts
|
||||
** the expression given in its argument from a TK_STRING into a TK_ID
|
||||
** if the expression is just a TK_STRING with an optional COLLATE clause.
|
||||
** If the epxression is anything other than TK_STRING, the expression is
|
||||
** unchanged.
|
||||
*/
|
||||
static void sqlite3StringToId(Expr *p){
|
||||
if( p->op==TK_STRING ){
|
||||
p->op = TK_ID;
|
||||
}else if( p->op==TK_COLLATE && p->pLeft->op==TK_STRING ){
|
||||
p->pLeft->op = TK_ID;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
** Create a new index for an SQL table. pName1.pName2 is the name of the index
|
||||
** and pTblList is the name of the table that is to be indexed. Both will
|
||||
|
||||
@@ -4352,6 +4352,7 @@ int sqlite3_value_bytes16(sqlite3_value*);
|
||||
double sqlite3_value_double(sqlite3_value*);
|
||||
int sqlite3_value_int(sqlite3_value*);
|
||||
sqlite3_int64 sqlite3_value_int64(sqlite3_value*);
|
||||
void *sqlite3_value_pointer(sqlite3_value*);
|
||||
const unsigned char *sqlite3_value_text(sqlite3_value*);
|
||||
const void *sqlite3_value_text16(sqlite3_value*);
|
||||
const void *sqlite3_value_text16le(sqlite3_value*);
|
||||
@@ -4664,6 +4665,7 @@ void sqlite3_result_error_code(sqlite3_context*, int);
|
||||
void sqlite3_result_int(sqlite3_context*, int);
|
||||
void sqlite3_result_int64(sqlite3_context*, sqlite3_int64);
|
||||
void sqlite3_result_null(sqlite3_context*);
|
||||
void sqlite3_result_pointer(sqlite3_context*, void*);
|
||||
void sqlite3_result_text(sqlite3_context*, const char*, int, void(*)(void*));
|
||||
void sqlite3_result_text64(sqlite3_context*, const char*,sqlite3_uint64,
|
||||
void(*)(void*), unsigned char encoding);
|
||||
|
||||
+3
-1
@@ -169,6 +169,7 @@ struct Mem {
|
||||
double r; /* Real value used when MEM_Real is set in flags */
|
||||
i64 i; /* Integer value used when MEM_Int is set in flags */
|
||||
int nZero; /* Used when bit MEM_Zero is set in flags */
|
||||
void *pPtr; /* Pointer when flags==MEM_Ptr|MEM_Null */
|
||||
FuncDef *pDef; /* Used only when flags==MEM_Agg */
|
||||
RowSet *pRowSet; /* Used only when flags==MEM_RowSet */
|
||||
VdbeFrame *pFrame; /* Used when flags==MEM_Frame */
|
||||
@@ -226,6 +227,7 @@ struct Mem {
|
||||
** policy for Mem.z. The MEM_Term flag tells us whether or not the
|
||||
** string is \000 or \u0000 terminated
|
||||
*/
|
||||
#define MEM_Ptr 0x8000 /* u.pPtr is valid if type==SQLITE_NULL */
|
||||
#define MEM_Term 0x0200 /* String rep is nul terminated */
|
||||
#define MEM_Dyn 0x0400 /* Need to call Mem.xDel() on Mem.z */
|
||||
#define MEM_Static 0x0800 /* Mem.z points to a static string */
|
||||
@@ -241,7 +243,7 @@ struct Mem {
|
||||
** Clear any existing type flags from a Mem and replace them with f
|
||||
*/
|
||||
#define MemSetTypeFlag(p, f) \
|
||||
((p)->flags = ((p)->flags&~(MEM_TypeMask|MEM_Zero))|f)
|
||||
((p)->flags = ((p)->flags&~(MEM_TypeMask|MEM_Zero|MEM_Ptr))|f)
|
||||
|
||||
/*
|
||||
** Return true if a memory cell is not marked as invalid. This macro
|
||||
|
||||
@@ -190,6 +190,11 @@ sqlite_int64 sqlite3_value_int64(sqlite3_value *pVal){
|
||||
unsigned int sqlite3_value_subtype(sqlite3_value *pVal){
|
||||
return ((Mem*)pVal)->eSubtype;
|
||||
}
|
||||
void *sqlite3_value_pointer(sqlite3_value *pVal){
|
||||
Mem *p = (Mem*)pVal;
|
||||
if( (p->flags&(MEM_TypeMask|MEM_Ptr))==(MEM_Null|MEM_Ptr) ) return p->u.pPtr;
|
||||
return 0;
|
||||
}
|
||||
const unsigned char *sqlite3_value_text(sqlite3_value *pVal){
|
||||
return (const unsigned char *)sqlite3ValueText(pVal, SQLITE_UTF8);
|
||||
}
|
||||
@@ -364,6 +369,13 @@ void sqlite3_result_int64(sqlite3_context *pCtx, i64 iVal){
|
||||
assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
|
||||
sqlite3VdbeMemSetInt64(pCtx->pOut, iVal);
|
||||
}
|
||||
void sqlite3_result_pointer(sqlite3_context *pCtx, void *pPtr){
|
||||
assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
|
||||
sqlite3VdbeMemSetNull(pCtx->pOut);
|
||||
assert( (pCtx->pOut->flags & (MEM_TypeMask|MEM_Ptr))==MEM_Null );
|
||||
pCtx->pOut->flags |= MEM_Ptr;
|
||||
pCtx->pOut->u.pPtr = pPtr;
|
||||
}
|
||||
void sqlite3_result_null(sqlite3_context *pCtx){
|
||||
assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
|
||||
sqlite3VdbeMemSetNull(pCtx->pOut);
|
||||
|
||||
+28
-9
@@ -485,14 +485,20 @@ static LogEst estLog(LogEst N){
|
||||
** Convert OP_Column opcodes to OP_Copy in previously generated code.
|
||||
**
|
||||
** This routine runs over generated VDBE code and translates OP_Column
|
||||
** opcodes into OP_Copy, and OP_Rowid into OP_Null, when the table is being
|
||||
** accessed via co-routine instead of via table lookup.
|
||||
** opcodes into OP_Copy when the table is being accessed via co-routine
|
||||
** instead of via table lookup.
|
||||
**
|
||||
** If the bIncrRowid parameter is 0, then any OP_Rowid instructions on
|
||||
** cursor iTabCur are transformed into OP_Null. Or, if bIncrRowid is non-zero,
|
||||
** then each OP_Rowid is transformed into an instruction to increment the
|
||||
** value stored in its output register.
|
||||
*/
|
||||
static void translateColumnToCopy(
|
||||
Vdbe *v, /* The VDBE containing code to translate */
|
||||
int iStart, /* Translate from this opcode to the end */
|
||||
int iTabCur, /* OP_Column/OP_Rowid references to this table */
|
||||
int iRegister /* The first column is in this register */
|
||||
int iRegister, /* The first column is in this register */
|
||||
int bIncrRowid /* If non-zero, transform OP_rowid to OP_AddImm(1) */
|
||||
){
|
||||
VdbeOp *pOp = sqlite3VdbeGetOp(v, iStart);
|
||||
int iEnd = sqlite3VdbeCurrentAddr(v);
|
||||
@@ -504,9 +510,16 @@ static void translateColumnToCopy(
|
||||
pOp->p2 = pOp->p3;
|
||||
pOp->p3 = 0;
|
||||
}else if( pOp->opcode==OP_Rowid ){
|
||||
pOp->opcode = OP_Null;
|
||||
pOp->p1 = 0;
|
||||
pOp->p3 = 0;
|
||||
if( bIncrRowid ){
|
||||
/* Increment the value stored in the P2 operand of the OP_Rowid. */
|
||||
pOp->opcode = OP_AddImm;
|
||||
pOp->p1 = pOp->p2;
|
||||
pOp->p2 = 1;
|
||||
}else{
|
||||
pOp->opcode = OP_Null;
|
||||
pOp->p1 = 0;
|
||||
pOp->p3 = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -614,6 +627,8 @@ static void constructAutomaticIndex(
|
||||
Expr *pPartial = 0; /* Partial Index Expression */
|
||||
int iContinue = 0; /* Jump here to skip excluded rows */
|
||||
struct SrcList_item *pTabItem; /* FROM clause term being indexed */
|
||||
int addrCounter; /* Address where integer counter is initialized */
|
||||
int regBase; /* Array of registers where record is assembled */
|
||||
|
||||
/* Generate code to skip over the creation and initialization of the
|
||||
** transient index on 2nd and subsequent iterations of the loop. */
|
||||
@@ -742,6 +757,7 @@ static void constructAutomaticIndex(
|
||||
pTabItem = &pWC->pWInfo->pTabList->a[pLevel->iFrom];
|
||||
if( pTabItem->fg.viaCoroutine ){
|
||||
int regYield = pTabItem->regReturn;
|
||||
addrCounter = sqlite3VdbeAddOp2(v, OP_Integer, 0, 0);
|
||||
sqlite3VdbeAddOp3(v, OP_InitCoroutine, regYield, 0, pTabItem->addrFillSub);
|
||||
addrTop = sqlite3VdbeAddOp1(v, OP_Yield, regYield);
|
||||
VdbeCoverage(v);
|
||||
@@ -755,12 +771,15 @@ static void constructAutomaticIndex(
|
||||
pLoop->wsFlags |= WHERE_PARTIALIDX;
|
||||
}
|
||||
regRecord = sqlite3GetTempReg(pParse);
|
||||
sqlite3GenerateIndexKey(pParse, pIdx, pLevel->iTabCur, regRecord, 0, 0, 0, 0);
|
||||
regBase = sqlite3GenerateIndexKey(
|
||||
pParse, pIdx, pLevel->iTabCur, regRecord, 0, 0, 0, 0
|
||||
);
|
||||
sqlite3VdbeAddOp2(v, OP_IdxInsert, pLevel->iIdxCur, regRecord);
|
||||
sqlite3VdbeChangeP5(v, OPFLAG_USESEEKRESULT);
|
||||
if( pPartial ) sqlite3VdbeResolveLabel(v, iContinue);
|
||||
if( pTabItem->fg.viaCoroutine ){
|
||||
translateColumnToCopy(v, addrTop, pLevel->iTabCur, pTabItem->regResult);
|
||||
sqlite3VdbeChangeP2(v, addrCounter, regBase+n);
|
||||
translateColumnToCopy(v, addrTop, pLevel->iTabCur, pTabItem->regResult, 1);
|
||||
sqlite3VdbeGoto(v, addrTop);
|
||||
pTabItem->fg.viaCoroutine = 0;
|
||||
}else{
|
||||
@@ -4509,7 +4528,7 @@ void sqlite3WhereEnd(WhereInfo *pWInfo){
|
||||
*/
|
||||
if( pTabItem->fg.viaCoroutine && !db->mallocFailed ){
|
||||
translateColumnToCopy(v, pLevel->addrBody, pLevel->iTabCur,
|
||||
pTabItem->regResult);
|
||||
pTabItem->regResult, 0);
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
|
||||
set testdir [file dirname $argv0]
|
||||
source $testdir/tester.tcl
|
||||
set testprefix autoindex5
|
||||
|
||||
# Schema is from the Debian security database
|
||||
#
|
||||
@@ -103,6 +104,26 @@ do_execsql_test autoindex5-1.1 {
|
||||
OR sp.release = 'wheezy' OR sp.release = 'squeeze' )
|
||||
ORDER BY sp.name, st.bug_name, sp.release, sp.subrelease;
|
||||
} {/SEARCH SUBQUERY 2 USING AUTOMATIC COVERING INDEX .bug_name=/}
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
# Test that ticket [8a2adec1] has been fixed.
|
||||
#
|
||||
do_execsql_test 2.1 {
|
||||
CREATE TABLE one(o);
|
||||
INSERT INTO one DEFAULT VALUES;
|
||||
|
||||
CREATE TABLE t1(x, z);
|
||||
INSERT INTO t1 VALUES('aaa', 4.0);
|
||||
INSERT INTO t1 VALUES('aaa', 4.0);
|
||||
CREATE VIEW vvv AS
|
||||
SELECT * FROM t1
|
||||
UNION ALL
|
||||
SELECT 0, 0 WHERE 0;
|
||||
|
||||
SELECT (
|
||||
SELECT sum(z) FROM vvv WHERE x='aaa'
|
||||
) FROM one;
|
||||
} {8.0}
|
||||
|
||||
|
||||
finish_test
|
||||
|
||||
@@ -62,6 +62,21 @@ do_execsql_test index3-2.2eqp {
|
||||
EXPLAIN QUERY PLAN
|
||||
SELECT a FROM t1 WHERE b='ab005xy' COLLATE nocase;
|
||||
} {/USING INDEX/}
|
||||
do_execsql_test index3-2.3 {
|
||||
SELECT name FROM sqlite_master WHERE tbl_name='t1' ORDER BY name
|
||||
} {sqlite_autoindex_t1_1 sqlite_autoindex_t1_2 t1 t1c t1d}
|
||||
do_execsql_test index3-2.4 {
|
||||
CREATE TABLE t2a(a integer, b, PRIMARY KEY(a));
|
||||
CREATE TABLE t2b("a" integer, b, PRIMARY KEY("a"));
|
||||
CREATE TABLE t2c([a] integer, b, PRIMARY KEY([a]));
|
||||
CREATE TABLE t2d('a' integer, b, PRIMARY KEY('a'));
|
||||
}
|
||||
do_execsql_test index3-2.5 {
|
||||
SELECT name FROM sqlite_master WHERE tbl_name LIKE 't2_' ORDER BY name
|
||||
} {t2a t2b t2c t2d}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
# This test corrupts the database file so it must be the last test
|
||||
|
||||
Reference in New Issue
Block a user