dan
c50f75df96
Fix a problem with ALTER TABLE when there are views or triggers in the schema
...
that contain "<expr> IS NULL" expressions.
FossilOrigin-Name: 91aab32e71fcb924e24c02d5f0901f7a474760fc993a7e7436e667512cf5d3c3
2018-09-06 18:56:36 +00:00
dan
1041a6a817
Fix a problem in ALTER TABLE with SQLITE_OMIT_VIRTUALTABLE builds.
...
FossilOrigin-Name: fa835145e63749e06e04bd50ff992afaeae05dcdd1df597d13911f944e62076b
2018-09-06 17:47:09 +00:00
dan
7ea1edb703
Fix test script problems causing SQLITE_OMIT_VIRTUALTABLE builds to fail.
...
FossilOrigin-Name: 37ad064e5f5704cf345d23b38b3f6d627fbcf20dbb78c8a91e96c9704760a1b8
2018-09-06 17:23:08 +00:00
dan
71998f03b5
Add new test file "alterauth.test".
...
FossilOrigin-Name: 00940265b18a3cf848602e1e0b3edbd935cb4309ef91a34b0d5746a258a47ae6
2018-09-06 16:24:23 +00:00
dan
1d85c6bf48
Ensure that the tbl_name column in the sqlite_temp_master table is updated
...
correctly as part of a RENAME TABLE operation.
FossilOrigin-Name: ffecfca511718e39e0003b380d5113755b8a11405a5bd80cc04503d9557f0842
2018-09-06 16:01:37 +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
65372fa963
Improve the error messages emitted by RENAME TABLE.
...
FossilOrigin-Name: 6805b5900df5e6d3329cbad2660875ebe4069efe37b19575f527d153dc0882a1
2018-09-03 20:05:15 +00:00
dan
143df55d24
Add another test case to altertab.test.
...
FossilOrigin-Name: 828e8849faed85812c03215b00a2ba34cbb00dfa4d4afdcbd11300ba7fcf9743
2018-09-01 20:38:42 +00:00
dan
b87a9a8a5e
Fix a problem with renaming a column in a table that has a temp trigger that
...
references another attached database.
FossilOrigin-Name: 336b8a0923bf65b7a2c35811cb6dec0e262a0b31e534d2a6ab093d2afdb05c1f
2018-09-01 20:23:28 +00:00
drh
010f8ee2fb
Merge fixes from the alter-table-rename-column branch that occurred after
...
this branch separated from that one.
FossilOrigin-Name: 22e785aa2bbce4ae0852bc3d127d4b12222a192eb6e3ee874bf8e5c8582d05f3
2018-09-01 15:55:44 +00:00
drh
c840b428fc
Merge fixes and enhancements from trunk.
...
FossilOrigin-Name: 589186c083ff3af8d5a6d5ad34e1cefea57806ebf3831ea3bf5a48ef1e173140
2018-09-01 15:49:13 +00:00
dan
6ae2454a67
Update test script snapshot_fault.test to account for the new
...
sqlite3_snapshot_open() error code.
FossilOrigin-Name: c1aca7673ab04740bc8ad76af0a72a229c79a0cd51cf84d1c689a77424ff17c6
2018-09-01 06:13:07 +00:00
dan
8d4b7a3fa8
If a call to sqlite3_snapshot_open() fails because the requested snapshot no
...
longer exists, return SQLITE_ERROR_SNAPSHOT instead of SQLITE_BUSY_SNAPSHOT.
FossilOrigin-Name: e07923128bb164efbafde29d49175b61f2ef44b2dfac5ae4ed61937945dfcf4c
2018-08-31 19:00:16 +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
dan
9d324823a8
Test the schema after renaming a table. Ensure that temp database triggers and
...
views are updated when renaming a column.
FossilOrigin-Name: f3c27d916d4837f8fc3dd812bd004535f04c7a53bd2a0a2419613275f48bec76
2018-08-30 20:03:44 +00:00
dan
0ccda96867
Fix an ALTER TABLE problem with processing temp schema views and triggers.
...
FossilOrigin-Name: 72cfb1be29971d91a164f1d4f20cb054de68960a0bd547630bcd1160565971c5
2018-08-30 16:26:48 +00:00
dan
c9461ecc28
Extend RENAME TABLE to edit triggers and views. Still buggy.
...
FossilOrigin-Name: 01308bae3acf33f78b5bb90892085eab340df093aafc17e6ccf6a7d6cf324897
2018-08-29 21:00:16 +00:00
drh
8ab114c6a9
Disable the server1.test script on old PPC Macs due to problems in the
...
pthreads implementation on those archaic machines.
FossilOrigin-Name: 43efdd8c7e468405c9d4956a8caa66548059499289cbcc091628de7b055268cd
2018-08-28 21:12:02 +00:00
dan
f5778751f7
Fix a problem causing spurious SQLITE_CORRUPT errors when using the snapshot
...
API to read from old database snapshots.
FossilOrigin-Name: 535155be584ad8c1836e6b1c62de836d9872056d39608c995221c928cb5b365d
2018-08-28 11:23:52 +00:00
drh
050398bdf1
Fix a minor issue in the altercol.test script so that it runs on Windows.
...
FossilOrigin-Name: 62089c6daf9ea51be769c077c23d6fa881ba797255fa22d71baaac191a9c1ba7
2018-08-25 16:22:33 +00:00
drh
0d019b9243
Invoke the authorizer for ALTER TABLE RENAME COLUMN.
...
FossilOrigin-Name: fc293bcb3402f049fb9e22aacfb4fdcd13f8609edf29c97d6cb95ce351363873
2018-08-25 16:14:46 +00:00
dan
aa42e9816b
Fix a problem by renaming a column when the schema contains an trigger program
...
featuring an UPSERT that uses an "excluded.*" reference to a different table.
FossilOrigin-Name: 83d5f5abce6be2f6d342a6fc68839289400d7bcb80eaa38194789142c93a80c3
2018-08-24 20:20:33 +00:00
dan
85a9d508df
Fix a problem with renaming a column that occurs as an "excluded.colname"
...
construction in an UPSERT that is part of a trigger program.
FossilOrigin-Name: bb2f7234968157b605522dea8e115d8772ab4234147894089d6e48fedf5d6a5d
2018-08-24 20:10:22 +00:00
dan
0d5fa6b979
After modifying and reparsing the schema as part of an ALTER TABLE RENAME
...
COLUMN, check that no new schema errors have been introduced (e.g. ambiguous
column names in views) before committing the operation.
FossilOrigin-Name: a0e06d2c5e3abb3f300491e7651bb177a436899efd4506de9239359096b6a9e7
2018-08-24 17:55:49 +00:00
dan
1b0c5de434
Avoid incorrectly replacing tokens that refer to a column being renamed via an
...
alias. For example, do not overwrite "xyz" when "a" is renamed in "CREATE VIEW
v1 AS SELECT a AS xyz FROM tbl WHERE xyz=1"
FossilOrigin-Name: ad072a835f97ff418f5919d94f547ce8afb4fc7c7b590deba41f1e62136a79ac
2018-08-24 16:04:26 +00:00
drh
355f2e02e9
Add the "atrc" test program to the Makefiles. Fix a typo in the instructions
...
in the header comment of the atrc program.
FossilOrigin-Name: 2130a407ddd8cdf3d29b109d773686c84906d9dc1663376e94e191086d524c9e
2018-08-23 20:09:19 +00:00
drh
79a5ee93c7
Fix harmless compiler warnings in the ALTER TABLE logic. Rephrase an
...
error message to use active voice.
FossilOrigin-Name: a7dae59a7e7b187fa2e9457bbb4b01cfe3d48bbdf59c3f8f7b4156bcde3bda98
2018-08-23 19:32:04 +00:00
dan
79e9d34764
Fix a test case that was failing for SQLITE_ENABLE_STAT4 builds.
...
FossilOrigin-Name: 1e29fd430dead641c5d92943ce81cf51b3df2f45c5a011bb2eed592efd62e056
2018-08-21 17:03:25 +00:00
dan
0624939818
Rationalize some duplicated code in alter.c. Also improve error messages for
...
ALTER TABLE RENAME COLUMN in some cases.
FossilOrigin-Name: 5d2163c734aea8c0e1611af1161734bf141e7bd02c08f0b5f2e7bac3c7dfd2a5
2018-08-21 15:06:59 +00:00
dan
b013738b4c
Add further tests for RENAME COLUMN.
...
FossilOrigin-Name: 82c4c10a96db76f39edf5f6d027294d449d75b5a18da70da3667786da90e184d
2018-08-20 20:01:01 +00:00
dan
9d70557e80
Ensure that it is not possible to rename columns of system tables, views or
...
virtual tables.
FossilOrigin-Name: 786b5991dc0bb6ba13327a3ac9d04efbf8b591dedc736b719b206ffd865b1918
2018-08-20 16:16:05 +00:00
drh
2ee001ab39
Merge trunk fixes.
...
FossilOrigin-Name: ccad277927baa2c36d0b5a03832dc51d9a7f3071587f0da0f2c1b44885c82e8d
2018-08-18 18:14:02 +00:00
dan
24fedb94c2
Improvements to error handling in ALTER TABLE RENAME COLUMN.
...
FossilOrigin-Name: 7fa1faeaff30b74b68ee6f4b363d837f21cf313d8262361c901bda884df139a2
2018-08-18 17:35:38 +00:00
dan
499b825487
Allow an ALTER TABLE RENAME COLUMN to proceed even if the schema contains a
...
virtual table for which the module is unavailable.
FossilOrigin-Name: 7b72b2360a70eb1f788b3c4d745967dfedb2c80af6b2e146ba940a3741fd51a1
2018-08-17 18:08:28 +00:00
dan
dabc268f96
Ensure that CREATE VIEW, TRIGGER or INDEX statements can be edited by ALTER
...
TABLE RENAME COLUMN even if they use collation-sequences or
user-defined-functions that are not available.
FossilOrigin-Name: 540014efd6a048373313c6cd9413de10d5d7114daf537cf5999ccf3c5c3f9358
2018-08-17 17:18:16 +00:00
dan
0cbb0b11f1
Further progress on updating trigger programs as part of ALTER TABLE RENAME
...
COLUMN.
FossilOrigin-Name: 3f47222b6e20e1c1ef41c0f7391c8b5c7648e2a2d6013303d155ad59ce27143a
2018-08-16 19:49:16 +00:00
drh
d8852095e0
Fix EXPLAIN QUERY PLAN so that it describes IN operators implemented using
...
a ROWID lookup.
FossilOrigin-Name: 60045fbf52162f15f2e18a4e392e80fab19bdbce242728b5e62b0894eac49dfd
2018-08-16 15:29:40 +00:00
dan
5be60c55e8
(no comment)
...
FossilOrigin-Name: e272dc2b1c0edab59a40f32c77c81a3e636937280524161eff5669cb0046ad84
2018-08-15 20:28:39 +00:00
dan
588032fe33
Allow sqlite3_snapshot_open() to be called to change the snapshot after a read
...
transaction is already open on database.
FossilOrigin-Name: 41399169954f9bef53c3fa89879f39823b80bd127f76cf60abbe24217878a571
2018-08-15 14:03:26 +00:00
dan
356afab163
Fix a problem when renaming an IPK column that is also part of a child key.
...
FossilOrigin-Name: 6e6a2bfdbbfd4ffc14be88962ff97bf3c626fef9d1a337715d2a4be1a657fb0d
2018-08-14 21:05:35 +00:00
dan
f62e8937ac
Fix a problem when renaming an IPK column that is also part of a child key.
...
FossilOrigin-Name: ad15486022209205c65fb5ffdbe30a7b99379170451e6aff4bab6e90b549d6c7
2018-08-14 21:03:38 +00:00
dan
72238130d0
Merge latest trunk and ALTER TABLE error message improvements into this
...
branch.
FossilOrigin-Name: 7a45802dafaed3c058f59d1487fe8091e1f309cc5f0a5bcf2579f0bdd8e92d89
2018-08-14 20:40:25 +00:00
dan
987db767d2
Have ALTER TABLE RENAME edit column references in CREATE VIEW statements.
...
FossilOrigin-Name: db829dc1a2d7afa49798a2fd32d1f070185b23e513416e65d8144fda24f23b50
2018-08-14 20:18:50 +00:00
drh
1595abcda6
Improved error messages when an ALTER TABLE RENAME COLUMN fails due to a
...
duplicate column name.
FossilOrigin-Name: 37d11b8e8224a8b241ff57b9c4b9499db39dde4ddcb56ff8b03a3d08091a4c11
2018-08-14 19:27:51 +00:00
drh
5550b5eee7
Merge fixes and enhancements from trunk.
...
FossilOrigin-Name: dff0314b7e7ef2d04375ff21fbf89039bf5f64a9cdca53d7bc7120faacd92c06
2018-08-14 18:12:33 +00:00
dan
689b9d269c
Fix ALTER TABLE RENAME COLUMN in cases where the column being renamed is an
...
IPK declared with a separate PRIMARY KEY clause - "CREATE TABLE x(y INTEGER,
PRIMARY KEY(y))".
FossilOrigin-Name: 32ca8418df8735a6c53e53153f733579e514711f091e4e09ecce83db85fe4d85
2018-08-14 16:18:19 +00:00
drh
8430450674
Fix UPSERT so that it checks the target-constraint first and fires the
...
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
2018-08-14 15:12:52 +00:00
dan
5496d6a25a
Edit the WHEN and UPDATE OF clauses of trigger programs as part of ALTER TABLE
...
RENAME COLUMN.
FossilOrigin-Name: 5fdb6b0aafba727139e1937ef5950e4434a77f95a10fc46f8010ca2de3922326
2018-08-13 17:14:26 +00:00
drh
3a9a76b70a
Add the "atrc" test program. "Atrc" is short for "ALTER TABLE RENAME COLUMN".
...
See the header comment on the program itself for further information.
FossilOrigin-Name: ed64a55a2242408ac0b889b330cf91d38a954399b75c6ebe71232613b864c70b
2018-08-11 20:46:54 +00:00
dan
404c3ba0d6
If the new column name in an ALTER TABLE RENAME COLUMN statement is quoted,
...
then also use quotes for the column name in the edited SQL statements.
FossilOrigin-Name: ca5184a25f9150540a3e401ef67df0606efa7a294d70e3fa5edad9854003eb36
2018-08-11 20:38:33 +00:00