drh
92e21ef079
Include the original text of the CHECK constraint in the error message for
...
anonymous CHECK constraints.
FossilOrigin-Name: 5ce34a955bb36d77edc9951cb7ac2ef9c876d7d3ff5852af682f558e248f428c
2020-08-27 18:36:30 +00:00
drh
9e5fdc41c1
Release some restrictions on columns added by ALTER TABLE so that they
...
only apply if the table contains one or more rows.
FossilOrigin-Name: 3a16c0ce4d8851f79f670d94786032c8007619154ece44647dc9cc5b1f9654ff
2020-05-08 19:02:21 +00:00
drh
171c50ec38
New test-only SQL functions: implies_nonnull_row(), expr_compare(), and
...
expr_implies_expr(). The SQLITE_TESTCTRL_INTERNAL_FUNCTIONS test-control
is modified to toggle internal function access on and off for a single
database connection.
FossilOrigin-Name: 473892a8eceacf24d57fd0c72ff2a0b8be4e0d75e0af7a30bdb24fbc3b453601
2020-01-01 15:43:30 +00:00
drh
eea8eb6d04
Do not allow direct access to internal-use SQL functions such as
...
sqlite_rename_column() and sqlite3_rename_table() except when the
new SQLITE_TESTCTRL_INTERNAL_FUNCTIONS flag is set.
FossilOrigin-Name: 6e1330545e7b74fe5f1f20751a3425e2788441485fc07fcb7626e448c72027ce
2018-11-26 18:09:15 +00:00
dan
5921f2b9e7
Fix some test script errors. And an incorrect assert() in fts5.
...
FossilOrigin-Name: f804336f083d8d26314bb1ba34cec427675065a67cbe2bf00bb42e40752aeb33
2018-09-05 17:45:17 +00:00
dan
141e119a17
Ensure b-tree mutexes are always held when sqlite3FindTable() is called. Do
...
not invoke the authorizer callback when parsing schema items as part of ALTER
TABLE commands. Fix test script issues.
FossilOrigin-Name: eac2aa7dce577f1998cc2078dd8ac384070f8acf1ceb565999a5cf719092024e
2018-08-31 18:23:53 +00:00
drh
e0a04a36a6
All temp.sqlite_master to be used as an alias for sqlite_temp_master.
...
FossilOrigin-Name: 8d646905b830d5bb29092e103ac5cb499b3c7e5a
2016-12-16 01:00:21 +00:00
drh
ab4e7f3337
Make sure all cursors are closed when returning from a VDBE subprogram that
...
implements a foreign-key construct.
FossilOrigin-Name: d04d354d8e423961c3091b6ebcfbbbf10d3ecb04
2015-04-16 18:11:50 +00:00
drh
e06874eaa1
Make sure errors in coding triggers are propagated back up to the parser.
...
FossilOrigin-Name: 928f973ca9adc7933015b2fb6b6fcb8e3154cb9c
2015-04-16 15:47:06 +00:00
drh
e918aaba98
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".
FossilOrigin-Name: ed3cbaab6ad49b0cb5b17e44def26c866919387a
2015-04-10 12:04:57 +00:00
drh
32c6a48b5e
Add support for the extra parameter on the sqlite3_set_authorizer() callback
...
and support for failing an ATTACH with an authentication-required database
using bad credentials. The extension is now feature complete, but much
testing and bug-fixing remains.
FossilOrigin-Name: 596e728b0eb19a34c888e33d4d37978ca2bf1e00
2014-09-11 13:44:52 +00:00
drh
f9c8ce3ced
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.
FossilOrigin-Name: 54b221929744b1bcdbcc2030fef2e510618afd41
2013-11-05 13:33:55 +00:00
drh
00012df46d
Add the conflict2.test script. Fix issues discovered by this script.
...
FossilOrigin-Name: 294ed33756b06375e56c41f1088d42ee48adbdc8
2013-11-05 01:59:07 +00:00
drh
433dccfb52
Rename SQLITE_CONSTRAINT_RAISE to SQLITE_CONSTRAINT_TRIGGER. Put the
...
extended constraint error codes in alphabetical order. Add many test cases
for the extended constraint error codes.
FossilOrigin-Name: 3f67437536591a1b0742a25b983707933aaa16d5
2013-02-09 15:37:11 +00:00
drh
9148defa61
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.
FossilOrigin-Name: 0f9963526c299757ff95c153fb05a67cddb6af28
2012-12-17 20:40:39 +00:00
drh
602acb4871
Add the SQLITE_OMIT_AUTORESET compile-time option which if enabled causes
...
the sqlite3_step() routine to return SQLITE_MISUSE if it is called after
it has previously returned anything other than SQLITE_ROW, SQLITE_BUSY, or
SQLITE_LOCKED.
FossilOrigin-Name: 053ce76deb356d31358454507ba94947142e20ca
2011-01-17 17:42:37 +00:00
drh
6cbda64d07
Correct handling of compound foreign key constraints that include the
...
integer primary key as one of the columns.
Ticket [ce7c133ea6cc9ccdc1]
FossilOrigin-Name: 53902f7d4a46aa70ecc5bf180a01ff888d52686a
2010-07-29 01:50:38 +00:00
dan
a7a0c615d7
Add tests to fkey2.test to check that ON CONFLICT clauses do not affect SQLite's behaviour when an FK constraint is violated.
...
FossilOrigin-Name: e9e5b1001986348ef0f88c19de87b94559a5451e
2010-05-29 08:40:37 +00:00
drh
5c092e8a4f
Make sure the value of an INTEGER PRIMARY KEY column supplied to triggers
...
and especially to FK constraints really contains the ROWID and not the
NULL that is stored in the column itself. Ticket [dd08e5a988d00dec].
FossilOrigin-Name: 636f86095eb1f4bdcfb0c9ed846c4c6b3589c10b
2010-05-14 19:24:02 +00:00
dan
6908343c65
Zero the "immediate FK constraint counter" associated with a statement object when sqlite3_reset() is called. Fix for [c39ff61c43].
...
FossilOrigin-Name: f660be615a0c1f4641782a83744533f5d3119218
2010-04-29 22:57:56 +00:00
drh
3674bfd1b6
Change sqlite3_step() so that it automatically calls sqlite3_reset() instead
...
of returning SQLITE_MISUSE when invoked on a prepared statement that
previously returned any value other than SQLITE_ROW.
FossilOrigin-Name: 3e646e3f4cd0ca288e444561e951cecfdaee2ab5
2010-04-17 12:53:19 +00:00
drh
9a6ffc845b
Fix the ALTER TABLE RENAME command so that it converts FOREIGN KEY constraints
...
in ATTACH-ed and in TEMP tables as well as in the main database.
Ticket [13336e9c3c8c3f].
FossilOrigin-Name: ab197d0aaf18016ac2dd3674f49bea5f1556451c
2010-02-15 18:03:20 +00:00
dan
f589450dc9
Add some tests of statements in foreignkeys.html.
...
FossilOrigin-Name: 8382867956caf20f62c46c15b456c1c16d0824fd
2009-10-07 18:41:19 +00:00
dan
02470b20f3
Handle an SQLITE_IGNORE returned when requesting authorization to read parent key columns by pretending the parent key columns contain NULL values.
...
FossilOrigin-Name: 3c24df38e6ae5dfe999bbf3133b65df0074c6a50
2009-10-03 07:04:11 +00:00
dan
251ad6e1c5
Add one more authentication test to fkey2.test to cover an untested branch.
...
FossilOrigin-Name: e4fa8be770eb79806d489be46f68f969de17378b
2009-10-02 15:29:10 +00:00
dan
47a06346ff
When inserting a row into a child table, invoke the authorization callback to request permission to read the parent key columns.
...
FossilOrigin-Name: 9842f2d5f606eb8f641ecae9fbc5368b8d7e4286
2009-10-02 14:23:41 +00:00
dan
3d7b046996
Add test cases to cover the branches added by the previous commit.
...
FossilOrigin-Name: aaa005b6da222f711f201c453d28f5be40e9c601
2009-10-01 17:13:31 +00:00
dan
e7a94d8128
If an update does not modify any child or parent key columns, omit foreign key processing for the statement.
...
FossilOrigin-Name: edff3500058eb8ad2381f855ef7a09ecb680f7b8
2009-10-01 16:09:04 +00:00
dan
d583502e7d
Add tests to check that FK support interacts with count-changes correctly.
...
FossilOrigin-Name: 5b8366154b2a91c1be3e7e52ec270ecdfe7d2bb1
2009-10-01 04:35:05 +00:00
dan
f7a94543b8
Remove unreachable branches from fkey.c. Add a few tests to cover the remaining branches.
...
FossilOrigin-Name: 0a0a17d87c990a811a2755b9d9d4141b611b49db
2009-09-30 08:11:07 +00:00
dan
652ac1d0a7
Use the affinity and collation sequence associated with the parent key when finding child table rows to apply a foreign key action to.
...
FossilOrigin-Name: 9a4b7ec2928307e88783223903c842accaff7ccf
2009-09-29 16:38:59 +00:00
dan
9707c7b104
Check that a unique index uses the default collation sequences for each column before using it as part of a foreign key constraint operation.
...
FossilOrigin-Name: 64154174cf8a53bd9be818db53cb0e586c5d24cb
2009-09-29 15:41:57 +00:00
dan
792e92012f
Remove an unused variable from fkey.c.
...
FossilOrigin-Name: 582bd7682831362cd0e2f91ac0dba5ab2b7e2983
2009-09-29 11:28:51 +00:00
dan
856ef1a5f9
Various fixes so that "make test" works with OMIT_FOREIGN_KEY, OMIT_TRIGGER and OMIT_ALTER_TABLE.
...
FossilOrigin-Name: e4eb227b14e4bfcb9f7f284692a391b7355f0204
2009-09-29 06:33:23 +00:00
dan
f0662567fa
Ignore foreign key mismatch errors while compiling DROP TABLE commands.
...
FossilOrigin-Name: 5b4d46374a8e808246a1813c12c36c4a75371898
2009-09-28 18:52:11 +00:00
dan
d66c83095e
Fix the DROP TABLE command so that it cannot be used to bypass foreign key constraints (if foreign key support is enabled).
...
FossilOrigin-Name: 8353808c9e70412fdee31bfda7810e948f1c7485
2009-09-28 14:49:01 +00:00
dan
9277efa3d5
Fix some foreign key constraint related problems that occur when a row refers to itself.
...
FossilOrigin-Name: 9e503e2d0428c9e8df878c7c6594790232cca4e0
2009-09-28 11:54:21 +00:00
dan
432cc5b9f3
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.
...
FossilOrigin-Name: b4a10c39e726dc190e9597e382baddc034294114
2009-09-26 17:51:48 +00:00
dan
0ff297eaa7
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.
...
FossilOrigin-Name: 519144ac437b5842e4213f0e81e05c709939c2ab
2009-09-25 17:03:14 +00:00
dan
bd74783270
Fix comments in fkey2.c to reflect the immediate-constraint-counter approach.
...
FossilOrigin-Name: 9fd54b0aa73ed74c65f7db53cb666752f13263f9
2009-09-25 12:00:01 +00:00
dan
53c3fa8dbe
Prevent ALTER TABLE from being used to add a column with a REFERENCES clause and a non-NULL default value while foreign key support is enabled.
...
FossilOrigin-Name: 353b1b18253ab71ba38a887e555994f5469b87bd
2009-09-25 11:26:54 +00:00
dan
140026bdb5
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.
...
FossilOrigin-Name: 76e8e74b49be4c80b9fb20d52e9b39db8001362e
2009-09-24 18:19:41 +00:00
dan
1bea559a94
Ensure foreign key related processing takes place when rows are deleted from the database by REPLACE conflict handling.
...
FossilOrigin-Name: 3f40c142c8526c1572020bd4d945c03a72019135
2009-09-24 11:31:21 +00:00
dan
32b09f29c9
Do not check immediate foreign key constraints until the end of the statement. This matches the postgres behaviour.
...
FossilOrigin-Name: 1a32149cc3c722058f4ed4c81edadeb6ce5bc9e4
2009-09-23 17:29:59 +00:00
dan
d981d44781
Disallow using the implicit rowid column as the parent key of an FK constraint.
...
FossilOrigin-Name: a5f7e71f424900071a3925e53e9128c9148ea2e8
2009-09-23 13:59:17 +00:00
dan
a8f0bf643e
Add extra tests for foreign key support.
...
FossilOrigin-Name: 7d086afe69da4d03bd1de5408626858273f91e8f
2009-09-23 12:06:52 +00:00
dan
934ce300a0
Fix a problem with ON DELETE SET DEFAULT actions.
...
FossilOrigin-Name: 9406995055f53639b0af46985c7b0a24a80308ae
2009-09-22 16:08:58 +00:00
dan
29c7f9caac
Fix an OOM related crash in fkey.c.
...
FossilOrigin-Name: 635d6a775a3f192d4292738905f5e01bc956a712
2009-09-22 15:53:47 +00:00
dan
3606264bc9
Fix a problem with foreign key constraints that map from and IPK column.
...
FossilOrigin-Name: 84129052623dc6a175c76db602ab07fa3e57f1eb
2009-09-21 18:56:23 +00:00
dan
75cbd984f7
Fix compilation with OMIT_TRIGGER defined. Ticket [1ff6d29030e9757d052af0f394e56bea96b8b59b|1ff6d29030].
...
FossilOrigin-Name: fb6ceed388f6d75bdc2ac2f43e5c98da74e2a448
2009-09-21 16:06:03 +00:00