Commit Graph

6383 Commits

Author SHA1 Message Date
danielk1977
be2296501c Make sure struct WhereClause is aligned on an 8-byte boundary. Fix for #3613, #3736. (CVS 6364)
FossilOrigin-Name: 093a0cf4adc8613f744c2ccdef61f0b30a46818c
2009-03-20 14:18:51 +00:00
drh
7555d8ec40 Rename the unused MEM2 static mutex to OPEN and reuse it to serialize access
to the sqlite3BtreeOpen() routine to prevent a race condition on detection
of sharable caches.  Ticket #3735. (CVS 6363)

FossilOrigin-Name: 19fa5a29b97f017a9e176e48c848100299ba6920
2009-03-20 13:15:30 +00:00
danielk1977
df0f3c06b6 Fix a problem in thread005.test cause errors on osx. (CVS 6362)
FossilOrigin-Name: 56e6fca1a9da69c3a0fe43b00db9a6d9d93f03ba
2009-03-20 10:24:03 +00:00
danielk1977
eefa000331 Fix a problem in loadext.test causing an error on OSX. This is not a real problem, just a case of the test script expecting a slightly different error message than the one returned. (CVS 6361)
FossilOrigin-Name: 18680989b5365b0e35fadca5919dfced22433ff4
2009-03-20 09:09:37 +00:00
danielk1977
238746a650 Fix a couple of fairly obscure cases where an assert() could fail following a malloc failure. (CVS 6360)
FossilOrigin-Name: cc0d925669ddeb55048e88aa5b4f658be60b0962
2009-03-19 18:51:06 +00:00
danielk1977
65a2ea1155 Change sqlite3_step() to return SQLITE_LOCKED if a statement cannot be re-compiled due to locks on the shared-cache schema. Also add a blocking wrapper of sqlite3_prepare_v2() to the test code. (CVS 6359)
FossilOrigin-Name: e8be1af922098e298902820730f8b28603bd6fae
2009-03-19 07:58:31 +00:00
danielk1977
cb9d8d8821 Fix a crash that could occur when creating an index in shared-cache mode with lookaside enabled. (CVS 6358)
FossilOrigin-Name: 097737e3689b9a7e32815fe9c6fc6eed796ae53c
2009-03-18 18:43:36 +00:00
danielk1977
308ef5a548 Modify test script backup2.test so that it works on OSX. (CVS 6357)
FossilOrigin-Name: d82e8cd43f46dda15fd15b567901a7dbb2276287
2009-03-18 13:55:29 +00:00
drh
0bb1221eed Add comments and testcase() macros to the fix for shared-cache schema default
value problem of check-in (6353). (CVS 6356)

FossilOrigin-Name: 05d8607d44cd3ff262c07cc1192f4471f3192b09
2009-03-18 10:36:12 +00:00
danielk1977
bd43455c38 Fix some cases where executing SQL from within a user-function callback could cause problems related to statement-transactions. (CVS 6355)
FossilOrigin-Name: a60f4191791dd7bb49d5c95b350a9924845b59a8
2009-03-18 10:33:00 +00:00
drh
7f75122149 Move the rowid cache out of VdbeCursor and into BtCursor. When multiple
BtCursors are open on the same table, set their rowid cache all at the
same time.  Ticket #3731. (CVS 6354)

FossilOrigin-Name: 189785832a7dc9f4a0a2113d850b92b987e0f9bf
2009-03-17 22:33:00 +00:00
danielk1977
21822c58b0 Fix a problem that could cause a crash when a shared-cache schema contains column default values. (CVS 6353)
FossilOrigin-Name: afadddc34eee3d6a39102b790ce1a869b33d4286
2009-03-17 17:48:59 +00:00
drh
3ded8d6f2a Fix test script bugs in the thread002.test and thread_common.tcl. (CVS 6352)
FossilOrigin-Name: d137e841ce90be92f4c18218f35d22e3a06b0f14
2009-03-17 15:39:31 +00:00
drh
1f4969a117 Make sure the finished() array in thread005.test is cleared before the
script starts. (CVS 6351)

