]> git.ipfire.org Git - thirdparty/sqlite.git/log
thirdparty/sqlite.git
12 years agoTwo new SQL functions: unicode() and char(). unicode-function
drh [Fri, 22 Feb 2013 19:34:25 +0000 (19:34 +0000)] 
Two new SQL functions: unicode() and char().

FossilOrigin-Name: 209b21085b9767f10f6ffb7c7cac756fcb74ded5

12 years agoOn Minix, disable the ".timer" command in the shell in order to avoid
drh [Wed, 20 Feb 2013 00:54:21 +0000 (00:54 +0000)] 
On Minix, disable the ".timer" command in the shell in order to avoid
calling getrusage().

FossilOrigin-Name: 9bd9bd9cab8c804c1a51d472199459176044a633

12 years agoEnhance the showdb tool with options to show PTRMAP usage and content.
drh [Tue, 19 Feb 2013 22:26:51 +0000 (22:26 +0000)] 
Enhance the showdb tool with options to show PTRMAP usage and content.

FossilOrigin-Name: 06bd91305ed6752315c5224be5f89e87cafa6687

12 years agoFix the showdb utility so that it displays the correct secondary usage of
drh [Tue, 19 Feb 2013 20:25:16 +0000 (20:25 +0000)] 
Fix the showdb utility so that it displays the correct secondary usage of
a page when reporting on an error of a page being used more than once.

FossilOrigin-Name: 4507f0b3d409cd14bb2b9c29c92c76aa3ccb22b6

12 years agoEnhance the pgidx of the showdb utility so that it provides better information
drh [Tue, 19 Feb 2013 18:45:11 +0000 (18:45 +0000)] 
Enhance the pgidx of the showdb utility so that it provides better information
even if the sqlite_master table is corrupt.

FossilOrigin-Name: d14263a719101d9c70054f2fc37e7788f73aab28

12 years agoDo not rollback the schema if a parsing error occurs while parsing the schema
drh [Tue, 19 Feb 2013 18:34:45 +0000 (18:34 +0000)] 
Do not rollback the schema if a parsing error occurs while parsing the schema
and writable_schema is set.

FossilOrigin-Name: 680d3ab56b578bd4b0170559f9e35615ff43cf2c

12 years agoTruncate over-length source lines in sqliteInt.h to 80 characters or less.
drh [Tue, 19 Feb 2013 18:34:12 +0000 (18:34 +0000)] 
Truncate over-length source lines in sqliteInt.h to 80 characters or less.

FossilOrigin-Name: d71abab08518f0be1eb73c7068566ab813652318

12 years agoAdd the edit_cost_table= command to the spellfix1 virtual table, permitting
drh [Tue, 19 Feb 2013 11:51:27 +0000 (11:51 +0000)] 
Add the edit_cost_table= command to the spellfix1 virtual table, permitting
the edit distance cost table to be changed at runtime.

FossilOrigin-Name: 89d6368250f9ba2f49e930bbe5524f3da615ce70

12 years agoFix an unsafe VM register deallocation.
drh [Sat, 16 Feb 2013 02:41:01 +0000 (02:41 +0000)] 
Fix an unsafe VM register deallocation.

FossilOrigin-Name: cfba2c8dadbf1fa6f1602a327933570820a3b134

12 years agoCheck for a NULL handle prior to manually calling winClose.
mistachkin [Fri, 15 Feb 2013 04:21:01 +0000 (04:21 +0000)] 
Check for a NULL handle prior to manually calling winClose.

FossilOrigin-Name: 843e1c543aabab8cd62f28742d5818887d36bcb7

12 years agoVerify that the schema has not changed before running PRAGMA table_info,
drh [Thu, 14 Feb 2013 16:16:05 +0000 (16:16 +0000)] 
Verify that the schema has not changed before running PRAGMA table_info,
index_list, index_info, and foreign_key_list.

FossilOrigin-Name: 82952d08f3e3aa80a7f51e80dbc89742cb4a09f0

12 years agoOn WinCE, fill in the winFile structure after winceCreateLock has succeeded.
mistachkin [Wed, 13 Feb 2013 22:54:03 +0000 (22:54 +0000)] 
On WinCE, fill in the winFile structure after winceCreateLock has succeeded.

FossilOrigin-Name: ec13544ce336e8a02b34d574ced5912b06c82c0e

12 years agoAdd recent API additions to the extension mechanism.
drh [Wed, 13 Feb 2013 14:04:28 +0000 (14:04 +0000)] 
Add recent API additions to the extension mechanism.

FossilOrigin-Name: 7e10a62d0eb1cb2bdafb6752b78a9d368e9f21f5

