Compare commits

...

33 Commits

Author SHA1 Message Date
mistachkin f5840160b7 Fix typo in sqlite3_close() function documentation reported on the mailing list.
FossilOrigin-Name: 7232093d6c6871a9f4ea155ab215e3b39c1c322d
2013-03-12 20:58:21 +00:00
dan 881bd79293 Define _BSD_SOURCE when building on OpenBSD. This is required for fchmod().
FossilOrigin-Name: f9027cb47bdec8dcebf1f038921b28d9e9928c18
2013-03-11 13:37:52 +00:00
dan b606ec52c7 Fixes for compiling with SQLITE_OMIT_AUTOVACUUM and/or SQLITE_OMIT_TRIGGER defined.
FossilOrigin-Name: 1da15adba8f6eec69c24ec6385d6f1a7905a388f
2013-03-11 11:57:30 +00:00
dan 09ff9e1664 Fixes for compiling with SQLITE_OMIT_AUTOVACUUM and/or SQLITE_OMIT_TRIGGER defined.
FossilOrigin-Name: 938b91e8552516772060d4e55e2f79cca4c13e27
2013-03-11 11:49:03 +00:00
dan 3da0df9d18 Add a test case for the problem fixed by the previous commit.
FossilOrigin-Name: e899b058a703158012c054974bd9a909d75144d8
2013-03-09 14:49:07 +00:00
dan 6d235cb8d8 Fix a problem with resolving "db.view.column" references that appear in UPDATE or DELETE statements executed against views.
FossilOrigin-Name: ddee56c9b2b591b9386b1072c3b3a699f7c1f853
2013-03-09 14:40:24 +00:00
dan 994ff6f587 If SQLITE_OMIT_UTF16 is defined, avoid setting the 'enc' field of Schema objects to any value except SQLITE_UTF8. Otherwise, assert() statements may fail or spurious SQLITE_NOMEM errors may be returned at the vdbe level later on.
FossilOrigin-Name: f2fecfb2d32cf666e16a87032042dc163ac30250
2013-03-08 18:16:33 +00:00
dan dbd4d5fc77 If SQLITE_OMIT_UTF16 is defined, avoid setting the 'enc' field of Schema objects to any value except SQLITE_UTF8. Otherwise, assert() statements may fail or spurious SQLITE_NOMEM errors may be returned at the vdbe level later on.
FossilOrigin-Name: 69746ef787680a4b7590bd1d3c86b229d9d0dac4
2013-03-08 07:10:37 +00:00
drh fe7a5d11b6 Fix the char() function so that it works even if SQLITE_OMIT_UTF16 is defined.
FossilOrigin-Name: af542c82e8e7f0415530b639fa397429c5f377f6
2013-03-07 14:00:04 +00:00
mistachkin 5acefe7dbe Skip tests that require UTF-16 support when compiled with SQLITE_OMIT_UTF16.
FossilOrigin-Name: e39391422e748407d74853d3de297dc1ea6b991d
2013-03-07 09:39:18 +00:00
mistachkin ef593f293e Fix two compilation issues, one warning and one error, that occur only when SQLITE_OMIT_UTF16 is defined.
FossilOrigin-Name: 10ace06be7fbe9a76a201c418b2af453c7a69043
2013-03-07 06:42:53 +00:00
dan 42c4bd02f4 Fix a problem in incrvacuum_ioerr.test. Do not run ioerr6.test with an in-memory journal.
FossilOrigin-Name: 66576b450a0f0329571e344280994a964c967f8f
2013-03-06 11:44:57 +00:00
drh 459f63e7ed Fix a bug (ticket [fc7bd6358f59]) that caused incorrect query results in
three way queries that involved comparing INTEGER and TEXT columns for
equality.

FossilOrigin-Name: 7097241c1220ada318f8eda938c3e3430b94a606
2013-03-06 01:55:27 +00:00
drh a0272d8255 Add the SQLITE_READONLY_ROLLBACK extended error code.
Do not try to set the permissions on journal or wal files except if the
filesize is initially zero (indicating that it is a new file.)

FossilOrigin-Name: ce4ac66a4b623a3cee1a63089dd5ba8341244f1e
2013-03-06 01:48:20 +00:00
drh cfc176973e Fix an operator precedence problem on the [1d8086902e] check-in.
FossilOrigin-Name: 4f5f3aebe81c3cbe539db3e33ec38fa3de47e90b
2013-03-06 01:41:53 +00:00
dan 77dfe91662 Merge experimental branch with trunk.
FossilOrigin-Name: 4e6e07a60e543d5d1727cde27ab11e156202a1b8
2013-03-05 16:54:45 +00:00
dan b83c21e600 Do not attempt to set the permissions on an existing journal or wal file. Do this only immediately after creating a new file (or opening one zero bytes in size).
FossilOrigin-Name: 1d8086902ee96347491bce5ec04dc92ccd42efa1
2013-03-05 15:27:34 +00:00
dan e3664fb03c Add extended error code SQLITE_READONLY_ROLLBACK. Returned if a read-only connection cannot read the database because doing so would require it to roll back a hot-journal.
FossilOrigin-Name: 39247b14a52b0c0222fe5a848bf0aef0854058c4
2013-03-05 15:09:25 +00:00
dan e1df4e31ec Fix a bug in the recent incremental-vacuum related changes.
FossilOrigin-Name: 717863fca6d58828bf9321bc8b169e385ad4263f
2013-03-05 11:27:04 +00:00
drh edf9a17b47 Simplified error message on the showdb utility.
FossilOrigin-Name: 8e0ced1af78d8c25a06423a8e7e337ac845155cc
2013-03-05 01:46:26 +00:00
dan 84fb4c22b9 Omit a test that uses the progress handler callback from view.test if OMIT_PROGRESS_HANDLER is defined.
FossilOrigin-Name: f40552ada57622825d2974d392356aa34612d5ee
2013-03-04 17:41:32 +00:00
dan e0ac363c62 Remove an assert() statement that has been incorrect since the recent incremental-vacuum related changes in [26e235b7a4].
FossilOrigin-Name: 090a47127fde90616a92a324d26bf9ddd4053120
2013-03-04 16:35:06 +00:00
drh 7015698b81 Add the test_fs.c test module to Makefile.in. Adjust the success criteria
on index5-1.3 so that it works under auto_vacuum configurations.

FossilOrigin-Name: b457c8870ac5ef58f2b7f8daed723c0cf0c07340
2013-03-03 20:26:46 +00:00
drh 82e647d7c3 Update comments on the free-page allocator to accurately reflect the
latest implementation.  Add new asserts to the free-page allocator.

FossilOrigin-Name: 9a135e37b696b8544da8dbddf9d1041b8fa6f1c2
2013-03-02 03:25:55 +00:00
drh 1d59d036de Complete the initialization of the loadable extension thunk table. Also
fix other (harmless) compiler warnings.

FossilOrigin-Name: 780d06c5e54590f677f993fa9c313989c2eab8c7
2013-03-01 23:40:26 +00:00
drh 1488052d38 Update the cygwin interface to use the newer 1.7 APIs instead of the
1.5 APIs.  Also shorten over-length source code lines in os_win.c.

FossilOrigin-Name: 6b2838336a31e34c540210ccc9c934d4ba94757c
2013-03-01 23:24:04 +00:00
mistachkin 6e8a54fbd2 Prevent Tcl file encoding issues in the tests for the unicode() and char() functions.
FossilOrigin-Name: c9c2b82c86fff457a0b32d5be84ec66639065ae1
2013-03-01 23:13:37 +00:00
drh 6ffb4975f7 Fix an overly restrictive assert() in the pager.
FossilOrigin-Name: f476eace86102fd5442cfbba169c18f6ee44eae2
2013-03-01 21:01:05 +00:00
drh de97724827 Fix the handling of UTF16 surrogate pairs in the char() function.
FossilOrigin-Name: ff67d87894eeb0036374235c5723e267536909f9
2013-03-01 15:02:52 +00:00
drh 503a686e09 Always use strncmp() rather than memcmp() when comparing strings where one
or other string might be less than the length parameter, since optimized
versions of memcmp() might read past the first difference and in so doing
generate an access violation.

FossilOrigin-Name: d73435587ba7459e2e2c32980d0e17abdeceb4bc
2013-03-01 01:07:17 +00:00
mistachkin 016fff2b6e In the incrvacuum3 test, add missing call to the Tcl close command.
FossilOrigin-Name: cd8067238439638bcfd3966d55d2a3990f36d702
2013-02-26 18:54:18 +00:00
drh dd1dd489d9 When comparing names during name resolution, make sure the names match
exactly and that one name isn't merely a prefix of the other.
Fix for ticket [7a31705a7e6c95d51].

