SQLite

All files named ”src/fkey.c”
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

History for src/fkey.c

2024-08-20
19:09
[928ed2517e] part of check-in [fd72d3400a] Tighter checking of access constraints on union members in SrcItem. Improved invariant checking. (check-in: [fd72d3400a] user: drh branch: srcitem-opt, size: 59458)
2024-08-17
23:23
[849049c74a] part of check-in [9f5aeef3cb] Give unique names to fields in the SrcItem object, to facilitate analysis of how those fields are used using "grep". (check-in: [9f5aeef3cb] user: drh branch: srcitem-opt, size: 59427)
19:46
[d27603c782] part of check-in [a4c59ac3c6] Reduce the size of the SrcItem object by combining fields into a union. (check-in: [a4c59ac3c6] user: drh branch: srcitem-opt, size: 59425)
2024-05-08
17:42
[852f93c0ef] part of check-in [003e1c8c27] Allow arbitrary expressions as the second argument to RAISE(). (check-in: [003e1c8c27] user: drh branch: enhanced-raise, size: 59374)
2024-03-01
14:47
[0592046ed7] part of check-in [144e332f44] Improved handling of foreign-key constraints on a multi-drop of tables. (check-in: [144e332f44] user: drh branch: multi-drop, size: 60108)
2024-02-29
19:40
[b7ecbc98b4] part of check-in [02f9fc73ee] Attempt to fix multi-object DROP. Working better, but still not perfect. (check-in: [02f9fc73ee] user: drh branch: multi-drop, size: 59509)
2023-10-21
20:34
[a47610f0a5] part of check-in [023a9dbe83] Remove a branch that cannot affect the outcome from FkNoAction processing in fkey.c. Replace it with an assert(). (check-in: [023a9dbe83] user: drh branch: trunk, size: 59315)
19:51
[0f17beec51] part of check-in [cbea52e9ef] Check-in contains stray edit. (check-in: [cbea52e9ef] user: drh branch: mistake, size: 59309)
2023-10-20
17:06
[360a9b644e] part of check-in [fc9f82ea08] Add the SQLITE_CHANGESETAPPLY_FKNOACTION flag to sqlite3session.h, for passing to sqlite3changeset_apply_v2() to cause all foreign key constraints to behave as if they were declared NO ACTION. (check-in: [fc9f82ea08] user: dan branch: trunk, size: 59301)
2023-06-16
14:39
[a7fcbf7e66] part of check-in [365caf2f97] Address various harmless compiler warnings from forum post d526da8ee4. (check-in: [365caf2f97] user: drh branch: trunk, size: 59039)
2023-04-14
00:20
[03c134cc8b] part of check-in [bb2b5ab172] Avoid double de-quoting of table names when processing RESTRICT actions in foreign key constraints. Chromium 1405220. Problem introduced by [9e503e2d0428c9e8] 2009-09-28 for version 3.6.19. (check-in: [bb2b5ab172] user: drh branch: trunk, size: 59055)
2022-10-24
13:50
[e6408a869e] part of check-in [3d1992de47] Improve the ability of the query planner to recognize covering indexes even on tables with more than 63 columns and where the index is over columns beyond the 63rd column. (check-in: [3d1992de47] user: drh branch: branch-3.28, size: 57301)
2022-08-22
02:00
[722f20779f] part of check-in [e5eaa80e81] Add the new internal interface sqlite3DbNNFreeNN(db,ptr) where both the db and ptr parameters are guaranteed to be non-NULL. Use this where appropriate to save more than 2 million CPU cycles on the standard performance test. (check-in: [e5eaa80e81] user: drh branch: trunk, size: 58992)
2022-04-16
15:46
[d965ede15d] part of check-in [04d5b637f0] Fix a problem with "ON DELETE RESTRICT" and "ON UPDATE RESTRICT" foreign keys in attached databases scanning child tables in the wrong schema. (check-in: [04d5b637f0] user: dan branch: trunk, size: 58980)
2022-04-04
18:17
[94927f9b46] part of check-in [328dc76657] Use unpacked keys for OP_Found in foreign key processing. (check-in: [328dc76657] user: drh branch: trunk, size: 59160)
2022-01-27
16:14
[06e4ac3303] part of check-in [74fa5757ee] Give the virtual table xBestIndex method access to (some) OFFSET and LIMIT clauses. (check-in: [74fa5757ee] user: drh branch: vtab-limit-offset, size: 59253)
2022-01-02
12:01
[5b73f7a7c0] part of check-in [5232c9777f] Clear the cache of triggers used to implement CASCADE foreign key constraints whenever the schema changes. Fix for the problem identified by forum post 2831335356. (check-in: [5232c9777f] user: drh branch: trunk, size: 59250)
2021-10-07
20:46
[187b67af20] part of check-in [87e2f5eb43] Protect access to the Expr.y union using nearby assert()s and branches. (check-in: [87e2f5eb43] user: drh branch: trunk, size: 58597)
12:11
[0c57a9cd2a] part of check-in [50e08338ae] Protect every access to the Table.u union using a nearby assert() or branch. (check-in: [50e08338ae] user: drh branch: trunk, size: 58563)
2021-08-05
15:27
[1905af1821] part of check-in [832ac4c1ee] Store the collating sequence name for each column of a table as an extension to the column name, for an additional savings in the heap space needed to hold the schema. (check-in: [832ac4c1ee] user: drh branch: trunk, size: 58592)
2021-08-03
18:45
[9e2b412746] part of check-in [cbc703f70d] Improved harmony with the reuse-schema branch. (check-in: [cbc703f70d] user: drh branch: trunk, size: 58570)
16:11
[3083323d69] part of check-in [d71adc3fd8] Merge recent trunk enhancements into the reuse-schema branch. (check-in: [d71adc3fd8] user: drh branch: reuse-schema, size: 58598)
2021-08-02
18:03
[7713a4e877] part of check-in [8b781dcaf6] Refactor field names in the Column object, zCnName and zCnColl, to make them unique and thus easier to find amid all the other code. (check-in: [8b781dcaf6] user: drh branch: trunk, size: 58568)
16:41
[bcd5006ce0] part of check-in [bbb6759bcf] Refactor the Table object to reduce its memory footprint. (check-in: [bbb6759bcf] user: drh branch: trunk, size: 58531)
2021-07-31
20:30
[1df6ad2190] part of check-in [8646547e54] Refactor the way that DEFAULT expressions are stored on columns, in order to save memory in the common case where the column has no DEFAULT clause. (check-in: [8646547e54] user: drh branch: trunk, size: 58379)
2021-03-03
19:54
[6dcbab4ead] part of check-in [73bf458e1d] Merge recent trunk enhancements into the reuse-schema branch. (check-in: [73bf458e1d] user: drh branch: reuse-schema, size: 58355)
2021-02-21
21:04
[e906364839] part of check-in [bfd5bf2c73] Rename the "struct SrcList_item" object to the more succinct "SrcItem". This is a symbolic change only. The logic is unmodified. (check-in: [bfd5bf2c73] user: drh branch: trunk, size: 58353)
2021-02-10
20:20
[5e41765582] part of check-in [d29c41bd26] Merge latest trunk changes into this branch. (check-in: [d29c41bd26] user: dan branch: reuse-schema, size: 58367)
2021-02-03
14:20
[73adaca988] part of check-in [7f3b036e73] Avoid doing any foreign-key constraint related processing for an UPDATE statement that does not modify any columns that are part of FK constraints, even if the table has a self-referencing FK. (check-in: [7f3b036e73] user: dan branch: trunk, size: 58365)
2021-01-29
21:18
[02e4a33118] part of check-in [b0e3ae303d] Allow "*" wildcards in the RETURNING clause. (check-in: [b0e3ae303d] user: drh branch: returning, size: 58136)
19:32
[df06098e66] part of check-in [b7ef4dc21f] Working prototype. (check-in: [b7ef4dc21f] user: drh branch: returning, size: 58176)
2020-08-11
14:55
[6cf1e15c98] part of check-in [b1a77b7ead] Merge all changes since the 3.32.0 release into the reuse-schema branch. (check-in: [b1a77b7ead] user: drh branch: reuse-schema, size: 58139)
2020-08-10
14:18
[8337240329] part of check-in [9d670a3183] Fix harmless compiler warnings that surface in newer versions of GCC. (check-in: [9d670a3183] user: drh branch: trunk, size: 58137)
2020-02-27
15:20
[784662bc65] part of check-in [3f5650aae6] Merge latest trunk changes into this branch. (check-in: [3f5650aae6] user: dan branch: reuse-schema, size: 58092)
2020-02-07
19:44
[4b575423b0] part of check-in [bcf876e67e] During byte-code generation, strive to avoid jumps that merely jump to the following instruction. (check-in: [bcf876e67e] user: drh branch: trunk, size: 58090)
2020-01-15
14:26
[2d234423b9] part of check-in [f783917800] Merge all recent enhancements and fixes from trunk. (check-in: [f783917800] user: drh branch: reuse-schema, size: 58083)
2019-11-01
18:52
[92a248ec0f] part of check-in [f0ebea35d9] Fix a harmless compiler warning. (check-in: [f0ebea35d9] user: drh branch: trunk, size: 58081)
17:31
[89a727204b] part of check-in [b47513d2b3] The SET DEFAULT and SET NULL conflict resolution actions for foreign key constraints should cause an error when they appear on a generated column. (check-in: [b47513d2b3] user: drh branch: trunk, size: 58071)
16:08
[171e541121] part of check-in [32df5edcfe] Add another missing column number translation to the foreign key logic. (check-in: [32df5edcfe] user: drh branch: trunk, size: 57800)
12:14
[3c177deff5] part of check-in [bc6a43e7ee] Add missing column translations to foreign key logic. Ticket [c28a01da72f8957c] (check-in: [bc6a43e7ee] user: drh branch: trunk, size: 57713)
2019-10-23
00:31
[ac56f02ffe] part of check-in [3de57145a1] Fix the foreign key logic to be compatible with generated columns. (check-in: [3de57145a1] user: drh branch: generated-columns, size: 57679)
2019-10-09
17:06
[48921db21c] part of check-in [5ba8cee8f7] An alternative, experimental lookaside memory allocator that uses two different slot sizes. (check-in: [5ba8cee8f7] user: sperry branch: 2-size-lookaside, size: 57394)
2019-10-05
14:39
[6271fda517] part of check-in [17ce1c49cb] Performance optimization to the lookaside-memory disabling mechanism. (check-in: [17ce1c49cb] user: drh branch: trunk, size: 57325)
2019-08-13
15:22
[2c14c9431a] part of check-in [5b4689d89c] Merge latest trunk changes with this branch. (check-in: [5b4689d89c] user: dan branch: reuse-schema, size: 57344)
2019-08-05
18:01
[6b79f4c244] part of check-in [a29f2a7d07] Refactor field Expr.affinity into Expr.affExpr to avoid confusion with other fields and variables named "affinity" and display affExpr it in sqlite3TreeViewExpr() output. (check-in: [a29f2a7d07] user: drh branch: trunk, size: 57342)
2019-07-26
20:54
[f4ef6f813f] part of check-in [7f1e4e4b99] Merge latest changes from trunk into this branch. (check-in: [7f1e4e4b99] user: dan branch: reuse-schema, size: 57347)
2019-07-16
19:44
[ab19719004] part of check-in [9e66458592] Add new assert() statements in an attempt to help static analyzers avoid false-positives. (check-in: [9e66458592] user: drh branch: trunk, size: 57345)
2019-05-14
22:25
[4b54ea6777] part of check-in [018f3199b9] Merge all the latest trunk enhancements into the reuse-schema branch. (check-in: [018f3199b9] user: drh branch: reuse-schema, size: 57320)
2019-04-19
13:38
[0e14d4bef8] part of check-in [7713996aa9] Streamline the processing of the AND operator. Slightly smaller and faster. (check-in: [7713996aa9] user: drh branch: trunk, size: 57318)
2019-02-18
18:16
[56ceea1459] part of check-in [88cbf54eee] Ensure that creating temp schema items does not cause an OPEN_SHARABLE_SCHEMA connection to load all schemas into memory. (check-in: [88cbf54eee] user: dan branch: reuse-schema, size: 57303)
2019-02-12
19:20
[878bec1b4d] part of check-in [ea611d7cba] Share schemas between databases attached to the same database handle. (check-in: [ea611d7cba] user: dan branch: reuse-schema, size: 57300)
2019-01-17
15:40
[bd0138acdc] part of check-in [df08d472b0] Revamp the SrcList allocator routines to be methods of Parse instead of being methods of the "sqlite3" object, so that they can leave better error messages when the SrcList object grows too large. (check-in: [df08d472b0] user: drh branch: trunk, size: 57298)
2018-12-29
02:26
[aaf28be73a] part of check-in [4a0929ac76] A new implementation of sqlite3VdbeMakeLabel() is faster and makes fewer 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*. (check-in: [4a0929ac76] user: drh branch: trunk, size: 57290)
2018-12-20
17:32
[012dd7dba1] part of check-in [16fff05347] Fix a bug in the code that detects self-referencing rows as part of foreign key processing. Fix for [50d2a6c2]. (check-in: [16fff05347] user: dan branch: trunk, size: 57285)
2018-11-17
18:11
[2c112c0066] part of check-in [6d7a7e5faf] Fix further problems with the feature on this branch. (check-in: [6d7a7e5faf] user: dan branch: reuse-schema1, size: 57133)
2018-11-15
21:20
[029a6f10f7] part of check-in [31b6aee755] Fix some problems with the feature on this branch. Many problems remain. (check-in: [31b6aee755] user: dan branch: reuse-schema1, size: 57192)
2018-09-20
19:02
[972a4ba142] part of check-in [ad130bb86e] Combine the Expr.pTab and Expr.pWin fields into a union named "y". Add a new EP_WinFunc property that is only true if Expr.y.pWin is a valid pointer. This reduces the size of the Expr object by 8 bytes, reduces the overall amount of code, and shaves over 1 million cycles off of the speed test. (check-in: [ad130bb86e] user: drh branch: trunk, size: 57120)
2018-09-19
20:14
[234d4e9fb2] part of check-in [24b0f66ac6] Reduce the size of Expr to 64-bytes. This works somewhat, but there are test failures. More importantly, the size reduction from 80- to 64-bytes has not lowered the schema memory usage, but it has made the code a little bigger and a little slower. So the initial evidence is that this Expr refactoring experiment is not working... (check-in: [24b0f66ac6] user: drh branch: expr-simplify, size: 57204)
2018-07-22
00:45
[f59253c0be] part of check-in [523ff77925] Remove an unused branch in the FK logic. (check-in: [523ff77925] user: drh branch: dropViewNoStat, size: 57118)
2018-05-28
17:31
[b1da9ef8dc] part of check-in [5a4542dbcf] When compiling with SQLITE_DEBUG, add run-time checks to ensure that no statement aborts unless either there have been no writes or else there is a statement journal. (check-in: [5a4542dbcf] user: drh branch: stmt-journal-testing, size: 57085)
2017-11-14
23:48
[d617daf66b] part of check-in [3925facd94] In the parse tree, combine LIMIT and OFFSET into a single expression rooted on a TK_LIMIT node, for a small code size reduction and performance increase, and a reduction in code complexity. (check-in: [3925facd94] user: drh branch: trunk, size: 56847)
18:26
[f19ee86f39] part of check-in [b2679d3b7a] Fix the SQLITE_ENABLE_UPDATE_DELETE_LIMIT functionality so that it works with views and WITHOUT ROWID tables. This is a modified cherrypick of [dae4a97a]. (check-in: [b2679d3b7a] user: dan branch: branch-3.8.9, size: 56129)
2017-11-10
20:13
[821f70b6c4] part of check-in [72be33f9c8] Omit some extra code from non-SQLITE_ENABLE_UPDATE_DELETE_LIMIT builds. (check-in: [72be33f9c8] user: dan branch: update-delete-limit-fix, size: 56853)
2017-06-22
16:51
[5ff2c895fe] part of check-in [e4a022be4b] When generating individual loops for each ORed term of an OR scan, move any constant WHERE expressions outside of the loop, as is done for top-level loops. (check-in: [e4a022be4b] user: dan branch: or-optimization, size: 56844)
2017-04-11
19:58
[db65492ae5] part of check-in [477bea9ed0] Avoid updating unaffected indexes on a table as part of an UPDATE that requires foreign key processing in some cases. (check-in: [477bea9ed0] user: dan branch: fkey-optimization, size: 56805)
2016-12-14
14:07
[2e9aabe1ae] part of check-in [9cae4c2e30] Refactor the Table.nRef field as Table.nTabRef for easier grepping. (check-in: [9cae4c2e30] user: drh branch: trunk, size: 56287)
2016-12-13
16:57
[4f527ddd05] part of check-in [850877d1ea] Fix a problem causing SQLite to return false "foreign key violation" errors when there is a partial (i.e. WHERE constrained) UNIQUE index on the parent key columns. This bug did not cause SQLite to allow illegal data to be inserted into the database, only to reject legal operations. (check-in: [850877d1ea] user: dan branch: trunk, size: 56284)
2016-12-06
22:47
[4017dc6d8b] part of check-in [2a81763e68] Performance improvement and size reduction in the Expr node allocator function sqlite3PExpr(). (check-in: [2a81763e68] user: drh branch: trunk, size: 56258)
2016-09-23
20:59
[b9ca262f6a] part of check-in [afac0709ce] Use sqlite3ExprAlloc() instead of sqlite3PExpr() for leaf nodes in the expression tree, where appropriate. This is both smaller and faster. (check-in: [afac0709ce] user: drh branch: trunk, size: 56340)
2016-08-18
14:33
[e2be0968c1] part of check-in [92a22f0134] Rename the Db.zName field to Db.zDbSName to make it more descriptive and to distinguish it from all of the other "zName" variables scattered throughout the code. (check-in: [92a22f0134] user: drh branch: zDbSName, size: 56346)
2016-06-03
18:21
[bc41453475] part of check-in [31b83a7d7e] Fix a memory leak when a WITHOUT ROWID eponymous virtual table is used. (check-in: [31b83a7d7e] user: drh branch: without-rowid-vtab, size: 56343)
2016-03-30
14:17
[4c0bd09e60] part of check-in [9cdf813c6a] Remove a redundant test for disabling RESTRICT with defer_foreign_keys=ON. (check-in: [9cdf813c6a] user: drh branch: trunk, size: 56315)
2016-03-04
16:42
[5da47ff524] part of check-in [456df3365e] Merge recent enhancements from trunk. Default page size is 4096. Writes to statement journals are avoided. (check-in: [456df3365e] user: drh branch: sessions, size: 56396)
2016-02-25
21:38
[5cb42d9a59] part of check-in [e0d25913b7] Small optimization in FK handling. (check-in: [e0d25913b7] user: mistachkin branch: trunk, size: 56316)
19:52
[a842533c41] part of check-in [8fea116601] Disable the RESTRICT foreign key action if "PRAGMA defer_foreign_keys" is set. (check-in: [8fea116601] user: dan branch: sessions, size: 56315)
2016-02-05
13:38
[08edad1fce] part of check-in [0a802e96ab] Add the slightly faster sqlite3DbMallocRawNN(db,n) routine for the majority cases where db is guaranteed to be not NULL. (check-in: [0a802e96ab] user: drh branch: oom-handling, size: 56235)
01:55
[dc893ee37a] part of check-in [c3ef03478a] Improvements to the way that OOM errors are processed. (check-in: [c3ef03478a] user: drh branch: oom-handling, size: 56233)
2016-01-22
17:48
[c66d3e5b35] part of check-in [7323175337] Add the sqlite3TokenInit() utility function. (check-in: [7323175337] user: drh branch: trunk, size: 56368)
2016-01-21
17:25
[3fd2e17526] part of check-in [82470d1c3a] Disable the RESTRICT foreign key action if "PRAGMA defer_foreign_keys" is set. (check-in: [82470d1c3a] user: dan branch: disable-restrict, size: 56490)
2015-12-30
16:51
[e18b3dff7d] part of check-in [2081d75767] Changes to the way that the default BINARY collating sequence is recorded result in a slightly smaller and slightly faster executable. More work could be done to make this cleaner. (check-in: [2081d75767] user: drh branch: trunk, size: 56410)
2015-09-29
17:20
[3190076309] part of check-in [7d272aa62c] Use symbolic names XN_ROWID and XN_EXPR in place of the (-1) and (-2) magic numbers in Index.aiColumn[]. Add asserts to help verify that Index.aiColumn[] is always used correctly. Fix one place in FK processing where Index.aiColumn[] was not being used correctly. (check-in: [7d272aa62c] user: drh branch: trunk, size: 56427)
2015-09-03
13:46
[83e1baba99] part of check-in [847387ec8e] Add the sqlite3VdbeLoadString() and sqlite3VdbeMultiLoad() routines to help with code generation, especially on PRAGMAs. Rename sqlite3VdbeAddGoto() to just sqlite3VdbeGoto(). (check-in: [847387ec8e] user: drh branch: trunk, size: 56117)
2015-09-02
18:19
[a1d9d555c3] part of check-in [be78f413df] Add the sqlite3VdbeAddGoto(v,i) routine as a shorthand for sqlite3VdbeAddOp2(v,OP_Goto,0,i). (check-in: [be78f413df] user: drh branch: trunk, size: 56123)
2015-08-25
19:20
[3ce33dd49f] part of check-in [1ee089a72d] Use the sqlite3IndexColumnAffinity() routine to quickly and correctly find the affinity of an index column. (check-in: [1ee089a72d] user: drh branch: trunk, size: 56145)
2015-06-08
22:59
[6c5a2dbf83] part of check-in [cabf218716] Code refactoring to try to shift FROM-clause subquery manifesting until after the query planner runs. Except this does not currently work because the query planner needs an estimated of the number of rows in the manifested table. Work in progress. (check-in: [cabf218716] user: drh branch: view-optimization, size: 56139)
2015-05-21
02:20
[46f9dc13b4] part of check-in [9e3f64a4f4] Ensure that tables names are dequoted exactly once by the trigger logic. Cherrypick [59e92bd9521f1e8] and [9d887b92f8086961e]. (check-in: [9e3f64a4f4] user: drh branch: branch-3.7.11, size: 49494)
2015-05-20
20:30
[5fadcfb51f] part of check-in [bd357739d7] Ensure that tables names are dequoted exactly once by the trigger and FK logic. Cherrypick of [59e92bd9521f] and [9d887b92f808]. (check-in: [bd357739d7] user: dan branch: branch-3.8.6, size: 54447)
2015-04-21
16:38
[c9b63a217d] part of check-in [9d887b92f8] Ensure that tables names are dequoted exactly once by the trigger logic. (check-in: [9d887b92f8] user: dan branch: trunk, size: 56136)
03:13
[6040cf8889] part of check-in [59e92bd952] Fix some identifier name de-quoting issues in the foreign key and trigger logic. (check-in: [59e92bd952] user: drh branch: trunk, size: 56170)
2015-04-10
12:04
[3343d551a8] part of check-in [ed3cbaab6a] Fix foreign key CASCADE for cases where the parent key is an INTEGER PRIMARY KEY and the parent table contains other columns named "rowid", "_rowid_", and "oid". (check-in: [ed3cbaab6a] user: drh branch: trunk, size: 56197)
2014-12-17
14:38
[e0444b61be] part of check-in [210cb2a6aa] Fix some comments in fkey.c. Add tests to fkey8.test. (check-in: [210cb2a6aa] user: dan branch: experimental-fk-actions, size: 56120)
2014-12-16
20:13
[eab56799b0] part of check-in [35a20a5f22] Experimental opimizations to speed up FK constraint CASCADE and SET NULL action processing. Requires further testing. (check-in: [35a20a5f22] user: dan branch: experimental-fk-actions, size: 55464)
2014-09-06
16:39
[da985ae673] part of check-in [e62aab5e92] Fix typos in comments. No code changes. (check-in: [e62aab5e92] user: peter.d.reid branch: trunk, size: 54435)
2014-08-21
20:26
[8d81a780ad] part of check-in [14b0f561fe] Simplify the interface to the symbol table, saving 600 bytes of code space. (check-in: [14b0f561fe] user: drh branch: trunk, size: 54437)
2014-08-04
15:12
[3a8804f756] part of check-in [2f724cbac9] Changed my mind: This opcode name changes mere creates unnecessary diff marks between older and newer versions without significantly improving readability. Was: Rename the IsNull opcode to IfNull and rename the NotNull opcode to IfNotNull. (check-in: [2f724cbac9] user: drh branch: deadend, size: 54508)
2014-07-31
22:59
[8545f3b36d] part of check-in [e75b26ee35] Refactoring: Change "pIndex->onError!=OE_None" to use a macro: "IsUniqueIndex(pIndex)". Easier to understand that way. (check-in: [e75b26ee35] user: drh branch: trunk, size: 54508)
2014-05-27
18:18
[a549cff9fe] part of check-in [d16e575dac] Change the name of the Index.autoIndex field to Index.idxType and provide symbolic names for the various values of that field rather than using magic numbers. (check-in: [d16e575dac] user: drh branch: trunk, size: 54511)
2014-05-19
15:16
[abbf1c2636] part of check-in [17349a49d2] Changes to help ensure that a multiplication does not overflow when computing the number of bytes needed for a memory allocation, and cause a malfunction. No problems existing problems were discovered. However, these changes should help to ensure that no problems arise in the future. (check-in: [17349a49d2] user: drh branch: safer-malloc, size: 54532)
2014-02-19
14:20
[5269ef07b1] part of check-in [d2c047f304] Add the SQLITE_NOTNULL P5 code for comparison operations - really a composite of SQLITE_NULLEQ and SQLITE_JUMPIFNULL. This flag indicates that NULL operands are not possible and raises and assert() if NULL operands are seen. Also omit an unnecessary scan of the sqlite_sequence table when writing into an AUTOINCREMENT table. (check-in: [d2c047f304] user: drh branch: trunk, size: 54527)
2014-02-17
22:40
[3cd6ce9984] part of check-in [ce184c7bb1] Add logic to do test coverage measurements on the VDBE code. (check-in: [ce184c7bb1] user: drh branch: insert-optimization, size: 54479)
14:59
[b3da26dfcd] part of check-in [35b4d6e938] Avoid unnecessary calls to applyAffinity() during INSERT and UPDATE operations, especially for table that have indices and tables for which all columns have affinity "NONE". (check-in: [35b4d6e938] user: drh branch: insert-optimization, size: 54272)
2013-11-18
11:20
[2ab0f5384b] part of check-in [8d002740bf] Fix harmless compiler warnings from clang scan-build. (check-in: [8d002740bf] user: drh branch: trunk, size: 54290)
2013-11-08
17:13
[78364daed3] part of check-in [0077c0772a] Fix harmless compiler warnings. (check-in: [0077c0772a] user: drh branch: trunk, size: 54226)
2013-11-06
19:59
[5370840745] part of check-in [defd5205a7] Reference count the KeyInfo object. Cache a copy of an appropriate KeyInfo for each index in the Index object, and reuse that one copy as much as possible. (check-in: [defd5205a7] user: drh branch: omit-rowid, size: 54239)
2013-11-05
13:33
[c82c3aa57b] part of check-in [54b2219297] Standardize the error messages generated by constraint failures to a format of "$TYPE constraint failed: $DETAIL". This involves many changes to the expected output of test cases. (check-in: [54b2219297] user: drh branch: omit-rowid, size: 54318)
2013-11-04
13:56
[24bbd27a96] part of check-in [af128862ab] Correctly handle self-referential foreign keys on WITHOUT ROWID tables. (check-in: [af128862ab] user: drh branch: omit-rowid, size: 54356)
2013-11-03
02:27
[df809cab54] part of check-in [1315d9109c] Improved comments on foreign key logic. (check-in: [1315d9109c] user: drh branch: omit-rowid, size: 52806)
2013-11-02
22:09
[8dc2b14dd9] part of check-in [39e32187b6] Many new test cases added, that mostly work. Currently 18 errors in without_rowid3.test. Also there is a hack marked by a /*FIXME*/ comment on at fkey.c:547 that needs fixing. (check-in: [39e32187b6] user: drh branch: omit-rowid, size: 52690)
2013-10-22
18:01
[628f811772] part of check-in [a106ce86cd] The Index object now has nKeyCol and nColumn. nColumn is the total number of columns and nKeyCol is the number of key columns. Currently these always differ by one. Refactor aiColumn[] to be of type i16 instead of int. (check-in: [a106ce86cd] user: drh branch: omit-rowid, size: 52662)
2013-10-12
15:12
[5dc10cbaa3] part of check-in [27001356ed] Fix handling of "DROP TABLE" commands when "PRAGMA defer_foreign_keys=1" is set. (check-in: [27001356ed] user: dan branch: trunk, size: 52662)
2013-09-05
18:40
[be866cd8c4] part of check-in [e940b5de49] When preparing an UPDATE statement, avoid generating VDBE code for those foreign key related actions and constraint checks that may be seen to be unnecessary by considering the subset of table columns potentially modified by the UPDATE. (check-in: [e940b5de49] user: dan branch: trunk, size: 52385)
2013-07-11
12:19
[914a6bbd98] part of check-in [3a2ab74c85] Rename the SQLITE_DeferForeignKeys macro to shorter SQLITE_DeferFKs. Move the "defer_foreign_keys" pragma into the flagPragma() routine. (check-in: [3a2ab74c85] user: drh branch: sessions, size: 50000)
2013-07-04
15:22
[87619fc3a9] part of check-in [1452defb8c] Fix a bug preventing some FK constraint checking from being deferred until the end of changeset application. (check-in: [1452defb8c] user: dan branch: sessions, size: 50016)
2013-07-03
19:53
[ddd160ce0b] part of check-in [1d44e5d3c2] Experimental change to the handling of foreign key constraint violations when applying a changeset: all foreign keys, immediate and deferred, are deferred until the end of the transaction (or sub-transaction) opened by the sqlite3changeset_apply(). A single call to the conflict-handler (if any) is made if any FK constraint violations are still present in the database at this point. The conflict-handler may choose to rollback the changeset or to apply it, constraint violations and all. (check-in: [1d44e5d3c2] user: dan branch: sessions, size: 49967)
2013-02-09
13:58
[e16942bd5c] part of check-in [5461104668] Add extended error codes for constraint errors. (check-in: [5461104668] user: drh branch: constraint-error-codes, size: 49903)
2012-12-17
20:40
[5b7a12e2f8] part of check-in [0f9963526c] Enhance the error message for "foreign key mismatch" to include the names of the child and parent tables. Begin adding test cases for PRAGMA foreign_key_check. Make sure PRAGMA foreign_key_check gets all necessary table locks. (check-in: [0f9963526c] user: drh branch: foreign-key-check, size: 49817)
16:46
[21fb59849f] part of check-in [01c980e9bb] Prototype for PRAGMA that checks all foreign key constraints on a table. (check-in: [01c980e9bb] user: drh branch: foreign-key-check, size: 49734)
2012-12-08
03:34
[dcb7c37a4b] part of check-in [7b96115e81] Veryquick passes all tests now. (check-in: [7b96115e81] user: drh branch: ticket-71e333e7, size: 49712)
2012-12-07
18:38
[ddf44f8ce4] part of check-in [972443b4eb] Some errors in veryquick resolved. Many more to go. (check-in: [972443b4eb] user: drh branch: ticket-71e333e7, size: 49609)
14:02
[0ef356ae0c] part of check-in [7fafab12e4] Veryquick now runs to completion without segfaulting or asserting. But there are still lots of errors. (check-in: [7fafab12e4] user: drh branch: ticket-71e333e7, size: 49730)
2012-12-06
21:16
[ca70996e72] part of check-in [fd011cb22f] 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. (check-in: [fd011cb22f] user: drh branch: ticket-71e333e7, size: 49614)
2012-09-13
14:22
[c82a04e7a9] part of check-in [4163f5f194] Change boolean fields in the Column object from unsigned characters into bits in a single bit mask variable. (check-in: [4163f5f194] user: drh branch: trunk, size: 49602)
2012-08-25
00:49
[b792889ef2] part of check-in [865dfcbaa5] Backport check-in [62678be3df35cd]: When the same index is used for all OR-terms in a WHERE clause, then try to use that index as a covering index. (check-in: [865dfcbaa5] user: drh branch: branch-3.7.2, size: 48107)
2012-08-24
18:44
[9c77d842dc] part of check-in [a3e26038a1] Fix a problem to do with multi-or queries and automatic indexes. (check-in: [a3e26038a1] user: dan branch: multi-or-covering-index, size: 49558)
2012-07-18
16:07
[7d1ec22d72] part of check-in [defd828e90] Remove another branch from the DbMalloc() paths. (check-in: [defd828e90] user: dan branch: calloc, size: 49523)
2011-10-25
20:36
[ca7cdb310a] part of check-in [14bc58ca70] Cherrypick changes [53f5cfe115] and [1f7ef0af8d] in order to fix an issue with DISTINCT (check-in: [14bc58ca70] user: drh branch: branch-3.7.2, size: 48104)
2011-10-14
21:49
[657212460b] part of check-in [60fee9574b] Add assert() statements and eliminate needless variable assignments in order to get the clang scan-build utility to report zero problems against the SQLite core. Clang's static analysis did find one real problem - but it was in the command-line shell, not in the SQLite core. (check-in: [60fee9574b] user: drh branch: trunk, size: 49555)
2011-08-22
20:33
[9f00ea98f6] part of check-in [6c227cc853] Remove an unreachable branch in the FK code. (check-in: [6c227cc853] user: drh branch: trunk, size: 49531)
09:54
[c92c8eece2] part of check-in [3f3acee465] Fix for [b1d3a2e531]. (check-in: [3f3acee465] user: dan branch: trunk, size: 49549)
2011-07-02
13:34
[d56da9f698] part of check-in [c593792ce0] Cherrypick [45e581bff7] into the 3.7.2 branch. (check-in: [c593792ce0] user: dan branch: branch-3.7.2, size: 48105)
2011-06-30
20:17
[c8492fed77] part of check-in [f7ba0219ef] Experimental changes to improve optimization of DISTINCT queries. (check-in: [f7ba0219ef] user: dan branch: experimental, size: 48645)
2011-06-10
16:33
[9fabba17a4] part of check-in [442d8d8bfe] Fix minor problems with foreign key constraints where the parent table is the same as the child table. (check-in: [442d8d8bfe] user: dan branch: trunk, size: 48642)
2011-04-05
13:12
[a43ba8a005] part of check-in [5db4511d8a] Merge the scheme-parse-refactor changes into trunk: (1) added sqlite3SchemaMutexHeld() asserts, (2) Use -1 instead of 0 to mean "all" in sqlite3ResetInternalSchema(), and other cosmetic changes. (check-in: [5db4511d8a] user: drh branch: trunk, size: 48088)
12:25
[8ab7ace42f] part of check-in [bf664b206b] Fix the P4_TRANSIENT constant so that it works correct - so that it really makes a copy of the string for the P4 argument. Use P4_TRANSIENT wherever appropriate. Change P4_STATICs of schema names to P4_TRANSIENT. (check-in: [bf664b206b] user: drh branch: trunk, size: 48021)
2011-04-04
18:22
[387c9b458e] part of check-in [ae8374af05] Add a description of access rules for the Schema object and lots of asserts to verify that the access rules are followed. (check-in: [ae8374af05] user: drh branch: schema-parse-refactor, size: 48078)
2011-03-06
21:28
[418b840007] part of check-in [01a79d5a7a] Remove dead code identified by the clang static analyzer. (check-in: [01a79d5a7a] user: drh branch: trunk, size: 48011)
2010-09-28
00:25
[17950a28f2] part of check-in [d0342f4bb9] Continuing work toward detecting and fixing shallow-copy misuse. (check-in: [d0342f4bb9] user: drh branch: bug-b351d95f9c, size: 48101)
2010-07-29
01:50
[58bbf52c6d] part of check-in [53902f7d4a] Correct handling of compound foreign key constraints that include the integer primary key as one of the columns. Ticket [ce7c133ea6cc9ccdc1] (check-in: [53902f7d4a] user: drh branch: trunk, size: 48102)
2010-07-24
11:28
[cacfe3e24b] part of check-in [9aa30342f4] Experimental code to measure memory consumed by database schemas and prepared statements. (check-in: [9aa30342f4] user: dan branch: experimental, size: 48067)
2010-07-23
17:06
[62eed881a2] part of check-in [5c58f44aeb] Remove additional traces (mostly in comments) of the Table.dbMem field. (check-in: [5c58f44aeb] user: drh branch: trunk, size: 48012)
15:41
[31b8dc8e73] part of check-in [6eddc6e601] Remove the Table.dbMem variable, as it is no longer being used for its original purpose. (check-in: [6eddc6e601] user: dan branch: trunk, size: 48224)
2009-11-12
19:59
[e2116672a6] part of check-in [b9eab885cd] Enhance the OP_Found and OP_NotFound opcodes so that they can accept an array of registers as an unpacked record in addition to a record built using OP_MakeRecord. Use this to avoid OP_MakeRecord calls during IN expression processing. (check-in: [b9eab885cd] user: drh branch: trunk, size: 48238)
2009-10-13
13:08
[41219cba18] part of check-in [5d381daa6e] Suppress some harmless compiler warnings. (check-in: [5d381daa6e] user: drh branch: trunk, size: 48232)
2009-10-12
22:30
[34ee2b0d60] part of check-in [634ef4fc9f] Add asserts as evidence that all FK constraints are either immediate or deferred. (check-in: [634ef4fc9f] user: drh branch: trunk, size: 48221)
20:01
[2b79b3851b] part of check-in [a4ab5215fe] When processing FK constraints on changes to parent tables, make sure the names of child tables appear correctly in the output of EXPLAIN QUERY PLAN. (check-in: [a4ab5215fe] user: drh branch: trunk, size: 48096)
2009-10-07
16:04
[6d27707f81] part of check-in [5caa4a2b05] Add a missing OP_Close opcode to VDBE programs that check for FK constraint violations. (check-in: [5caa4a2b05] user: dan branch: trunk, size: 47995)
2009-10-03
07:04
[720f049dc4] part of check-in [3c24df38e6] Handle an SQLITE_IGNORE returned when requesting authorization to read parent key columns by pretending the parent key columns contain NULL values. (check-in: [3c24df38e6] user: dan branch: trunk, size: 47955)
2009-10-02
14:23
[bcc2af88a4] part of check-in [9842f2d5f6] When inserting a row into a child table, invoke the authorization callback to request permission to read the parent key columns. (check-in: [9842f2d5f6] user: dan branch: trunk, size: 47490)
2009-10-01
16:09
[b20074e0dc] part of check-in [edff350005] If an update does not modify any child or parent key columns, omit foreign key processing for the statement. (check-in: [edff350005] user: dan branch: trunk, size: 47216)
2009-09-30
08:11
[8b438b1fda] part of check-in [0a0a17d87c] Remove unreachable branches from fkey.c. Add a few tests to cover the remaining branches. (check-in: [0a0a17d87c] user: dan branch: trunk, size: 46423)
2009-09-29
16:38
[e1128e8d23] part of check-in [9a4b7ec292] Use the affinity and collation sequence associated with the parent key when finding child table rows to apply a foreign key action to. (check-in: [9a4b7ec292] user: dan branch: trunk, size: 46663)
15:41
[aed9dc4cb0] part of check-in [64154174cf] Check that a unique index uses the default collation sequences for each column before using it as part of a foreign key constraint operation. (check-in: [64154174cf] user: dan branch: trunk, size: 46453)
11:28
[93b4f9a948] part of check-in [582bd76828] Remove an unused variable from fkey.c. (check-in: [582bd76828] user: dan branch: trunk, size: 45756)
2009-09-28
18:52
[e31715c14b] part of check-in [5b4d46374a] Ignore foreign key mismatch errors while compiling DROP TABLE commands. (check-in: [5b4d46374a] user: dan branch: trunk, size: 46033)
14:49
[8c5deb1775] part of check-in [8353808c9e] Fix the DROP TABLE command so that it cannot be used to bypass foreign key constraints (if foreign key support is enabled). (check-in: [8353808c9e] user: dan branch: trunk, size: 45687)
11:54
[5bbe13f5d9] part of check-in [9e503e2d04] Fix some foreign key constraint related problems that occur when a row refers to itself. (check-in: [9e503e2d04] user: dan branch: trunk, size: 43372)
2009-09-26
17:51
[ee4e0d2465] part of check-in [b4a10c39e7] When ALTER TABLE RENAME TO is used to change the name of a table that is the parent table of a foreign key constraint, modify that foreign key constraint to use the new table name. (check-in: [b4a10c39e7] user: dan branch: trunk, size: 41490)
2009-09-25
17:03
[542de974e3] part of check-in [519144ac43] Avoid checking if an insert or delete has "fixed" an outstanding FK constraint violation if the constraint counter indicates that the database contains no such violations. (check-in: [519144ac43] user: dan branch: trunk, size: 41452)
12:00
[8719d0fa09] part of check-in [9fd54b0aa7] Fix comments in fkey2.c to reflect the immediate-constraint-counter approach. (check-in: [9fd54b0aa7] user: dan branch: trunk, size: 40886)
2009-09-24
18:19
[5ec139b6d2] part of check-in [76e8e74b49] Fixes and test cases to make sure the affinity and collation sequence associated with the parent key is used when comparing it with a child key value. (check-in: [76e8e74b49] user: dan branch: trunk, size: 39637)
15:16
[d5610f840b] part of check-in [8a000a8aae] Fix a problem in fkey.c when a child key is the IPK of its table. (check-in: [8a000a8aae] user: dan branch: trunk, size: 38786)
14:27
[ba7fa13d98] part of check-in [3656896335] Remove the ALWAYS() added by the previous check-in. It is not needed. (check-in: [3656896335] user: drh branch: trunk, size: 38798)
13:48
[3a5f73fd9a] part of check-in [d5b714cfff] Comment enhancements. Add an ALWAYS macro in fkey.c to indicate a branch that is always taken. (check-in: [d5b714cfff] user: drh branch: trunk, size: 38840)
2009-09-23
18:07
[a1c293cca2] part of check-in [e0a48d5311] Fix a problem with FK constraints that implicitly map to a composite primary key. (check-in: [e0a48d5311] user: dan branch: trunk, size: 38759)
17:30
[8923275841] part of check-in [1a32149cc3] Do not check immediate foreign key constraints until the end of the statement. This matches the postgres behaviour. (check-in: [1a32149cc3] user: dan branch: trunk, size: 38855)
13:59
[9a0afe076c] part of check-in [a5f7e71f42] Disallow using the implicit rowid column as the parent key of an FK constraint. (check-in: [a5f7e71f42] user: dan branch: trunk, size: 38791)
12:06
[320b318d31] part of check-in [7d086afe69] Add extra tests for foreign key support. (check-in: [7d086afe69] user: dan branch: trunk, size: 38923)
08:43
[da1a63c1cb] part of check-in [540c2d18e1] Add missing comments to fkey.c. Also, change the terminology used for comments and names in fkey.c from "referenced/referencing" to "parent/child". This is arguably less correct, but is easier to follow. (check-in: [540c2d18e1] user: dan branch: trunk, size: 38951)
03:01
[de29694234] part of check-in [71ac8e28e5] Do not run ON UPDATE actions of a foreign key constraint unless at least one column value really does change. (check-in: [71ac8e28e5] user: drh branch: trunk, size: 31648)
2009-09-22
16:55
[fa1ad14492] part of check-in [e2bc51bc61] Fix another OOM related problem in fkey.c. (check-in: [e2bc51bc61] user: dan branch: trunk, size: 30668)
16:08
[db2225a0d7] part of check-in [9406995055] Fix a problem with ON DELETE SET DEFAULT actions. (check-in: [9406995055] user: dan branch: trunk, size: 30564)
15:53
[2c20574e7c] part of check-in [635d6a775a] Fix an OOM related crash in fkey.c. (check-in: [635d6a775a] user: dan branch: trunk, size: 30576)
2009-09-21
18:56
[6aad270ae5] part of check-in [8412905262] Fix a problem with foreign key constraints that map from and IPK column. (check-in: [8412905262] user: dan branch: trunk, size: 29691)
16:06
[0f06ecda52] part of check-in [fb6ceed388] Fix compilation with OMIT_TRIGGER defined. Ticket [1ff6d29030]. (check-in: [fb6ceed388] user: dan branch: trunk, size: 29442)
2009-09-19
17:00
Added: [77a358c505] part of check-in [d5d3998118] Check in implementation of foreign key constraints. (check-in: [d5d3998118] user: dan branch: trunk, size: 29302)