12 years agoAllow an index to be used for sorting even if prior terms of the index
drh [Wed, 13 Feb 2013 01:00:35 +0000 (01:00 +0000)] 
Allow an index to be used for sorting even if prior terms of the index
are constrained by IN operators.

FossilOrigin-Name: 2cef8b68f0e1216cf68bb7dd45a5a9a330748070

12 years agoImprove memory allocation error handling on WinCE.
drh [Tue, 12 Feb 2013 22:20:01 +0000 (22:20 +0000)] 
Improve memory allocation error handling on WinCE.

FossilOrigin-Name: cdbca259da80df901837034d2616da434cb82216

12 years agoA bug report coming from from Firefox
drh [Tue, 12 Feb 2013 22:09:48 +0000 (22:09 +0000)] 
A bug report coming from from Firefox
([https://bugzilla.mozilla.org/show_bug.cgi?id=840377])
describes an infinite recursion.  We are unable to reproduce the problem.
Nevertheless, this check-in should prevent the problem from ever occurring
again.

FossilOrigin-Name: b7222a2bd035e7a32dc9416b25a488d9d017aad1

12 years agoImprove memory allocation error handling on WinCE. wince
mistachkin [Tue, 12 Feb 2013 09:46:48 +0000 (09:46 +0000)] 
Improve memory allocation error handling on WinCE.

FossilOrigin-Name: 09dfc0c915ec2f0c5f633a3485d47cad15eec4dc

12 years agoAdd extended error codes for all SQLITE_CONSTRAINT errors.
drh [Mon, 11 Feb 2013 13:47:39 +0000 (13:47 +0000)] 
Add extended error codes for all SQLITE_CONSTRAINT errors.

FossilOrigin-Name: 939d8282748b00a7032cdd72e5d3bf3086ebfc97

12 years agoRename SQLITE_CONSTRAINT_RAISE to SQLITE_CONSTRAINT_TRIGGER. Put the constraint-error-codes
drh [Sat, 9 Feb 2013 15:37:11 +0000 (15:37 +0000)] 
Rename SQLITE_CONSTRAINT_RAISE to SQLITE_CONSTRAINT_TRIGGER.  Put the
extended constraint error codes in alphabetical order.  Add many test cases
for the extended constraint error codes.

FossilOrigin-Name: 3f67437536591a1b0742a25b983707933aaa16d5

12 years agoAdd extended error codes for constraint errors.
drh [Sat, 9 Feb 2013 13:58:25 +0000 (13:58 +0000)] 
Add extended error codes for constraint errors.

FossilOrigin-Name: 5461104668a49529577f21df97f6a0e7d8f0c679

12 years agoFix a potential NULL-pointer dereference following an OOM error IN-with-ORDERBY
drh [Fri, 8 Feb 2013 23:18:18 +0000 (23:18 +0000)] 
Fix a potential NULL-pointer dereference following an OOM error
in the query planner logic for virtual tables with OR-connected terms.

FossilOrigin-Name: 71b6c26053fdf2a5a84116e005bad1f2ca873a66

12 years agoMake sure the virtual tables that take advantage of IN operators sort the
drh [Fri, 8 Feb 2013 20:39:02 +0000 (20:39 +0000)] 
Make sure the virtual tables that take advantage of IN operators sort the
RHS of the IN operator in the correct order according to the ORDER BY
clause.

FossilOrigin-Name: b016b7546d6fbfba06019398b9ac239b0cbe9086

12 years agoLoop through the elements on the RHS of an IN operator in reverse order when
drh [Fri, 8 Feb 2013 18:48:23 +0000 (18:48 +0000)] 
Loop through the elements on the RHS of an IN operator in reverse order when
the ORDER BY clauses specifies DESC.

FossilOrigin-Name: f78395c8896666bb1359b83fbcd58d5e3dbc39d3

12 years agoAllow the "a=?1 OR a=?2" to "a IN (?1,?2)" transformation to work on virtual
drh [Fri, 8 Feb 2013 16:04:19 +0000 (16:04 +0000)] 
Allow the "a=?1 OR a=?2" to "a IN (?1,?2)" transformation to work on virtual
tables again.  This was formerly restricted because virtual tables could not
optimize IN terms.  (See check-in [fad88e71cf195e].)  But IN terms are now
used by virtual tables (as of check-in [3d65c70343]) so the restriction can
now be removed.

FossilOrigin-Name: a917c1f09254b54e03e31b119cc49c551269d82e

12 years agoAllow an index to be used for sorting even if prior terms of the index
drh [Thu, 7 Feb 2013 21:15:14 +0000 (21:15 +0000)] 
Allow an index to be used for sorting even if prior terms of the index
are constrained by IN operators.

FossilOrigin-Name: 98bf668ab1a8683b46ee8c94cb60f8215aabc517

12 years agoFix harmless compiler warnings.
drh [Thu, 7 Feb 2013 09:33:56 +0000 (09:33 +0000)] 
Fix harmless compiler warnings.

FossilOrigin-Name: 4a7b4ee011fea911b981206c242e3d5553303b52

12 years agoAdd the ability to skip defining the localtime() function when being compiled for...
mistachkin [Thu, 7 Feb 2013 05:12:25 +0000 (05:12 +0000)] 
Add the ability to skip defining the localtime() function when being compiled for WinCE.

FossilOrigin-Name: e1640876df7ed6fb4e84292e5ce1f78635df64ab

12 years agoRemove some debugging logic accidently left in the limit.test module.
drh [Wed, 30 Jan 2013 01:46:06 +0000 (01:46 +0000)] 
Remove some debugging logic accidently left in the limit.test module.

FossilOrigin-Name: 7d346250e8a212880c4635a455cc9c98a1395c4c

12 years agoFix LIMIT and OFFSET so that they work and do not leak memory even on
drh [Tue, 29 Jan 2013 23:55:50 +0000 (23:55 +0000)] 
Fix LIMIT and OFFSET so that they work and do not leak memory even on
complex queries involving deeply nested views of UNION ALL compounds.
Ticket [db4d96798da8].  Secondary to ticket [d58ccbb3f1b7].

FossilOrigin-Name: 497ee36cb8d07c936e6896135163c5cd7e94bdde

12 years agoNew debugging pragmas: PRAGMA vdbe_debug=ON is short-hand for the sql_trace,
drh [Tue, 29 Jan 2013 19:14:31 +0000 (19:14 +0000)] 
New debugging pragmas:  PRAGMA vdbe_debug=ON is short-hand for the sql_trace,
vdbe_listing, and vdbe_trace pragmas.  PRAGMA vdbe_debug enables tracing of
sqlite3VdbeAddOp() calls.  None of this is active unless compiled with
SQLITE_DEBUG.

FossilOrigin-Name: ae565ff3e0836b0cb45cc0ba7f27fa8cb2d21d77

12 years agoFix an issue with the SQLITE_TESTCTRL_EXPLAIN_STMT and compound queries with
drh [Mon, 28 Jan 2013 22:52:34 +0000 (22:52 +0000)] 
Fix an issue with the SQLITE_TESTCTRL_EXPLAIN_STMT and compound queries with
multiple terms.

FossilOrigin-Name: a6499c2521637931661ed4d3afc4f96f91c69785

12 years agoIssue an error message and quit (rather than overflowing a reference counter)
drh [Mon, 28 Jan 2013 19:00:20 +0000 (19:00 +0000)] 
Issue an error message and quit (rather than overflowing a reference counter)
if the number of references to a table exceeds the maximum due to nested
UNION views.  Fix for ticket [d58ccbb3f1].

FossilOrigin-Name: c2462a95ed8e1e69886681400d673207d906bf1b

12 years agoCause the command-line shell to issue an error message if you give something
drh [Mon, 28 Jan 2013 18:18:26 +0000 (18:18 +0000)] 
Cause the command-line shell to issue an error message if you give something
that does not look like a boolean value to a dot-command that wants a boolean
argument.

FossilOrigin-Name: b4d94947fc11bd63180cbc27554b3bbb60abe7ff

12 years agoAdd a single test case to fts4unicode.test to verify that title-case
drh [Sat, 26 Jan 2013 19:31:42 +0000 (19:31 +0000)] 
Add a single test case to fts4unicode.test to verify that title-case
maps to lower case.

FossilOrigin-Name: 955a9459dabad231aa8d6282676975ab7fba244e

12 years agoFix the test_spellfix.c extension so that it can be made loadable at run-time.
drh [Fri, 25 Jan 2013 19:11:31 +0000 (19:11 +0000)] 
Fix the test_spellfix.c extension so that it can be made loadable at run-time.
Add spellfix to the shell when building using the build-shell.sh script.

FossilOrigin-Name: 7813b17d8b9fe48ddc841fe1c4bb75f7747073de

12 years agoEnhance the command-line shell so that adding a non-zero numeric argument
drh [Fri, 25 Jan 2013 18:33:43 +0000 (18:33 +0000)] 
Enhance the command-line shell so that adding a non-zero numeric argument
to the ".exit" command causes an immediate exit without cleaning up.  This
can be used (for example) to cause journal files to be left behind.

FossilOrigin-Name: 8ba951d1b76a0fb0ffd9bc6cec1be3ddba80538a

12 years agoAdd btree-page decoding logic to showwal.c. Commands of the form:
drh [Fri, 25 Jan 2013 15:59:55 +0000 (15:59 +0000)] 
Add btree-page decoding logic to showwal.c.  Commands of the form:
"showwal $FILE 123bmc" show the content of the btree page in frame
123.  "b" means decode the btree.  "c" means show cell content.
"m" means give a map of the btree page.

FossilOrigin-Name: 93b159da5d2570946fdcd7da120bf7eb82b840f3

12 years agoFurther improvements to showwal.c: Reset the checksum after each frame so that
drh [Fri, 25 Jan 2013 15:31:44 +0000 (15:31 +0000)] 
Further improvements to showwal.c:  Reset the checksum after each frame so that
only individual checksum failures are shown.  And only show failures, not
correct checksums.

FossilOrigin-Name: 4e2bf57549a8d50fc0993386c724eb4a2b35c9fe

12 years agoEnhance the "showwal" utility program to show checksum failures on frames.
drh [Fri, 25 Jan 2013 15:09:41 +0000 (15:09 +0000)] 
Enhance the "showwal" utility program to show checksum failures on frames.

FossilOrigin-Name: a7f6d19816cbfc50060a9d1c0c402cdd23bd16de

12 years agoImproved parsing of the arguments to the ".backup" command in the
drh [Wed, 23 Jan 2013 18:53:23 +0000 (18:53 +0000)] 
Improved parsing of the arguments to the ".backup" command in the
command-line shell.

FossilOrigin-Name: f1127e87b90c7ba049404ec68cb4e99009c22185

12 years agoFix a double-free() call that can occur
drh [Wed, 23 Jan 2013 18:44:22 +0000 (18:44 +0000)] 
Fix a double-free() call that can occur
when SQLITE_ENABLE_TREE_EXPLAIN is defined.

FossilOrigin-Name: 5bfb5967d70433bf41d39b57506b7ec167a1b6a0

12 years agoFix a typo in a comment in the test_regexp.c test file.
drh [Sun, 20 Jan 2013 00:18:49 +0000 (00:18 +0000)] 
Fix a typo in a comment in the test_regexp.c test file.

FossilOrigin-Name: 68346af70bc43baf791227a381e54f9aca802c72

12 years agoThe \xXX escape in the test_regexp.c must be followed by exactly two hex
drh [Fri, 18 Jan 2013 03:35:14 +0000 (03:35 +0000)] 
The \xXX escape in the test_regexp.c must be followed by exactly two hex
digits.

FossilOrigin-Name: 82957495aa0729468a020c2a0a45ed60019b6e07

12 years agoEnhance the query planner to exploit transitivity of join constraints.
drh [Thu, 17 Jan 2013 17:20:49 +0000 (17:20 +0000)] 
Enhance the query planner to exploit transitivity of join constraints.

FossilOrigin-Name: 38852f158ab20bb4d7b264af987ec1538052bec3

12 years agoImproved error messages on the RTREE virtual table. Make the "fs" virtual
drh [Thu, 17 Jan 2013 17:05:28 +0000 (17:05 +0000)] 
Improved error messages on the RTREE virtual table.  Make the "fs" virtual
table used for testing available on windows.

FossilOrigin-Name: c0b90d75a86b01f7fafec755cbe046c14d725341

12 years agoAdd the ability to disable transitive constraints using the
drh [Thu, 17 Jan 2013 16:43:33 +0000 (16:43 +0000)] 
Add the ability to disable transitive constraints using the
sqlite3_test_control(SQLITE_TESTCTRL_OPTIMIZATIONS) interface.

FossilOrigin-Name: 593d67c8b0908daf7a70b2a310ed85515d384cbf

12 years agoAvoid unnecessary collating sequence and affinity restrictions on the use
drh [Thu, 17 Jan 2013 16:18:55 +0000 (16:18 +0000)] 
Avoid unnecessary collating sequence and affinity restrictions on the use
of transitivity.  Add test cases to show that the restrictions are not
needed.

FossilOrigin-Name: 56549f45666b53876012df5c2bdf813474e10925

12 years agoMake more aggressive use of transitivity in optimizing queries. Add a test
drh [Thu, 17 Jan 2013 15:05:17 +0000 (15:05 +0000)] 
Make more aggressive use of transitivity in optimizing queries.  Add a test
case.

FossilOrigin-Name: d96762841a461e192fb2f317d684d000376350dd

12 years agoEnhance RTree virtual table creation error messages that involve the getNodeSize... rtreeErrMsg
mistachkin [Thu, 17 Jan 2013 03:18:38 +0000 (03:18 +0000)] 
Enhance RTree virtual table creation error messages that involve the getNodeSize() function.

FossilOrigin-Name: 652233d646236d3fbca629813b20d075f00f3ed6

12 years agoMake the 'fs' virtual table module portable to Windows. fsVfsWin
mistachkin [Thu, 17 Jan 2013 03:18:14 +0000 (03:18 +0000)] 
Make the 'fs' virtual table module portable to Windows.

FossilOrigin-Name: dd473cae5b6ea02b73168b30365f0af5556ee24d

12 years agoImproved comments explaining the operation of the findTerm() utility routine
drh [Thu, 17 Jan 2013 00:08:42 +0000 (00:08 +0000)] 
Improved comments explaining the operation of the findTerm() utility routine
in where.c.  Increase the maximum number of levels of transitivity from 4
to 11.

FossilOrigin-Name: fe152f8b048c9a18f99fa6096ff0e68dd630c318

12 years agoFix the activate_extensions pragma so that it is a no-op when the required
drh [Wed, 16 Jan 2013 20:33:02 +0000 (20:33 +0000)] 
Fix the activate_extensions pragma so that it is a no-op when the required
argument is omitted.

FossilOrigin-Name: 6195ebd83323eaad92a0aa095cce1094bf8e2ba6

12 years agoEnhance the query planner to exploit transitivity of join constraints in
drh [Wed, 16 Jan 2013 17:08:58 +0000 (17:08 +0000)] 
Enhance the query planner to exploit transitivity of join constraints in
a multi-way join.

FossilOrigin-Name: 13171eb5dc19733276fbfd5515d75b70a9f5f5d7

12 years agoImprovements to query planning for joins: Avoid unnecessary calls to
drh [Wed, 16 Jan 2013 00:46:09 +0000 (00:46 +0000)] 
Improvements to query planning for joins:  Avoid unnecessary calls to
"optimal scan" checks in cases where table reordering is not possible.
Make sure optimal scan checks are carried out for CROSS JOINs and LEFT
JOINs.

FossilOrigin-Name: d5ebb7877885839e93eee3b322624d4c4215c1c4

12 years agoFix a missing word in a comment. Enhance the "wheretrace" debugging output
drh [Tue, 15 Jan 2013 18:49:07 +0000 (18:49 +0000)] 
Fix a missing word in a comment.  Enhance the "wheretrace" debugging output
to show the estimated cost of each table option while planning the join order.

FossilOrigin-Name: ac4e119a87497f2e422ff1cb711112ed8594bfa9

12 years agoClarification to a comment in where.c. No code changes.
drh [Tue, 15 Jan 2013 16:15:28 +0000 (16:15 +0000)] 
Clarification to a comment in where.c.  No code changes.

FossilOrigin-Name: 04507c176330a06b09dcafa35ec0ca7498f5ace7

12 years agoAdd another test for the fts4 content= option.
dan [Fri, 11 Jan 2013 09:58:54 +0000 (09:58 +0000)] 
Add another test for the fts4 content= option.

FossilOrigin-Name: 7e6007a0002f6989bd489abeba8db52acb4a6854

12 years agoCheck in an extra test for the fts4 "content=" option. No code changes.
dan [Wed, 9 Jan 2013 15:44:23 +0000 (15:44 +0000)] 
Check in an extra test for the fts4 "content=" option. No code changes.

FossilOrigin-Name: 0d0e5ab8f16c890629ec1120c78168ef6be9e419

12 years agoFix an over-aggressive optimization of ORDER BY on a three-way join where the
drh [Wed, 9 Jan 2013 11:31:17 +0000 (11:31 +0000)] 
Fix an over-aggressive optimization of ORDER BY on a three-way join where the
second table is UNIQUE and the ORDER BY occurs on the third table.
Ticket [598f5f7596b0557].

FossilOrigin-Name: 5774f2175ce621dfc4b6b93f7ee13fd66f3ec2b9

12 years agoFix the date on the new orderby3.test test case.
drh [Wed, 9 Jan 2013 11:27:48 +0000 (11:27 +0000)] 
Fix the date on the new orderby3.test test case.

FossilOrigin-Name: 7249bfc2ca57624d73f2be0197a9807c58463c48

12 years agoAdd a test case that demonstrates ticket [956e4d7f8958e7065f].
drh [Wed, 9 Jan 2013 11:25:27 +0000 (11:25 +0000)] 
Add a test case that demonstrates ticket [956e4d7f8958e7065f].

FossilOrigin-Name: 598f5f7596b0557b22f31e6643a59ff9096fd023

12 years agoDo not raise an error if an unknown SQL function is found in a CHECK
drh [Tue, 8 Jan 2013 12:48:10 +0000 (12:48 +0000)] 
Do not raise an error if an unknown SQL function is found in a CHECK
constraint while parsing the schema of an existing database.

FossilOrigin-Name: cda790280a52d65f98a45bacb9123367b159ac7c

12 years agoMore bug fixes to the test_regexp.c module. Bring test_regexp.c into alignment
drh [Sat, 5 Jan 2013 17:17:21 +0000 (17:17 +0000)] 
More bug fixes to the test_regexp.c module.  Bring test_regexp.c into alignment
with the regexp.c file in the Fossil sources.

FossilOrigin-Name: 7695b88fe0d73fd0a36fb7d8f95350b80615a89e

12 years agoRemove superfluous text from a comment.
mistachkin [Fri, 4 Jan 2013 22:26:47 +0000 (22:26 +0000)] 
Remove superfluous text from a comment.

FossilOrigin-Name: e9ac5339603766c120c775bda8ae816d0ccb1503

12 years agoDo not use umask() since it change the umask for the entire process, not just
drh [Fri, 4 Jan 2013 20:45:13 +0000 (20:45 +0000)] 
Do not use umask() since it change the umask for the entire process, not just
the thread using SQLite.  Make whatever permission changes are needed using
fchmod() after the file is created, instead.

FossilOrigin-Name: 6c4c2b7dbadedac384d380efd54f12f6ccbf4ca9

12 years agoFix an out-of-order local variable declaration in test_regexp.c.
drh [Fri, 4 Jan 2013 19:22:33 +0000 (19:22 +0000)] 
Fix an out-of-order local variable declaration in test_regexp.c.

FossilOrigin-Name: 8285b15a058811a9a8b452837f52e6a065868115

12 years agoFix the zInit[] optimization of test_regexp.c when the initial string
drh [Fri, 4 Jan 2013 14:06:24 +0000 (14:06 +0000)] 
Fix the zInit[] optimization of test_regexp.c when the initial string
contains 3-byte UTF8 characters.

FossilOrigin-Name: 357231ec970adb5dfcdaf9665499141004cb1198

12 years agoBring back test_regexp changes that were made when porting to Fossil. Also
drh [Thu, 3 Jan 2013 19:34:46 +0000 (19:34 +0000)] 
Bring back test_regexp changes that were made when porting to Fossil.  Also
fix some bugs that were introduced by the Fossil port.

FossilOrigin-Name: 45c158b1a015e0295244982e7a61ecc55cca8436

12 years agoImprovements to column name resolution in queries with parenthesized FROM
drh [Thu, 3 Jan 2013 18:07:37 +0000 (18:07 +0000)] 
Improvements to column name resolution in queries with parenthesized FROM
clauses.  Also includes a fix for ticket [beba9cae6345a3].

FossilOrigin-Name: 99127a669c49f82918853091c9c5b7db5ad73cba

12 years agoFurther corner-case fixes to the name resolution logic. name-resolution-fix
drh [Thu, 3 Jan 2013 17:34:28 +0000 (17:34 +0000)] 
Further corner-case fixes to the name resolution logic.

FossilOrigin-Name: 20730bad7082b559a65e8cfedb31b6afca50df58

12 years agoRemove an incorrect assert() statement (ticket [beba9cae6345a]). Fix other
drh [Thu, 3 Jan 2013 16:54:20 +0000 (16:54 +0000)] 
Remove an incorrect assert() statement (ticket [beba9cae6345a]).  Fix other
minor problems in the name resolution logic.

FossilOrigin-Name: afe96a118c8a9627819ba5960aa83a607e734087

12 years agoNow supports result sets of the form "TABLE.*" with nested FROM clauses.
drh [Thu, 3 Jan 2013 00:45:56 +0000 (00:45 +0000)] 
Now supports result sets of the form "TABLE.*" with nested FROM clauses.

FossilOrigin-Name: 4cf5ed7ea198abc32f8118e79490e77f847f08c1

12 years agoWhen resolving result-set name collisions, make them x:1, x:2, x:3, etc.
drh [Wed, 2 Jan 2013 14:57:32 +0000 (14:57 +0000)] 
When resolving result-set name collisions, make them x:1, x:2, x:3, etc.
instead of x:1, x:1:1, x:1;1;1.

FossilOrigin-Name: ef01e30456670e6b1bc67fe41ec27e52c182efaf

12 years agoMerge all the latest trunk changes into the name-resolution enhancement branch.
drh [Wed, 2 Jan 2013 12:29:05 +0000 (12:29 +0000)] 
Merge all the latest trunk changes into the name-resolution enhancement branch.

FossilOrigin-Name: a5f4d2b641f7fafb6f1a312efeffb10f213d2d0a

12 years agoReduce the size of the Index object (by 8 bytes on x64).
drh [Tue, 1 Jan 2013 14:01:28 +0000 (14:01 +0000)] 
Reduce the size of the Index object (by 8 bytes on x64).

FossilOrigin-Name: 5a2ac944839ec0c5b9147a035c6cbf0935f3d202

12 years agoEnhance the table_info pragma so that the pk column shows the order of the
drh [Tue, 1 Jan 2013 13:55:31 +0000 (13:55 +0000)] 
Enhance the table_info pragma so that the pk column shows the order of the
columns in a multi-column primary key.

FossilOrigin-Name: 3076a89015071e9b40e728bd55160e3a6ed98820

12 years agoMore test cases for the REGEXP operator. Fix minor bugs uncovered by these
drh [Mon, 31 Dec 2012 20:16:35 +0000 (20:16 +0000)] 
More test cases for the REGEXP operator.  Fix minor bugs uncovered by these
test cases.

FossilOrigin-Name: a611c75061c8e821cb266fcb09759100d4a646b0

12 years agoAdd the test_regexp.c module containing a cross-platform implementation
drh [Mon, 31 Dec 2012 19:18:38 +0000 (19:18 +0000)] 
Add the test_regexp.c module containing a cross-platform implementation
of the REGEXP operator.

FossilOrigin-Name: 46c8c01b751c1ea7fc02cc35e3b5bb99dbe46c4b

12 years agoEnsure the database size field in the db header of a backup database is set correctly...
dan [Fri, 21 Dec 2012 16:15:35 +0000 (16:15 +0000)] 
Ensure the database size field in the db header of a backup database is set correctly. Fix for [0cfd98ee201].

FossilOrigin-Name: ff6857b6ed6a46671006b75157d8cf853a816ef9

12 years agoAdd PRAGMA foreign_key_check. Name the child and parent tables as part of
drh [Thu, 20 Dec 2012 01:15:20 +0000 (01:15 +0000)] 
Add PRAGMA foreign_key_check.  Name the child and parent tables as part of
a "foreign key mismatch" error.

FossilOrigin-Name: e408dc9080594dc464b8763dece6b365772c6105

12 years agoRemove an unreachable branch operation from the foreign_key_check pragma. foreign-key-check
drh [Thu, 20 Dec 2012 00:32:49 +0000 (00:32 +0000)] 
Remove an unreachable branch operation from the foreign_key_check pragma.

FossilOrigin-Name: b5a8f3160b5dc1397312add3c5410e7e0a12b75e

12 years agoFix the segfault problem of ticket [a7b7803e8d1e869] which involved
drh [Wed, 19 Dec 2012 16:58:02 +0000 (16:58 +0000)] 
Fix the segfault problem of ticket [a7b7803e8d1e869] which involved
the use of "AS" named result columns as logical terms of the WHERE clause.

FossilOrigin-Name: b3c9e8f81275fe07272c01f66b16c16417f034af

12 years agoA couple more test cases. tkt-a7b7803e
drh [Wed, 19 Dec 2012 16:32:33 +0000 (16:32 +0000)] 
A couple more test cases.

FossilOrigin-Name: 0ae142178d5ff874a4df58d699adad3a41e3d8d2

12 years agoAdditional test cases involving the use of a result column specified by its
drh [Wed, 19 Dec 2012 16:25:55 +0000 (16:25 +0000)] 
Additional test cases involving the use of a result column specified by its
"AS" name as a logical term of the WHERE clause.
Ticket [a7b7803e8d1e8699cd].

FossilOrigin-Name: d7cc364e87870746c231b97b648658bf343945fa

12 years agoProposed fix for ticket [a7b7803e8d1e8699cd8a].
drh [Wed, 19 Dec 2012 15:53:51 +0000 (15:53 +0000)] 
Proposed fix for ticket [a7b7803e8d1e8699cd8a].

FossilOrigin-Name: 3d0e00c731c39af91bad74c6d74853375bac356e

12 years agoAdd commentary to the ExprList object to explain how zSpan is overloaded.
drh [Wed, 19 Dec 2012 13:41:03 +0000 (13:41 +0000)] 
Add commentary to the ExprList object to explain how zSpan is overloaded.
Add test cases for the new name resolution functionality.

FossilOrigin-Name: 3e7d84db7861911c9b2c7dcdabe0b213bf483d79

12 years agoBetter resolution of table and column names in joins where some of the
drh [Wed, 19 Dec 2012 02:36:45 +0000 (02:36 +0000)] 
Better resolution of table and column names in joins where some of the
terms of the FROM clause are parenthesized.

FossilOrigin-Name: 7344e791b9456286ecdca6d45f2f5260fb3f10e2

12 years agoOptimize the degenerate case of a FROM clause table name enclosed all by
drh [Tue, 18 Dec 2012 19:36:11 +0000 (19:36 +0000)] 
Optimize the degenerate case of a FROM clause table name enclosed all by
itself inside parentheses.  Generate code as if the parentheses did not
exist, rather than the old behavior of manifesting the parenthesized table
into a transient table.  Also, tag every FROM-clause SELECT subquery that is
generated by a parenthesized FROM-clause expression using the SF_NestedFrom
flag.  The new SF_NestedFrom flag is not yet used for anything.

FossilOrigin-Name: 7fecced466d86a66b0b751c5b5608141e134fe2d

12 years agoResolve names in FROM-clause subqueries prior to resolving names in the
drh [Tue, 18 Dec 2012 16:07:08 +0000 (16:07 +0000)] 
Resolve names in FROM-clause subqueries prior to resolving names in the
result set expressions of a SELECT statement.

FossilOrigin-Name: 9b67c633d932f3e566f521ee6a9cf3be193436fa

12 years agoRemove old commented-out code from parse.y. Fix some over-length source lines
drh [Tue, 18 Dec 2012 13:12:03 +0000 (13:12 +0000)] 
Remove old commented-out code from parse.y.  Fix some over-length source lines
in parse.y.  No logical changes.

FossilOrigin-Name: 7e30c021abe5a559918efaa5fc0b21db8ca782ad

12 years agoOn atomic-write capable systems, if copying the contents of an in-memory journal...
dan [Tue, 18 Dec 2012 11:59:39 +0000 (11:59 +0000)] 
On atomic-write capable systems, if copying the contents of an in-memory journal to disk fails, close the (on disk) journal file before returning the error to the caller. This causes the subsequent rollback operation to use the in-memory journal. Fix for [df678d738adb].

FossilOrigin-Name: 8183d8d7ae1ff4bad2fcc01adb923b966b347832

12 years agoAdded test cases for PRAGMA foreign_key_check. Fixed a bug that appears
drh [Mon, 17 Dec 2012 22:32:14 +0000 (22:32 +0000)] 
Added test cases for PRAGMA foreign_key_check.  Fixed a bug that appears
when the column order of the child and parent differ.

FossilOrigin-Name: 25411f83f99803e39feee368703fd20b4ade8eeb

12 years agoAdd to the foreign_key_check pragma an extra output column "parent" that
drh [Mon, 17 Dec 2012 20:57:15 +0000 (20:57 +0000)] 
Add to the foreign_key_check pragma an extra output column "parent" that
contains the name of the parent table for the constraint that failed.

FossilOrigin-Name: 97f7f7377259ecf562019f62ebed0897cfae236e

12 years agoEnhance the error message for "foreign key mismatch" to include the names of
drh [Mon, 17 Dec 2012 20:40:39 +0000 (20:40 +0000)] 
Enhance the error message for "foreign key mismatch" to include the names of
the child and parent tables.  Begin adding test cases for
PRAGMA foreign_key_check.  Make sure PRAGMA foreign_key_check gets all
necessary table locks.

FossilOrigin-Name: 0f9963526c299757ff95c153fb05a67cddb6af28

12 years ago"PRAGMA foreign_key_check" with no argument checks the foreign keys on all
drh [Mon, 17 Dec 2012 18:43:02 +0000 (18:43 +0000)] 
"PRAGMA foreign_key_check" with no argument checks the foreign keys on all
tables.

FossilOrigin-Name: 57d47423a65d183cb1efcb95b28cb143e788b953

12 years agoFix an issue with child keys that are not INTEGER PRIMARY KEY
drh [Mon, 17 Dec 2012 18:05:54 +0000 (18:05 +0000)] 
Fix an issue with child keys that are not INTEGER PRIMARY KEY
referencing INTEGER PRIMARY KEY in the parent.

FossilOrigin-Name: 603b695bf094b9da905f877a13dcb134463db92a

12 years agoPrototype for PRAGMA that checks all foreign key constraints on a table.
drh [Mon, 17 Dec 2012 16:46:37 +0000 (16:46 +0000)] 
Prototype for PRAGMA that checks all foreign key constraints on a table.

FossilOrigin-Name: 01c980e9bbdf82e0b37667b6403c19ed8c73ee62

12 years agoOptimize IN operators in the WHERE clause of queries using virtual tables.
drh [Fri, 14 Dec 2012 17:54:38 +0000 (17:54 +0000)] 
Optimize IN operators in the WHERE clause of queries using virtual tables.

FossilOrigin-Name: 3d65c70343196b8f69c5293e7703839846fade85

12 years agoRemove an unreachable branch. Improvements to comments.
drh [Fri, 14 Dec 2012 17:48:08 +0000 (17:48 +0000)] 
Remove an unreachable branch.  Improvements to comments.

FossilOrigin-Name: d2fb7619b063b329b6d7ba9a16a7290e5d868f23

12 years agoMerge in all the trunk changes that have occurred since this branch was
drh [Fri, 14 Dec 2012 15:54:05 +0000 (15:54 +0000)] 
Merge in all the trunk changes that have occurred since this branch was
opened.

FossilOrigin-Name: 6d507e4de924e2f4556ea4a03ee0fa7d647bf8bb