drh
784156f84c
Make sure "rowid" columns are correctly resolved in joins between normal
...
tables and WITHOUT ROWID tables. Fix for ticket [c34d0557f740c45070].
FossilOrigin-Name: 5d01426ddfb2d47c57f93f71378594e637424be0
2014-02-12 14:43:52 +00:00
drh
bbbb0e8053
Make sure the update hook is not invoked for WITHOUT ROWID tables, as
...
the documentation specifies. This bug was found while adding requirements
marks, so a few extraneous requirements marks are included in this
check-in.
FossilOrigin-Name: 0978bac6b8aee229d7a0d148546f50d380d06a06
2013-11-26 23:27:07 +00:00
drh
10f468f37a
Remove the obsolete TK_CONST_FUNC token type.
...
FossilOrigin-Name: 9b4217f055e9bced186b4c56a5753bd6da7115b5
2013-11-21 14:44:38 +00:00
drh
b1fba2868b
Add the ability to factor constant functions out of inner loops. But do
...
not factor out non-constant functions, like random().
FossilOrigin-Name: 1b0f779e19a5c0d51eddd2d88db50034d77d132c
2013-11-21 14:33:48 +00:00
drh
c2acc4e466
Changes to make the new constant expression factoring logic more general
...
and more testable.
FossilOrigin-Name: d10fb49a92f5f6e93093ae83544e5aec7984361a
2013-11-15 18:15:19 +00:00
drh
511717c645
Fix harmless compiler warnings.
...
FossilOrigin-Name: 0077c0772a884b54d81fa3733aac6f0c364ef1a8
2013-11-08 17:13:23 +00:00
drh
11f9b033cc
Report an error when trying to resolve column name "rowid" in a
...
WITHOUT ROWID table.
FossilOrigin-Name: 36bcc9cb885523fba2f3b0d152de9e08073668c1
2013-10-23 17:39:41 +00:00
drh
b32652601c
Fix a typo in a requirements mark comment. No changes to code.
...
FossilOrigin-Name: e5a439cfa5c921187e4aa7050832ec2660fba13d
2013-10-16 23:58:21 +00:00
drh
3432daa8b2
Additional test cases and requirements marks for the unlikely(),
...
likelihood() and instr() functions.
FossilOrigin-Name: 5f01cd36ee8678a07b79f9e01855daffb6bb8c43
2013-10-11 16:35:49 +00:00
drh
ebb6a65d16
Refactor the ExprSetIrreducible() macro into ExprSetVVAProperty(*,EP_NoReduce).
...
This is a naming change only. The logic is the same.
FossilOrigin-Name: 695aee46e9bdf15159ab52db7f522b30c91aed0f
2013-09-12 23:42:22 +00:00
drh
a4c3c87e3d
Merge in the Expr.flags expansion to 32-bits. Use an extra bit to help
...
optimize the sqlite3ExprSkipCollate() routine.
FossilOrigin-Name: 4c84d1b4c20f18921dd705bf67e8225975b83e86
2013-09-12 17:29:25 +00:00
drh
c5cd124900
Increase the number of bits available in Expr.flags. Other tweaks aimed at
...
making expression processing more robust.
FossilOrigin-Name: 579a512538528cf4bb4381ba393c5d9e7310086b
2013-09-12 16:50:49 +00:00
drh
09328c00d6
Additional unlikely() test cases. Logic tweaks to support test coverage.
...
FossilOrigin-Name: 5d00cce74a7aefaf30022ae971ab1e0451e0ad6e
2013-09-11 14:34:58 +00:00
drh
aae0f9e462
Change the name of the two-argument unlikely() function to likelihood().
...
Add test cases.
FossilOrigin-Name: 29a359b8d7f90e6fa2b28ce2a112284fd3870494
2013-09-11 11:38:58 +00:00
drh
abfa6d52ed
Tweaks to the index selection logic.
...
FossilOrigin-Name: 52d52688644f635a50a60ff17b160f3affa8fa6c
2013-09-11 03:53:22 +00:00
drh
add5ce303f
Continuing refinements of the logic to take WHERE clause terms not used for
...
indexing into account when computing the number of output rows from each
table.
FossilOrigin-Name: b65dc53415f42d8402d0ec7f4bedf59d7b39b486
2013-09-07 00:29:06 +00:00
drh
fde1e6bc37
Enhance the plan solver to take into account the number of output rows when
...
computing the set of paths to retain for the next cycle.
FossilOrigin-Name: 1a46a7242313da96420985fa52e1de3f84533e5b
2013-09-06 17:45:42 +00:00
drh
cca9f3d291
Initial implementation of the unlikely() SQL function used as a hint to
...
the query planner.
FossilOrigin-Name: 036fc37a034093a4c6fc190633bd41c2b7230d77
2013-09-06 15:23:29 +00:00
drh
0af16ab2c2
Make sure that GROUP BY terms select input column names in preference to
...
output column names, in compliance with the SQL standard.
Ticket [1c69be2dafc28].
FossilOrigin-Name: f2d175f975cd0be63425424ec322a98fb650019e
2013-08-15 22:40:21 +00:00
drh
e35463b312
Bare identifiers in ORDER BY clauses bind more tightly to output column name,
...
but identifiers in expressions bind more tightly to input column names.
This is a compromise between SQL92 and SQL99 behavior and is what
PostgreSQL and MS-SQL do. Ticket [f617ea3125e9c].
FossilOrigin-Name: c78b357c00a35ed48ce2ffbc041de8d22570d1e2
2013-08-15 20:24:27 +00:00
drh
26080d9241
Clarification and typo fixes in comments related to name resolution.
...
No changes to code.
FossilOrigin-Name: f30abdf9d814d6c75bf1c803054737c737ad636f
2013-08-15 14:27:42 +00:00
drh
1e7d43c977
Silently ignore database name qualifiers in CHECK constraints and in
...
partial index WHERE clauses.
FossilOrigin-Name: 2e8c845eb5011a2743dace333aa38383588f2080
2013-08-02 14:18:18 +00:00
drh
619a1305e7
Fill out an initial implementation of the sqlite3ExprImpliesExpr() function.
...
FossilOrigin-Name: 8e07aa2ad5579aeb82174ce5bd432ddb9c058bc1
2013-08-01 13:04:46 +00:00
drh
3780be115a
Resolve names in CREATE INDEX WHERE clauses and detect errors. Disallow
...
expressions that contain variables, subqueries, or functions.
The expression is still not used for anything, however.
still unused.
FossilOrigin-Name: f2aa7842c8b9df24294f09e2bde27b3f08c455c7
2013-07-31 19:05:22 +00:00
drh
58a450c041
Treat identifiers in the HAVING clause the same as in the WHERE clause.
...
Only consider AS names from the result set to match if there are no other
matches. Continuation of the fix for [2500cdb9be05]. This check-in
fixes a bug found by [http://www.sqlite.org/sqllogictest/ | SqlLogicTest]
during release testing for version 3.7.17.
FossilOrigin-Name: 9ffff3d05226bbd01a0745dd0a511776358253c0
2013-05-16 01:02:45 +00:00
drh
aa87f9a68b
Make sure the affinity and datatype of sub-subqueries are initialized
...
prior to subqueries as the latter relies on the former.
FossilOrigin-Name: 39b4e6ff9316cc78ea88349091e195b8104d1e9e
2013-04-25 00:57:10 +00:00
drh
a3a5bd9b62
Only consider AS names from the result set as candidates for resolving
...
identifiers in the WHERE clause if there are no other matches. In the
ORDER BY clause, AS names take priority over any column names.
Candidate fix for ticket [2500cdb9be].
FossilOrigin-Name: ad53924dcadffb95c6497c46c228c67e8f5370e4
2013-04-13 19:59:58 +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
drh
928d9c6209
Fix harmless compiler warnings.
...
FossilOrigin-Name: 4a7b4ee011fea911b981206c242e3d5553303b52
2013-02-07 09:33:56 +00:00
drh
ddd1fc7283
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
2013-01-08 12:48:10 +00:00
drh
38b384a032
Further corner-case fixes to the name resolution logic.
...
FossilOrigin-Name: 20730bad7082b559a65e8cfedb31b6afca50df58
2013-01-03 17:34:28 +00:00
drh
c75e09c761
Remove an incorrect assert() statement (ticket [beba9cae6345a]). Fix other
...
minor problems in the name resolution logic.
FossilOrigin-Name: afe96a118c8a9627819ba5960aa83a607e734087
2013-01-03 16:54:20 +00:00
drh
3e3f1a5b49
Now supports result sets of the form "TABLE.*" with nested FROM clauses.
...
FossilOrigin-Name: 4cf5ed7ea198abc32f8118e79490e77f847f08c1
2013-01-03 00:45:56 +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
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
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
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
drh
bd13d34b08
Fix the processing of ORDER BY clauses with COLLATE terms on compound
...
queries. 52 veryquick test failures remain.
FossilOrigin-Name: 49654453ad157693414c1f86fa3afa0918acffd4
2012-12-07 21:02:47 +00:00
drh
0a8a406e9b
Some errors in veryquick resolved. Many more to go.
...
FossilOrigin-Name: 972443b4eb282d45507da06c75e2cd46dd72326b
2012-12-07 18:38:16 +00:00
drh
4b17cf5855
Veryquick now row to completion without segfaulting or asserting. But there
...
are still lots of errors.
FossilOrigin-Name: 7fafab12e4c0c832c421975f8329c3214403d281
2012-12-07 14:02:14 +00:00
drh
ae80ddea9f
Remove the Expr.pColl field and compute the collating sequence as it is needed.
...
This fixes the test script "shared9.test", though there is still a memory leak.
And there are other problems. Consider this a work-in-progress.
FossilOrigin-Name: fd011cb22f2d899d94ec7ce22641d7a8f5e19972
2012-12-06 21:16:43 +00:00
drh
5a05be1b68
Attempt to suppress warnings generated by Coverity.
...
FossilOrigin-Name: 7b1a6e6cb5099076bf19db142b17c99044a869cd
2012-10-09 18:51:44 +00:00
drh
ed551b95a4
Add test cases and fix bugs associated with the previous check-in
...
enhancements to nested aggregate subquery processing.
FossilOrigin-Name: 00b1dc71be4c3420730b5f7840af824ea86165e7
2012-08-23 19:46:11 +00:00
drh
030796df8d
Further improvements to the processing of nested aggregate queries.
...
FossilOrigin-Name: 3c3ffa901f5ce8a523028ff15563ce3e0f55a641
2012-08-23 16:18:10 +00:00
drh
a51009b251
Convert the NameContext object from using u8 booleans to using individual
...
bits in a single u8 as its booleans. This change might become a basis for
a fix for [c2ad16f997ee9c].
FossilOrigin-Name: 722260969306778029b738402f22e3c154dd77a1
2012-05-21 19:11:25 +00:00
drh
70331cd725
Enhance the processing of ORDER BY clauses on compound queries to better
...
match terms of the order by against expressions in the result set, in order
to enable better query optimization.
FossilOrigin-Name: a49e909c8738317c8383ce93771c0a9c4cf270bc
2012-04-27 01:09:06 +00:00
drh
89d5d6a2a7
Fix the application-defined function logic so that functions with a variable
...
number of parameters can be replaced or deleted correctly. Also refactor
some of the function-finder code for clarity of presentation.
FossilOrigin-Name: 09d5581c81fb6a9bf6a369d0abf5ef6b54637576
2012-04-07 00:09:21 +00:00
drh
4b3ac73c2f
Minor cleanups of the compound-subquery flattening logic. New test cases
...
added for joins the compound subquery.
FossilOrigin-Name: 5061d85ff934db3c217c97acbbbed3286d9e02aa
2011-12-10 23:18:32 +00:00
drh
e802c5da01
Improved handling of USING and NATURAL JOIN in 3-way and higher joins.
...
Ticket [3338b3fa19ac4ab]
FossilOrigin-Name: 551ce407bd77149865423511bd52eba2f404161a
2011-10-18 18:10:40 +00:00
dan
da79cf0cc9
Fix for [54844eea3f]: Do not create automatic indexes on correlated sub-queries.
...
FossilOrigin-Name: 9f14fa56ba31afe3de8b0cf26ed09573a2cc2283
2011-07-08 16:10:54 +00:00