aboutsummaryrefslogtreecommitdiff
path: root/src/sqliteInt.h
Commit message (Collapse)AuthorAge
...
| * Attempt to omit ORDER BY clauses from FROM-clause subqueries if those ORDER BYdrh2021-07-15
|/ | | | | | | | | clauses do not affect the output. See [forum:/forumpost/2d76f2bcf65d256a|forum thread 2d76f2bcf65d256a] for discussion. This can help the query flattener in some cases, resulting in faster query plans. The current implemention does not always work. FossilOrigin-Name: ef97c3e7c3ea2cf1a4db6591328fe7ce3f1d189afc2d578159135824ec89e620
* Rename optional SQLITE_CUSTOM_INC define to SQLITE_CUSTOM_INCLUDE.mistachkin2021-07-08
| | | FossilOrigin-Name: 060aec37accae858ced5b081a2ff76dccdd8f8bcefc63d1fe2e7478257c69e76
* Allow library build to #include a user-specified header.larrybr2021-07-08
| | | FossilOrigin-Name: 71e6490bbe59939cd15f0094e507dd8a2e167fdd8de675c3ebfeaf528a01f87a
* Improve the error message in cases where there is a row-value on the LHS of ↵dan2021-07-07
| | | | | an IN() operator, the RHS is a list (not a sub-select) and at least one element of the list is not a row-value with the correct number of elements. FossilOrigin-Name: 6b22f4e71dbc14c887ebbda67095b5faaa8079cac87cd4ab5a2ae90c71cd9633
* Handle "<vector> IN (<vector>, <vector> ...)" in the same way as "<vector> ↵dan2021-07-06
| | | | | IN (VALUES(<vector>, <vector>, ...)". FossilOrigin-Name: 981d230ece98ce89502dab02aa44f73699a9d0e4fce3e9e9dfd47444a5a9990f
* Add the ATOMIC_INTRINSICS compile-time output output. Move sqlite3Int.hdrh2021-07-05
| | | | | | in front of ctime.c so that default values that are not overridden are shown in PRAGMA compile-time option output. FossilOrigin-Name: e306952690bfb140e2c404a74b05ff2d070c487f7e52c62d62a004505fba0e15
* Revert [5204c2c4a7b73a64], restoring the old pre-processor logic for ↵dan2021-07-05
| | | | | determining the availability of the __atomic_store_n()/__atomic_load_n() primitives. FossilOrigin-Name: e690abb9e4e189c41182ac813115d55d811135013f5ce94ec0c45a547597f8ad
* Allow sub-queries in the FROM clause of an UPDATE...FROM statement to access ↵dan2021-07-05
| | | | | the object being updated without using an alias, as is required in the parent query. FossilOrigin-Name: 740cb43025449b7d7b47a97ad00885e54b7701cbcb14f4a50c7523022e3936d5
* Ensure that TK_SELECT_COLUMN Expr nodes always have their iTable field set todrh2021-07-05
| | | | | | to the number of columns in the vector. This is not strictly necessary. It just simplifies the state description and make the code easier to reason about. FossilOrigin-Name: 026f08d4cff19a95e0f38f2ef431cacd65c7c77ed92e30d7f2ded84651f47150
* Add the sqlite3_changes64() and sqlite3_total_changes64() API functions.dan2021-06-22
| | | FossilOrigin-Name: 48fdec22c966003f5577e0bf52906ef90df11e4e395723a646304e67ed976f37
* Fix an ALTER TABLE problem with handling infinite loops of CTEs in the ↵dan2021-06-14
| | | | | database schema. FossilOrigin-Name: c09d90eec2a49b948c60971294d146db5c82438855cd3fa48ddc3d2e6b44c26c
* This is an alternative approach to the use-after-free problem fixeddrh2021-06-12
| | | | | by [193b14a58e378ab3], saved here for historical reference. FossilOrigin-Name: 6796b7a2485eca279db9d777595a886bc0d1dd7ec9551e1797e0032ef5493559
* Fix problems with ALTER TABLE and schemas that contain views with some ↵dan2021-06-11
| | | | | recursive CTEs, or CTEs that reference other CTEs. FossilOrigin-Name: 8b1f9a51e962cd9a5593a1ecf4da6c86e34c4f9ff96ffcea0fb421880c8836cb
* Revamp SQLITE_TESTCTRL_TUNE to provide visibility of current turningdrh2021-06-04
| | | | | parameter values. FossilOrigin-Name: 677e645e69e1f06487c26da6671fc03f0fb89a0f8e0d35712e6bdcf7279bdfc4
* Add support for SQLITE_TESTCTRL_TUNE and the ".testctrl tune ID VALUE" commanddrh2021-06-04
| | | | | in the CLI. FossilOrigin-Name: f1199d58b9cfdcddb83bc35544ce38299ac4ed50d7ab90d33463f6ccce526feb
* Add an optimization control bit to disable the OP_SeekScan optimization.drh2021-06-02
| | | FossilOrigin-Name: f674c41e5cbbb08ffc3cc00ab449229b672054c872e209337f12e7eacb531fe5
* Ensure that objects within view definitions are not incorrectly resolved to ↵dan2021-05-20
| | | | | CTEs that are part of the statement using the view. FossilOrigin-Name: f7dcc4b5197c6413be31384b390bb98a737d3f9edb7964433448c3b90b35a436
* Replace [0f0959c6f95046e8] with a new and better solution that also fixes thedrh2021-05-20
| | | | | | | CTE name resolution problem described in [forum:/forumpost/8590e3f6dc|forum post 8590e3f6dc]. Test cases for both problems added. FossilOrigin-Name: 5614279daff5007d6e047c5c1b3cc82ba80a5c91c529525b0fe68b79ee82dd2c
* Improved column name and column type determination for the RETURNING clause.drh2021-05-19
| | | FossilOrigin-Name: 699c33990a9438f28673ecf34f1e521d1af0b01c6ee30a608c0c91d2d593590e
* Fix problems with refering to CTEs from within sub-selects in PARTITION BY ↵dan2021-05-17
| | | | | or ORDER BY clauses of window frame definitions. Also a problem with renaming a column when the schema contains a trigger containing a correlated sub-select within a window frames PARTITION BY or ORDER BY clause. FossilOrigin-Name: 4c6cd54a8db78e5535912e76856bed4f797261aaca4248c69d2e2452194de297
* Enable the sqlite3_serialize() and sqlite3_deserialize() interfaces bydrh2021-05-08
| | | | | | default. Omit the SQLITE_ENABLE_DESERIALIZE option and replace it with the SQLITE_OMIT_DESERIALIZE option. FossilOrigin-Name: 6df3b03e00b1143be8fed3a39a58ce81063020275aa1ac13d87c84f1ceda6e27
* Back out the EXISTS-to-IN optimization. It slows things down rather thandrh2021-05-04
| | | | | | | | speeds them up depending on the query. And (see [forum:/forumpost/8692d94725|forum post 8692d94725]) it sometimes results in an incorrect answer. We may come back and revisit this optimization later, but for now it seems best just to disable it. FossilOrigin-Name: 16252d73fa73569fd7506676f6ffbbcd43addfb105384fb74449d30ca720904a
* Raise an error on an attempt to rename an eponymous virtual table.drh2021-04-22
| | | FossilOrigin-Name: c7909e8e0d0577c6109f13c0b14fb565239aae8af8963d659f363e124f3437fc
* An improvement to check-in [1a341378ab24a509] that omits the newdrh2021-04-19
| | | | | | Walker.bWalkWinDefn boolean (which is not always initialized) and uses a special value for xSelectCallback2 instead. FossilOrigin-Name: bef2238de9550de84d4cd1c970a542b43db288d73d09a3c3ced7f98bb3188fd3
* Ensure that variables are not used in the WINDOW clause of a query insidedrh2021-04-17
| | | | | of a trigger. dbsqlfuzz d9cf66100064952b66951845dfab41de1c124611 FossilOrigin-Name: 1a341378ab24a5091e6cf03b9e957d11b2bfe5c711835e8c583785f8fa0125d3
* Fix a segfault that could occur if the ORDER BY clause of a compound SELECT ↵dan2021-04-12
| | | | | contains a sub-select that uses one or more window functions. FossilOrigin-Name: 5ba15ebb34c3af85ef6c54bbb3acb57176d629cda83774881b2a6467e138e904
* Refactor NameContext.nErr into nNcErr to avoid confusion with Parse.nErr.drh2021-04-10
| | | | | | | Do not abandon sqlite3ResolveExprList() on nNcErr if nErr is still zero as we might have hit a problem with ORDER BY resolution that should be a suppressed error. dbsqlfuzz 41b9dad40919d3549ca7e52d893da81a6dded4ad FossilOrigin-Name: 7d674970741bd9b228b818c701c1ae010b90cc287a4c60a872f18b66353d164d
* Fix a crash in handling queries of the form "SELECT aggregate(DISTINCT ↵dan2021-04-03
| | | | | tbl.col) FROM ... LEFT JOIN tbl ...". Fixes a problem introduced by [ef4ac0ddd297bbd3]. FossilOrigin-Name: 0dcf808ddf23da834da724d88b1715ed06565f1f1290713ff42a3fcf6ffb802e
* Defer deletion of expressions that are optimized out by the AND optimizerdrh2021-03-31
| | | | | | | | | in the sqlite3ExprAnd() routine until the corresponding Parse object is deleted. This avoids a dangling pointer in AggInfo if sqlite3ExprAnd() is invoked by the push-down optimization. The dangling pointer appears to be harmless in release builds, only showing up in debug builds. Problem found by dbsqlfuzz. FossilOrigin-Name: c36b43589abd9f62a709bdb47b8748e0c1e8743487a3d83d1eb35eb06b65d763
* Omit the SQLITE_STOREP2 and SQLITE_KEEPNULL options from the comparisondrh2021-03-29
| | | | | | | opcodes, allowing them to run faster. This required refactoring the vector comparison logic, which in turn required changing OP_ElseNotEq into OP_ElseEq. FossilOrigin-Name: 380b46054b6a9b67e57357815e8e94057253fa3cce838ae76e5d5031c6bd26b2
* Alternative implementation of the comparison opcode speed-up ofdrh2021-03-28
| | | | | check-in [4a8805d9a66dc888] that should pass muster with UBSAN. FossilOrigin-Name: afb18f64541effaeaada2d72c7c91adfe5ec3e2b1418c0bc281083125fb5badb
* Improvements to distinct aggregates such that they can sometimes avoiddrh2021-03-24
|\ | | | | | | | | | | using an ephermeral table to test for duplicates if the column that is distinct is part of an index. FossilOrigin-Name: ef4ac0ddd297bbd38351410c5a387e1628561b3f1bec9e4c2c9d76fbe29f955a
| * Fix typos in comments and add test cases.dan2021-03-13
| | | | | | FossilOrigin-Name: 01312a3dbd92823af535dc618c68d95a2aa1cbee2501b0a9826eae3f09bec760
| * Merge latest trunk changes into this branch.dan2021-03-12
| |\ | | | | | | FossilOrigin-Name: 198bc510d64b5794559584ad5c9de41dc966dce4eb78be15b12adba43dfcb639
| * | Experimental optimization for distinct aggregates (e.g. "SELECT ↵dan2021-03-09
| | | | | | | | | | | | | | | count(DISTINCT <expr) FROM ..."). FossilOrigin-Name: eb919611fd2f255e4ad1fe7db633363793169f6cf99c650eaefa48c022eb5d22
* | | When doing schema updates, try to convert (incorrect) double-quoted stringsdrh2021-03-23
|\ \ \ | | |/ | |/| | | | | | | into (SQL-standard) single-quoted strings. FossilOrigin-Name: 0770470488e140fa21cb5097c26d58e21da85544af8b69faced1670bbc6d6089
* | | Add the ExprList.nAlloc column and use it to make the sqlite3ExprListAppend()drh2021-03-23
| | | | | | | | | | | | | | | routine much faster. FossilOrigin-Name: 1d3c4662c2f522ac695d97441324069f3fc65f3fa0b87194c7094dfb8cd549f2
* | | An alternative approach for fixing ticket [1c24a659e6d7f3a1].drh2021-03-14
|/ / | | | | FossilOrigin-Name: a2adae907a28e169e64cfe69d97d7b68cb94e6ba07d2dfa995e3fbc6672fafdd
* / Do not confuse the constant SQLITE_MAX_ATTACHED with the maximum number ofdrh2021-03-10
|/ | | | | | schemas. Add the new SQLITE_MAX_DB constant for the maximum number of schemas. [forum:/forumpost/a006d86f72|Forum post a006d86f72]. FossilOrigin-Name: 7b65fb9f7bd616f834633afd64b3448bf9ca2b6e4cc6d6c01e75d1d877c88a79
* Earlier detection of a misplaced ORDER BY or LIMIT clause in a compounddrh2021-03-04
| | | | | | | SELECT. This prevents problems in recursive CTEs with multiple recursive terms in which there is an ORDER BY or LIMIT clause on the last non-recursive term. FossilOrigin-Name: e893f88750ea64d45922429e022c585748974016404f2a2b7952f5a227865246
* Allow WHERE terms to be pushed down into sub-queries that contain window ↵dan2021-02-22
| | | | | functions, provided that the WHERE term is made up of entirely of constants and copies of expressions found in the PARTITION BY clauses of all window functions in the sub-query. FossilOrigin-Name: dac51f303bba1a0aac7768c688b0c134deb7641062cce2071d546f2d8f241dec
* Add the AS MATERIALIZED and AS NOT MATERIALIZED syntax that works like itdrh2021-02-22
| | | | | does in PostgreSQL. FossilOrigin-Name: a6bb272ec0c758ab069bfc07443624e0ea7910b1f23224ee078d050fa3ccf068
* Materialize any CTE that is used more than once.drh2021-02-21
| | | FossilOrigin-Name: ba59159fbe6b83fb6d79fbfee22d983768b0ebbaac7e99d2ac66c810e5e04100
* Rename the "struct SrcList_item" object to the more succinct "SrcItem".drh2021-02-21
| | | | | This is a symbolic change only. The logic is unmodified. FossilOrigin-Name: bfd5bf2c73110fcb36db9ba2a949ff516131fbd3e89325f88fe9f5c2b4ed87b2
* Break out the Cte object from the With object. This will make it simplerdrh2021-02-20
| | | | | | | to add new kinds of Cte objects (ex: DML statements) and/or MATERIALIZED keywords in the future. It brings trunk into closer alignment with the experimental as-materialize branch. FossilOrigin-Name: f03efe905d7b40fb25f9f78b874bb56c6d6ccacb60f86b3b199d430d5eade8d2
* Merge changes from trunk into the alter-table-drop-column branch.drh2021-02-18
|\ | | | | FossilOrigin-Name: 9ea640073f8809dfe2612ae1ea384a938b433f884c54d9e5aa3712de79397ac1
| * Improvement to the INSERT optimization of check-in [16ac213c57196361] sodrh2021-02-18
| | | | | | | | | | | | that it works with SQLITE_ENABLE_HIDDEN_COLUMN but is also easier to maintain and a little faster as well. FossilOrigin-Name: f985a78ecc0c6d9ff671c730a109d97dc781b06e47a0ab03f441cea5d021a4c3
| * Use the sqlite3ParserAddCleanup() mechanism to ensure that the AggInfodrh2021-02-17
| | | | | | | | | | | | structure associated with an aggregate query is deallocated, for a performance increase and size reduction. FossilOrigin-Name: 7a1399671fa10c64d5358cc4d364d24c643fe9dd8da923356462267ee7962f61
* | Fix various issues with the changes on this branch. Add test cases for the same.dan2021-02-17
| | | | | | FossilOrigin-Name: 10538ec6fc1642dfc2ca6cef06ce6cb9e124847b421ccf01f5842064fad379ab
* | Add experimental implementation of ALTER TABLE DROP COLUMN. Only some cases ↵dan2021-02-16
|/ | | | | work so far. FossilOrigin-Name: f0217937d7306fb595727e61e871e8b03d8c881d339a0865bfd0117d90d42e4e