Compare commits

...

4 Commits

Author SHA1 Message Date
drh 27b3079590 Version 3.10.1 release candidate
FossilOrigin-Name: 254419c36766225ca542ae873ed38255e3fb8588
2016-01-13 21:41:56 +00:00
drh f93359bdc1 Version number to 3.10.1.
FossilOrigin-Name: 4660da251bcbfded00d96f105c6b60c394c8d0f4
2016-01-13 18:26:47 +00:00
drh c5f9877995 Add the SQLITE_FCNTL_JOURNAL_POINTER file control.
FossilOrigin-Name: ea9ce228e8c0a2a366b252bff1088bb061d4ec6f
2016-01-13 18:21:19 +00:00
drh 9bd7cd12de When the [https://www.sqlite.org/queryplanner.html#partialsort|block sorting optimization]
is used in a scalar subquery, be sure to exit the loop as soon as the first
valid output row is received.  Fix for ticket [cb3aa0641d9a4].

FossilOrigin-Name: 8b4f5080621a8c23d9d32bf578bb83edc43de5c3
2016-01-13 17:59:28 +00:00
12 changed files with 85 additions and 40 deletions
+1 -1
View File
@@ -1 +1 @@
3.10.0
3.10.1
Vendored
+9 -9
View File
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.69 for sqlite 3.10.0.
# Generated by GNU Autoconf 2.69 for sqlite 3.10.1.
#
#
# 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.10.0'
PACKAGE_STRING='sqlite 3.10.0'
PACKAGE_VERSION='3.10.1'
PACKAGE_STRING='sqlite 3.10.1'
PACKAGE_BUGREPORT=''
PACKAGE_URL=''
@@ -1460,7 +1460,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.10.0 to adapt to many kinds of systems.
\`configure' configures sqlite 3.10.1 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -1525,7 +1525,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
short | recursive ) echo "Configuration of sqlite 3.10.0:";;
short | recursive ) echo "Configuration of sqlite 3.10.1:";;
esac
cat <<\_ACEOF
@@ -1646,7 +1646,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
sqlite configure 3.10.0
sqlite configure 3.10.1
generated by GNU Autoconf 2.69
Copyright (C) 2012 Free Software Foundation, Inc.
@@ -2065,7 +2065,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.10.0, which was
It was created by sqlite $as_me 3.10.1, which was
generated by GNU Autoconf 2.69. Invocation command line was
$ $0 $@
@@ -12023,7 +12023,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.10.0, which was
This file was extended by sqlite $as_me 3.10.1, which was
generated by GNU Autoconf 2.69. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@@ -12089,7 +12089,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.10.0
sqlite config.status 3.10.1
configured by $0, generated by GNU Autoconf 2.69,
with options \\"\$ac_cs_config\\"
+15 -18
View File
@@ -1,10 +1,10 @@
C Version\s3.10.0
D 2016-01-06T11:01:07.739
C Version\s3.10.1\srelease\scandidate
D 2016-01-13T21:41:56.020
F Makefile.in 7c8cc4c2f0179efc6fa9492141d1fb65f4807054
F Makefile.linux-gcc 7bc79876b875010e8c8f9502eb935ca92aa3c434
F Makefile.msc e45d8b9b56dfa3f2cd860b2c28bd9d304513b042
F README.md 8ecc12493ff9f820cdea6520a9016001cb2e59b7
F VERSION 8b9d3ac6f1962f94e06ba05462422a544f9c4e36
F VERSION ae5b305b789e9fe41ef13462bf119db244ed7b1d
F aclocal.m4 a5c22d164aff7ed549d53a90fa56d56955281f50
F art/sqlite370.eps aa97a671332b432a54e1d74ff5e8775be34200c2
F art/sqlite370.ico af56c1d00fee7cd4753e8631ed60703ed0fc6e90
@@ -29,7 +29,7 @@ F autoconf/tea/win/rules.vc c511f222b80064096b705dbeb97060ee1d6b6d63
F config.guess 226d9a188c6196f3033ffc651cbc9dcee1a42977
F config.h.in 42b71ad3fe21c9e88fa59e8458ca1a6bc72eb0c0
F config.sub 9ebe4c3b3dab6431ece34f16828b594fb420da55
F configure e511ceefe595e35051933a90c848ab4fa1d48add x
F configure cdd403128a5193cbc39d03dc99fe56002cd903f9 x
F configure.ac fcfc67b323d32daaa3e46cf7782d9465ed423a6d
F contrib/sqlitecon.tcl 210a913ad63f9f991070821e599d600bd913e0ad
F doc/lemon.html 334dbf6621b8fb8790297ec1abf3cfa4621709d1
@@ -298,7 +298,7 @@ F src/insert.c 6b45cc86967da11aa024d034745f93f66d53f650
F src/journal.c b4124532212b6952f42eb2c12fa3c25701d8ba8d
F src/legacy.c ba1863ea58c4c840335a84ec276fc2b25e22bc4e
F src/loadext.c 84996d7d70a605597d79c1f1d7b2012a5fd34f2b
F src/main.c b9641a4f650230bfc5dbb0bebf7b33ff4d27586a
F src/main.c 6d589f27980c4aec014ae9a081d611e7e5ebc115
F src/malloc.c 8f787669e79de26efc42272b5797bc00fff527c6
F src/mem0.c 6a55ebe57c46ca1a7d98da93aaa07f99f1059645
F src/mem1.c 6919bcf12f221868ea066eec27e579fed95ce98b
@@ -320,8 +320,8 @@ F src/os_setup.h c9d4553b5aaa6f73391448b265b89bed0b890faa
F src/os_unix.c 0ca6d8710366fbb01a275160f018334cd347cbda
F src/os_win.c 386fba30419e8458b13209781c2af5590eab2811
F src/os_win.h eb7a47aa17b26b77eb97e4823f20a00b8bda12ca
F src/pager.c 58d2593612acb6b542de6715b4af397ea1fa0a35
F src/pager.h bf25005b4656cd805af43487c3139fca9678d0cc
F src/pager.c 5dda328a9a5e9405b6971d62d0d5e3ea85c6195a
F src/pager.h 1c2a49143dfba9e69cc8159ef019f472ed8d260b
F src/parse.y 23737e649c26ce327603799e57f5c2ff50e5e6ba
F src/pcache.c 73895411fa6b7bd6f0091212feabbe833b358d23
F src/pcache.h 1ff11adce609ba7de139b6abfabaf9a2bac947b5
@@ -333,9 +333,9 @@ F src/printf.c af589a27b7d40f6f4f704e9eea99f02f18ad6d32
F src/random.c ba2679f80ec82c4190062d756f22d0c358180696
F src/resolve.c a83b41104e6ff69855d03cd0aaa09e93927ec39f
F src/rowset.c eccf6af6d620aaa4579bd3b72c1b6395d9e9fa1e
F src/select.c f8fded11fc443a9f5a73cc5db069d06b34460e2f
F src/select.c 47cd4189c47d937478dae4fc8ec4bceb4ecebf11
F src/shell.c ed71dc7679e6f087a3f1ea3f9dae4b0fae7209c3
F src/sqlite.h.in 7d87d71b9a4689c51fa092f48f16590ff71558e3
F src/sqlite.h.in 214476a62012e578f42133a9a3b4f97a9aa421a3
F src/sqlite3.rc 992c9f5fb8285ae285d6be28240a7e8d3a7f2bad
F src/sqlite3ext.h dfbe62ffd95b99afe2140d8c35b180d11924072d
F src/sqliteInt.h f97614d43833bae0ed6c51ac8e550f0099a1d0ba
@@ -409,8 +409,8 @@ F src/vdbesort.c a7ec02da4494c59dfd071126dd3726be5a11459d
F src/vdbetrace.c 8befe829faff6d9e6f6e4dee5a7d3f85cc85f1a0
F src/vtab.c 2a8b44aa372c33f6154208e7a7f6c44254549806
F src/vxworks.h c18586c8edc1bddbc15c004fa16aeb1e1342b4fb
F src/wal.c 974928c988681c5157202c79dd9f26afaa7b5086
F src/wal.h 907943dfdef10b583e81906679a347e0ec6f1b1b
F src/wal.c 407f6f3929aeeb360f53a9279342940fe79823e1
F src/wal.h 2f7c831cf3b071fa548bf2d5cac640846a7ff19c
F src/walker.c 2e14d17f592d176b6dc879c33fbdec4fbccaa2ba
F src/where.c c6d3d2f6af57d574a7365ee2b225a5024f2a6bec
F src/whereInt.h 78b6b4de94db84aecbdc07fe3e38f648eb391e9a
@@ -903,7 +903,7 @@ F test/numcast.test 5d126f7f581432e86a90d1e35cac625164aec4a1
F test/numindex1.test 20a5450d4b056e48cd5db30e659f13347a099823
F test/offset1.test f06b83657bcf26f9ce805e67450e189e282143b2
F test/openv2.test 0d3040974bf402e19b7df4b783e447289d7ab394
F test/orderby1.test 870e150450437d3980badbde3d0166b81d9e33f6
F test/orderby1.test 4d22a7c75f6a83fc1f188cc7bb5192285fdf2552
F test/orderby2.test bc11009f7cd99d96b1b11e57b199b00633eb5b04
F test/orderby3.test 8619d06a3debdcd80a27c0fdea5c40b468854b99
F test/orderby4.test 4d39bfbaaa3ae64d026ca2ff166353d2edca4ba4
@@ -1406,10 +1406,7 @@ F tool/vdbe_profile.tcl 246d0da094856d72d2c12efec03250d71639d19f
F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4
F tool/warnings.sh 48bd54594752d5be3337f12c72f28d2080cb630b
F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f
P a855697719e288c908ddb7950d32fd17ef546509
R 658872c8eaad4f517adfb9642371bf29
T +bgcolor * #d0c0ff
T +sym-release *
T +sym-version-3.10.0 *
P 4660da251bcbfded00d96f105c6b60c394c8d0f4
R 5ba94cc6a4969a90103e60e246aa0492
U drh
Z 024a1b2bbd235a427c0ebcd39a99300a
Z 0d3438b18fba0c0eb6c0a5fbd8ff397b
+1 -1
View File
@@ -1 +1 @@
fd0a50f0797d154fefff724624f00548b5320566
254419c36766225ca542ae873ed38255e3fb8588
+3
View File
@@ -3424,6 +3424,9 @@ int sqlite3_file_control(sqlite3 *db, const char *zDbName, int op, void *pArg){
}else if( op==SQLITE_FCNTL_VFS_POINTER ){
*(sqlite3_vfs**)pArg = sqlite3PagerVfs(pPager);
rc = SQLITE_OK;
}else if( op==SQLITE_FCNTL_JOURNAL_POINTER ){
*(sqlite3_file**)pArg = sqlite3PagerJrnlFile(pPager);
rc = SQLITE_OK;
}else if( fd->pMethods ){
rc = sqlite3OsFileControl(fd, op, pArg);
}else{
+8
View File
@@ -6692,6 +6692,14 @@ sqlite3_file *sqlite3PagerFile(Pager *pPager){
return pPager->fd;
}
/*
** Return the file handle for the journal file (if it exists).
** This will be either the rollback journal or the WAL file.
*/
sqlite3_file *sqlite3PagerJrnlFile(Pager *pPager){
return pPager->pWal ? sqlite3WalFile(pPager->pWal) : pPager->jfd;
}
/*
** Return the full pathname of the journal file.
*/
+1
View File
@@ -188,6 +188,7 @@ int sqlite3PagerMemUsed(Pager*);
const char *sqlite3PagerFilename(Pager*, int);
sqlite3_vfs *sqlite3PagerVfs(Pager*);
sqlite3_file *sqlite3PagerFile(Pager*);
sqlite3_file *sqlite3PagerJrnlFile(Pager*);
const char *sqlite3PagerJournalname(Pager*);
int sqlite3PagerNosync(Pager*);
void *sqlite3PagerTempSpace(Pager*);
+12 -9
View File
@@ -54,6 +54,7 @@ struct SortCtx {
int regReturn; /* Register holding block-output return address */
int labelBkOut; /* Start label for the block-output subroutine */
int addrSortIndex; /* Address of the OP_SorterOpen or OP_OpenEphemeral */
int labelDone; /* Jump here when done, ex: LIMIT reached */
u8 sortFlags; /* Zero or more SORTFLAG_* bits */
};
#define SORTFLAG_UseSorter 0x01 /* Use SorterOpen instead of OpenEphemeral */
@@ -508,6 +509,7 @@ static void pushOntoSorter(
int regRecord = ++pParse->nMem; /* Assembled sorter record */
int nOBSat = pSort->nOBSat; /* ORDER BY terms to skip */
int op; /* Opcode to add sorter record to sorter */
int iLimit; /* LIMIT counter */
assert( bSeq==0 || bSeq==1 );
assert( nData==1 || regData==regOrigData );
@@ -518,6 +520,9 @@ static void pushOntoSorter(
regBase = pParse->nMem + 1;
pParse->nMem += nBase;
}
assert( pSelect->iOffset==0 || pSelect->iLimit!=0 );
iLimit = pSelect->iOffset ? pSelect->iOffset+1 : pSelect->iLimit;
pSort->labelDone = sqlite3VdbeMakeLabel(v);
sqlite3ExprCodeExprList(pParse, pSort->pOrderBy, regBase, regOrigData,
SQLITE_ECEL_DUP|SQLITE_ECEL_REF);
if( bSeq ){
@@ -526,7 +531,6 @@ static void pushOntoSorter(
if( nPrefixReg==0 ){
sqlite3ExprCodeMove(pParse, regData, regBase+nExpr+bSeq, nData);
}
sqlite3VdbeAddOp3(v, OP_MakeRecord, regBase+nOBSat, nBase-nOBSat, regRecord);
if( nOBSat>0 ){
int regPrevKey; /* The first nOBSat columns of the previous row */
@@ -561,6 +565,10 @@ static void pushOntoSorter(
pSort->regReturn = ++pParse->nMem;
sqlite3VdbeAddOp2(v, OP_Gosub, pSort->regReturn, pSort->labelBkOut);
sqlite3VdbeAddOp1(v, OP_ResetSorter, pSort->iECursor);
if( iLimit ){
sqlite3VdbeAddOp2(v, OP_IfNot, iLimit, pSort->labelDone);
VdbeCoverage(v);
}
sqlite3VdbeJumpHere(v, addrFirst);
sqlite3ExprCodeMove(pParse, regBase, regPrevKey, pSort->nOBSat);
sqlite3VdbeJumpHere(v, addrJmp);
@@ -571,14 +579,8 @@ static void pushOntoSorter(
op = OP_IdxInsert;
}
sqlite3VdbeAddOp2(v, op, pSort->iECursor, regRecord);
if( pSelect->iLimit ){
if( iLimit ){
int addr;
int iLimit;
if( pSelect->iOffset ){
iLimit = pSelect->iOffset+1;
}else{
iLimit = pSelect->iLimit;
}
addr = sqlite3VdbeAddOp3(v, OP_IfNotZero, iLimit, 0, 1); VdbeCoverage(v);
sqlite3VdbeAddOp1(v, OP_Last, pSort->iECursor);
sqlite3VdbeAddOp1(v, OP_Delete, pSort->iECursor);
@@ -1182,7 +1184,7 @@ static void generateSortTail(
SelectDest *pDest /* Write the sorted results here */
){
Vdbe *v = pParse->pVdbe; /* The prepared statement */
int addrBreak = sqlite3VdbeMakeLabel(v); /* Jump here to exit loop */
int addrBreak = pSort->labelDone; /* Jump here to exit loop */
int addrContinue = sqlite3VdbeMakeLabel(v); /* Jump here for next cycle */
int addr;
int addrOnce = 0;
@@ -1201,6 +1203,7 @@ static void generateSortTail(
struct ExprList_item *aOutEx = p->pEList->a;
#endif
assert( addrBreak<0 );
if( pSort->labelBkOut ){
sqlite3VdbeAddOp2(v, OP_Gosub, pSort->regReturn, pSort->labelBkOut);
sqlite3VdbeGoto(v, addrBreak);
+8 -2
View File
@@ -794,8 +794,13 @@ struct sqlite3_io_methods {
** <li>[[SQLITE_FCNTL_FILE_POINTER]]
** The [SQLITE_FCNTL_FILE_POINTER] opcode is used to obtain a pointer
** to the [sqlite3_file] object associated with a particular database
** connection. See the [sqlite3_file_control()] documentation for
** additional information.
** connection. See also [SQLITE_FCNTL_JOURNAL_POINTER].
**
** <li>[[SQLITE_FCNTL_JOURNAL_POINTER]]
** The [SQLITE_FCNTL_JOURNAL_POINTER] opcode is used to obtain a pointer
** to the [sqlite3_file] object associated with the journal file (either
** the [rollback journal] or the [write-ahead log]) for a particular database
** connection. See also [SQLITE_FCNTL_FILE_POINTER].
**
** <li>[[SQLITE_FCNTL_SYNC_OMITTED]]
** No longer in use.
@@ -1010,6 +1015,7 @@ struct sqlite3_io_methods {
#define SQLITE_FCNTL_ZIPVFS 25
#define SQLITE_FCNTL_RBU 26
#define SQLITE_FCNTL_VFS_POINTER 27
#define SQLITE_FCNTL_JOURNAL_POINTER 28
/* deprecated names */
#define SQLITE_GET_LOCKPROXYFILE SQLITE_FCNTL_GET_LOCKPROXYFILE
+6
View File
@@ -3310,4 +3310,10 @@ int sqlite3WalFramesize(Wal *pWal){
}
#endif
/* Return the sqlite3_file object for the WAL file
*/
sqlite3_file *sqlite3WalFile(Wal *pWal){
return pWal->pWalFd;
}
#endif /* #ifndef SQLITE_OMIT_WAL */
+4
View File
@@ -44,6 +44,7 @@
# define sqlite3WalHeapMemory(z) 0
# define sqlite3WalFramesize(z) 0
# define sqlite3WalFindFrame(x,y,z) 0
# define sqlite3WalFile(x) 0
#else
#define WAL_SAVEPOINT_NDATA 4
@@ -138,5 +139,8 @@ void sqlite3WalSnapshotOpen(Wal *pWal, sqlite3_snapshot *pSnapshot);
int sqlite3WalFramesize(Wal *pWal);
#endif
/* Return the sqlite3_file object for the WAL file */
sqlite3_file *sqlite3WalFile(Wal *pWal);
#endif /* ifndef SQLITE_OMIT_WAL */
#endif /* _WAL_H_ */
+17
View File
@@ -528,4 +528,21 @@ do_test 8.3 {
set res
} 5000
#---------------------------------------------------------------------------
# https://www.sqlite.org/src/tktview/cb3aa0641d9a413841c004293a4fc06cdc122029
#
# Adverse interaction between scalar subqueries and the partial-sorting
# logic.
#
do_execsql_test 9.0 {
DROP TABLE IF EXISTS t1;
CREATE TABLE t1(x INTEGER PRIMARY KEY);
INSERT INTO t1 VALUES(1),(2);
DROP TABLE IF EXISTS t2;
CREATE TABLE t2(y);
INSERT INTO t2 VALUES(9),(8),(3),(4);
SELECT (SELECT x||y FROM t2, t1 ORDER BY x, y);
} {13}
finish_test