aboutsummaryrefslogtreecommitdiff
path: root/src/trigger.c
Commit message (Collapse)AuthorAge
* Make use of the flexible-array feature of C99, when available, to try todrh2025-03-14
| | | | | | pacify -fsanitize=strict-bounds. This check-in fixes the core. There is more yet to do in FTS3, RTREE, and in FTS5. FossilOrigin-Name: 6fd6b32d06bd6a705e5140cd613af823b8183a6f6a9ceeeedfcf5e8b50821d68
* Further reduction in the amount of memset() needed to initialize the Parsedrh2025-02-07
| | | | | object. FossilOrigin-Name: 45e462c0060e51c3375a226d636148e3415ee6020e544ecc84861c7aef4ecf7b
* Reduce the amount of memset() needed to initialize the Parse object.drh2025-02-07
| | | FossilOrigin-Name: 284538d8486ef3e9bee1ab980043b53c144743c31b984be13a5cc137e7cbec31
* Increase the maximum number of arguments on an SQL function to 1000 with thedrh2024-12-12
| | | | | capability to increase it further up to 32767 using a compile-time option. FossilOrigin-Name: e8d7d68ba0bb0bc2f948db5d9966990a5d23597fc3658b7cd0bc99d53c7353a9
* Tighter checking of access constraints on union members in SrcItem.drh2024-08-20
| | | | | Improved invariant checking. FossilOrigin-Name: fd72d3400a8fe5747f494eee81654698acee350bb95b9db269e87d857af03492
* Give unique names to fields in the SrcItem object, to facilitate analysis ofdrh2024-08-17
| | | | | how those fields are used using "grep". FossilOrigin-Name: 9f5aeef3cbc2c95267c8f7bf60d5c66971a76789669fb0e8f853273ff6f616f2
* Reduce the size of the SrcItem object by combining fields into a union.drh2024-08-17
| | | FossilOrigin-Name: a4c59ac3c6ec979c25b544d29e47b8e39f6439c098eed8f84b3bd506c9adf047
* If a RETURNING clause contains a subquery that references the table that isdrh2024-04-24
| | | | | | | | being updated in the statement that includes the RETURNING clause, then mark the subquery as correlated sot hat it is recomputed for each result and not just computed once and reused. See [forum:/forumpost/2c83569ce8945d39|forum post 2c83569ce8945d39]. FossilOrigin-Name: 9ea6bcc8fdf6aadb756ec5bcaaa7af314167f8973bdd32fd23f83bd964f0c21e
* Add comments linking the assert() added in [cef4d9e3ba586735] to the placesdrh2024-04-24
| | | | | where the precondition that the assert() tests are actually required. FossilOrigin-Name: 6f0e7e195275aeb4aefd9da20348af35e3ef7f0a6b2768a34824daeace16eff1
* Ensure that temporary SrcItem objects created by trigger processing havedrh2024-04-24
| | | | | | either SrcItem.zName or SrcItem.pSelect defined. Every SrcItem should have one or the other. FossilOrigin-Name: cef4d9e3ba586735598f03eb5e8f29072c9e6f62b0d34ddd2fb3ed1795f6e21c
* Further enhancements to make sure the correct returnning trigger is run whendrh2023-10-26
| | | | | there are nested INSERT RETURNING statements. FossilOrigin-Name: d83405e870b071540b56e76291bdce1388db80b860afd68a34e4233f6ff2a3ab
* Deal with the case of a reentrant INSERT on a virtual table where thedrh2023-10-26
| | | | | | outer INSERT has a RETURNING clause but the inner does not. dbsqlfuzz 3ac9a1e33f676254e02c0f297263b0a7aeb0c1a5. FossilOrigin-Name: 8aba78e4dbf5c196aa50a28579f4bcd7c96103661c5968d62b2fded075bc73e4
* Do not allow triggers on shadow tables under defensive mode.drh2023-10-13
| | | FossilOrigin-Name: 44b932ff16e35814febd842d11215cf243393f173aade33ceded473598221e88
* Fix multiple problems with RETURNING on a DML statement against a view,drh2023-03-28
| | | | | | | | | | all inspired by [forum:/forumpost/dc3b92cfa0|forum post dc3b92cfa0]. (1) Do not allow a RETURNING clause to trick the code generator into thinking that the view being updated has an INSTEAD OF trigger. (2) Generate all result columns for a view in a DML statement. (3) The automatic covering index for a view should cover all result columns of the view. FossilOrigin-Name: c8bedef0d61731c29ae34de1594222d15b578f9e2cddbbd5b74fb3059644fe0f
* Fix assert() statements that would (incorrectly) fire if an IF NOT EXISTSdrh2023-03-17
| | | | | | trigger that already exists contained two or more RETURNING clauses. Tickets [89d259d45b855a0d] and [d15b3a4ea901ef0d]. FossilOrigin-Name: 648899e4ded72cac6cc24bccf7ebfc709ee7309a003452b21fd6ab0ba20c34b8
* Fix a possible NULL pointer dereference due to the sqlite3_interrupt()drh2023-03-08
| | | | | | enhancement at [bd8fa10e59f58886]. Reported by [forum:/forumpost/f5a2b1db87|forum post f5a2b1db87]. FossilOrigin-Name: 84417bbd144b2197c9930a520feb94b59053957c190be79f8deaaaebca68ecf1
* Ensure the RETURNING clause is honoured when a row of a temp table is ↵dan2022-11-28
| | | | | updated by an ON CONFLICT clause. FossilOrigin-Name: a2449bcc2c71d0f4c3289621fbf1cb97f0f407c9f7b5bf18245b7854a07c6cfa
* Replace the Parse.disableVtab field with Parse.prepFlags for increaseddrh2022-10-01
| | | | | generality, a small size reduction, and a small performance increase. FossilOrigin-Name: b7da0bcdf70e53ab1ec00a0694e17c7429e23bc6eb3f39b622d06a930aa2f6a3
* Enhance defensive mode so that it disallows CREATE TRIGGER statements if thedrh2022-09-27
| | | | | statements within the trigger attempt to write on a shadow table. FossilOrigin-Name: 3283bbd12a60f472ed03cb7c6209a605a3bf9f3d9083371e17840b56e8b3f559
* Fix further issues with ALTER TABLE and triggers that contain UPDATE..FROM ↵dan2022-05-27
| | | | | statements. FossilOrigin-Name: 53fbc269ddbabc4a97d297e881e5f9cd2bfbcd24af4af1b7cf9db412a3a51813
* Correct handling of outer joins in the FROM clause of an UPDATE statementdrh2022-05-26
| | | | | that occurs inside of a trigger. Follow-on to [98b3816bbaf539ea]. FossilOrigin-Name: 664a49fa813144b6fa5a7ae3f65af5412f150dd5def261c4d581d706b39f7846
* Organize the various flag bits of the ExprList_item object into a substructuredrh2022-05-02
| | | | | so that the whole lot can be copied all at once. Faster and smaller code. FossilOrigin-Name: 5341d4bbe9a943f9cdbbdea829e18f108e98972ebb706396c50fc62fcc6a6328
* Fix two unreachable branches introduced by the recentdrh2022-04-07
| | | | | sqlite3TriggersExist() optimization. FossilOrigin-Name: 1b5475d212cf9de0bff69eee8c607b4fcd8e04bf4df72171429e7609c4153951
* Optimization to sqlite3TriggersExist() saves over 700K CPU cycles.drh2022-04-07
| | | FossilOrigin-Name: 5043a3507e0781878e0e1bea5095a33273958820baead4af8fc2929e9d7c07ee
* Change a conditional into an assert() due to the change indrh2022-03-17
| | | | | [387ab17b8a0a4b87]. FossilOrigin-Name: 13b584869f40ea6aa2190dbac64709695ee8d72b27bc5afb8b39ab3763b9c46a
* Do not allocate new Trigger objects in the parser following a syntax error,drh2022-03-07
| | | | | | | to avoid violating invariants associated with Expr nodes. See [forum:/forumpost/2024e94071ef1531|forum thread 2024e94071ef1531] for more information. FossilOrigin-Name: 5e0ed49b3d739d292f5df3e498449ae8f4357cbb83394181fb34f98ed8372707
* Disable the sqlite3_error_offset() when the error occurs in a trigger ordrh2022-02-07
| | | | | view or some other bit of text that is not part of the original statement. FossilOrigin-Name: 0e909e34fa74e7b9b7954e4ed4c39dd293c1d413b58fda03607faab74aa382ad
* Add ALWAYS() macros. Change some existing ALWAYS() into assert(). Otherdrh2022-01-24
| | | | | code simplifications. FossilOrigin-Name: 4aa27b4fcd1ffd06c38357a87ba3f5776367570439c49652f0903873def0bb23
* Remove many redundant checks for sqlite3.mallocFailed now that any OOM shoulddrh2022-01-24
| | | | | cause Parse.nErr to be non-zero. FossilOrigin-Name: 1f7fa46126ea33ed30e93186aff3df51068aeb4be6f79a102bfe8c4e44941d71
* Make it so that any Parse object is always linked into the database conenctiondrh2022-01-24
| | | | | while it is active. Hence, an OOM will cause Parse.nErr to be set. FossilOrigin-Name: 6a45d8fe8bfbc11a5b86d25237e1f8bccfb0f22f3dcaf004ba797aeb57b365ec
* Ensure that any error encountered while coding a trigger program is ↵dan2022-01-24
| | | | | transfered to the main Parse structure before it is used with any other routine that might set the error code. FossilOrigin-Name: 4293656578811b500786335de7cc9ac0d6ccc6fb273b9419a86968a095404c43
* Fix an assert() failure that could follow an OOM when coding a RETURNING ↵dan2022-01-05
| | | | | trigger. dbsqlfuzz case 5d3e2438f15dc32b473d9f29413157857efa1212. FossilOrigin-Name: 7ae596dd4a73a09585c5dc9f4faf75d126d0733fc2fb32c1de64126a1088d967
* Improved handling of OOM errors in sqlite3ExpandReturning().drh2022-01-05
| | | | | dbsqlfuzz 1040b720f0bbc3bdcfe7336acffbf71517e3ef82. FossilOrigin-Name: 33c6b8e94bda12df13b4d2dd782b3120c3628596b86ef531d20b3100bf159b50
* Ensure that the affinity of columns is honored in the RETURNING clause.drh2021-12-29
| | | | | See [forum:/forumpost/e0c7574ab2|forum post e0c7574ab2] for the bug report. FossilOrigin-Name: 4711fb69547f4f17653ab116030c32fdcc2c836410349d1d025866ffc15704da
* Show the preferred schema table names in the output of "PRAGMA table_list".drh2021-11-04
| | | FossilOrigin-Name: 9147390d9885a37a62edc1058f313434627f1b59965c890877d2cb119e355c78
* Refactor field names in the Column object, zCnName and zCnColl, to make themdrh2021-08-02
| | | | | unique and thus easier to find amid all the other code. FossilOrigin-Name: 8b781dcaf68e0cf12a844708c82eee00193e340195cbca915d077e4846983bf3
* Refactor the Table object to reduce its memory footprint.drh2021-08-02
| | | FossilOrigin-Name: bbb6759bcf6e01d36dfc787a82a610d359f50aaeac8104b73883a84906d54e1f
* When generating data for a RETURNING clause, avoid assuming cursor number 0 ↵dan2021-06-28
| | | | | is available for use. FossilOrigin-Name: 4b2c59acce6ff1bb6c9c04c45c80945ae23a26588718cc20635d60f7497adabb
* Improved column name and column type determination for the RETURNING clause.drh2021-05-19
| | | FossilOrigin-Name: 699c33990a9438f28673ecf34f1e521d1af0b01c6ee30a608c0c91d2d593590e
* Further improvements to the handling of RETURNING clauses on changesdrh2021-04-27
| | | | | | to TEMP tables with triggers. dbsqlfuzz 683913e98f54fe4f14e8dd11a48011f73bdca58d FossilOrigin-Name: ff3538ae37a02f4f36a15cddd1245171e724aac9c84b2e576980fd3806302775
* RETURNING bug fix: Correctly deal with RETURNING statements on changes todrh2021-04-27
| | | | | | TEMP tables that also have triggers. dbsqlfuzz 78b9400770ef8cc7d9427dfba26f4fcf46ea7dc2 FossilOrigin-Name: d0b15eccbfe1e50c3daf7b2fd4769a52bba35d553b07e462ca3f5f22df6742fd
* Earlier detection and handling of OOM problems.drh2021-04-06
| | | | | dbsqlfuzz 39f2963ea5559aa3a16e24e0e3cb42aac85a7371. FossilOrigin-Name: 8d46df73132e46abb32b9dc129b6beb978d34dac3d372fb004ca283b0832d04c
* Avoid compile error when SQLITE_OMIT_VIRTUALTABLE defined.larrybr2021-04-04
| | | FossilOrigin-Name: 0ee0ef476ba9e17794c088a1347a136df3eb1ef864da884cfe81e3b2e94e9719
* Correctly capture the error when a RETURNING clause appears on an drh2021-04-02
| | | | | | attempt to UPDATE an eponymous virtual table. dbsqlfuzz 486f791cbe2dc45839310073e71367a1d8ad22dd. FossilOrigin-Name: 778a9a6e6f8d960fd55ac9be7eea20b1875a46192db85e63dddc61b632b30173
* Raise an error if a term of the form "TABLE.*" appears in the RETURNING clause,drh2021-03-30
| | | | | | as SQLite does not (yet) know how to handle that. Ticket [132994c8b1063bfb]. FossilOrigin-Name: 3039bcaff95bb5d096c80b5eefdaeda6abd1d1337e829f32fd28a968f663f481
* Improved labeling of EXPLAIN QUERY PLAN output. Many test failures due todrh2021-03-19
| | | | | the different output format. FossilOrigin-Name: 6f8faec0222a7ca07cc1a5ed16cc08d92c6e20bbcb34851b4eff9e624de53601
* Fix various issues with the changes on this branch. Add test cases for the same.dan2021-02-17
| | | FossilOrigin-Name: 10538ec6fc1642dfc2ca6cef06ce6cb9e124847b421ccf01f5842064fad379ab
* Fix harmless compiler warnings.drh2021-02-07
| | | FossilOrigin-Name: 5f8bf99579e6663fc701cdc94f685584a86398c4687e25e7e241de755398f17d
* Remove unreachable code. Fix a shift UB problem introduced yesterdaydrh2021-02-05
| | | | | and discovered by OSSFuzz. FossilOrigin-Name: 078dbff04a95a001bbd8690ab08038fbb5506899df8290991b53fd1122a4c30c
* Remove dead code. Fix RETURNING for INSERT into a virtual table.drh2021-02-04
| | | FossilOrigin-Name: dbfa38699c87ab4bf390666e411dda8d375c7b53b9b4fb131adacbf575867a72