FossilOrigin-Name: ddadc25d550efd56e319bf5508c27d66e346be1b
2009-03-16 17:07:57 +00:00
danielk1977
d52acb3b5b Modify quick.test to support the QUICKTEST_INCLUDE environment variable, which can be used to override the built-in EXCLUDE list. (CVS 6350)
FossilOrigin-Name: fdfe22f0a568b5e8a5a2ad302d7c06b2696809b0
2009-03-16 14:48:18 +00:00
drh
8948747d8d Additional hyperlinks in the sqlite3_unlock_notify() documentation. (CVS 6349)
FossilOrigin-Name: 4dae5f6ed1662ca1c5c26d57049f7d349299468c
2009-03-16 13:37:02 +00:00
danielk1977
404ca07578 Add the sqlite3_unlock_notify() API. (CVS 6348)
FossilOrigin-Name: b649a6cc5bfefddd6a04b1183647d2923e0a0daa
2009-03-16 13:19:36 +00:00
drh
b030434d93 Bump the version number to 3.6.12. (CVS 6347)
FossilOrigin-Name: 2fcccca3e56e2e3a95bdedeb01ab7da1b24b7ac2
2009-03-16 12:30:52 +00:00
drh
93a989cf65 Remove surplus white space from shell.c. Use strlen30() instead of strlen(). (CVS 6346)
FossilOrigin-Name: 324a1aff300b7349b9fc1dea56d640d86500f100
2009-03-16 10:59:44 +00:00
danielk1977
1b870de6b0 Fix for #3719. When synthesizing a CREATE TABLE statement as as result of a "CREATE TABLE AS", quote the column type names unless they are simple identifiers or simple identifiers followed by one or two dimensions (e.g. "VARCHAR(10)"). (CVS 6345)
FossilOrigin-Name: 7c6437efe0a0e935cfa8041bd6b94070c8654fa4
2009-03-14 08:37:23 +00:00
danielk1977
9365c6760a Do not overrun a buffer in the genfkey code (now part of shell.c). Fix for #3722. (CVS 6344)
FossilOrigin-Name: 943b11fb188835f0c62b6064b084192b1bbe1c0c
2009-03-13 15:32:53 +00:00
danielk1977
2fe5cb1809 Avoid fts3 crash on (MATCH '""') expressions. Ticket #3717. (CVS 6343)
FossilOrigin-Name: 03679857a320517a7b89e5214e948bce9af896a9
2009-03-12 15:43:47 +00:00
danielk1977
20736d82e2 Make calls to sqlite3BtreeRollbackStmt() no-ops when passed a Btree* handle that does not have an open statement transaction. Ticket #3718. (CVS 6342)
FossilOrigin-Name: a1bb1aef0e06140a2d5d5e4b6c10c73ce95c89e0
2009-03-12 14:43:27 +00:00
danielk1977
6fa0fe13f0 Begin purging dirty pages from the cache once 90% of the cache is dirty (insteadof waiting until it is 100% dirty). This improves performance in some circumstances by effectively reserving 10% of the configured page-cache for frequently reused read-only pages. (CVS 6341)
FossilOrigin-Name: 823fe7f5551e121e211d1ede606a7ce7487ffe0d
2009-03-05 14:59:39 +00:00
danielk1977
c427740b78 Comment out a recently added assert statement that is failing. (CVS 6340)
FossilOrigin-Name: d0b2015f1caf2fc60ec82bd8e760f7b61befa3b4
2009-03-05 14:53:18 +00:00
shane
50daafc74a Implemented winSectorSize(); Other changes for consistency. os_win.c. Ticket #2931. (CVS 6339)
FossilOrigin-Name: 68abcb278ced40c0d97af724dbd1b751a3becdc2
2009-03-05 05:54:55 +00:00
shane
3c9cfa999c Changes to cleanup and improve the consistency of tests for large file support in bigfile.test. (CVS 6338)
FossilOrigin-Name: 3dbdf68030855a5da24de0ae2f10a26da2531d33
2009-03-05 04:27:08 +00:00
shane
e34c647ed0 Added some asserts and a check for a null pointer dereference. (CVS 6337)
FossilOrigin-Name: 6b0cabd017ed25530b2d918d2c069fcbdd60a3f6
2009-03-05 04:23:47 +00:00
shane
be21779385 Corrected typos and misspellings. Ticket #3702. (CVS 6336)
FossilOrigin-Name: 6404afa0c515a6536fc2e878d4fb451e4dc06942
2009-03-05 04:20:31 +00:00
shane
c0688ea172 Removed compiler warnings from MSVC builds. Ticket #3701. (CVS 6335)
FossilOrigin-Name: 5477833ec7f707ea9937d3fd6a6d8ab49f2016f1
2009-03-05 03:48:06 +00:00
shane
ce6fa1706a Converted EXPR_*SIZE macros to use offsetof() to avoid MSVC compiler warnings. (CVS 6334)
FossilOrigin-Name: 5e8e16f7d505a4b21272f1d300f366ee0e211e56
2009-03-02 17:18:48 +00:00
drh
18209cd6e2 Fix the SQLITE_ENABLE_UPDATE_DELETE_LIMIT option for the new Expr compression
logic of check-in (6305).  Bug discovered during regression testing. (CVS 6333)

FossilOrigin-Name: 91969edac737adf087e35e10aa0a732b3303afd5
2009-03-02 14:24:21 +00:00
drh
d742bb78f8 Fix a bug in the GROUP BY alias name resolution. The bug was by
check-in (6305).  Discovered by regression test on 64-bit linux.
Test cases added so that the problems is detected on 32-bit systems. (CVS 6332)

FossilOrigin-Name: fa0008502ec4f891bfed4a11f01650d274f95c44
2009-03-02 01:22:40 +00:00
drh
d43fe20bc9 Suppress some compiler warnings (where possible). Ticket #3696. (CVS 6331)
FossilOrigin-Name: a2373e5409e4e59903f315a4446db8cb6ba000cc
2009-03-01 22:29:20 +00:00
drh
b45f65db8f Fix a critical bug in the VDBE opcode array resizer introduced by
check-in (6307).  Bug detected by regression testing. (CVS 6330)

