aboutsummaryrefslogtreecommitdiff
path: root/src/expr.c
Commit message (Collapse)AuthorAge
...
* | The sqlite3FaultSim(300) error from [1e8863909ac369e5] must be treated asdrh2024-05-10
| | | | | | | | | | | | an OOM, since it simulates an OOM. Also fix deferred deletion of Expr objects from [a53bdd311c4154fd] so that it does not corrupt the AST if an OOM occurs. FossilOrigin-Name: c623d9a51e0ae6b4a8e1186714d14e7aa3df55246e123323481f07f07749dea5
| * Allow arbitrary expressions as the second argument to RAISE().drh2024-05-08
|/ | | FossilOrigin-Name: 003e1c8c27824cb917b3869bdf9000f32ff0b6887a2aff8516712cfe865cf34d
* Avoid unnecessary recursion in sqlite3ExprDeleteNN(). This complicates thedrh2024-05-06
| | | | | | code, but it is needed to prevent nuisance "stack overflow" reports from OSSFuzz while it is running the latest ASAN. FossilOrigin-Name: 70abc144ca90a58ea25dc2d90683545246c084d961215c20ec070b0abe640371
* Avoid slowdown when exprNodeIsConstant() is called on deeply nested SQL ↵dan2024-04-24
| | | | | functions. FossilOrigin-Name: 1c0b0345451853846076467831884f951c92ec79476be40ce7f7b766fd2d8fc1
* Merge trunk enhancements into the pushdown-subquery branch.drh2024-04-07
|\ | | | | FossilOrigin-Name: 27865e316f8dfbf4c20290cf1be3024d7518fec46655e34f3fc435e15346c63e
| * Add comments to note the name abiguity between the MySQL push-downdrh2024-04-07
| | | | | | | | | | optimization and the WHERE-clause push-down optimization. FossilOrigin-Name: 3d5fb1ec7a0440072d6e3b957903c85d0f32b8b07207a1ef22d1a69cf5e664d1
* | Do not allow changes to sqlite3ExprIsTableConstant() that support pushdown ofdrh2024-04-06
| | | | | | | | | | subqueries interfere with the hash-join logic. FossilOrigin-Name: 8682931f9c6b40e1b09139c10bbe932c38330b5eb0c5c84f2432ad19a6793e37
* | Generalize pushdown to allow any uncorrelated subquery to be pushed down.drh2024-04-06
| | | | | | FossilOrigin-Name: 87c45fb0d5f5ca5d6d1ad27bef83f294231d17d94299e1997364a7975b423e38
* | Experimental enhancement in which expressions of the form "expr IN table"drh2024-04-05
|/ | | | | can be pushed down into subexpressions. FossilOrigin-Name: 2cbd7838fd6ffdf210f34671cd2e3e749a076a3a6f155bbe5f910a67db31c5b1
* The RAISE() operator is not a constant expression and cannot participate indrh2024-03-25
| | | | | | the VALUE-as-coroutine optimization. dbsqlfuzz 74cf7c9904360322a6c917e4934b127543d1cd51 FossilOrigin-Name: 6a06dc73847716c88d65651d1bf0e002002303881df1389beac884d0032eae08
* Do not automatically assume that ROWID is NOT NULL when compiled withdrh2024-03-24
| | | | | | SQLITE_ALLOW_ROWID_IN_VIEW. dbsqlfuzz 31b38eeb63a4e1562de665078f52b7b47a7543cf FossilOrigin-Name: 80c4223098c1827ff3a564f1f9a4203164a943e9a83eef99df68378fa3c4764b
* Make sure the new u1.nRow value is copied when making a copy of a SrcItemdrh2024-03-19
| | | | | object. This fixes a problem in [ac6f095e13e43d66] from yesterady. FossilOrigin-Name: 262f8f9d80d37160e4126634b99aa48fce2073e61f6365e8bdbe1cc4fa560a96
* Fix the patch at [10ee6fcba08ab128] so that it works on reduced-size Exprdrh2024-03-18
| | | | | nodes. FossilOrigin-Name: 260bd764c3f2d6d067adb9cd0045b7c24d5e00b02ab2735b1cba455a6143ff4c
* Fix a problem caused by a non-aggregate function with an OVER clause in a ↵dan2024-03-18
| | | | | multi-row VALUES clause. FossilOrigin-Name: 10ee6fcba08ab1281235197602148fe062560e1d5034a477b8e7b574dd3e2907
* A formerly impossible case has now become possible because of the newdrh2024-03-16
| | | | | ExprIsConstant enhancements. So deal with that. FossilOrigin-Name: 9ba3cff9d48fe8fc8a0a51291169599209d464465e44bdfd60058fd1e314a2b1
* Further expand the scope of usage for the enhacement to expr-is-constant.drh2024-03-16
| | | FossilOrigin-Name: d7eadcf7dd089f0f4aa963c58f0df32edd951368c9906375fd62b0a61cd393b8
* Assert that the eCode is always non-zero upon entry into exprNodeIsConstant().drh2024-03-16
| | | FossilOrigin-Name: f71b28f6713126745bca53e098dfe3444d4235d6a2b87ced5b333a7f0ee79be8
* Fix exprNodeIsConstantFunction() so that it returns WRC_Continue, not ↵dan2024-03-16
| | | | | WRC_Abort, if the function really is constant. FossilOrigin-Name: d85dd4de2d0989127e0ae6a2eec9d83a577777f8d5ba40700084a0b498016634
* Enhance the sqlite3ExprIsConstant() function so that it recognizesdrh2024-03-16
| | | | | | constant functions. So far the enhancement only applies to the multi-row VALUES clause, but it could possibly be applied in many other places. FossilOrigin-Name: c9e0488c6c0135932b6e76b0f3f3acd69ef65327e0a54daa59777f35da1aef26
* Attempt to reduce the memory used by VALUES clauses in as many statements as ↵dan2024-03-11
| | | | | possible, not just INSERT. This branch still has problems. FossilOrigin-Name: 17d1f7cfabc7593d0725051b0c7c9619a23a482265f30f15ab9493fef5caeeb0
* Remove code that added a P4 parameter to the OP_Variable opcode. This is no ↵dan2024-03-05
| | | | | longer required. FossilOrigin-Name: dd5977c9a8a418be3fbd646d74933996381099a9263a02eb4a990f0084463dc1
* Always convert 32-bit integer literals into EP_IntValue notation, even ifdrh2024-02-28
| | | | | they contain "_" separators. FossilOrigin-Name: 2dfc427f676255cbe189a26bfec2405d41d31ccc4512c55b31e6e633261d7a23
* Remove an ALWAYS() added in [c50e6c2ace49d092] because it is sometimes false.drh2023-12-24
| | | | | dbsqlfuzz c393a4f783d42efd9552772110aff7e5d937f15e. FossilOrigin-Name: b9daf37e57cde12c4de271a2b1995e8e91b6411f8c2e8882e536241929609b3a
* Remove redundant conditional from sqlite3ExprCanBeNull().drh2023-12-19
| | | FossilOrigin-Name: 257f96a2d22c605885fa66220c28cf7dc5941c330bccee3f132b9e7b70d89d30
* Add ALWAYS() and NEVER() on branches made unreachable by recent changes.drh2023-12-19
| | | FossilOrigin-Name: c50e6c2ace49d0928b05cbfd877c621e9a0f77dc4e056ccb1dbe5cf118a00d00
* Ignore COLLATE operators when determining whether the result of a subexpressiondrh2023-12-19
| | | | | should be shallow-copied or deep-copied. FossilOrigin-Name: 34ae36a45e814bed7c8340412c7ef3fc849b82357656d0eb5f0f805e59d846d0
* Extra ALWAYS() macros to verify state in the sqlite3ExprCanBeNull() routine.drh2023-12-19
| | | FossilOrigin-Name: be19b84c9f3fe127165809908add148dbe9a827a55608b0490de7e69b7f7f191
* Pass subtype information through the aggregate ORDER BY sorter fordrh2023-12-14
| | | | | aggregate functions that use subtype information. FossilOrigin-Name: 3536f4030eab6d650b7ed729d2f71eb6cc3b5fbe16b4e96b99008d66522aaccb
* Add ALWAYS() on branches added in [ec0ae4030968c782] that are always true.drh2023-12-07
| | | FossilOrigin-Name: 451cef8609e96dd9244818adc5c6f240544694bcb4ae620e88f90e403e59d70f
* Work around LLVM's newfound hatred of function pointer casts.drh2023-12-06
| | | | | [forum:/forumpost/1a7d257346636292|Forum post 1a7d257346636292]. FossilOrigin-Name: ec0ae4030968c782af48d1c776351c14b2ada21d40aeb97915f33df30706e18f
* Back out an incorrect change to the sqlite3ExprCompareSkip() function thatdrh2023-11-20
| | | | | | | was added way back on 2019-08-22 for [44578865fa7baf97|check-in 44578865fa7ba] and which was only today discovered to be incorrect by [forum:/forumpost/45ec3d9788|forum post 45ec3d9788]. FossilOrigin-Name: f5b3eb0fc8936ba274a7654ff6dfa7d4654bd8dbca7f3a5ec1134b0b5260d59d
* Add NEVER() to a branch made unreachable by [6f9eed826f5b3d1c].drh2023-11-14
| | | FossilOrigin-Name: 26dcaa34e3521783bde687749d590eca54cecb4bb95ef332a4a6473c4141d052
* Fix another obscure problem with nested aggregates. dbsqlfuzz 04408efc51.dan2023-11-14
| | | FossilOrigin-Name: 6f9eed826f5b3d1cb08402925b406a7fe9b54259af1ba5eba92d4d37fbad628a
* Fix harmless compiler warnings in test code.drh2023-10-31
| | | FossilOrigin-Name: d1895dd8f5757a339f619f22b29c8a739398ded673bb9c93f1b8eb8a4b38f510
* When doing a DISTINCT aggregate that contains an ORDER BY, only thedrh2023-10-25
| | | | | arguments to the aggregate need to be distinct, not the ORDER BY terms. FossilOrigin-Name: d2dbbdf7194bab4e5e3b74d3dbffb012a335829824c775c72dd7347c013d2125
* Fix sqlite3ExprDup() alignment assertions so that they work on 32-bitdrh2023-10-23
| | | | | platforms. FossilOrigin-Name: 143f95efc7114455b1920f1d2f9a867392740f608d1dda4306005f01238103f8
* Fix [f5c01676fd281e93] so that it always preserves 8-byte alignment for Exprdrh2023-10-22
| | | | | objects. Add new assert() statement to verify this. FossilOrigin-Name: 678a9728dc6b88d8ef924c86603056df18204bc9a9c4776b9baffd7c5b10c5f2
* Omit some redundant calls to strlen() used to find the size ofdrh2023-10-20
| | | | | | | Expr.u.zToken in sqliteExprDup(). This inefficiency was seen while working on the previous check-in, and I thought it best to fix it while it was fresh in mind. FossilOrigin-Name: b7a84eff5dcdf5b2ff81331097cdc64d0c5d16a4ae224320f39b64541ec72dc7
* Improvements to the sqlite3ExprDup() logic for faster performance and betterdrh2023-10-20
| | | | | | | | run-time error detection. This check-in fixes the 5x oversize memory allocation bug from [f371e4c0f8ea73ae] as well as all other known issues that result from handing the ORDER BY clause of an aggregate function off of the pLeft pointer of the Expr object. FossilOrigin-Name: f5c01676fd281e938181b846dd2024d050f597dc6a7a91928beab9d8553dfdb5
* Simplifications and optimizations to the Expr object duplication logic.drh2023-10-20
| | | | | | The 5x multiplier crutch from [f371e4c0f8ea73ae] is still present. More fixes are still needed. FossilOrigin-Name: 56142a78163b755f16afc05201f623a7a19d9a4b0620a67f7fa20d2a965a288d
* Use sqlite3ParserAddCleanup() instead of calling sqlite3ExprListDelete()drh2023-10-20
| | | | | | directly when disposing of an unused ORDER BY in an aggregate function, to avoid disrupting ALTER TABLE data structures. FossilOrigin-Name: d083e42086733ecd79aba8c268e020b01782bfe1cfa9684ce1c277af9c8bf92a
* For TK_ORDER expression nodes to always be full-size.drh2023-10-19
| | | FossilOrigin-Name: a5c73b46f4772f214ffbfa31cb87dce82ebd690addabef539bd09def26b7744d
* Fix an adverse interaction between the new aggregate ORDER BY logic and thedrh2023-10-19
| | | | | expression compressor. FossilOrigin-Name: f371e4c0f8ea73aee9ea0645f396e3da20f1eb97be34c83de9d94c9cbb959934
* Simplify the Expr compression logic slightly by adding the new EP_FullSizedrh2023-10-19
| | | | | | property to expressions that are exceptions to the rule and should not be compressed. FossilOrigin-Name: d5ae82ec52eafed5e3dc8c9d99685f6523fce7d973ef7e8d9d75ed9b8912426a
* Fix the sqlite3ReferencesSrcList() routine so that it recognizes columnsdrh2023-10-19
| | | | | | in the ORDER BY clause of an aggregate. Fixes a problem with [634286828dad873d] discoverd by dbsqlfuzz. FossilOrigin-Name: 3d26f1aaa4876f21f2c3abf13bbc37933c8f32471153e29019880cc9530cb011
* Merge the latest changes from trunk.drh2023-10-19
|\ | | | | FossilOrigin-Name: d18bc400146812c8c5048af7eaf4a5371ddd80fc9ce895d253b6114b9eae7fc3
| * Fix a false-positive in run-time error checking.drh2023-10-19
| | | | | | FossilOrigin-Name: cd63eec0758960d9ee63d7b964ec62e2bd622f8c94a58bd9556046381ffa18d0
* | Changes for test coverage.drh2023-10-18
| | | | | | FossilOrigin-Name: ddfa09c6031afd4391a9888381bf09214cd542a826b431eeb1537a070f65c5f9
* | Make sure all terms of the ORDER BY within an aggregate go through aggregatedrh2023-10-18
| | | | | | | | | | analysis. Do not attach an aggregate ORDER BY to a window function. FossilOrigin-Name: 16f3805514a741405f70e0ee3b5a6b67720bc75719372e82daa4136fe411ea2b
* | Basic test cases.drh2023-10-18
| | | | | | FossilOrigin-Name: 6cccf86c362631ada0c6cbaf661520648f8bbf7ae2b137b3d7d959647387e5c2