FossilOrigin-Name: c2d5a23b1ab39918e97c596cf75c42f86a5fe2b7
2013-02-26 12:57:42 +00:00
dan 9cf37e718c Change the way test script incrvacuum3.test copies database files in order to avoid trying to read the (locked) 512 byte 'pending-byte' region.
FossilOrigin-Name: fa1842e462049b1366909fe36d6d81b634be3953
2013-02-26 06:14:27 +00:00
39 changed files with 422 additions and 151 deletions
+1
View File
@@ -357,6 +357,7 @@ TESTSRC = \
$(TOP)/src/test_config.c \
$(TOP)/src/test_demovfs.c \
$(TOP)/src/test_devsym.c \
$(TOP)/src/test_fs.c \
$(TOP)/src/test_func.c \
$(TOP)/src/test_fuzzer.c \
$(TOP)/src/test_hexio.c \
+44 -42
View File
@@ -1,7 +1,7 @@
C Prevent\sTcl\sfile\sencoding\sissues\sin\sthe\stests\sfor\sthe\sunicode()\sand\schar()\sfunctions.
D 2013-02-26T05:44:33.955
C Fix\stypo\sin\ssqlite3_close()\sfunction\sdocumentation\sreported\son\sthe\smailing\slist.
D 2013-03-12T20:58:21.853
F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f
F Makefile.in a48faa9e7dd7d556d84f5456eabe5825dd8a6282
F Makefile.in 9a804abbd3cae82d196e4d33aba13239e32522a5
F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23
F Makefile.msc 1bed3bca025ee90441bb0c9f95f36f42b70bd839
F Makefile.vxworks b18ad88e9a8c6a001f5cf4a389116a4f1a7ab45f
@@ -115,25 +115,25 @@ F sqlite.pc.in 42b7bf0d02e08b9e77734a47798d1a55a9e0716b
F sqlite3.1 6be1ad09113570e1fc8dcaff84c9b0b337db5ffc
F sqlite3.pc.in ae6f59a76e862f5c561eb32a380228a02afc3cad
F src/alter.c f8db986c03eb0bfb221523fc9bbb9d0b70de3168
F src/analyze.c 7553068d21e32a57fc33ab6b2393fc8c1ba41410
F src/analyze.c d5f895810e8ff9737c9ec7b76abc3dcff5860335
F src/attach.c ea5247f240e2c08afd608e9beb380814b86655e1
F src/auth.c 523da7fb4979469955d822ff9298352d6b31de34
F src/backup.c b2cac9f7993f3f9588827b824b1501d0c820fa68
F src/bitvec.c 26675fe8e431dc555e6f2d0e11e651d172234aa1
F src/btmutex.c 976f45a12e37293e32cae0281b15a21d48a8aaa7
F src/btree.c cbad71970cfadfa342fc137ca5e319f98b2d0da1
F src/btree.c 746c4dafae8565b3be6fb9ce3bb1fa9f1e67cc59
F src/btree.h 3ad7964d6c5b1c7bff569aab6adfa075f8bf06cd
F src/btreeInt.h eecc84f02375b2bb7a44abbcbbe3747dde73edb2
F src/build.c 73ca65f32938e4e0d94e831b61b5749b211b79be
F src/build.c 375e5df716e03b9343c5e1211be3b24e6d6dff05
F src/callback.c d7e46f40c3cf53c43550b7da7a1d0479910b62cc
F src/complete.c dc1d136c0feee03c2f7550bafc0d29075e36deac
F src/ctime.c 72a70dcfda75d3a1f81041ce4573e7afddcd8e4e
F src/date.c 067a81c9942c497aafd2c260e13add8a7d0c7dd4
F src/delete.c 9b8d308979114991e5dc7cee958316e07186941d
F src/expr.c f6c20285bd36e87ec47f4d840e90a32755e2a90c
F src/delete.c aeabdabeeeaa0584127f291baa9617153d334778
F src/expr.c a23b4aac2a455b2e76b55bef5dcfbe62b665375c
F src/fault.c 160a0c015b6c2629d3899ed2daf63d75754a32bb
F src/fkey.c e16942bd5c8a868ac53287886464a5ed0e72b179
F src/func.c cac45cca7bbe29bbefef46116174e89e1284763b
F src/func.c 48987c025d69399f59a1c2a553cea5da41bf105d
F src/global.c e59ecd2c553ad0d4bfbc84ca71231336f8993a7a
F src/hash.c ac3470bbf1ca4ae4e306a8ecb0fdf1731810ffe4
F src/hash.h 2894c932d84d9f892d4b4023a75e501f83050970
@@ -142,7 +142,7 @@ F src/insert.c f7cb141e8ce257cb6b15c497f09e4e23d6055599
F src/journal.c b4124532212b6952f42eb2c12fa3c25701d8ba8d
F src/legacy.c a199d7683d60cef73089e892409113e69c23a99f
F src/lempar.c cdf0a000315332fc9b50b62f3b5e22e080a0952b
F src/loadext.c f20382fbaeec832438a1ba7797bee3d3c8a6d51d
F src/loadext.c 1422eba4aa2b1fb5f7b3aef574752272477d21e2
F src/main.c 8d204866d1abf5100503dcd54d3187b88f6846b7
F src/malloc.c fe085aa851b666b7c375c1ff957643dc20a04bf6
F src/mem0.c 6a55ebe57c46ca1a7d98da93aaa07f99f1059645
@@ -160,31 +160,31 @@ F src/notify.c 976dd0f6171d4588e89e874fcc765e92914b6d30
F src/os.c e1acdc09ff3ac2412945cca9766e2dcf4675f31c
F src/os.h 027491c77d2404c0a678bb3fb06286f331eb9b57
F src/os_common.h 92815ed65f805560b66166e3583470ff94478f04
F src/os_unix.c dfdc04b126f7b05dcb2e2cc5c1262f98acbb49d9
F src/os_win.c eabd00b813577d36bd66271cb08dd64ea0589dac
F src/pager.c 0dbf5ff5d5d7d3a21fcab82e9e4d129b6fe6314f
F src/os_unix.c f6387eef0cf8f6b808738f4f3aa47e6132af0940
F src/os_win.c f7da4dc0a2545c0a430080380809946ae4d676d6
F src/pager.c 582f8da52d0bd4b43d3bdaeba0ea7702c1f23702
F src/pager.h 1109a06578ec5574dc2c74cf8d9f69daf36fe3e0
F src/parse.y 5d5e12772845805fdfeb889163516b84fbb9ae95
F src/pcache.c f8043b433a57aba85384a531e3937a804432a346
F src/pcache.h 1b5dcc3dc8103d03e625b177023ee67764fa6b7c
F src/pcache1.c 9fd22671c270b35131ef480bbc00392b8b5f8ab9
F src/pragma.c bdb484d0283965c431d4153f28c30f836a1f16b1
F src/prepare.c 931ad0d852a0df48f79adcba6ce79ca5f475625c
F src/pragma.c 9f0ee3d74a7f33eeeff40a4b014fc3abf8182ce2
F src/prepare.c 78cd7ae8cd0d8de8ef8a8b5352fc5f38693a0852
F src/printf.c 4a9f882f1c1787a8b494a2987765acf9d97ac21f
F src/random.c cd4a67b3953b88019f8cd4ccd81394a8ddfaba50
F src/resolve.c 652ae6dc0f185b01b4536bb2fa7d878f13f0f1df
F src/resolve.c 9079da7d59aed2bb14ec8315bc7f720dd85b5b65
F src/rowset.c 64655f1a627c9c212d9ab497899e7424a34222e0
F src/select.c e1c6f6abdf9f359f4e735cb8ae11d2f359bf52a9
F src/shell.c 7c41bfcd9e5bf9d96b9215f79b03a5b2b44a3bca
F src/sqlite.h.in 6296506a8fba279d8fa31f4abf01ab0cc92738a6
F src/sqlite.h.in f2fa32f440dda59ca47e22889966b2a6eb3b491c
F src/sqlite3.rc fea433eb0a59f4c9393c8e6d76a6e2596b1fe0c0
F src/sqlite3ext.h 7183ab832e23db0f934494f16928da127a571d75
F src/sqliteInt.h 601c887f6d9c92e75551873c0a34711fff745bed
F src/sqliteInt.h 59477c6ddb25e7ed8d8b67f4c58ded254371182e
F src/sqliteLimit.h 164b0e6749d31e0daa1a4589a169d31c0dec7b3d
F src/status.c bedc37ec1a6bb9399944024d63f4c769971955a9
F src/table.c 2cd62736f845d82200acfa1287e33feb3c15d62e
F src/tclsqlite.c 3213f3101e3b85f047d6e389da5a53d76d3d7540
F src/test1.c 50003e3beccad5569f757598fc7ce81b4f21aa7e
F src/test1.c ff3e68eedfbd858c9b89cf03e3db233cd29be1d0
F src/test2.c 4178056dd1e7d70f954ad8a1e3edb71a2a784daf
F src/test3.c 3c3c2407fa6ec7a19e24ae23f7cb439d0275a60d
F src/test4.c bf9fa9bece01de08e6f5e02314e4af5c13590dfa
@@ -216,13 +216,13 @@ F src/test_mutex.c a6bd7b9cf6e19d989e31392b06ac8d189f0d573e
F src/test_onefile.c 0396f220561f3b4eedc450cef26d40c593c69a25
F src/test_osinst.c 90a845c8183013d80eccb1f29e8805608516edba
F src/test_pcache.c a5cd24730cb43c5b18629043314548c9169abb00
F src/test_quota.c 0e0e2e3bf6766b101ecccd8c042b66e44e9be8f5
F src/test_quota.c 1ec82e02fd3643899e9a5de9684515e84641c91f
F src/test_quota.h 8761e463b25e75ebc078bd67d70e39b9c817a0cb
F src/test_regexp.c 58e0349f155bc307dfa209df4b03add0a7749866
F src/test_regexp.c 5ff0eafd66c9a209417142fa319006f7028fbda8
F src/test_rtree.c aba603c949766c4193f1068b91c787f57274e0d9
F src/test_schema.c 8c06ef9ddb240c7a0fcd31bc221a6a2aade58bf0
F src/test_server.c 2f99eb2837dfa06a4aacf24af24c6affdf66a84f
F src/test_spellfix.c 83abe9d8c364cdd5f93bc06eaf40a349ebbf6c5c
F src/test_spellfix.c 56dfa6d583ac34f61af0834d7b58d674e7e18e13
F src/test_sqllog.c 8acb843ddb9928dea8962e31bb09f421a72ffccb
F src/test_stat.c d1569c7a4839f13e80187e2c26b2ab4da2d03935
F src/test_superlock.c 2b97936ca127d13962c3605dbc9a4ef269c424cd
@@ -242,17 +242,17 @@ F src/vacuum.c 2727bdd08847fcb6b2d2da6d14f018910e8645d3
F src/vdbe.c 292f8f7ced59c29c63fe17830cbe5f5a0230cdf0
F src/vdbe.h b52887278cb173e66188da84dfab216bea61119d
F src/vdbeInt.h 396bb03eec560f768d1b86092b00f46c25575d3b
F src/vdbeapi.c 4c2418161cf45392ba76a7ca92f9a5f06b96f89c
F src/vdbeapi.c 9616986209cc77822aa9f7d91cf9e6880516d557
F src/vdbeaux.c 735a6905df302a7f3c715a82bd3af06dc7d74ef2
F src/vdbeblob.c 32f2a4899d67f69634ea4dd93e3f651936d732cb
F src/vdbemem.c cb55e84b8e2c15704968ee05f0fae25883299b74
F src/vdbemem.c 833005f1cbbf447289f1973dba2a0c2228c7b8ab
F src/vdbesort.c c61ca318681c0e7267da8be3abfca8469652a7e9
F src/vdbetrace.c 8bd5da325fc90f28464335e4cc4ad1407fe30835
F src/vtab.c b05e5f1f4902461ba9f5fc49bb7eb7c3a0741a83
F src/wal.c f5c7b5027d0ed0e9bc9afeb4a3a8dfea762ec7d2
F src/wal.h 29c197540b19044e6cd73487017e5e47a1d3dac6
F src/walker.c 3d75ba73de15e0f8cd0737643badbeb0e002f07b
F src/where.c 43e05406f0e05960a62d4719ed77f551f8204d3f
F src/where.c 8b7690cae8700b385d8a53a39387cf8054d8cc47
F test/8_3_names.test 631ea964a3edb091cf73c3b540f6bcfdb36ce823
F test/aggerror.test a867e273ef9e3d7919f03ef4f0e8c0d2767944f2
F test/aggnested.test 45c0201e28045ad38a530b5a144b73cd4aa2cfd6
@@ -281,7 +281,7 @@ F test/attach2.test e54436ed956d3d88bdee61221da59bf3935a0966
F test/attach3.test d89ccfe4fe6e2b5e368d480fcdfe4b496c54cf4e
F test/attach4.test 53bf502f17647c6d6c5add46dda6bac8b6f4665c
F test/attachmalloc.test 3a4bfca9545bfe906a8d2e622de10fbac5b711b0
F test/auth.test 304e82f31592820d3bde26ab6b75deaa123e1a6f
F test/auth.test 1b21145e888130d60a03db0cb829d59df8f29266
F test/auth2.test a2a371aa6df15f8b0c8109b33d3d7f0f73e4c9aa
F test/auth3.test a4755e6a2a2fea547ffe63c874eb569e60a28eb5
F test/autoinc.test bd30d372d00045252f6c2e41b5f41455e1975acf
@@ -462,7 +462,7 @@ F test/fts3ae.test ce32a13b34b0260928e4213b4481acf801533bda
F test/fts3af.test d394978c534eabf22dd0837e718b913fd66b499c
F test/fts3ag.test 0b7d303f61ae5d620c4efb5e825713ea34ff9441
F test/fts3ah.test dc9f66c32c296f1bc8bcc4535126bddfeca62894
F test/fts3ai.test d29cee6ed653e30de478066881cec8aa766531b2
F test/fts3ai.test 24058fdc6e9e5102c1fd8459591b114b6a85d285
F test/fts3aj.test 0ed71e1dd9b03b843a857dc3eb9b15630e0104fc
F test/fts3ak.test bd14deafe9d1586e8e9bf032411026ac4f8c925d
F test/fts3al.test 07d64326e79bbdbab20ee87fc3328fbf01641c9f
@@ -534,13 +534,13 @@ F test/incrblob_err.test d2562d2771ebffd4b3af89ef64c140dd44371597
F test/incrblobfault.test 917c0292224c64a56ef7215fd633a3a82f805be0
F test/incrvacuum.test d2a6ddf5e429720b5fe502766af747915ccf6c32
F test/incrvacuum2.test 379eeb8740b0ef60c372c439ad4cbea20b34bb9b
F test/incrvacuum3.test 1159ec2b3e7bafbde5718867bc7328ba58863313
F test/incrvacuum_ioerr.test 293f2714571255539c8c789da2f7de4ec3f7101e
F test/incrvacuum3.test 2ffa9e4a23f072bd7902b9ae6471f8822a6522a7
F test/incrvacuum_ioerr.test 6ae2f783424e47a0033304808fe27789cf93e635
F test/index.test b5429732b3b983fa810e3ac867d7ca85dae35097
F test/index2.test ee83c6b5e3173a3d7137140d945d9a5d4fdfb9d6
F test/index3.test 423a25c789fc8cc51aaf2a4370bbdde2d9e9eed7
F test/index4.test 2983216eb8c86ee62d9ed7cb206b5cc3331c0026
F test/index5.test 5616266b2387003bf83c39df626c7292622d58de
F test/index5.test fc07c14193c0430814e7a08b5da46888ee795c33
F test/indexedby.test be501e381b82b2f8ab406309ba7aac46e221f4ad
F test/indexfault.test 31d4ab9a7d2f6e9616933eb079722362a883eb1d
F test/init.test 15c823093fdabbf7b531fe22cf037134d09587a7
@@ -559,7 +559,7 @@ F test/ioerr2.test 9d71166f8466eda510f1af6137bdabaa82b5408d
F test/ioerr3.test d3cec5e1a11ad6d27527d0d38573fbff14c71bdd
F test/ioerr4.test f130fe9e71008577b342b8874d52984bd04ede2c
F test/ioerr5.test 2edfa4fb0f896f733071303b42224df8bedd9da4
F test/ioerr6.test 13f0f9c31d706f0dd575995c369af07c0227e9a2
F test/ioerr6.test cf25523b921d1a6a0e5b536cd4acb3c3d979ea52
F test/join.test 8d63cc4d230a7affafa4b6ab0b97c49b8ccb365c
F test/join2.test f2171c265e57ee298a27e57e7051d22962f9f324
F test/join3.test 6f0c774ff1ba0489e6c88a3e77b9d3528fb4fda0
@@ -606,7 +606,7 @@ F test/mallocC.test 3dffe16532f109293ce1ccecd0c31dca55ef08c4
F test/mallocD.test f78c295e8e18ea3029e65ca08278690e00c22100
F test/mallocE.test db1ed69d7eded1b080952e2a7c37f364ad241b08
F test/mallocF.test 2d5c590ebc2fc7f0dcebdf5aa8498b9aed69107e
F test/mallocG.test 4584d0d8ddb8009f16ca0c8bab1fa37f6358efa2
F test/mallocG.test 0ff91b65c50bdaba680fb75d87fe4ad35bb7934f
F test/mallocH.test 79b65aed612c9b3ed2dcdaa727c85895fd1bfbdb
F test/mallocI.test a88c2b9627c8506bf4703d8397420043a786cdb6
F test/mallocJ.test b5d1839da331d96223e5f458856f8ffe1366f62e
@@ -628,7 +628,7 @@ F test/misc3.test fe55130a43e444ee75e2156ff75dc96e964b5738
F test/misc4.test 9c078510fbfff05a9869a0b6d8b86a623ad2c4f6
F test/misc5.test 528468b26d03303b1f047146e5eefc941b9069f5
F test/misc6.test 953cc693924d88e6117aeba16f46f0bf5abede91
F test/misc7.test f00dad9a004da659330013e6f21819d018b683d3
F test/misc7.test dd82ec9250b89178b96cd28b2aca70639d21e5b3
F test/misuse.test ba4fb5d1a6101d1c171ea38b3c613d0661c83054
F test/multiplex.test e08cc7177bd6d85990ee1d71100bb6c684c02256
F test/multiplex2.test 580ca5817c7edbe4cc68fa150609c9473393003a
@@ -646,7 +646,7 @@ F test/orderby1.test f33968647da5c546528fe4d2bf86c6a6a2e5a7ae
F test/orderby2.test bc11009f7cd99d96b1b11e57b199b00633eb5b04
F test/orderby3.test 8619d06a3debdcd80a27c0fdea5c40b468854b99
F test/oserror.test 50417780d0e0d7cd23cf12a8277bb44024765df3
F test/pager1.test 8e14e7cfd2fbfe65eabead73af10ceeb2fc676aa
F test/pager1.test 31c04bec797dda1bde337810b52efa08d1f1f08e
F test/pager2.test 745b911dde3d1f24ae0870bd433dfa83d7c658c1
F test/pager3.test 3856d9c80839be0668efee1b74811b1b7f7fc95f
F test/pagerfault.test 452f2cc23e3bfcfa935f4442aec1da4fe1dc0442
@@ -784,6 +784,7 @@ F test/tkt-5e10420e8d.test 904d1687b3c06d43e5b3555bbcf6802e7c0ffd84
F test/tkt-5ee23731f.test 9db6e1d7209dc0794948b260d6f82b2b1de83a9f
F test/tkt-752e1646fc.test ea78d88d14fe9866bdd991c634483334639e13bf
F test/tkt-78e04e52ea.test 703e0bfb23d543edf0426a97e3bbd0ca346508ec
F test/tkt-7a31705a7e6.test 5a7889fdb095ffbe1622413e0145de1637d421bd
F test/tkt-7bbfb7d442.test dfa5c8097a8c353ae40705d6cddeb1f99c18b81a
F test/tkt-80ba201079.test 105a721e6aad0ae3c5946d7615d1e4d03f6145b8
F test/tkt-80e031a00f.test 9a154173461a4dbe2de49cda73963e04842d52f7
@@ -808,6 +809,7 @@ F test/tkt-f7b4edec.test d998a08ff2b18b7f62edce8e3044317c45efe6c7
F test/tkt-f973c7ac31.test 1da0ed15ec2c7749fb5ce2828cd69d07153ad9f4
F test/tkt-fa7bf5ec.test 9102dfea58aa371d78969da735f9392c57e2e035
F test/tkt-fc62af4523.test 72825d3febdedcd5593a27989fc05accdbfc2bb4
F test/tkt-fc7bd6358f.test 634bb4af7d661e82d6b61b80c86727bad698e08f
F test/tkt1435.test f8c52c41de6e5ca02f1845f3a46e18e25cadac00
F test/tkt1443.test bacc311da5c96a227bf8c167e77a30c99f8e8368
F test/tkt1444.test a9d72f9e942708bd82dde6c707da61c489e213e9
@@ -907,7 +909,7 @@ F test/trigger6.test 0e411654f122552da6590f0b4e6f781048a4a9b9
F test/trigger7.test b39e6dee1debe0ff9c2ef66326668f149f07c9c4
F test/trigger8.test 30cb0530bd7c4728055420e3f739aa00412eafa4
F test/trigger9.test 5b0789f1c5c4600961f8e68511b825b87be53e31
F test/triggerA.test e0aaba16d3547193d36bbd82a1b0ed75e9c88d40
F test/triggerA.test fe5597f47ee21bacb4936dc827994ed94161e332
F test/triggerB.test 56780c031b454abac2340dbb3b71ac5c56c3d7fe
F test/triggerC.test a7b4367392c755bc5fd5fff88011753e6b6afe90
F test/triggerD.test 8e7f3921a92a5797d472732108109e44575fa650
@@ -927,7 +929,7 @@ F test/vacuum3.test 77ecdd54592b45a0bcb133339f99f1ae0ae94d0d
F test/vacuum4.test d3f8ecff345f166911568f397d2432c16d2867d9
F test/varint.test ab7b110089a08b9926ed7390e7e97bdefeb74102
F test/veryquick.test 7701bb609fe8bf6535514e8b849a309e8f00573b
F test/view.test 977eb3fa17b44f73fc2b636172dc9136311024ce
F test/view.test 4057630287bfa5955628fe90a13d4c225d1c7352
F test/vtab1.test 4403f987860ebddef1ce2de6db7216421035339d
F test/vtab2.test 7bcffc050da5c68f4f312e49e443063e2d391c0d
F test/vtab3.test baad99fd27217f5d6db10660522e0b7192446de1
@@ -1015,7 +1017,7 @@ F tool/omittest.tcl 4665982e95a6e5c1bd806cf7bc3dea95be422d77
F tool/opcodeDoc.awk b3a2a3d5d3075b8bd90b7afe24283efdd586659c
F tool/restore_jrnl.tcl 6957a34f8f1f0f8285e07536225ec3b292a9024a
F tool/rollback-test.c 9fc98427d1e23e84429d7e6d07d9094fbdec65a5
F tool/showdb.c 16960a5ce59d8b1d70dc3bdc51e2c0fe7bb91359
F tool/showdb.c acd24ea035a3bd2ffe266f1ef8a161812c29b2f0
F tool/showjournal.c b62cecaab86a4053d944c276bb5232e4d17ece02
F tool/showwal.c 3f7f7da5ec0cba51b1449a75f700493377da57b5
F tool/soak1.tcl 8d407956e1a45b485a8e072470a3e629a27037fe
@@ -1035,10 +1037,10 @@ F tool/vdbe-compress.tcl f12c884766bd14277f4fcedcae07078011717381
F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4
F tool/warnings.sh fbc018d67fd7395f440c28f33ef0f94420226381
F tool/win/sqlite.vsix 97894c2790eda7b5bce3cc79cb2a8ec2fde9b3ac
P 6d7973524a7d3bf3158fdac58975945da7f51740
R 49ff1f2b0a98496405857ab66db0f4ad
T *branch * funcTestEncoding
T *sym-funcTestEncoding *
P f9027cb47bdec8dcebf1f038921b28d9e9928c18
R 2b8e011f63f1ea6b304ed54d625b070b
T *branch * docTypo
T *sym-docTypo *
T -sym-trunk *
U mistachkin
Z 6ef7a794e2bcbed68706686e53ccd98f
Z dcdca813dff9ba7b609032afb852ad4f
+1 -1
View File
@@ -1 +1 @@
d2e7dfca5a92074a7984032deb6a4e3681389c72
7232093d6c6871a9f4ea155ab215e3b39c1c322d
+2 -2
View File
@@ -473,7 +473,7 @@ static void analyzeOneTable(
/* Do not gather statistics on views or virtual tables */
return;
}
if( memcmp(pTab->zName, "sqlite_", 7)==0 ){
if( sqlite3_strnicmp(pTab->zName, "sqlite_", 7)==0 ){
/* Do not gather statistics on system tables */
return;
}
@@ -883,7 +883,7 @@ static int analysisLoader(void *pData, int argc, char **argv, char **NotUsed){
if( pIndex==0 ) break;
pIndex->aiRowEst[i] = v;
if( *z==' ' ) z++;
if( memcmp(z, "unordered", 10)==0 ){
if( strcmp(z, "unordered")==0 ){
pIndex->bUnordered = 1;
break;
}
+37 -17
View File
@@ -43,6 +43,25 @@ int sqlite3BtreeTrace=1; /* True to enable tracing */
*/
#define get2byteNotZero(X) (((((int)get2byte(X))-1)&0xffff)+1)
/*
** Values passed as the 5th argument to allocateBtreePage()
*/
#define BTALLOC_ANY 0 /* Allocate any page */
#define BTALLOC_EXACT 1 /* Allocate exact page if possible */
#define BTALLOC_LE 2 /* Allocate any page <= the parameter */
/*
** Macro IfNotOmitAV(x) returns (x) if SQLITE_OMIT_AUTOVACUUM is not
** defined, or 0 if it is. For example:
**
** bIncrVacuum = IfNotOmitAV(pBtShared->incrVacuum);
*/
#ifndef SQLITE_OMIT_AUTOVACUUM
#define IfNotOmitAV(expr) (expr)
#else
#define IfNotOmitAV(expr) 0
#endif
#ifndef SQLITE_OMIT_SHARED_CACHE
/*
** A list of BtShared objects that are eligible for participation
@@ -2595,7 +2614,7 @@ int sqlite3BtreeBeginTrans(Btree *p, int wrflag){
if( p->inTrans==TRANS_WRITE || (p->inTrans==TRANS_READ && !wrflag) ){
goto trans_begun;
}
assert( pBt->bDoTruncate==0 );
assert( IfNotOmitAV(pBt->bDoTruncate)==0 );
/* Write transactions are not possible on a read-only database */
if( (pBt->btsFlags & BTS_READ_ONLY)!=0 && wrflag ){
@@ -2910,9 +2929,6 @@ static int relocatePage(
/* Forward declaration required by incrVacuumStep(). */
static int allocateBtreePage(BtShared *, MemPage **, Pgno *, Pgno, u8);
#define BTALLOC_ANY 0 /* Allocate any page */
#define BTALLOC_EXACT 1 /* Allocate exact page if possible */
#define BTALLOC_LE 2 /* Allocate any page <= the parameter */
/*
** Perform a single step of an incremental-vacuum. If successful, return
@@ -3004,7 +3020,7 @@ static int incrVacuumStep(BtShared *pBt, Pgno nFin, Pgno iLastPg, int bCommit){
}while( bCommit && iFreePg>nFin );
assert( iFreePg<iLastPg );
rc = relocatePage(pBt, pLastPg, eType, iPtrPage, iFreePg, nFin!=0);
rc = relocatePage(pBt, pLastPg, eType, iPtrPage, iFreePg, bCommit);
releasePage(pLastPg);
if( rc!=SQLITE_OK ){
return rc;
@@ -4875,21 +4891,23 @@ int sqlite3BtreePrevious(BtCursor *pCur, int *pRes){
** an error. *ppPage and *pPgno are undefined in the event of an error.
** Do not invoke sqlite3PagerUnref() on *ppPage if an error is returned.
**
** If the "nearby" parameter is not 0, then a (feeble) effort is made to
** If the "nearby" parameter is not 0, then an effort is made to
** locate a page close to the page number "nearby". This can be used in an
** attempt to keep related pages close to each other in the database file,
** which in turn can make database access faster.
**
** If the "exact" parameter is not 0, and the page-number nearby exists
** anywhere on the free-list, then it is guarenteed to be returned. This
** is only used by auto-vacuum databases when allocating a new table.
** If the eMode parameter is BTALLOC_EXACT and the nearby page exists
** anywhere on the free-list, then it is guaranteed to be returned. If
** eMode is BTALLOC_LT then the page returned will be less than or equal
** to nearby if any such page exists. If eMode is BTALLOC_ANY then there
** are no restrictions on which page is returned.
*/
static int allocateBtreePage(
BtShared *pBt,
MemPage **ppPage,
Pgno *pPgno,
Pgno nearby,
u8 eMode
BtShared *pBt, /* The btree */
MemPage **ppPage, /* Store pointer to the allocated page here */
Pgno *pPgno, /* Store the page number here */
Pgno nearby, /* Search for a page near this one */
u8 eMode /* BTALLOC_EXACT, BTALLOC_LT, or BTALLOC_ANY */
){
MemPage *pPage1;
int rc;
@@ -4900,6 +4918,7 @@ static int allocateBtreePage(
Pgno mxPage; /* Total size of the database file */
assert( sqlite3_mutex_held(pBt->mutex) );
assert( eMode==BTALLOC_ANY || (nearby>0 && IfNotOmitAV(pBt->autoVacuum)) );
pPage1 = pBt->pPage1;
mxPage = btreePagecount(pBt);
n = get4byte(&pPage1->aData[36]);
@@ -4912,7 +4931,7 @@ static int allocateBtreePage(
Pgno iTrunk;
u8 searchList = 0; /* If the free-list must be searched for 'nearby' */
/* If the 'exact' parameter was true and a query of the pointer-map
/* If eMode==BTALLOC_EXACT and a query of the pointer-map
** shows that the page 'nearby' is somewhere on the free-list, then
** the entire-list will be searched for that page.
*/
@@ -4942,7 +4961,8 @@ static int allocateBtreePage(
/* The code within this loop is run only once if the 'searchList' variable
** is not true. Otherwise, it runs once for each trunk-page on the
** free-list until the page 'nearby' is located.
** free-list until the page 'nearby' is located (eMode==BTALLOC_EXACT)
** or until a page less than 'nearby' is located (eMode==BTALLOC_LT)
*/
do {
pPrevTrunk = pTrunk;
@@ -5131,7 +5151,7 @@ static int allocateBtreePage(
** here are confined to those pages that lie between the end of the
** database image and the end of the database file.
*/
int bNoContent = (0==pBt->bDoTruncate);
int bNoContent = (0==IfNotOmitAV(pBt->bDoTruncate));
rc = sqlite3PagerWrite(pBt->pPage1->pDbPage);
if( rc ) return rc;
+1 -1
View File
@@ -2594,7 +2594,7 @@ Index *sqlite3CreateIndex(
assert( pTab!=0 );
assert( pParse->nErr==0 );
if( sqlite3StrNICmp(pTab->zName, "sqlite_", 7)==0
&& memcmp(&pTab->zName[7],"altertab_",9)!=0 ){
&& sqlite3StrNICmp(&pTab->zName[7],"altertab_",9)!=0 ){
sqlite3ErrorMsg(pParse, "table %s may not be indexed", pTab->zName);
goto exit_create_index;
}
+18 -20
View File
@@ -93,30 +93,28 @@ void sqlite3MaterializeView(
int iCur /* Cursor number for ephemerial table */
){
SelectDest dest;
Select *pDup;
Select *pSel;
SrcList *pFrom;
sqlite3 *db = pParse->db;
int iDb = sqlite3SchemaToIndex(db, pView->pSchema);
pDup = sqlite3SelectDup(db, pView->pSelect, 0);
if( pWhere ){
SrcList *pFrom;
pWhere = sqlite3ExprDup(db, pWhere, 0);
pFrom = sqlite3SrcListAppend(db, 0, 0, 0);
if( pFrom ){
assert( pFrom->nSrc==1 );
pFrom->a[0].zAlias = sqlite3DbStrDup(db, pView->zName);
pFrom->a[0].pSelect = pDup;
assert( pFrom->a[0].pOn==0 );
assert( pFrom->a[0].pUsing==0 );
}else{
sqlite3SelectDelete(db, pDup);
}
pDup = sqlite3SelectNew(pParse, 0, pFrom, pWhere, 0, 0, 0, 0, 0, 0);
if( pDup ) pDup->selFlags |= SF_Materialize;
pWhere = sqlite3ExprDup(db, pWhere, 0);
pFrom = sqlite3SrcListAppend(db, 0, 0, 0);
if( pFrom ){
assert( pFrom->nSrc==1 );
pFrom->a[0].zName = sqlite3DbStrDup(db, pView->zName);
pFrom->a[0].zDatabase = sqlite3DbStrDup(db, db->aDb[iDb].zName);
assert( pFrom->a[0].pOn==0 );
assert( pFrom->a[0].pUsing==0 );
}
pSel = sqlite3SelectNew(pParse, 0, pFrom, pWhere, 0, 0, 0, 0, 0, 0);
if( pSel ) pSel->selFlags |= SF_Materialize;
sqlite3SelectDestInit(&dest, SRT_EphemTab, iCur);
sqlite3Select(pParse, pDup, &dest);
sqlite3SelectDelete(db, pDup);
sqlite3Select(pParse, pSel, &dest);
sqlite3SelectDelete(db, pSel);
}
#endif /* !defined(SQLITE_OMIT_VIEW) && !defined(SQLITE_OMIT_TRIGGER) */
+1 -1
View File
@@ -638,7 +638,7 @@ void sqlite3ExprAssignVarNumber(Parse *pParse, Expr *pExpr){
*/
ynVar i;
for(i=0; i<pParse->nzVar; i++){
if( pParse->azVar[i] && memcmp(pParse->azVar[i],z,n+1)==0 ){
if( pParse->azVar[i] && strcmp(pParse->azVar[i],z)==0 ){
pExpr->iColumn = x = (ynVar)i+1;
break;
}
+16 -10
View File
@@ -972,6 +972,7 @@ static void unicodeFunc(
sqlite3_value **argv
){
const unsigned char *z = sqlite3_value_text(argv[0]);
(void)argc;
if( z && z[0] ) sqlite3_result_int(context, sqlite3Utf8Read(&z));
}
@@ -998,18 +999,23 @@ static void charFunc(
x = sqlite3_value_int64(argv[i]);
if( x<0 || x>0x10ffff ) x = 0xfffd;
c = (unsigned)(x & 0x1fffff);
if( c<=0xFFFF ){
*zOut++ = (u8)(c&0x00FF);
*zOut++ = (u8)((c>>8)&0x00FF);
if( c<0x00080 ){
*zOut++ = (u8)(c&0xFF);
}else if( c<0x00800 ){
*zOut++ = 0xC0 + (u8)((c>>6)&0x1F);
*zOut++ = 0x80 + (u8)(c & 0x3F);
}else if( c<0x10000 ){
*zOut++ = 0xE0 + (u8)((c>>12)&0x0F);
*zOut++ = 0x80 + (u8)((c>>6) & 0x3F);
*zOut++ = 0x80 + (u8)(c & 0x3F);
}else{
if( c>=0xd800 && c<=0xdbff ) c = 0xfffd;
*zOut++ = (u8)(((c>>10)&0x003F) + (((c-0x10000)>>10)&0x00C0));
*zOut++ = (u8)(0x00D8 + (((c-0x10000)>>18)&0x03));
*zOut++ = (u8)(c&0x00FF);
*zOut++ = (u8)(0x00DC + ((c>>8)&0x03));
}
*zOut++ = 0xF0 + (u8)((c>>18) & 0x07);
*zOut++ = 0x80 + (u8)((c>>12) & 0x3F);
*zOut++ = 0x80 + (u8)((c>>6) & 0x3F);
*zOut++ = 0x80 + (u8)(c & 0x3F);
} \
}
sqlite3_result_text16le(context, (char*)z, (int)(zOut-z), sqlite3_free);
sqlite3_result_text(context, (char*)z, (int)(zOut-z), sqlite3_free);
}
/*
+13
View File
@@ -378,6 +378,19 @@ static const sqlite3_api_routines sqlite3Apis = {
sqlite3_blob_reopen,
sqlite3_vtab_config,
sqlite3_vtab_on_conflict,
sqlite3_close_v2,
sqlite3_db_filename,
sqlite3_db_readonly,
sqlite3_db_release_memory,
sqlite3_errstr,
sqlite3_stmt_busy,
sqlite3_stmt_readonly,
sqlite3_stricmp,
sqlite3_uri_boolean,
sqlite3_uri_int64,
sqlite3_uri_parameter,
sqlite3_vsnprintf,
sqlite3_wal_checkpoint_v2
};
/*
+5 -2
View File
@@ -552,7 +552,10 @@ static int robust_open(const char *z, int f, mode_t m){
if( fd>=0 ){
if( m!=0 ){
struct stat statbuf;
if( osFstat(fd, &statbuf)==0 && (statbuf.st_mode&0777)!=m ){
if( osFstat(fd, &statbuf)==0
&& statbuf.st_size==0
&& (statbuf.st_mode&0777)!=m
){
osFchmod(fd, m);
}
}
@@ -4752,7 +4755,7 @@ static int fillInUnixFile(
"psow", SQLITE_POWERSAFE_OVERWRITE) ){
pNew->ctrlFlags |= UNIXFILE_PSOW;
}
if( memcmp(pVfs->zName,"unix-excl",10)==0 ){
if( strcmp(pVfs->zName,"unix-excl")==0 ){
pNew->ctrlFlags |= UNIXFILE_EXCL;
}
+27 -20
View File
@@ -1838,7 +1838,8 @@ static BOOL winceLockFile(
}
/* Want a pending lock? */
else if (dwFileOffsetLow == (DWORD)PENDING_BYTE && nNumberOfBytesToLockLow == 1){
else if (dwFileOffsetLow == (DWORD)PENDING_BYTE
&& nNumberOfBytesToLockLow == 1){
/* If no pending lock has been acquired, then acquire it */
if (pFile->shared->bPending == 0) {
pFile->shared->bPending = TRUE;
@@ -1848,7 +1849,8 @@ static BOOL winceLockFile(
}
/* Want a reserved lock? */
else if (dwFileOffsetLow == (DWORD)RESERVED_BYTE && nNumberOfBytesToLockLow == 1){
else if (dwFileOffsetLow == (DWORD)RESERVED_BYTE
&& nNumberOfBytesToLockLow == 1){
if (pFile->shared->bReserved == 0) {
pFile->shared->bReserved = TRUE;
pFile->local.bReserved = TRUE;
@@ -1891,7 +1893,8 @@ static BOOL winceUnlockFile(
/* Did we just have a reader lock? */
else if (pFile->local.nReaders){
assert(nNumberOfBytesToUnlockLow == (DWORD)SHARED_SIZE || nNumberOfBytesToUnlockLow == 1);
assert(nNumberOfBytesToUnlockLow == (DWORD)SHARED_SIZE
|| nNumberOfBytesToUnlockLow == 1);
pFile->local.nReaders --;
if (pFile->local.nReaders == 0)
{
@@ -1902,7 +1905,8 @@ static BOOL winceUnlockFile(
}
/* Releasing a pending lock */
else if (dwFileOffsetLow == (DWORD)PENDING_BYTE && nNumberOfBytesToUnlockLow == 1){
else if (dwFileOffsetLow == (DWORD)PENDING_BYTE
&& nNumberOfBytesToUnlockLow == 1){
if (pFile->local.bPending){
pFile->local.bPending = FALSE;
pFile->shared->bPending = FALSE;
@@ -1910,7 +1914,8 @@ static BOOL winceUnlockFile(
}
}
/* Releasing a reserved lock */
else if (dwFileOffsetLow == (DWORD)RESERVED_BYTE && nNumberOfBytesToUnlockLow == 1){
else if (dwFileOffsetLow == (DWORD)RESERVED_BYTE
&& nNumberOfBytesToUnlockLow == 1){
if (pFile->local.bReserved) {
pFile->local.bReserved = FALSE;
pFile->shared->bReserved = FALSE;
@@ -3073,7 +3078,7 @@ static int winOpenSharedMemory(winFile *pDbFd){
rc = winOpen(pDbFd->pVfs,
pShmNode->zFilename, /* Name of the file (UTF-8) */
(sqlite3_file*)&pShmNode->hFile, /* File handle here */
SQLITE_OPEN_WAL | SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE, /* Mode flags */
SQLITE_OPEN_WAL | SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE,
0);
if( SQLITE_OK!=rc ){
goto shm_open_err;
@@ -3827,7 +3832,9 @@ static int winOpen(
sqlite3_free(zConverted);
if( isReadWrite && !isExclusive ){
return winOpen(pVfs, zName, id,
((flags|SQLITE_OPEN_READONLY)&~(SQLITE_OPEN_CREATE|SQLITE_OPEN_READWRITE)), pOutFlags);
((flags|SQLITE_OPEN_READONLY) &
~(SQLITE_OPEN_CREATE|SQLITE_OPEN_READWRITE)),
pOutFlags);
}else{
return SQLITE_CANTOPEN_BKPT;
}
@@ -3910,7 +3917,8 @@ static int winDelete(
attr = sAttrData.dwFileAttributes;
}else{
lastErrno = osGetLastError();
if( lastErrno==ERROR_FILE_NOT_FOUND || lastErrno==ERROR_PATH_NOT_FOUND ){
if( lastErrno==ERROR_FILE_NOT_FOUND
|| lastErrno==ERROR_PATH_NOT_FOUND ){
rc = SQLITE_IOERR_DELETE_NOENT; /* Already gone? */
}else{
rc = SQLITE_ERROR;
@@ -3922,7 +3930,8 @@ static int winDelete(
#endif
if ( attr==INVALID_FILE_ATTRIBUTES ){
lastErrno = osGetLastError();
if( lastErrno==ERROR_FILE_NOT_FOUND || lastErrno==ERROR_PATH_NOT_FOUND ){
if( lastErrno==ERROR_FILE_NOT_FOUND
|| lastErrno==ERROR_PATH_NOT_FOUND ){
rc = SQLITE_IOERR_DELETE_NOENT; /* Already gone? */
}else{
rc = SQLITE_ERROR;
@@ -3949,7 +3958,8 @@ static int winDelete(
attr = osGetFileAttributesA(zConverted);
if ( attr==INVALID_FILE_ATTRIBUTES ){
lastErrno = osGetLastError();
if( lastErrno==ERROR_FILE_NOT_FOUND || lastErrno==ERROR_PATH_NOT_FOUND ){
if( lastErrno==ERROR_FILE_NOT_FOUND
|| lastErrno==ERROR_PATH_NOT_FOUND ){
rc = SQLITE_IOERR_DELETE_NOENT; /* Already gone? */
}else{
rc = SQLITE_ERROR;
@@ -4117,16 +4127,12 @@ static int winFullPathname(
*/
char zOut[MAX_PATH+1];
memset(zOut, 0, MAX_PATH+1);
cygwin_conv_to_win32_path(zRelative, zOut); /* POSIX to Win32 */
cygwin_conv_path(CCP_POSIX_TO_WIN_A|CCP_RELATIVE, zRelative, zOut,
MAX_PATH+1);
sqlite3_snprintf(MIN(nFull, pVfs->mxPathname), zFull, "%s\\%s",
sqlite3_data_directory, zOut);
}else{
/*
** NOTE: The Cygwin docs state that the maximum length needed
** for the buffer passed to cygwin_conv_to_full_win32_path
** is MAX_PATH.
*/
cygwin_conv_to_full_win32_path(zRelative, zFull);
cygwin_conv_path(CCP_POSIX_TO_WIN_A, zRelative, zFull, nFull);
}
return SQLITE_OK;
#endif
@@ -4284,9 +4290,9 @@ static void winDlError(sqlite3_vfs *pVfs, int nBuf, char *zBufOut){
UNUSED_PARAMETER(pVfs);
getLastErrorMsg(osGetLastError(), nBuf, zBufOut);
}
static void (*winDlSym(sqlite3_vfs *pVfs, void *pHandle, const char *zSymbol))(void){
static void (*winDlSym(sqlite3_vfs *pVfs,void *pH,const char *zSym))(void){
UNUSED_PARAMETER(pVfs);
return (void(*)(void))osGetProcAddressA((HANDLE)pHandle, zSymbol);
return (void(*)(void))osGetProcAddressA((HANDLE)pH, zSym);
}
static void winDlClose(sqlite3_vfs *pVfs, void *pHandle){
UNUSED_PARAMETER(pVfs);
@@ -4384,7 +4390,8 @@ static int winCurrentTimeInt64(sqlite3_vfs *pVfs, sqlite3_int64 *piNow){
#endif
/* 2^32 - to avoid use of LL and warnings in gcc */
static const sqlite3_int64 max32BitValue =
(sqlite3_int64)2000000000 + (sqlite3_int64)2000000000 + (sqlite3_int64)294967296;
(sqlite3_int64)2000000000 + (sqlite3_int64)2000000000 +
(sqlite3_int64)294967296;
#if SQLITE_OS_WINCE
SYSTEMTIME time;
+22 -2
View File
@@ -3755,12 +3755,26 @@ static void assertTruncateConstraint(Pager *pPager){
** function does not actually modify the database file on disk. It
** just sets the internal state of the pager object so that the
** truncation will be done when the current transaction is committed.
**
** This function is only called right before committing a transaction.
** Once this function has been called, the transaction must either be
** rolled back or committed. It is not safe to call this function and
** then continue writing to the database.
*/
void sqlite3PagerTruncateImage(Pager *pPager, Pgno nPage){
assert( pPager->dbSize>=nPage );
assert( pPager->eState>=PAGER_WRITER_CACHEMOD );
pPager->dbSize = nPage;
assertTruncateConstraint(pPager);
/* At one point the code here called assertTruncateConstraint() to
** ensure that all pages being truncated away by this operation are,
** if one or more savepoints are open, present in the savepoint
** journal so that they can be restored if the savepoint is rolled
** back. This is no longer necessary as this function is now only
** called right before committing a transaction. So although the
** Pager object may still have open savepoints (Pager.nSavepoint!=0),
** they cannot be rolled back. So the assertTruncateConstraint() call
** is no longer correct. */
}
@@ -4813,6 +4827,11 @@ int sqlite3PagerSharedLock(Pager *pPager){
goto failed;
}
if( bHotJournal ){
if( pPager->readOnly ){
rc = SQLITE_READONLY_ROLLBACK;
goto failed;
}
/* Get an EXCLUSIVE lock on the database file. At this point it is
** important that a RESERVED lock is not obtained on the way to the
** EXCLUSIVE lock. If it were, another process might open the
@@ -6451,7 +6470,8 @@ int sqlite3PagerMovepage(Pager *pPager, DbPage *pPg, Pgno pgno, int isCommit){
*/
if( (pPg->flags&PGHDR_NEED_SYNC) && !isCommit ){
needSyncPgno = pPg->pgno;
assert( pageInJournal(pPg) || pPg->pgno>pPager->dbOrigSize );
assert( pPager->journalMode==PAGER_JOURNALMODE_OFF ||
pageInJournal(pPg) || pPg->pgno>pPager->dbOrigSize );
assert( pPg->flags&PGHDR_DIRTY );
}
+2
View File
@@ -1130,6 +1130,7 @@ void sqlite3Pragma(
#endif /* !defined(SQLITE_OMIT_FOREIGN_KEY) */
#ifndef SQLITE_OMIT_FOREIGN_KEY
#ifndef SQLITE_OMIT_TRIGGER
if( sqlite3StrICmp(zLeft, "foreign_key_check")==0 ){
FKey *pFK; /* A foreign key constraint */
Table *pTab; /* Child table contain "REFERENCES" keyword */
@@ -1241,6 +1242,7 @@ void sqlite3Pragma(
sqlite3VdbeJumpHere(v, addrTop);
}
}else
#endif /* !defined(SQLITE_OMIT_TRIGGER) */
#endif /* !defined(SQLITE_OMIT_FOREIGN_KEY) */
#ifndef NDEBUG
+4
View File
@@ -259,11 +259,15 @@ static int sqlite3InitOne(sqlite3 *db, int iDb, char **pzErrMsg){
*/
if( meta[BTREE_TEXT_ENCODING-1] ){ /* text encoding */
if( iDb==0 ){
#ifndef SQLITE_OMIT_UTF16
u8 encoding;
/* If opening the main database, set ENC(db). */
encoding = (u8)meta[BTREE_TEXT_ENCODING-1] & 3;
if( encoding==0 ) encoding = SQLITE_UTF8;
ENC(db) = encoding;
#else
ENC(db) = SQLITE_UTF8;
#endif
}else{
/* If opening an attached database, the encoding much match ENC(db) */
if( meta[BTREE_TEXT_ENCODING-1]!=ENC(db) ){
+2 -2
View File
@@ -165,12 +165,12 @@ int sqlite3MatchSpanName(
){
int n;
for(n=0; ALWAYS(zSpan[n]) && zSpan[n]!='.'; n++){}
if( zDb && sqlite3StrNICmp(zSpan, zDb, n)!=0 ){
if( zDb && (sqlite3StrNICmp(zSpan, zDb, n)!=0 || zDb[n]!=0) ){
return 0;
}
zSpan += n+1;
for(n=0; ALWAYS(zSpan[n]) && zSpan[n]!='.'; n++){}
if( zTab && sqlite3StrNICmp(zSpan, zTab, n)!=0 ){
if( zTab && (sqlite3StrNICmp(zSpan, zTab, n)!=0 || zTab[n]!=0) ){
return 0;
}
zSpan += n+1;
+2 -1
View File
@@ -283,7 +283,7 @@ typedef sqlite_uint64 sqlite3_uint64;
** [sqlite3_blob_close | close] all [BLOB handles], and
** [sqlite3_backup_finish | finish] all [sqlite3_backup] objects associated
** with the [sqlite3] object prior to attempting to close the object. ^If
** sqlite3_close() is called on a [database connection] that still has
** sqlite3_close_v2() is called on a [database connection] that still has
** outstanding [prepared statements], [BLOB handles], and/or
** [sqlite3_backup] objects then it returns SQLITE_OK but the deallocation
** of resources is deferred until all [prepared statements], [BLOB handles],
@@ -478,6 +478,7 @@ int sqlite3_exec(
#define SQLITE_CORRUPT_VTAB (SQLITE_CORRUPT | (1<<8))
#define SQLITE_READONLY_RECOVERY (SQLITE_READONLY | (1<<8))
#define SQLITE_READONLY_CANTLOCK (SQLITE_READONLY | (2<<8))
#define SQLITE_READONLY_ROLLBACK (SQLITE_READONLY | (3<<8))
#define SQLITE_ABORT_ROLLBACK (SQLITE_ABORT | (2<<8))
#define SQLITE_CONSTRAINT_CHECK (SQLITE_CONSTRAINT | (1<<8))
#define SQLITE_CONSTRAINT_COMMITHOOK (SQLITE_CONSTRAINT | (2<<8))
+4
View File
@@ -66,6 +66,10 @@
# define _GNU_SOURCE
#endif
#if defined(__OpenBSD__) && !defined(_BSD_SOURCE)
# define _BSD_SOURCE
#endif
/*
** Include standard header files as necessary
*/
+1
View File
@@ -178,6 +178,7 @@ const char *sqlite3TestErrorName(int rc){
case SQLITE_CORRUPT_VTAB: zName = "SQLITE_CORRUPT_VTAB"; break;
case SQLITE_READONLY_RECOVERY: zName = "SQLITE_READONLY_RECOVERY"; break;
case SQLITE_READONLY_CANTLOCK: zName = "SQLITE_READONLY_CANTLOCK"; break;
case SQLITE_READONLY_ROLLBACK: zName = "SQLITE_READONLY_ROLLBACK"; break;
default: zName = "SQLITE_Unknown"; break;
}
return zName;
+1 -1
View File
@@ -1295,7 +1295,7 @@ int sqlite3_quota_remove(const char *zFilename){
if( pGroup ){
for(pFile=pGroup->pFiles; pFile && rc==SQLITE_OK; pFile=pNextFile){
pNextFile = pFile->pNext;
diff = memcmp(zFull, pFile->zFilename, nFull);
diff = strncmp(zFull, pFile->zFilename, nFull);
if( diff==0 && ((c = pFile->zFilename[nFull])==0 || c=='/' || c=='\\') ){
if( pFile->nRef ){
pFile->deleteOnClose = 1;
+3 -2
View File
@@ -107,7 +107,7 @@ struct ReCompiled {
char *aOp; /* Operators for the virtual machine */
int *aArg; /* Arguments to each operator */
unsigned (*xNextChar)(ReInput*); /* Next character function */
char zInit[12]; /* Initial text to match */
unsigned char zInit[12]; /* Initial text to match */
int nInit; /* Number of characters in zInit */
unsigned nState; /* Number of entries in aOp[] and aArg[] */
unsigned nAlloc; /* Slots allocated for aOp[] and aArg[] */
@@ -194,7 +194,8 @@ int re_match(ReCompiled *pRe, const unsigned char *zIn, int nIn){
if( pRe->nInit ){
unsigned char x = pRe->zInit[0];
while( in.i+pRe->nInit<=in.mx
&& (zIn[in.i]!=x || memcmp(zIn+in.i, pRe->zInit, pRe->nInit)!=0)
&& (zIn[in.i]!=x ||
strncmp((const char*)zIn+in.i, (const char*)pRe->zInit, pRe->nInit)!=0)
){
in.i++;
}
+6 -6
View File
@@ -744,22 +744,22 @@ static int utf8Len(unsigned char c, int N){
}
/*
** Return TRUE (non-zero) of the To side of the given cost matches
** Return TRUE (non-zero) if the To side of the given cost matches
** the given string.
*/
static int matchTo(EditDist3Cost *p, const char *z, int n){
if( p->nTo>n ) return 0;
if( memcmp(p->a+p->nFrom, z, p->nTo)!=0 ) return 0;
if( strncmp(p->a+p->nFrom, z, p->nTo)!=0 ) return 0;
return 1;
}
/*
** Return TRUE (non-zero) of the To side of the given cost matches
** Return TRUE (non-zero) if the From side of the given cost matches
** the given string.
*/
static int matchFrom(EditDist3Cost *p, const char *z, int n){
assert( p->nFrom<=n );
if( memcmp(p->a, z, p->nFrom)!=0 ) return 0;
if( strncmp(p->a, z, p->nFrom)!=0 ) return 0;
return 1;
}
@@ -1952,7 +1952,7 @@ static int spellfix1Init(
);
}
for(i=3; rc==SQLITE_OK && i<argc; i++){
if( memcmp(argv[i],"edit_cost_table=",16)==0 && pNew->zCostTable==0 ){
if( strncmp(argv[i],"edit_cost_table=",16)==0 && pNew->zCostTable==0 ){
pNew->zCostTable = spellfix1Dequote(&argv[i][16]);
if( pNew->zCostTable==0 ) rc = SQLITE_NOMEM;
continue;
@@ -2681,7 +2681,7 @@ static int spellfix1Update(
p->pConfig3 = 0;
return SQLITE_OK;
}
if( memcmp(zCmd,"edit_cost_table=",16)==0 ){
if( strncmp(zCmd,"edit_cost_table=",16)==0 ){
editDist3ConfigDelete(p->pConfig3);
p->pConfig3 = 0;
sqlite3_free(p->zCostTable);
+1 -1
View File
@@ -1198,7 +1198,7 @@ int sqlite3VdbeParameterIndex(Vdbe *p, const char *zName, int nName){
if( zName ){
for(i=0; i<p->nzVar; i++){
const char *z = p->azVar[i];
if( z && memcmp(z,zName,nName)==0 && z[nName]==0 ){
if( z && strncmp(z,zName,nName)==0 && z[nName]==0 ){
return i+1;
}
}
+2
View File
@@ -32,7 +32,9 @@
** between formats.
*/
int sqlite3VdbeChangeEncoding(Mem *pMem, int desiredEnc){
#ifndef SQLITE_OMIT_UTF16
int rc;
#endif
assert( (pMem->flags&MEM_RowSet)==0 );
assert( desiredEnc==SQLITE_UTF8 || desiredEnc==SQLITE_UTF16LE
|| desiredEnc==SQLITE_UTF16BE );
+9 -5
View File
@@ -643,9 +643,8 @@ static u16 operatorMask(int op){
** then try for the one with no dependencies on <expr> - in other words where
** <expr> is a constant expression of some kind. Only return entries of
** the form "X <op> Y" where Y is a column in another table if no terms of
** the form "X <op> <const-expr>" exist. Other than this priority, if there
** are two or more terms that match, then the choice of which term to return
** is arbitrary.
** the form "X <op> <const-expr>" exist. If no terms with a constant RHS
** exist, try to return a term that does not use WO_EQUIV.
*/
static WhereTerm *findTerm(
WhereClause *pWC, /* The WHERE clause to be searched */
@@ -704,8 +703,12 @@ static WhereTerm *findTerm(
continue;
}
}
pResult = pTerm;
if( pTerm->prereqRight==0 ) goto findTerm_success;
if( pTerm->prereqRight==0 ){
pResult = pTerm;
goto findTerm_success;
}else if( pResult==0 ){
pResult = pTerm;
}
}
if( (pTerm->eOperator & WO_EQUIV)!=0
&& nEquiv<ArraySize(aEquiv)
@@ -4231,6 +4234,7 @@ static Bitmask codeOneLoopStart(
addrNxt = pLevel->addrNxt;
sqlite3VdbeAddOp2(v, OP_MustBeInt, iRowidReg, addrNxt);
sqlite3VdbeAddOp3(v, OP_NotExists, iCur, addrNxt, iRowidReg);
sqlite3ExprCacheAffinityChange(pParse, iRowidReg, 1);
sqlite3ExprCacheStore(pParse, iCur, -1, iRowidReg);
VdbeComment((v, "pk"));
pLevel->op = OP_Noop;
+6 -2
View File
@@ -2262,7 +2262,9 @@ do_test auth-4.3 {
SQLITE_SELECT {} {} {} v1 \
SQLITE_READ t2 a main v1 \
SQLITE_READ t2 b main v1 \
SQLITE_SELECT {} {} {} {} \
SQLITE_READ v1 x main v1 \
SQLITE_READ v1 x main v1 \
SQLITE_SELECT {} {} {} v1 \
SQLITE_READ v1 x main v1 \
SQLITE_INSERT v1chng {} main r2 \
SQLITE_READ v1 x main r2 \
@@ -2288,7 +2290,9 @@ do_test auth-4.5 {
SQLITE_SELECT {} {} {} v1 \
SQLITE_READ t2 a main v1 \
SQLITE_READ t2 b main v1 \
SQLITE_SELECT {} {} {} {} \
SQLITE_READ v1 x main v1 \
SQLITE_READ v1 x main v1 \
SQLITE_SELECT {} {} {} v1 \
SQLITE_READ v1 x main v1 \
SQLITE_INSERT v1chng {} main r3 \
SQLITE_READ v1 x main r3 \
+5
View File
@@ -19,6 +19,11 @@ ifcapable !fts3 {
return
}
ifcapable !utf16 {
finish_test
return
}
# Return the UTF-16 representation of the supplied UTF-8 string $str.
# If $nt is true, append two 0x00 bytes as a nul terminator.
# NOTE(shess) Copied from capi3.test.
+19 -2
View File
@@ -34,9 +34,8 @@ ifcapable {!autovacuum || !pragma} {
proc check_on_disk {} {
# Copy the files for database "test.db" to "test2.db".
# Copy the wal and journal files for database "test.db" to "test2.db".
forcedelete test2.db test2.db-journal test2.db-wal
forcecopy test.db test2.db
if {[file exists test.db-journal]} {
forcecopy test.db-journal test2.db-journal
}
@@ -44,6 +43,24 @@ proc check_on_disk {} {
forcecopy test.db-wal test2.db-wal
}
# Now copy the database file itself. Do this using open/read/puts
# instead of the [file copy] command in order to avoid attempting
# to read the 512 bytes begining at offset $sqlite_pending_byte.
#
set sz [file size test.db]
set fd [open test.db]
set fd2 [open test2.db w]
fconfigure $fd -encoding binary -translation binary
fconfigure $fd2 -encoding binary -translation binary
if {$sz>$::sqlite_pending_byte} {
puts -nonewline $fd2 [read $fd $::sqlite_pending_byte]
seek $fd [expr $::sqlite_pending_byte+512]
seek $fd2 [expr $::sqlite_pending_byte+512]
}
puts -nonewline $fd2 [read $fd]
close $fd2
close $fd
# Open "test2.db" and check it is Ok.
sqlite3 dbcheck test2.db
set ret [dbcheck eval { PRAGMA integrity_check }]
+2 -1
View File
@@ -141,6 +141,7 @@ ifcapable shared_cache {
#
set nFree [execsql {pragma freelist_count} db1]
set nPage [execsql {pragma page_count} db1]
puts "nFree=$nFree nPage=$nPage"
# Now run incremental-vacuum to vacuum 5 pages from the db file.
# The iTest'th I/O call is set to fail.
@@ -162,7 +163,7 @@ ifcapable shared_cache {
do_test incrvacuum-ioerr-4.$iTest.2 {
set shrink [expr {$nPage-$nPage2}]
expr {$shrink==0 || $shrink==5}
expr {$shrink==0 || $shrink==5 || ($nFree<5 && $shrink==$nFree)}
} {1}
do_test incrvacuum-ioerr-4.$iTest.3 {
+1 -1
View File
@@ -67,7 +67,7 @@ do_test 1.3 {
puts -nonewline \
" (forward=$nForward, back=$nBackward, noncontiguous=$nNoncont)"
expr {$nForward > 25*($nBackward + $nNoncont)}
expr {$nForward > 2*($nBackward + $nNoncont)}
} {1}
db close
tvfs delete
+10 -1
View File
@@ -20,6 +20,15 @@ ifcapable !atomicwrite {
finish_test
return
}
if {[permutation]=="inmemory_journal"} {
# These tests will not work with in-memory journals (as persistent VFS
# errors commencing after a transaction has started to write to the db
# cannot be recovered from).
finish_test
return
}
faultsim_save_and_close
do_test 1.1 {
@@ -63,7 +72,7 @@ do_faultsim_test 2 -faults full* -prep {
}
}
do_faultsim_test 2 -faults full* -prep {
do_faultsim_test 3 -faults full* -prep {
shmfault devchar atomic
faultsim_restore
sqlite3 db test.db
+5
View File
@@ -53,6 +53,11 @@ do_malloc_test mallocG-3 -sqlprep {
AND x BETWEEN 'i' AND 'm'
}
ifcapable !utf16 {
finish_test
return
}
proc utf16 {utf8} {
set utf16 [encoding convertto unicode $utf8]
append utf16 "\x00\x00"
+28
View File
@@ -488,6 +488,34 @@ do_test misc7-21.1 {
list $rc $msg
} {1 {unable to open database file}}
# Try to do hot-journal rollback with a read-only connection. The
# error code should be SQLITE_READONLY_ROLLBACK.
#
do_test misc7-22.1 {
db close
forcedelete test.db copy.db-journal
sqlite3 db test.db
execsql {
CREATE TABLE t1(a, b);
INSERT INTO t1 VALUES(1, 2);
INSERT INTO t1 VALUES(3, 4);
}
db close
sqlite3 db test.db -readonly 1
catchsql {
INSERT INTO t1 VALUES(5, 6);
}
} {1 {attempt to write a readonly database}}
do_test misc7-22.2 { execsql { SELECT * FROM t1 } } {1 2 3 4}
do_test misc7-22.3 {
set fd [open test.db-journal w]
puts $fd [string repeat abc 1000]
close $fd
catchsql { SELECT * FROM t1 }
} {1 {attempt to write a readonly database}}
do_test misc7-22.4 {
sqlite3_extended_errcode db
} SQLITE_READONLY_ROLLBACK
db close
forcedelete test.db
+1 -1
View File
@@ -752,7 +752,7 @@ sqlite3 db test.db -readonly 1
do_catchsql_test pager1.4.5.6 {
SELECT * FROM t1;
SELECT * FROM t2;
} {1 {disk I/O error}}
} {1 {attempt to write a readonly database}}
db close
# Snapshot the file-system just before multi-file commit. Save the name
+26
View File
@@ -0,0 +1,26 @@
# 2013 February 26
#
# 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. Specifically,
# it tests that ticket [7a31705a7e6c95d514e6f20a6900f436bbc9fed8] in the
# name resolver has been fixed.
#
set testdir [file dirname $argv0]
source $testdir/tester.tcl
do_execsql_test tkt-7a31705a7e6-1.1 {
CREATE TABLE t1 (a INTEGER PRIMARY KEY);
CREATE TABLE t2 (a INTEGER PRIMARY KEY, b INTEGER);
CREATE TABLE t2x (b INTEGER PRIMARY KEY);
SELECT t1.a FROM ((t1 JOIN t2 ON t1.a=t2.a) AS x JOIN t2x ON x.b=t2x.b) as y;
} {}
+78
View File
@@ -0,0 +1,78 @@
# 2013 March 05
#
# 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. Specifically,
# it tests that ticket [fc7bd6358f]:
#
# The following SQL yields an incorrect result (zero rows) in all
# versions of SQLite between 3.6.14 and 3.7.15.2:
#
# CREATE TABLE t(textid TEXT);
# INSERT INTO t VALUES('12');
# INSERT INTO t VALUES('34');
# CREATE TABLE i(intid INTEGER PRIMARY KEY);
# INSERT INTO i VALUES(12);
# INSERT INTO i VALUES(34);
#
# SELECT t1.textid AS a, i.intid AS b, t2.textid AS c
# FROM t t1, i, t t2
# WHERE t1.textid = i.intid
# AND t1.textid = t2.textid;
#
# The correct result should be two rows, one with 12|12|12 and the other
# with 34|34|34. With this bug, no rows are returned. Bisecting shows that
# this bug was introduced with check-in [dd4d67a67454] on 2009-04-23.
#
set testdir [file dirname $argv0]
source $testdir/tester.tcl
do_test tkt-fc7bd6358f.100 {
db eval {
CREATE TABLE t(textid TEXT);
INSERT INTO t VALUES('12');
INSERT INTO t VALUES('34');
CREATE TABLE i(intid INTEGER PRIMARY KEY);
INSERT INTO i VALUES(12);
INSERT INTO i VALUES(34);
}
} {}
unset -nocomplain from
unset -nocomplain where
unset -nocomplain a
unset -nocomplain b
foreach {a from} {
1 {FROM t t1, i, t t2}
2 {FROM i, t t1, t t2}
3 {FROM t t1, t t2, i}
} {
foreach {b where} {
1 {WHERE t1.textid=i.intid AND t1.textid=t2.textid}
2 {WHERE i.intid=t1.textid AND t1.textid=t2.textid}
3 {WHERE t1.textid=i.intid AND i.intid=t2.textid}
4 {WHERE t1.textid=i.intid AND t2.textid=i.intid}
5 {WHERE i.intid=t1.textid AND i.intid=t2.textid}
6 {WHERE i.intid=t1.textid AND t2.textid=i.intid}
7 {WHERE t1.textid=t2.textid AND i.intid=t2.textid}
8 {WHERE t1.textid=t2.textid AND t2.textid=i.intid}
} {
do_test tkt-fc7bd6358f.110.$a.$b.1 {
db eval {PRAGMA automatic_index=ON}
db eval "SELECT t1.textid, i.intid, t2.textid $from $where"
} {12 12 12 34 34 34}
do_test tkt-fc7bd6358f.110.$a.$b.2 {
db eval {PRAGMA automatic_index=OFF}
db eval "SELECT t1.textid, i.intid, t2.textid $from $where"
} {12 12 12 34 34 34}
}
}
finish_test
+7
View File
@@ -192,6 +192,13 @@ do_test triggerA-2.10 {
SELECT * FROM result4 ORDER BY a;
}
} {3 305 3 9900305 4 404 4 9900404 5 504 5 9900504}
do_test triggerA-2.11 {
db eval {
DELETE FROM result4;
UPDATE v5 SET b = main.v5.b+9900000 WHERE main.v5.x BETWEEN 3 AND 5;
SELECT * FROM result4 ORDER BY a;
}
} {3 305 3 9900305 4 404 4 9900404 5 504 5 9900504}
# Only run the reamining tests if memory debugging is turned on.
#
+8 -6
View File
@@ -602,11 +602,13 @@ do_test view-21.1 {
CREATE VIEW vx AS SELECT * FROM v32768 UNION SELECT * FROM v32768;
}
} {1 {too many references to "v1": max 65535}}
do_test view-21.2 {
db progress 1000 {expr 1}
catchsql {
SELECT * FROM v32768;
}
} {1 interrupted}
ifcapable progress {
do_test view-21.2 {
db progress 1000 {expr 1}
catchsql {
SELECT * FROM v32768;
}
} {1 interrupted}
}
finish_test
+1 -1
View File
@@ -471,7 +471,7 @@ static void page_usage_msg(int pgno, const char *zFormat, ...){
zMsg = sqlite3_vmprintf(zFormat, ap);
va_end(ap);
if( pgno<=0 || pgno>mxPage ){
printf("ERROR: page %d out of bounds. Range=1..%d. Msg: %s\n",
printf("ERROR: page %d out of range 1..%d: %s\n",
pgno, mxPage, zMsg);
sqlite3_free(zMsg);
return;