FossilOrigin-Name: ec3b18acaecabae6eb04eda006870e602faacb8c
2009-03-01 19:42:11 +00:00
danielk1977
2f886d1d53 Instead of linking temporary triggers on non-temporary tables into the Table.pTrigger list, search the temp schema for them on demand. Fix for #3688. (CVS 6329)
FossilOrigin-Name: 3befe1ef7e6ebddedfa69579553a1b85b411ee98
2009-02-28 10:47:41 +00:00
danielk1977
02b4e3b34e In sqlite3_table_column_metadata(), hold the mutex on all attached BtShared objects while accessing schema objects. Fix for #3679. (CVS 6328)
FossilOrigin-Name: d197afd658eecfc0e24913e5a779c8f1e2a138a6
2009-02-26 07:15:59 +00:00
drh
da10822a61 Move the new genfkey shell command out from within #ifdef _WIN32_ (CVS 6327)
FossilOrigin-Name: 48ee0e47e2d9669cc7425104e6b04ce49caf2e56
2009-02-25 19:07:24 +00:00
danielk1977
e632004fdd Remove genfkey.c. Change genfkey.README to talk about the new shell dot-command, not the old standalone genfkey program. (CVS 6326)
FossilOrigin-Name: 36d699660bc328e65170d72be715338e82dbbb50
2009-02-25 15:43:57 +00:00
danielk1977
c8c7069035 Add the 'genfkey' functionality to the sqlite3 shell. Accessed using a new dot-command - ".genfkey". (CVS 6325)
FossilOrigin-Name: 0a59fb28b46e5d85c850d1dfa1385a4656e4dda5
2009-02-25 15:22:02 +00:00
danielk1977
02f33725d2 Minor changes and coverge tests for "SELECT count(*)" optimization. (CVS 6324)
FossilOrigin-Name: a3695b98f63fb776c3b7f77f0553e8a38bcc6f78
2009-02-25 08:56:47 +00:00
drh
11b57d6929 Additional commands and another procedure name changes for clarity of
presentation. No logic changes. (CVS 6323)

FossilOrigin-Name: 91d9d51e03657e7492dd7b93e66c82b152abec3b
2009-02-24 19:21:41 +00:00
drh
c25eabedef Changes to comments and functions/procedure names for clarification. No
changes to logic. (CVS 6322)

FossilOrigin-Name: b99c1815fe270decf1ac3d714acc7e945d1e728a
2009-02-24 18:57:31 +00:00
danielk1977
2b0223ecf6 Remove old declaration of sqlite3_pending_byte (which was used by test code). It has been replaced by sqlite3PendingByte. Ticket #3677. (CVS 6321)
FossilOrigin-Name: 44f0162ebb760dd6926ee5691752b6798e3aacb9
2009-02-24 18:40:49 +00:00
danielk1977
7a895a8048 Fixes and some extra test cases for count(*) optimization. (CVS 6320)
FossilOrigin-Name: 3f0baa1b63df31f7dc885fd39290ca12ad2be6df
2009-02-24 18:33:15 +00:00
drh
c74d0b1dfc Enhanced comments on table locking logic as it relates to preparing new
statements.  Added assert() and testcase() but no other changes to code. (CVS 6319)

FossilOrigin-Name: 4a12f5b818b769d7518c942ff3dedf453dde698e
2009-02-24 16:18:05 +00:00
danielk1977
4d9c1dd262 Add test file test/count.test for testing "SELECT count(*)" statements. It is not properly populated yet. (CVS 6318)
FossilOrigin-Name: a195d74ff9ce836447dba4da7edcc6f1cdae5574
2009-02-24 10:48:27 +00:00
danielk1977
2d2e7bd32e Reverse commit (6315) for now. (CVS 6317)
FossilOrigin-Name: 0e7c369c23a8767b4d3e5cdd47c14716992fb71a
2009-02-24 10:14:40 +00:00
danielk1977
a55331620e Optimize queries of the form "SELECT count(*) FROM <tbl>" by adding a sqlite3BtreeCount() interface to the btree layer. (CVS 6316)
FossilOrigin-Name: d4aa6593183224b6868a322511511c0bbf63b598
2009-02-24 10:01:51 +00:00
danielk1977
e2d7b24d08 Scan an index instead of a table for "SELECT count(*) FROM <tbl>" queries. Because an index is usually smaller than a table on disk, this saves some IO. (CVS 6315)
FossilOrigin-Name: 294ba6f743c9132dce0e73da480bd3c2071e7239
2009-02-23 17:33:49 +00:00
drh
699b3d4f89 Add the reverse_unordered_selects pragma. (CVS 6314)
FossilOrigin-Name: bc078e0007b6c3dc07722820bb53798b643212b3
2009-02-23 16:52:07 +00:00
danielk1977
7c5c3cab89 Ensure the return value of sqlite3_errmsg16() is aligned on a 2-byte boundary. Ticket #3665. (CVS 6313)
FossilOrigin-Name: 9b8acf8319ec760713773407a4d5a33dea8d75e8
2009-02-23 14:42:53 +00:00
drh
6104b65303 The sqlite3.def file is automatically generated and is not suppose to be
part of the source code repository.  So it is hereby removed.
Ticket #3671. (CVS 6312)

FossilOrigin-Name: 5dcda154090e55a22b4d19f9def42beba8733f50
2009-02-21 22:38:59 +00:00
rse
973402e511 unbreak Autoconf-based build procedure by added missing backup.lo to the list of library objects (CVS 6311)
FossilOrigin-Name: 94945801973c0e659de3f429c98a7d95a8c693f6
2009-02-20 22:27:41 +00:00
danielk1977
d336e222f4 Instead of using SetNumColumns, specify the number of columns in a table or index using the P4 argument. (CVS 6310)
FossilOrigin-Name: e43ed649630cbc49a6f2a25a26a4a6b5fce84c48
2009-02-20 10:58:41 +00:00
drh
08de14908d Add a count parameter to the OP_Variable opcode and use it to simplify
prepared statements that copy consecutive unnamed parameters into
consecutive registers (a common case). (CVS 6309)

FossilOrigin-Name: 48b77b04935d8942eb22f0c061f3bc5e99bbd7db
2009-02-20 03:55:05 +00:00
drh
5053a79b6c Add the OP_HaltIfNull opcode and use it to simplify prepared statements
for INSERTs and UPDATEs of tables with NOT NULL columns. (CVS 6308)

