diff --git a/manifest b/manifest index 41f3141c14..2d93f8ada9 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C In\ssynchronous=normal\smode,\sdo\snot\ssync\sthe\slog\safter\severy\stransaction.\sIn\ssynchronous=full\smode,\ssync\sthe\slog\sand\sadd\sany\sextra\sframes\srequired\sto\savoid\sblast-radius\srelated\sproblems\safter\seach\stransaction. -D 2010-04-17T15:42:43 +C Merge\swith\strunk\scommit\s[3e646e3f4c]. +D 2010-04-17T15:45:35 F Makefile.arm-wince-mingw32ce-gcc fcd5e9cd67fe88836360bb4f9ef4cb7f8e2fb5a0 F Makefile.in 4f2f967b7e58a35bb74fb7ec8ae90e0f4ca7868b F Makefile.linux-gcc d53183f4aa6a9192d249731c90dbdffbd2c68654 @@ -166,9 +166,9 @@ F src/printf.c 5f5b65a83e63f2096a541a340722a509fa0240a7 F src/random.c cd4a67b3953b88019f8cd4ccd81394a8ddfaba50 F src/resolve.c ac5f1a713cd1ae77f08b83cc69581e11bf5ae6f9 F src/rowset.c 69afa95a97c524ba6faf3805e717b5b7ae85a697 -F src/select.c 5a08245cb18b7ddf2456274653599cbf738d3830 +F src/select.c b7c9a40bc1567bceff52ad4b73108734ee4bf268 F src/shell.c c40427c7245535a04a9cb4a417b6cc05c022e6a4 -F src/sqlite.h.in 0aeb53778e1591032fdf12ba7aa059250beb480a +F src/sqlite.h.in dc98616304e3e776008655671d81e3ad3028ada7 F src/sqlite3ext.h 69dfb8116af51b84a029cddb3b35062354270c89 F src/sqliteInt.h bd7ff54663bdd5b57e0eb8b49aca5a3a3c60119a F src/sqliteLimit.h 3afab2291762b5d09ae20c18feb8e9fa935a60a6 @@ -217,7 +217,7 @@ F src/vacuum.c b1d542c8919d4d11119f78069e1906a1ad07e0ee F src/vdbe.c 2e2aaa765de667dd15e0462cf853efd1b2f97998 F src/vdbe.h 471f6a3dcec4817ca33596fe7f6654d56c0e75f3 F src/vdbeInt.h 19ebc8c2a2e938340051ee65af3f377fb99102d1 -F src/vdbeapi.c 74c25680046a116b24b95393914d3669c23305dc +F src/vdbeapi.c 11bcc381e81e797fcf3e81fa6a14ec16a04801cc F src/vdbeaux.c 3028b2d50df39697e21263685349b5ff1333a29b F src/vdbeblob.c 5327132a42a91e8b7acfb60b9d2c3b1c5c863e0e F src/vdbemem.c 2a82f455f6ca6f78b59fb312f96054c04ae0ead1 @@ -275,7 +275,7 @@ F test/boundary4.tcl 0bb4b1a94f4fc5ae59b79b9a2b7a140c405e2983 F test/boundary4.test 89e02fa66397b8a325d5eb102b5806f961f8ec4b F test/busy.test 76b4887f8b9160ba903c1ac22e8ff406ad6ae2f0 F test/cache.test 3ff445c445742a7b6b9ba6e1d62a25263f9424b9 -F test/capi2.test 172c717ed101e78e0798dd21b9896a22366f35b4 +F test/capi2.test 00032d7504b9c14f1b36331670c5e7b0f73e3c5d F test/capi3.test 168e2cd66c58c510955b0f299750e4de73b8d952 F test/capi3b.test 664eb55318132f292f2c436f90906f578cad6b97 F test/capi3c.test 493385107dcedfaf4f2b1c3738c8c1fa00362006 @@ -347,7 +347,7 @@ F test/expr.test 9f521ae22f00e074959f72ce2e55d46b9ed23f68 F test/filectrl.test 8923a6dc7630f31c8a9dd3d3d740aa0922df7bf8 F test/filefmt.test 84e3d0fe9f12d0d2ac852465c6f8450aea0d6f43 F test/fkey1.test 01c7de578e11747e720c2d9aeef27f239853c4da -F test/fkey2.test e71f5baf9bb42cdba4700d73cba6f4d82fd6b925 +F test/fkey2.test 82652daf32ec5a40634a10bc8db571b84d39c7fe F test/fkey3.test 42f88d6048d8dc079e2a8cf7baad1cc1483a7620 F test/fkey_malloc.test a5ede29bd2f6e56dea78c3d43fb86dd696c068c8 F test/format4.test 1f0cac8ff3895e9359ed87e41aaabee982a812eb @@ -614,6 +614,7 @@ F test/thread2.test 6e0997f7beabb6a7e471bd18740ed04805c785f4 F test/thread_common.tcl 0b07423d29ddb73d4bacbac69268c8d37b6cc5d2 F test/threadtest1.c 6029d9c5567db28e6dc908a0c63099c3ba6c383b F test/threadtest2.c ace893054fa134af3fc8d6e7cfecddb8e3acefb9 +F test/tkt-02a8e81d44.test 58494de77be2cf249228ada3f313fa399821c6ab F test/tkt-2ea2425d34.test 1cf13e6f75d149b3209a0cb32927a82d3d79fb28 F test/tkt-31338dca7e.test 5741cd48de500347a437ba1be58c8335e83c5a5e F test/tkt-3fe897352e.test 10de1a67bd5c66b238a4c96abe55531b37bb4f00 @@ -804,7 +805,7 @@ F tool/speedtest2.tcl ee2149167303ba8e95af97873c575c3e0fab58ff F tool/speedtest8.c 2902c46588c40b55661e471d7a86e4dd71a18224 F tool/speedtest8inst1.c 293327bc76823f473684d589a8160bde1f52c14e F tool/vdbe-compress.tcl d70ea6d8a19e3571d7ab8c9b75cba86d1173ff0f -P 8549c286497f3d2cd118be1334fce00d6f8a26c4 -R 6ac8dd31103bf297ef819af9a9f02a12 +P 9bc9b6847303d0324543a9ded8dd0473490122d8 3e646e3f4cd0ca288e444561e951cecfdaee2ab5 +R 9ec1fc417b85c6217c6e7a04071a1912 U dan -Z 35f390be152b1baf460a096be51e37de +Z 5c9ba544c6cd36a35ee164445a4a1f25 diff --git a/manifest.uuid b/manifest.uuid index d5b1aacc94..d195514289 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -9bc9b6847303d0324543a9ded8dd0473490122d8 \ No newline at end of file +43463970f5885fb116588695146f2a56cb22804a \ No newline at end of file diff --git a/src/select.c b/src/select.c index 487a8b9207..47e409ffc8 100644 --- a/src/select.c +++ b/src/select.c @@ -2526,8 +2526,8 @@ static void substSelect( ** (14) The subquery does not use OFFSET ** ** (15) The outer query is not part of a compound select or the -** subquery does not have both an ORDER BY and a LIMIT clause. -** (See ticket #2339) +** subquery does not have a LIMIT clause. +** (See ticket #2339 and ticket [02a8e81d44]). ** ** (16) The outer query is not an aggregate or the subquery does ** not contain ORDER BY. (Ticket #2942) This used to not matter @@ -2610,7 +2610,7 @@ static int flattenSubquery( ** and (14). */ if( pSub->pLimit && p->pLimit ) return 0; /* Restriction (13) */ if( pSub->pOffset ) return 0; /* Restriction (14) */ - if( p->pRightmost && pSub->pLimit && pSub->pOrderBy ){ + if( p->pRightmost && pSub->pLimit ){ return 0; /* Restriction (15) */ } if( pSubSrc->nSrc==0 ) return 0; /* Restriction (7) */ diff --git a/src/sqlite.h.in b/src/sqlite.h.in index 78f3773e99..c1363031ea 100644 --- a/src/sqlite.h.in +++ b/src/sqlite.h.in @@ -2885,6 +2885,14 @@ const void *sqlite3_column_decltype16(sqlite3_stmt*,int); ** be the case that the same database connection is being used by two or ** more threads at the same moment in time. ** +** For all versions of SQLite up to and including 3.6.23.1, it was required +** after sqlite3_step() returned anything other than [SQLITE_ROW] that +** [sqlite3_reset()] be called before any subsequent invocation of +** sqlite3_step(). Failure to invoke [sqlite3_reset()] in this way would +** result in an [SQLITE_MISUSE] return from sqlite3_step(). But after +** version 3.6.23.1, sqlite3_step() began calling [sqlite3_reset()] +** automatically in this circumstance rather than returning [SQLITE_MISUSE]. +** ** Goofy Interface Alert: In the legacy interface, the sqlite3_step() ** API always returns a generic error code, [SQLITE_ERROR], following any ** error other than [SQLITE_BUSY] and [SQLITE_MISUSE]. You must call diff --git a/src/vdbeapi.c b/src/vdbeapi.c index 125f325d18..29a2a429bc 100644 --- a/src/vdbeapi.c +++ b/src/vdbeapi.c @@ -321,9 +321,12 @@ static int sqlite3Step(Vdbe *p){ assert(p); if( p->magic!=VDBE_MAGIC_RUN ){ - sqlite3_log(SQLITE_MISUSE, - "attempt to step a halted statement: [%s]", p->zSql); - return SQLITE_MISUSE_BKPT; + /* We used to require that sqlite3_reset() be called before retrying + ** sqlite3_step() after any error. But after 3.6.23, we changed this + ** so that sqlite3_reset() would be called automatically instead of + ** throwing the error. + */ + sqlite3_reset((sqlite3_stmt*)p); } /* Check that malloc() has not failed. If it has, return early. */ diff --git a/test/capi2.test b/test/capi2.test index 8bcb25a834..b4aa970c8e 100644 --- a/test/capi2.test +++ b/test/capi2.test @@ -71,15 +71,19 @@ do_test capi2-1.6 { do_test capi2-1.7 { list [sqlite3_column_count $VM] [get_row_values $VM] [get_column_names $VM] } {2 {} {name rowid text INTEGER}} -do_test capi2-1.8-misuse { + +# This used to be SQLITE_MISUSE. But now we automatically reset prepared +# statements. +do_test capi2-1.8 { sqlite3_step $VM -} {SQLITE_MISUSE} +} {SQLITE_ROW} # Update: In v2, once SQLITE_MISUSE is returned the statement handle cannot # be interrogated for more information. However in v3, since the column # count, names and types are determined at compile time, these are still # accessible after an SQLITE_MISUSE error. do_test capi2-1.9 { + sqlite3_reset $VM list [sqlite3_column_count $VM] [get_row_values $VM] [get_column_names $VM] } {2 {} {name rowid text INTEGER}} do_test capi2-1.10 { diff --git a/test/fkey2.test b/test/fkey2.test index 10a624ef0a..2134431b02 100644 --- a/test/fkey2.test +++ b/test/fkey2.test @@ -1410,7 +1410,7 @@ do_test fkey2-17.1.2 { } {SQLITE_CONSTRAINT} do_test fkey2-17.1.3 { sqlite3_step $STMT -} {SQLITE_MISUSE} +} {SQLITE_CONSTRAINT} do_test fkey2-17.1.4 { sqlite3_finalize $STMT } {SQLITE_CONSTRAINT} diff --git a/test/tkt-02a8e81d44.test b/test/tkt-02a8e81d44.test new file mode 100644 index 0000000000..4a48fb029e --- /dev/null +++ b/test/tkt-02a8e81d44.test @@ -0,0 +1,31 @@ +# 2010 April 15 +# +# 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. +# +# This file implements tests to verify that ticket [02a8e81d44] has been +# fixed. +# + +set testdir [file dirname $argv0] +source $testdir/tester.tcl + +do_test tkt-02a838-1.1 { + execsql { + CREATE TABLE t1(a); + INSERT INTO t1 VALUES(1); + INSERT INTO t1 VALUES(2); + INSERT INTO t1 VALUES(4); + INSERT INTO t1 VALUES(5); + SELECT * FROM (SELECT a FROM t1 LIMIT 1) UNION ALL SELECT 3; + } +} {1 3} + +finish_test