aboutsummaryrefslogtreecommitdiff
path: root/src/insert.c
Commit message (Collapse)AuthorAge
...
| * | | | Get generated columns working for WITHOUT ROWID tables.drh2019-10-18
| | | | | | | | | | | | | | | FossilOrigin-Name: 9f409649ec4282a47f0a8b079b419f1922e0c24779b297f477ced168d5b7910d
| * | | | Get indexes working on virtual columns.drh2019-10-18
| | | | | | | | | | | | | | | FossilOrigin-Name: 450c48766c8e62653d074c95f69b0576de3880d183a1d1e5992d88b6fce6cc39
| * | | | STORED columns can now reference other STORED columns, in any order, as longdrh2019-10-18
| | | | | | | | | | | | | | | | | | | | | | | | | as there are not loops. FossilOrigin-Name: 0d236698e64b2a4b46f91a25279c406e0bf392fe66116678456f0a034c11d7b4
| * | | | In the Table object, change the nVCol field to nNVCol - the number ofdrh2019-10-17
| | | | | | | | | | | | | | | | | | | | | | | | | non-virtual columns, as that is the quantity that we need most. FossilOrigin-Name: 4ad66af04a654d92711d2d056ce8f35cd21eac4b99fb8d78be1a314620b6d29e
| * | | | Bug fix with INSERT using an explicit column list on a table withdrh2019-10-17
| | | | | | | | | | | | | | | | | | | | | | | | | a non-final STORED column. FossilOrigin-Name: 61b4459ae6a6cc182c11abbc8b1dd629f77beb088d7ccad5e563d8d4769056df
| * | | | Some (but not all) INSERT and UPDATE statements now work for STORED columns.drh2019-10-17
| | | | | | | | | | | | | | | FossilOrigin-Name: fe7517bf4d360597576ab9aba29627d7926d23f2bbbfb3e7bf4d32761617574c
| * | | | Fix the xfer optimization for generated columns, so that VACUUM works again.drh2019-10-17
| | | | | | | | | | | | | | | FossilOrigin-Name: 8f67b89b04622c1509dc102a83be7a80057dc791625804fc2c294089c98b97e4
| * | | | Bug fixes so that "make test" once against runs with no errors.drh2019-10-17
| | | | | | | | | | | | | | | FossilOrigin-Name: 7bfe0f679d8951b3e925bdf549efa0f8d6b514eddeaca69cbfddbd9476cfff5f
| * | | | INSERT with named columns for a table with generated columns.drh2019-10-16
| | | | | | | | | | | | | | | FossilOrigin-Name: 64db39f92d68d1b9f23e48af35e16b969c38b58041fbe900066eeb3ddb291cef
| * | | | ALTER TABLE is able to add a VIRTUAL column.drh2019-10-16
| | | | | | | | | | | | | | | FossilOrigin-Name: 120c6b78cb51532f783014605f1107d40b2e4f54e3852fb1f8f167d0c0b78c69
| * | | | Simple INSERT and SELECT operations working with VIRTUAL columns.drh2019-10-16
| | | | | | | | | | | | | | | FossilOrigin-Name: 7f9f90b1b885fa9905b296f2e0fcc9b2341019b42fc839722a93cf60e49a9252
* | | | | Performance optimization on sqlite3GenerateConstraintChecks() - bypass thedrh2019-10-26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | loop that checks each column for NOT NULL constraints if it is known in advance that the table has no NOT NULL constraints. FossilOrigin-Name: e3c3f4d7872f431a95627d52553101388c1e39458cc7e7f93fc81255f49a89a5
* | | | | Clarify some comments and add assert() and testcase() macros to thedrh2019-10-26
| | | | | | | | | | | | | | | | | | | | | | | | | replace-trigger recheck logic for ticket [c1e19e12046d23fe] FossilOrigin-Name: 8c0042bd5ccd83f8794d19cbb1ec7564584f0dce54bfebc0ada00b836aca065f
* | | | | Overnight, OSSFuzz helpfully pointed out a potential use-after-free bug indrh2019-10-26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | yesterdays changes, involving continued use of a pointer after the memory pointed to had been realloc()-ed. Thanks Google. FossilOrigin-Name: c422afb507dc875751e6a72e4ba5f4f0793097c0de4533c1600311f689e76ed7
* | | | | Add missing VdbeCoverage() macro. Fix an off-by-one error in partial indexdrh2019-10-26
| | | | | | | | | | | | | | | | | | | | | | | | | handling. New test cases. Ticket [c1e19e12046d23fe] FossilOrigin-Name: 41cc8e3dab998f7efc898d18837ca7fdac94ea3f89954990c5231456bf725fee
* | | | | If replace triggers are run during uniqueness checking, then rerun alldrh2019-10-26
| |_|_|/ |/| | | | | | | | | | | | | | | | | | | uniqueness checks a second time using the ABORT algorithm. Fix for ticket [c1e19e12046d23fe] FossilOrigin-Name: fbac0c65d8464b126d385262d176864add55452ec9e3d5eb76ffee06e820cb9c
* | | | Correction to check-in [bec5b6d4d083556d] so that it detects *all*drh2019-10-24
| |_|/ |/| | | | | | | | | | | | | | triggers that might perturb the insertion cursor. Ticket [50c09fc2cf0d91ce]. FossilOrigin-Name: 521f1d36282549488a47a434484a24924ee970d29f05a8ae499b7d536bcd692b
* | | Add a VdbeCoverage() macro that was omitted from check-in [eea1e7aa57e74c43].drh2019-10-21
| |/ |/| | | FossilOrigin-Name: cd2317d04c1c4bcf5fe63aa02a6051bdfae8f5566a098e3f45bf9ec1dd0c3ea6
* | If an AFTER DELETE trigger fires when a conflict row is deleted by REPLACEdrh2019-10-16
|/ | | | | | | conflict resolution, make sure the conflict really has been resolved and that the trigger did not recreate the row before continuing. Ticket [a8a4847a2d96f5de] FossilOrigin-Name: eea1e7aa57e74c4329003f4550168e2aed9e33d2301a3ba84b10781a9cebbc1b
* When the affinity of a table column is INT or REAL, make the affinity ofdrh2019-08-30
| | | | | | | corresponding index columns NUMERIC. This increases the precision of index lookups for large numbers so that it matches the precision of ordinary comparison operators. Ticket [40812aea1fde9594] FossilOrigin-Name: e0d909c740b774d8a46731696e33342be83206cc4a95d07f42fdb3d8cc2d7a8e
* Prevent NULLS FIRST/LAST from being used in CREATE INDEX and other statements.dan2019-08-19
| | | FossilOrigin-Name: bb9767a287097a615aeb4abdba689b10e1a1c36c016c8e55905b508075e62c86
* Use 0x40 (ASCII '@') instead of 0x00 to mean "no affinity" so that columnsdrh2019-08-06
| | | | | | with no affinity can appear in a zero-terminated string. Use the new SQLITE_AFF_NONE macro for this new magic number. FossilOrigin-Name: e8234f6939ccff4c10f741cf66d1c537cfebcbd0d1d79a618a64c755a7f087b5
* One of two options on how to address ticket [61c853857f40da49]. In thisdrh2019-08-05
| | | | | | | | mode, we back out the documentation change of [https://www.sqlite.org/docsrc/info/07b7749da88d54e5|[07b7749da88d54e5]] and change the core to work as it has been documented to work since 2017, rather than how it has actually worked since 2009. FossilOrigin-Name: 09cd0c0c6e6c963e0039a733876e5149adb3cd10e9b92699fa1dcb0633e997a4
* Adjust requirements marks and add new requirements tests.drh2019-06-12
| | | FossilOrigin-Name: ebb81dad1f43dac4636cd44d4055d1d4b198c675f73e23c5a2d8d992ae27fe1f
* On an INSERT or UPDATE, generate the new table record prior to runningdrh2019-05-07
| | | | | | | foreign key checks, in case the foreign key checks changes datatypes on the registers holding column values. Proposed fix for ticket [e63cbcfd3378afe6980d626]. FossilOrigin-Name: 3f1c8051648a341db4dffad66d3b1f9980d8a2b314cb0ce879cb2a10d1779b84
* Add the ability to override the new corruption detection logicdrh2019-04-05
| | | | | | of the previous checkin, in order to exercise downstream corruption detection during testing. FossilOrigin-Name: e859d3184606dd453b9fc4ee388922d7be4b61aad84a66ac82107935ffd56f3a
* In the xfer-optimization, do early detection of when the source and destinationdrh2019-04-05
| | | | | | index share the same btree, to avoid a long delay prior to reporting the database corruption. FossilOrigin-Name: af1e5873d44d31466023ae145bdfc6b4191eb48b62e5752c6e683bcf571980e7
* Only preserve rowid values for VACUUM INTO. Keep the legacy behavior ofdrh2019-04-04
| | | | | renumbering rowids for ordinary VACUUM. FossilOrigin-Name: 13a0ea6466b051ea5281865ed5285b8b5a99ec4307f400c5f7b03692723f1cd1
* Make all ephemeral tables built to hold the RHS of an IN operator bedrh2019-02-22
| | | | | | | index-btrees, never table-btrees, regardless of whether or not they are used as IN_INDEX_LOOP or IN_INDEX_MEMBERSHIP. That way, the same ephmerial table can be reused for both cases. FossilOrigin-Name: c2d50df8fd1a1fdae6226a3e77296ded09b53a74540caedd4868e686a93cbc10
* Always use the symbolic name SQLITE_IDXTYPE_PRIMARYKEY rather than a hard-codeddrh2019-02-19
| | | | | magic number 2. FossilOrigin-Name: 55d43adc894a6b1e0f77bf481dad6dd604a0dc0022e72bbf2e3037f97351971e
* Experimental change to VACUUM so that it preserves existing ROWID values.drh2019-02-07
| | | FossilOrigin-Name: f264015f84de51d74f681ba62a5f26bd859480d93e1eaf9e1018b3e9b4e0bea3
* Disable the xfer-optimization if the two tables have the same root pagedrh2019-01-17
| | | | | due to schema corruption. FossilOrigin-Name: f31b3bd2a6a8aa35a6454f37f3a4b4595e2ad74256cd180439019ab4c6c2059e
* Fix a corner-case for the logic that cause an insert of a NULL into andrh2019-01-17
| | | | | | INTEGER PRIMARY KEY column to be converted into a valid integer key, when the NULL results from a CASE expression that lacks an ELSE clause. FossilOrigin-Name: 9a425051e7ba59e797636f5cf32b5f6efafdb21c8d5300e099b8008b829c1439
* Fix an off-by-one error on a Goto in the code generator, that onlydrh2019-01-12
| | | | | | causes problems for a REPLACE on an INTEGER PRIMARY KEY in non-debug builds. Test case in TH3. FossilOrigin-Name: e35eb8776ed539afe1d5db099470ab1124d8dd2db73ee5db7c811f8df9a9576e
* For SQLITE_ENABLE_PREUPDATE_HOOK builds, disable the optimization for adan2019-01-07
| | | | | | | | REPLACE command on a WITHOUT ROWID table with no indexes, triggers or foreign key constraints that causes SQLite to clobber any existing row without separately checking for it. This optimization causes SQLite to omit the expected pre-update-hook callbacks. FossilOrigin-Name: 6281ef974c0ac7a7133c9e1e04c09fdbd627c019c6ff3227293548caf8283864
* Give a meaningful error on an attempt to use UPSERT on a virtual table,drh2019-01-04
| | | | | rather than simply not working. FossilOrigin-Name: fa98748f956cff95fcfda3a513cea4df27aa573ae795a6855c40bfeca661d0b2
* A new implementation of sqlite3VdbeMakeLabel() is faster and makes fewerdrh2018-12-29
| | | | | | | | | memory allocations by deferring memory allocation until sqlite3VdbeResolveLabel() is called, at which point the code generator has a better idea of how big the relocation table needs to be. The sqlite3VdbeMakeLabel() routine now takes a Parse* parameter instead of Vdbe*. FossilOrigin-Name: 4a0929ac76d8aa5dd65eac3b83d6bbf41e505e01d175ca0fb2b19ba02d439415
* Do not all REPLACE to sneak a NULL value into a NOT NULL column. Detect thatdrh2018-12-22
| | | | | situation and ABORT instead. Fix for ticket [e6f1f2e34dceeb1ed61531c7e98]. FossilOrigin-Name: db8d1d12f5c1673404b2afb5426d5ea3afe3b69d01f8f2bc47ffdf70684fdf24
* Very slightly smaller and faster.drh2018-12-01
| | | FossilOrigin-Name: 27798f17f567ad065f8a99effcb287bc241df7b450330ef890d192c70528e62b
* Deploy the sqlite3Strlen30NN() function (argument guaranteed to be non-NULL) fordrh2018-10-31
| | | | | a small performance improvement. FossilOrigin-Name: 4a6ad5190b62020d97a7de02c801544f20b7b98145ceff14af1f2834d3057f9c
* Optimization: when doing an UPDATE on a table with indexes on an expression,drh2018-09-15
| | | | | | do not update the expression indexes if they do not refer to any of the columns of the table being updated. FossilOrigin-Name: a71b101635ed28a4c99734dabb20bd65ef1018c1d63ac143b7321cdb0fafa5d7
* Fix UPSERT so that it checks the target-constraint first and fires thedrh2018-08-14
| | | | | | | DO UPDATE if that constraint is violated regardless of whether or not other constraints are in violation. This aligns SQLite behavior with what PostgreSQL does. Fix for ticket [908f001483982c43cdb476dfb590a1a]. FossilOrigin-Name: 529fb55e3d00472f13446117527b0896827b11e870b581af7fe7cbb7392ef3cd
* Completely remove the column cache logic, which has been a persistent sourcedrh2018-08-03
| | | | | | | of bugs for many years. We recent enhancements to the performance of the OP_Column opcode, the removing the column cache actually makes speed-check.sh run faster. It also saves about 1,800 bytes of code space. FossilOrigin-Name: 3f5f60cd7529330209027fdae8129cca420cec1050eae50a7750d0b715b56972
* On an UPSERT when the order of constraint checks is rearranged, make suredrh2018-07-11
| | | | | | that the affinity transformations on the inserted content occur before any of the constraint checks. Fix for ticket [79cad5e4b2e219dd197242e9e5f4e]. FossilOrigin-Name: d120c45f3dc79f67afed0e44e5133569f784bc6792b15f5d79529deac2d13072
* Fix the column cache invalidation logic in the code for ROWID uniquenessdrh2018-06-11
| | | | | | constraint checking in the INSERT command. This fixes ticket [c2432ef9089ee73bd]. FossilOrigin-Name: 0b485a571c805a5bc431a231a196ff6034342c6548d92b09c52814dd57c89c75
* Do not require a statement journal in cases where REPLACE conflict handling isdan2018-05-28
| | | | | | used to insert a single row, so long as the REPLACE operation cannot fire any triggers or foreign key actions. FossilOrigin-Name: 469a62ca33081854e54f3af6d93ab5a350484b149c8c8c4ee8be0ae5418382d9
* When compiling with SQLITE_DEBUG, add run-time checks to ensure that nodrh2018-05-28
| | | | | | statement aborts unless either there have been no writes or else there is a statement journal. FossilOrigin-Name: 5a4542dbcf17a9f7fed600897555c271e1651fd50eb41d0b126725b486e1d14c
* Verify that the sqlite_sequence table exists and is in approximately thedrh2018-05-23
| | | | | | correct format prior to using it to process an autoincrement table. Fix for ticket [d8dc2b3a58cd5dc2918a1d4a]. FossilOrigin-Name: e199e859ace4f8381c6380175206e7a276e3f2228fadbbca9341bca8d2fc445d
* Add test cases for UPSERT. And a fix for a "REPLACE INTO ... ON CONFLICT"dan2018-04-20
| | | | | | statement where the new row conflicts with both the IPK and the ON CONFLICT indexes. FossilOrigin-Name: d8eb9f8d9b61400c7e12f01ef5c233257b03532221f7c7a8386f7ac2db439626
* Enhance UPSERT so that the UPDATE uses the same set of cursors as the INSERT.drh2018-04-20
| | | FossilOrigin-Name: c37f39d18d41ae5ba6c4561d87cbbf71f3b6896b86cc5cff9cdf046b02dc521a