Commit Graph

10475 Commits

Author SHA1 Message Date
drh
d530ee64ca Merge all the latest trunk changes into the name-resolution enhancement branch.
FossilOrigin-Name: a5f4d2b641f7fafb6f1a312efeffb10f213d2d0a
2013-01-02 12:29:05 +00:00
drh
b376daeb67 Reduce the size of the Index object (by 8 bytes on x64).
FossilOrigin-Name: 5a2ac944839ec0c5b9147a035c6cbf0935f3d202
2013-01-01 14:01:28 +00:00
drh
384b7fe221 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
2013-01-01 13:55:31 +00:00
drh
25846af3be More test cases for the REGEXP operator. Fix minor bugs uncovered by these
test cases.

FossilOrigin-Name: a611c75061c8e821cb266fcb09759100d4a646b0
2012-12-31 20:16:35 +00:00
drh
14172743a2 Add the test_regexp.c module containing a cross-platform implementation
of the REGEXP operator.

FossilOrigin-Name: 46c8c01b751c1ea7fc02cc35e3b5bb99dbe46c4b
2012-12-31 19:18:38 +00:00
dan
5cc3bea44a Ensure the database size field in the db header of a backup database is set correctly. Fix for [0cfd98ee201].
FossilOrigin-Name: ff6857b6ed6a46671006b75157d8cf853a816ef9
2012-12-21 16:15:35 +00:00
drh
b2bb176b70 Add PRAGMA foreign_key_check. Name the child and parent tables as part of
a "foreign key mismatch" error.

FossilOrigin-Name: e408dc9080594dc464b8763dece6b365772c6105
2012-12-20 01:15:20 +00:00
drh
83e0dba311 Remove an unreachable branch operation from the foreign_key_check pragma.
FossilOrigin-Name: b5a8f3160b5dc1397312add3c5410e7e0a12b75e
2012-12-20 00:32:49 +00:00
drh
b290294c46 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
2012-12-19 16:58:02 +00:00
drh
0e8578fc9e A couple more test cases.
FossilOrigin-Name: 0ae142178d5ff874a4df58d699adad3a41e3d8d2
2012-12-19 16:32:33 +00:00
drh
11c6387d38 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
2012-12-19 16:25:55 +00:00
drh
7ee751d241 Proposed fix for ticket [a7b7803e8d1e8699cd8a].
FossilOrigin-Name: 3d0e00c731c39af91bad74c6d74853375bac356e
2012-12-19 15:53:51 +00:00
drh
0dde4739f3 Add commentary to the ExprList object to explain how zSpan is overloaded.
Add test cases for the new name resolution functionality.

FossilOrigin-Name: 3e7d84db7861911c9b2c7dcdabe0b213bf483d79
2012-12-19 13:41:03 +00:00
drh
8f25d18b21 Better resolution of table and column names in joins where some of the
terms of the FROM clause are parenthesized.

FossilOrigin-Name: 7344e791b9456286ecdca6d45f2f5260fb3f10e2
2012-12-19 02:36:45 +00:00
drh
832ee3d4cc 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
2012-12-18 19:36:11 +00:00
drh
92689d2869 Resolve names in FROM-clause subqueries prior to resolving names in the
result set expressions of a SELECT statement.

FossilOrigin-Name: 9b67c633d932f3e566f521ee6a9cf3be193436fa
2012-12-18 16:07:08 +00:00
drh
e924041846 Remove old commented-out code from parse.y. Fix some over-length source lines
in parse.y.  No logical changes.

FossilOrigin-Name: 7e30c021abe5a559918efaa5fc0b21db8ca782ad
2012-12-18 13:12:03 +00:00
dan
985cd59c48 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
2012-12-18 11:59:39 +00:00
drh
7d22a4d710 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
2012-12-17 22:32:14 +00:00
drh
4b4b473a1e 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
2012-12-17 20:57:15 +00:00
drh
9148defa61 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
2012-12-17 20:40:39 +00:00
drh
613028b34e "PRAGMA foreign_key_check" with no argument checks the foreign keys on all
tables.