FossilOrigin-Name: feccad8d0d05925ce67856d40ffe1bc7054168a0
2009-02-20 03:02:23 +00:00
drh
b2771ce24c Reuse space left-over opcode space at the end of the VDBE opcode array to
store memory cells, VDBE cursors, and other content needed by the VDBE.
This reduces the memory required by a prepared statement. (CVS 6307)

FossilOrigin-Name: 58a1809257ccfb7d9112a35f79ca2f82b3daa878
2009-02-20 01:28:59 +00:00
drh
e1935f2367 Remove code in malloc.c that was already commented out using #if 0. (CVS 6306)
FossilOrigin-Name: e1ad757ec0abead25265f9251c954d2497bccc06
2009-02-19 20:50:14 +00:00
danielk1977
6ab3a2ec8a Changes to reduce the heap space consumed by triggers, views and tables in the in-memory representation of the schema. Also to reduce the space used by prepared statements slightly. (CVS 6305)
FossilOrigin-Name: d9f6ffbc5ea090ba0daac571fc9a6c68b9c864e4
2009-02-19 14:39:25 +00:00
drh
076d4661a6 Make sure the auto_vacuum=INCREMENTAL setting is preserved across a VACUUM.
Ticket #3663. (CVS 6304)

FossilOrigin-Name: ded04f12f41504e4a3ecd5164f0d4cbbde5e16f7
2009-02-18 20:31:18 +00:00
drh
8b39db1c83 Move the text of C-API requirements out of the sqlite.h.in source file and
into separate files in the "docsrc" CM system.  Comment changes only - no
changes to code. (CVS 6303)

FossilOrigin-Name: 419eb48b6b4238526850091eef28af503b6c4579
2009-02-18 18:37:58 +00:00
drh
40a390de50 Fix the amalgamation builder to mark sqlite3PagerBackupPtr as private.
Ticket #3662. (CVS 6302)

FossilOrigin-Name: fb281950c51ef81797f93d797113d328d66a7cb0
2009-02-18 12:25:28 +00:00
vapier
d3dd12b202 run autoconf so the updated version is in the configure script (CVS 6301)
FossilOrigin-Name: edbb3586e92d675d621e23126581e9c3072e32b9
2009-02-18 04:35:12 +00:00
vapier
afea974870 break libsqlite3.la install step out so the tcl install step can depend on it as well (CVS 6300)
FossilOrigin-Name: 0998c55467a777783e4d451b3c82d769bef84d0b
2009-02-18 04:33:59 +00:00
drh
446126ab07 Version 3.6.11 (CVS 6299)
FossilOrigin-Name: 6abd630c8703ed09af27776096677c2f35da6b85
2009-02-18 00:00:04 +00:00
drh
50b6568454 Add tests to double-check that nothing within SQLite ever tries to allocate
amounts of memory that are close to the maximum signed integer, leading to
an integer overflow within malloc().  This is not currently a problem.
The extra tests just insure it never becomes a problem. (CVS 6298)

FossilOrigin-Name: f6ba7bb9152cffc9f67dfa7de12e36a3244b7e03
2009-02-17 18:37:28 +00:00
danielk1977
f37adcb40f Initialize an uninitialized buffer to silence a valgrind warning during a VACUUM operation. (CVS 6297)
FossilOrigin-Name: 8c61968b33dd753618589cb3f859984223161d64
2009-02-17 17:56:30 +00:00
danielk1977
0a54907159 Allow sqlite3_shutdown() to be called by a process before sqlite3_initialize() is. Prior to this commit such a call could segfault. (CVS 6296)
FossilOrigin-Name: 79431c58d964d6057c7f42f7c1df74f3df4493eb
2009-02-17 16:29:10 +00:00
drh
e8df800d4c Make sure result variables are initialized or unused following a failure
of the xFullPathname VFS interface.  Problem detected by valgrind. (CVS 6295)

FossilOrigin-Name: 59a4755185f0e51699cd020ae67d279bee45de1c
2009-02-17 16:17:01 +00:00
shane
65ad7d225f Changes to remove some compiler warnings from MSVC. (CVS 6294)
FossilOrigin-Name: 68f15442e8db364952d30daf4ce60c6b938f5906
2009-02-16 17:55:47 +00:00
drh
38aec8dc09 Fix a compiler warning in backup.c. (CVS 6293)
FossilOrigin-Name: 82222fbf5d5a085ce3e2c172c648a4c6d9750626
2009-02-16 16:23:09 +00:00
drh
f16ce3bc2a Make sure OOM errors in the ANALYSIS loader get reported back out to
high-level layers.  Strange behavior can result otherwise. (CVS 6292)

FossilOrigin-Name: 88a6355cd65ddb319dbc27b5248c664dbf599778
2009-02-13 16:59:53 +00:00
drh
0388123f07 Correctly handle attempts to add a UNIQUE or PRIMARY KEY column using
the ALTER TABLE statement.  Ticket #3651. (CVS 6291)

FossilOrigin-Name: dd179ff2986bc2a86d70bbe927fd0e123e17d398
2009-02-13 03:43:31 +00:00
drh
aff46970a7 Add additional cross-references from API documentation to other documents.
Comment changes only; no changes to code. (CVS 6290)

FossilOrigin-Name: 97203a0ad7a7ddfae04daf99558389b0589fc170
2009-02-12 17:07:34 +00:00
drh
a32e0d05ff Update thread tests to clear the sqlite_open_file_count counter at the
end.  This counter is not threadsafe and can end up with an invalid value
at the end of the thread tests. (CVS 6289)