FossilOrigin-Name: 57d47423a65d183cb1efcb95b28cb143e788b953
2012-12-17 18:43:02 +00:00
drh
a7c2f3e760 Fix an issue with child keys that are not INTEGER PRIMARY KEY
referencing INTEGER PRIMARY KEY in the parent.

FossilOrigin-Name: 603b695bf094b9da905f877a13dcb134463db92a
2012-12-17 18:05:54 +00:00
drh
6c5b915fcb Prototype for PRAGMA that checks all foreign key constraints on a table.
FossilOrigin-Name: 01c980e9bbdf82e0b37667b6403c19ed8c73ee62
2012-12-17 16:46:37 +00:00
drh
6d42097622 Optimize IN operators in the WHERE clause of queries using virtual tables.
FossilOrigin-Name: 3d65c70343196b8f69c5293e7703839846fade85
2012-12-14 17:54:38 +00:00
drh
d03025327e Remove an unreachable branch. Improvements to comments.
FossilOrigin-Name: d2fb7619b063b329b6d7ba9a16a7290e5d868f23
2012-12-14 17:48:08 +00:00
drh
03597ef6e2 Merge in all the trunk changes that have occurred since this branch was
opened.

FossilOrigin-Name: 6d507e4de924e2f4556ea4a03ee0fa7d647bf8bb
2012-12-14 15:54:05 +00:00
drh
e40ed78c1c Fix the virtual table IN optimizer so that it work even if the virtual table
implementation leaves the sqlite3_index_info.aConstraintUsage[].omit flag
clear for an equality constraint that it intends to use.

FossilOrigin-Name: d6e045f89c5a4b500b1da7ea1224b132909bafc6
2012-12-14 15:36:17 +00:00
drh
b3256037ff Generalize the min/max optimization so that if an appropriate index exists,
the index it can be used by any aggregate query that contains only a single
max() or min() and does not contain a GROUP BY clause.

FossilOrigin-Name: 52e755943f87354febe214e5dc3b423a1e38ba80
2012-12-13 18:57:31 +00:00
drh
92f76572e0 Increase the version number to 3.7.16 in advance of adding new features
for the next release.

FossilOrigin-Name: 8bcf5f51d8a6ea47ba4eb8de001d7a30e0a5f2c3
2012-12-13 18:51:53 +00:00
dan
4ac391fc05 Attempt to further generalize the min/max optimization so that, if an appropriate index exists, it can be used by any aggregate query that contains only a single aggregate of the form max(colname) or min(colname) and does not contain a GROUP BY clause.
FossilOrigin-Name: 7280e14cd8f55896451847b432171e8750a07c81
2012-12-13 16:37:10 +00:00
drh
32055c2499 Allow the error message from "PRAGMA integrity_check" to be longer than
20,000 bytes.

FossilOrigin-Name: 120c82d56ecb574f46db01679317b8062d8779ed
2012-12-12 14:30:03 +00:00
dan
2d6381865d Version 3.7.15
FossilOrigin-Name: cd0b37c52658bfdf992b1e3dc467bae1835a94ae
2012-12-12 13:36:53 +00:00
drh
6949784cc4 Update requirements marks and test cases for multi-VALUE INSERT and to fix
typos in requirements text.

FossilOrigin-Name: 81d9ee0f0df7f283e69ba1c2845339ea3318cd66
2012-12-11 19:40:03 +00:00
drh
39ac5de6c5 Fix a typo in a comment that is used to generate
documentation.  No changes to code.

FossilOrigin-Name: e38adb60a7952ca9e28e496b4e4658c724a368d2
2012-12-11 19:10:37 +00:00
drh
be707b396a When an arithmetic operation with two integer operands must give a
floating-point answer due to overflow, make sure the answer is not
rounded back to integer by affinity.