FossilOrigin-Name: 8c4d71a169e529964d2d0cfba82bbad66a0bcd12
2009-02-12 17:06:41 +00:00
danielk1977
f2a79f2248 Fix some edge cases with backing up databases that are exactly PENDING_BYTE bytes in size, or just slightly larger. (CVS 6288)
FossilOrigin-Name: 2fc450e8e60248d6111d0b0d2b8f2344f5b89bca
2009-02-12 17:01:49 +00:00
danielk1977
1435ccd52b Modify lock.test to account for "PRAGMA lock_status" returning "unknown" for in-memory databases. (CVS 6287)
FossilOrigin-Name: 9a6e558ba6fe0b38376a85a6c1e2cea5570ea283
2009-02-12 09:36:15 +00:00
danielk1977
f7f33fb08a Fix a case where during a rollback triggered by an IO or malloc error an unjournalled region of the database could be written to (with it's original data). This was causing an assert in test_journal.c to fail. Add a test case in ioerr2.test to trigger this case. (CVS 6286)
FossilOrigin-Name: 315a6692f9a03a470871cce4f74567683546f343
2009-02-12 09:11:56 +00:00
shane
ce14f6245e Updated for Windows compatibility. Test scripts only. (CVS 6285)
FossilOrigin-Name: 2522ad1df3599fa71cd1d929142adaefaf3a4d67
2009-02-11 16:06:18 +00:00
drh
46f33ef93c Continuing documentation refinements. Comment changes only. (CVS 6284)
FossilOrigin-Name: 83e8308435be8c954fe7a347a64f28abcb81437b
2009-02-11 15:23:35 +00:00
danielk1977
3d781c2176 Fix the backup.test script so that it works regardless of the value of SQLITE_TEMP_STORE and the initial contents of the file-system. (CVS 6283)
FossilOrigin-Name: da660ea73ac6627b4e71706b8cd464646ea66550
2009-02-11 15:11:00 +00:00
drh
ae1a880719 Add hyperlinks from sqlite3_limit() documention to the limits.html page.
Comment changes only - no changes to code. (CVS 6282)

FossilOrigin-Name: f0189ec8c9b5d1dfe1f5d93746cc7b5703a80de5
2009-02-11 15:04:40 +00:00
danielk1977
d6846d75ca Fix the crashtest infrastructure so that it doesn't trigger the "don't write to the locking region" assert in os_unix.c. (CVS 6281)
FossilOrigin-Name: b7fd4615cd41179484bd44d2f4bd7aef04977911
2009-02-11 14:27:04 +00:00
danielk1977
4faa5f41b8 Modify the test_journal.c code to (1) account for the backup code writing to parts of the pending-byte page when changing a databases page-size, and (2) to avoid reading from the pending-byte page and triggering the assert in os_unix.c. Changes to test code only. (CVS 6280)
FossilOrigin-Name: 4879621658c2c785ab7b12dbae780901496d3a78
2009-02-11 07:38:11 +00:00
danielk1977
9ec30744bf In test_mutex.c, zero the global structure staticly instead of in Sqlitetest_mutex_Init(). This is because Sqlitetest_mutex_Init() is now called by each thread during thread tests ((6193)). Test code changes only. (CVS 6279)
FossilOrigin-Name: 8b318b9385d0542ca56750b901c0c6b7d05ca634
2009-02-11 05:18:06 +00:00
danielk1977
2b754b4820 For the "onefile" demo, pass SQLITE_OPEN_TEMP_DB instead of MAIN_DB to the OS layer when opening the single file. This is to work around the assert() in os_unix.c that tests that the locking region is not written to. (CVS 6278)
FossilOrigin-Name: 2da076a2c1663e916dc50e5e1679be216922dfc5
2009-02-10 18:54:02 +00:00
danielk1977
b8f12c1201 Reduce the number of iterations in one of the savepoint4.test crash tests. (CVS 6277)
FossilOrigin-Name: fafb07b83721d67f6c6f3126c8de94b9b7efa519
2009-02-10 14:45:12 +00:00
danielk1977
2d42c2b247 Prevent code in test6.c from reading the 512 byte locking region (the PENDING_BYTE page) of a database file. Doing so triggers an assert failure in os_unix.c. (CVS 6276)
FossilOrigin-Name: 2a6a43169220fab5a15a786e2a464b90cb893179
2009-02-10 14:28:57 +00:00
drh
52224a73f1 Create links from backup API documentation to the backup application note.
Comment changes only - no changes to code. (CVS 6275)

FossilOrigin-Name: 85de23fb4e63e5c71480c4c34efec331e774d7fb
2009-02-10 13:41:42 +00:00
danielk1977
cd503d6a3b Reenable triggering vdbe tracing by creating file-system entries. Add a (redundant) test that modifying the temp schema expires all prepared statements. (CVS 6274)
FossilOrigin-Name: f6590dac4612d0d05105fa820e8fcb80b5907a40
2009-02-10 11:17:43 +00:00
danielk1977
b632201d81 Do not always open a transaction on the temp database when writing to the main or another attached database. (CVS 6273)
FossilOrigin-Name: f76b0b8129657eace0a933ac1988b472d5e79c98
2009-02-10 10:44:42 +00:00
danielk1977
8e3e881a24 Fix a bug in test file misc7.test. No code changes. (CVS 6272)
FossilOrigin-Name: d919d2a14c8cbbda3fbd6fb2ddae174fa709177b
2009-02-10 05:45:41 +00:00
danielk1977
3d0cbc3362 Fix a problem in backup.c causing OsTruncate() to be called with an argument larger than the current file-size. (CVS 6271)
FossilOrigin-Name: b34bde80c7e2028baf7ba2ff26e587a63a170f3d
2009-02-09 18:55:45 +00:00
drh
08c6d4468c Add assert() statements to os_unix.c which fire if there is a read or
write for the locking region of a database file. (CVS 6270)

FossilOrigin-Name: 93e792ffa88ba2e8422d041f36b70d9b2e220da2
2009-02-09 17:34:07 +00:00
drh
0daa002c7c Better error message when DISTINCT is used on an aggregate function that
takes two or more arguments.  Ticket #3641. (CVS 6269)

FossilOrigin-Name: e20bf384668bcde7c2f2152ca88e28cf65a02679
2009-02-09 13:19:28 +00:00
danielk1977
09480a9dc2 Ignore the return structure of and F_GETLK fcntl() call on djgpp. Fix for #3642. (CVS 6268)
FossilOrigin-Name: 8227af3463ded1c52d0a16c63b8dbc516eab57f0
2009-02-09 05:32:32 +00:00
danielk1977
53b6028b9c Attempt to reproduce ticket #3643. No luck yet. (CVS 6267)
FossilOrigin-Name: 8f2f98d247b04ae6bda34621e9ccdba904f34ad7
2009-02-09 05:18:33 +00:00
danielk1977
03ab035796 Changes to the backup API: (1) if a negative number is passed as the second argument to backup_step(), this is interpreted as "copy all remaining pages" and (2) if backup_finish() is called after backup_step() fails with a BUSY or LOCKED error, then this error is also returned by backup_finish() (same handling as for other errors encountered by backup_step()). (CVS 6266)
FossilOrigin-Name: 9b8c8b18cf6b7d44d5fd64760537bc030097756b
2009-02-06 05:59:44 +00:00
drh
f4883888ca Fix a test case that was still using the old pending_byte mechanism. (CVS 6265)
FossilOrigin-Name: 08ec4f2c394ec834c20bfce0d98bbe6b4ce2be65
2009-02-05 17:00:54 +00:00
drh
ddb68e17fa Fix the declaration of sqlite3PendingByte so that it works with the
amalgamation. (CVS 6264)

FossilOrigin-Name: 193c871f3d16ce982040334c543610d330117bd5
2009-02-05 16:53:43 +00:00
drh
c7a3bb94c2 Make the pending byte adjustable via sqlite3_test_control() on all builds,
not just on test builds. (CVS 6263)

FossilOrigin-Name: e8f192e2a93350a136d86bd9caceff65f52f3513
2009-02-05 16:31:45 +00:00
shane
f5d335f851 Fixed error detection in winTrucate() in os_win.c. Windows version only. Ticket #3640. (CVS 6262)
FossilOrigin-Name: 82e03f1b5481c6fe5e94976f086e8fe8c99881af
2009-02-05 03:16:20 +00:00
shane
d20010c70e Improved overrun detection in mem2.c (SQLITE_MEMDEBUG). Previously was only checking up to 3 extra bytes allocated due to rounding. (CVS 6261)
FossilOrigin-Name: a6fe3d6b02734b23fe067a373c0232024a782a6c
2009-02-05 03:00:06 +00:00
drh
dc2c491525 Add "backup" and "restore" methods to the TCL interfaces and test cases
to exercise those methods. (CVS 6260)

FossilOrigin-Name: e420a3cedc7ee086a77cd719f6b9fb85415eb5f3
2009-02-04 22:46:47 +00:00
drh
9ff849fc87 Add ".backup" and ".restore" commands to the CLI - implemented using the
new backup API. (CVS 6259)

FossilOrigin-Name: 003e1d62189e9e37f901d86a696cfccd22bd3b38
2009-02-04 20:55:57 +00:00
drh
bd4c35b999 Increase the version number to 3.6.11. (CVS 6258)
FossilOrigin-Name: 0882a028c8cee868bb79728499fb1fa7c0630fa6
2009-02-04 20:08:26 +00:00
drh
9e7ba7c69a If the truncate operation fails in journalmode=TRUNCATE, do not fall back
to overwriting the journal header with zeros.  Simply fail the operation. (CVS 6257)

FossilOrigin-Name: d4af60e52a12262ad0194908e68a386c719fe177
2009-02-04 19:16:23 +00:00
drh
b309becded Simplify wording of backup API error message. Decapitalize some other
error messages. (CVS 6256)

FossilOrigin-Name: f92405afb649b698b735b423cd9195d4f8f137c9
2009-02-04 17:40:57 +00:00
drh
eef1eb0ff4 The sqlite3_backup_init() interface must lock the destination in case it
needs to change the error message. (CVS 6255)

FossilOrigin-Name: 572378d3a29c7d55fa4a15df14800c26d6c563a1
2009-02-04 16:56:19 +00:00
danielk1977
b48c1f192e Fix a bug in test_malloc.c whereby running multi-threaded test cases could cause subsequent OOM tests to fail. (CVS 6254)
FossilOrigin-Name: 03ea9e591337a3c442080ee7cd01cc4ee85c1357
2009-02-04 15:27:40 +00:00
danielk1977
8a569e2936 Ensure that thread001.test and thread002.test reset the global shared-cache-enabled setting before they finish. (CVS 6253)
FossilOrigin-Name: 416288a9fa39c7c4d9d414de18edc0423ed83794
2009-02-04 11:57:46 +00:00
danielk1977
651a52fac2 Do not attempt to use the sub-journal file descriptor if it is not opened (as in journal_mode=off mode). Ticket #3636. (CVS 6252)
FossilOrigin-Name: 20bd76055463c85f62a450e368f4bcf7d2215f94
2009-02-04 10:09:04 +00:00
danielk1977
de06e9f230 Fix a bug in malloc.test causing the exclusive permutation to fail. Changes to test code only. (CVS 6251)
FossilOrigin-Name: 72745bde90a9b4ffae1496f1668e4bb0678bd400
2009-02-04 08:17:57 +00:00
shane
fbd60f826d Changes to completely remove all floating point ops if SQLITE_OMIT_FLOATING_POINT defined. Note that w/o fp, date/time, round, nan, etc. are all gone or limited in functionality. Updated some of the test scripts to support missing fp and 64-bit functionality. Ticket #3029. (CVS 6250)
FossilOrigin-Name: 5cef400023205b55152b91441acc78f9cd8d58a9
2009-02-04 03:59:25 +00:00
shane
63207ab262 Remove compiler warnings under MSVC. (CVS 6249)
FossilOrigin-Name: 6301f08a2b32289a49c4af994f2770318c444b49
2009-02-04 01:49:30 +00:00
drh
d3a5c50ec7 Correction to check-ins (6246) and (6247): The backup object might not
hold a valid destination connection pointer.  Also, do not reset the
page cache when establishing a read-lock while there is a persistent
or truncated journal, only if there is a journal that really needs to
rollback.  Otherwise backups always reset whenever the source database
file is read. (CVS 6248)

FossilOrigin-Name: 7f827ba9d7af2dfe44aed386b4407716c85daf5e
2009-02-03 22:51:06 +00:00
drh
6231286dfe A backup must clear the internal schema of the destination database so
that the schema will be reloaded for the next sqlite3_prepare() (CVS 6247)

FossilOrigin-Name: 76f23a4394574e31f237e55c641bc70534f44d97
2009-02-03 22:17:42 +00:00
drh
662c58c9ba Must hold mutex on the destination during backups. Add documentation to
warn programmers that attempting to use the destination connection during
a backup can lead to deadlock. (CVS 6246)

FossilOrigin-Name: 5f6c06b974f26532264467ace603b6f1f830fba9
2009-02-03 21:13:07 +00:00
shane
39070edbab Fixed postToParent() return type (Tcl_ThreadCreateType) in test_thread.c to compile with MSVC. Removed a few compiler warnings. Test harness change only. (CVS 6245)
FossilOrigin-Name: e9475abaf87c0ae2f2bbcbaf0f7ba704f9f50c5f
2009-02-03 19:55:20 +00:00
shane
0f911e2559 Fix buffer size in md5_cmd() in test_md5.c. Test harness change only. (CVS 6244)
FossilOrigin-Name: c1e15717ff1b8181ff5fdc800015dadb62135e8c
2009-02-03 19:52:59 +00:00
drh
62b5d2d8e6 More adjustments to the backup API documentation. No changes to code. (CVS 6243)
FossilOrigin-Name: ca650879d3168d4475a33430300a0e8ac806facf
2009-02-03 18:47:22 +00:00
drh
27b3b84796 Tweaks to the backup API documentation contained in comments. No changes
to code. (CVS 6242)

FossilOrigin-Name: 6298bcca14bc0dd447198430af4147a3673963fc
2009-02-03 18:25:13 +00:00
danielk1977
0410302e58 Commit first version of the 'backup' feature. (CVS 6241)
FossilOrigin-Name: 663479b417fc06ba1790a544f28694f8797cee57
2009-02-03 16:51:24 +00:00
drh
7ed0cae237 Fix the sqlite3_mprintf_long test command (added by check-in (6224) in order
to address ticket #3621) so that it works on systems with sizeof(int)==4 and
sizeof(long)==8. (CVS 6240)

FossilOrigin-Name: 2e45c2a85183f7430225aa8dd89ee05028afecf2
2009-02-03 16:25:47 +00:00
drh
1d34fdecb6 Remove several compiler warnings. (CVS 6239)
FossilOrigin-Name: 85e9196d79ef8500300abb215a31e0519b2e8d02
2009-02-03 15:50:33 +00:00
drh
4b9421af6f Remove the text of the sqlite3VdbeMemSanity() routine, which was already
commented out. (CVS 6238)

FossilOrigin-Name: a3c260772bda68007b73feee6612495a704c84f5
2009-02-03 15:39:01 +00:00
drh
eb0d74ff39 Check at the write() call to work around the msdos bug in OSX actually
succeeds and throw an error if it does not.  #ifdef out the work-around
for all platforms other than OSX.  Ticket #3633. (CVS 6237)

FossilOrigin-Name: b054b569172c53f4e185e4a64f41d08784aa0f8b
2009-02-03 15:27:02 +00:00
drh
f158162191 Add a special rule to the amalgamation generator to deal with
the sqlite3OsDlSym function.  Ticket #3631. (CVS 6236)

FossilOrigin-Name: 876f874c6e2e6e7763083e6761eedc10a4522ec9
2009-02-03 13:51:17 +00:00
drh
2333606e9c Fix a problem in check-in (6226) which could cause an assertion fault
following a malloc failure.  The prior check-in was for ticket #3624. (CVS 6235)

FossilOrigin-Name: 1ffe44e9d6b49346a75850a977953de12c127069
2009-02-03 13:19:12 +00:00
drh
478000cf5c Check-in (6230) introduced a bugs in SUBSTR() which was caught by the fuzz
tester.  Fixed by this check-in.  Related to ticket #3628. (CVS 6234)

FossilOrigin-Name: cd2e7f6c0fe4c0c648f8ca21388ab0769164f5ef
2009-02-03 13:10:54 +00:00
drh
07d3117aed Make group_concat() a 1- or 2-value function, as the documentation says it
should be.  Use the md5sum() function to verify ticket #3179, not
group_concat().  This undoes the ill-advised group_concat() change of
check-in (5233). (CVS 6233)

FossilOrigin-Name: f2ae82c4d46c2eca30fc60a50ab5064728f20739
2009-02-02 21:57:05 +00:00
drh
bdb339ff73 Omit the TEMP keyword from the schema of TEMP tables created using
CREATE TEMP TABLE AS SELECT .....  Ticket #3630. (CVS 6232)

FossilOrigin-Name: 3b0a25548c4c15c86aadcd9a6c3af0adafb85c17
2009-02-02 18:03:21 +00:00
drh
a0df4ccfe3 Minor simplifications to SQL function implementations. (CVS 6231)
FossilOrigin-Name: 92e5c27f20f150c1777c1b91d35207ade961319d
2009-02-02 17:29:59 +00:00
drh
65595cd60b Update the SUBSTR function so that works consistently when the
2nd parameter is 0.  Ticket #3628. (CVS 6230)

FossilOrigin-Name: 5fc125d362df4b8525c7e1ab34a14f505756af24
2009-02-02 16:32:55 +00:00
drh
9373b01882 Restrict the RANDOM() function to have zero arguments. Ticket #3627. (CVS 6229)
FossilOrigin-Name: b8b546b6ed799dc1621ef7b06273249af1042fb2
2009-02-02 01:50:39 +00:00
drh
8198d25442 Fix SUBSTR() so that it returns NULL if any argument is NULL.
Ticket #3626. (CVS 6228)

FossilOrigin-Name: 779fce82b7a89b972da488ce8bd35e23ca120c04
2009-02-01 19:42:37 +00:00
drh
4e79c59454 Fix the SUBSTR() function so that when the 3rd argument is negative,
it counts backwards from the selected start point.  Ticket #3625. (CVS 6227)

FossilOrigin-Name: 2217339badf1e84edbed1309c39b9f8dfd7646ff
2009-02-01 19:23:32 +00:00
drh
a605fe8d8b Change the replace() function to return a copy of its first argument when
the 2nd argument is an empty string.  Ticket #3624. (CVS 6226)

FossilOrigin-Name: ffebf10f6fb2c7f3083992e2c712682b4cdcc6f0
2009-02-01 18:08:40 +00:00
drh
9437bd2945 Adjust comments in vdbe.c to use OP_MakeRecord instead of the obsolete
OP_MakeIdxRec.  Ticket #3619. (CVS 6225)

FossilOrigin-Name: 0d2abbbff5d9e12e2382ed201bf1648c5918c1c0
2009-02-01 00:29:56 +00:00
drh
c5cad1e350 Add a new test command, sqlite3_mprintf_long, for testing the behavior
of "long integer" printf formatting.  Ticket #3621. (CVS 6224)

FossilOrigin-Name: 3ba1a17b1306bc61b9861ec8d3b239e16a3081ba
2009-02-01 00:21:09 +00:00
drh
565911e912 Make the TO keyword available even if SQLITE_OMIT_ALTERTABLE is defined.
Ticket #3622. (CVS 6223)

FossilOrigin-Name: 3890985ca6750584876596fd0a124f47ee032075
2009-02-01 00:00:45 +00:00
drh
dfbc3a8a3b Better error message when coalesce() has too few arguments. Ticket #3623. (CVS 6222)
FossilOrigin-Name: 9cd43c82a3c123829806aa7bf14efdd29f4424d8
2009-01-31 22:28:48 +00:00
danielk1977
64beba4338 Avoid a segfault when running vacuum on an in-memory database. Ticket #3620. (CVS 6221)
FossilOrigin-Name: 407830c6839a81fa0a1010940740df3011713a88
2009-01-31 14:54:06 +00:00
drh
c531a22377 Fix a round-off error when moving dates by negative modifier amounts.
Ticket #3618.  Enhance the "NNN years" modifier to accept fractional
years. (CVS 6220)

FossilOrigin-Name: 86be908c5e77ba2b9ac98e394fa987b443d790f8
2009-01-30 17:27:44 +00:00
shane
1a38964b50 Made code to remove unused parameter warning part of the conditional. Ticket #3610. (CVS 6219)
FossilOrigin-Name: c5dca1146de72071ed2e5fdf6890f41682272587
2009-01-30 16:09:22 +00:00
shane
f71f89e842 Changes to setupLookaside() in main.c to better handle lookaside buffer configurations of zero-size. Ticket #3616. (CVS 6218)
FossilOrigin-Name: 0a2c7f740397c5c6373434c75d73c2714f14dd32
2009-01-30 06:11:54 +00:00
shane
9db299fb8f Implemented the SQLITE_LAST_ERRNO op in the xFileControl() method of os_win.c. Ticket #3615. (CVS 6217)
FossilOrigin-Name: 9ea871f3e8ce1ec5cffb72f13704c3002d3f5383
2009-01-30 05:59:10 +00:00
shane
6a91ca06b8 In test case incrvacuum-15.1 close both db handles (db and db2) before attempting to delete test.db. Ticket #3614. (CVS 6216)
FossilOrigin-Name: e764a7c5d369e2ff736d662b1209b3d54d778caf
2009-01-30 05:47:15 +00:00
shane
d87897dfa2 Minor changes to remove a few MSVC compiler warnings at /W3. Ticket #3610. (CVS 6215)
FossilOrigin-Name: c74c78e4eb7f6d674b7564b33387db996fbe5725
2009-01-30 05:40:27 +00:00