FossilOrigin-Name: bd7aeeb691fee69dd6a562138a7aba8e8e192272
2012-12-10 22:19:14 +00:00
dan
b136e902ad Modify releasetest.tcl so that it runs the "checksymbols" test on a build without SQLITE_DEBUG defined. If SQLITE_DEBUG is defined, the sqlite3WhereTrace variable causes the test to fail.
FossilOrigin-Name: 75e545a9e2614fae7db86ecfb84e41ecbe4097ba
2012-12-10 10:22:48 +00:00
dan
de7ced37fe Remove a reference to JumpOnce from a comment in vdbe.c. No code changes.
FossilOrigin-Name: ee662c039d67f118008485d95603c5a43fcac75f
2012-12-10 09:08:17 +00:00
drh
04229acebc Factor some work out of the index loop of the bestBtreeIndex() routine for
a small performance increase.

FossilOrigin-Name: 92c9ab56b1c67b9468bec57ab1d2c483a69a2810
2012-12-08 22:14:29 +00:00
drh
468ef9a87e Refactor collating-sequence handling as a fix for ticket [71e333e7d2e642].
The Expr.pColl field is removed from the Expr object.  The COLLATE operator
now becomes a separate instance of Expr in the expression tree.  The code
generator looks up the correct collating function as needed, rather than
referring to Expr.pColl.

FossilOrigin-Name: 8542e6180d4321d45b34f33e481658908ce1430d
2012-12-08 21:51:24 +00:00
drh
261d8a51e2 Adjustments to the collating-sequence refactoring to facilitate full-coverage
testing and to fix some minor issues found by TH3.

FossilOrigin-Name: cdbfa664839a409589ec7cebfc9111235d2f3b38
2012-12-08 21:36:26 +00:00
drh
fb76f5a00c Make sure WHERE clause constraints A=B and B=A work the same even with
COLLATE clauses.

FossilOrigin-Name: b3f53668115f0a12a01167c2a75eecc735416024
2012-12-08 14:16:47 +00:00
drh
0ca10dfbed Fix the header comment on the OP_Compare operator.
FossilOrigin-Name: 2722f4074fd8d189b7bd2b9107484b66500e5e9b
2012-12-08 13:26:23 +00:00
drh
2d8e920339 Duplicating check constraint expressions prior to code generation is no
longer required, and so it is removed.

FossilOrigin-Name: 1a9db8dc2f3c5cb089801d56122cdf5c3a618163
2012-12-08 04:10:44 +00:00
drh
580c8c1816 Veryquick passes all tests now.
FossilOrigin-Name: 7b96115e81deab0aa0472839cf787ba3f2fc64a7
2012-12-08 03:34:04 +00:00
drh
d91eba9673 Recognize TK_COLLATE operators that have been transformed into TK_REGISTER.
Skip both TK_COLLATE and TK_AS operators when looking for the top of an
expression.

FossilOrigin-Name: f66c1db2965054f38125218202b6a6ec62d57666
2012-12-08 00:52:14 +00:00
drh
85d641f948 Improved error messages when column integers in an ORDER BY clause are
out of range.

FossilOrigin-Name: bd960d937f8d6521c8ec4b7bd8a77a498dd432d4
2012-12-07 23:23:53 +00:00
drh
8e049633aa For an ORDER BY on a compound SELECT, take the collating sequence from the
left-most term of the compound.

FossilOrigin-Name: 8e724b383da1314909c9a05e9d941a26a9f50b95
2012-12-07 23:10:40 +00:00
drh
62a66e7034 Do not report missing collating functions while parsing the schema.
Also remove a stray comment.

FossilOrigin-Name: e313edca0472f07e9b872b92120d80b4bc177328
2012-12-07 22:54:41 +00:00
drh
953f7611da Fix a long-standing issue with the distinct-as-aggregate optimization that
only expressed when the new collating-sequence logic is turned on.

FossilOrigin-Name: 0aaf52a339808386984c30cca0c0c35ac2e70e7e
2012-12-07 22:18:54 +00:00