aboutsummaryrefslogtreecommitdiff
path: root/src/alter.c
Commit message (Collapse)AuthorAge
...
* Further refactoring of the schema table name.drh2020-06-19
| | | FossilOrigin-Name: 9536fa0ae0c1ae6e2e98d2fa11e5acda7f3c9b8ca5061b6f7f8cae63a11d936b
* Provide "sqlite_schema" as an alternative name to the table that holds thedrh2020-06-15
| | | | | database schema. FossilOrigin-Name: 61782a7ae3c25cf59d7a676cb295eb024d17c46e532ae78c6fe871a91d712fa9
* Do not allow a virtual table to be renamed into the name of one of itsdrh2020-05-14
| | | | | shadows. FossilOrigin-Name: eca0ba2cf4c0fdf757bae19c6397a48245adb99e8017ddc28f01804072a30b2c
* Release some restrictions on columns added by ALTER TABLE so that theydrh2020-05-08
| | | | | only apply if the table contains one or more rows. FossilOrigin-Name: 3a16c0ce4d8851f79f670d94786032c8007619154ece44647dc9cc5b1f9654ff
* The ALTER TABLE fix of check-in [7e5ad8e0ab7ee91a] is no longer needed duedrh2020-04-07
| | | | | | to the changes at check-in [4cf8721f5ceb1fda]. But, we keep the defense in place as an assert() for extra safety. FossilOrigin-Name: 230556e859536bbadf0daf8133a9a01ef4f03148b3296723e37bad66e3fc3d82
* Performance improvement for column name lookup.drh2020-04-06
| | | FossilOrigin-Name: 1e4b6a93987cdfbf829e2ff35ef417c290625f2894ad11949e301af518f1fb44
* Fix a case when a pointer might be used after being freed in the ALTER TABLE ↵dan2020-04-03
| | | | | code. Fix for [4722bdab08cb1]. FossilOrigin-Name: d09f8c3621d5f7f8c6d99d7d82bcaa8421855b3f470bea2b26c858106382b906
* NEVER() and ALWAYS() macros tagging unreachable branches.drh2020-01-02
| | | FossilOrigin-Name: 34b877742ef78e9bb3f16815180f4ad9cd722beb1d610f713400a3b25d68aa9b
* Merge recent enhancements from trunk.drh2019-12-31
|\ | | | | FossilOrigin-Name: 39d55579376906f212271ce9b2d367e3ad029fb173f22c7253312b467970208a
| * Fix a potential problem with ALTER TABLE commands on schemas that contains a ↵dan2019-12-20
| | | | | | | | | | triggers or view featuring a sub-query that uses an ON clause with a join that is not a LEFT JOIN. FossilOrigin-Name: 365dd8b663d5a28af33556b2b3820c6b5482114ef741a1d82b55c6e154f3043a
| * Fix harmless compiler warnings.drh2019-12-20
| | | | | | FossilOrigin-Name: 2bbd014c900e0d71fd30ec647739b82c5dc3aa237a0203f5a1db50593dae199e
| * Do not continue an ALTER TABLE tree walk of a subquery if a prior errordrh2019-12-20
| | | | | | | | | | is seen in the tree. Report the problem immediately, without continuing. FossilOrigin-Name: 01ca865f31c0c817ede7f357401ef76cf311ae662397908464f53e1c147f5b6b
| * Clean up the ExprList that holds the names of columns in a CTE before checkingdrh2019-12-17
| | | | | | | | | | for unused references in the ALTER TABLE implementation. FossilOrigin-Name: 8223e79f987feda5c8e51ec52cec6798cca16d070b10558939e2888ca1a25b8e
* | Tie up the loose ends in the ExprList size reduction.drh2019-12-13
| | | | | | FossilOrigin-Name: 59d0f3afe5249a2a6453fe7bc810c2c7beb896d3800174c7c90f9304c0b1ad88
* | Change the name of the Expr.a.zName field to zEName, so that it has a namedrh2019-12-12
|/ | | | | | that is distinct from other fields and variables and is hence easier to grep for. FossilOrigin-Name: d3783357f8fa76c42a86f12b214522f0388c37773c36ab8c5ce0623abbc4436a
* Add a NEVER() to the ALTER TABLE fix in check-in [1d2e53a39b87e364]drh2019-12-09
| | | FossilOrigin-Name: c7309ed3c7588c7e51e09418bf5cfd4611539b44c39cef9ed4ae0e385bae7625
* Avoid infinite recursion in the ALTER TABLE code when a view contains an ↵dan2019-12-09
| | | | | unused CTE that references, directly or indirectly, the view itself. FossilOrigin-Name: 1d2e53a39b87e364685e21de137655b6eee725e4c6d27fc90865072d7c5892b5
* Fix a problem in ALTER TABLE that could occur if an index, view or trigger ↵dan2019-12-05
| | | | | in the schema features an expression of the form ((SELECT ...) IN ()) where the SELECT statement uses a CTE. FossilOrigin-Name: 7e5ad8e0ab7ee91a5ccb19a9654d6a036233f74d2fdc45f7315feb3d9d035fd4
* Ensure that an ALWAYS() in the rename logic really is always true, evendrh2019-12-04
| | | | | for faulty inputs. FossilOrigin-Name: 54410f0e7710542d5159d0449898598d2b7f7676bfd993644ca47da1bf1fcdac
* Fix an assert() failure that could occur in ALTER TABLE code when the schema ↵dan2019-12-04
| | | | | contains a view that uses a CTE. FossilOrigin-Name: 75b04a4b0d2e65bfcd02cf4e0b6d8f1954957c590814a9b8f9a9ee2adc2ec022
* Break out the test for writable shadow tables into a separate subroutine.drh2019-11-16
| | | FossilOrigin-Name: 8ad34d36a141fa8f5d9bd784dfeb892c983897a6dc6b867607cc668508acf944
* Do not allow ALTER TABLE ADD COLUMN for a STORED column.drh2019-10-24
| | | FossilOrigin-Name: 42fc08bc1528a34a603c2c085b515766a8d33ae7ea0350a52b0ca24b94ebcbc5
* Refactor names of column index transformation functions, for clarity.drh2019-10-19
| | | | | Get generated columns working with ALTER TABLE RENAME COLUMN. FossilOrigin-Name: 27ab41c9102e7801ff829488fc123a8040da008bef373d6704efbe2f93e1da90
* ALTER TABLE is able to add a VIRTUAL column.drh2019-10-16
| | | FossilOrigin-Name: 120c6b78cb51532f783014605f1107d40b2e4f54e3852fb1f8f167d0c0b78c69
* An improved fix for the dbsqlfuzz-discovered ALWAYS() failure following OOM indrh2019-10-09
| | | | | sqlite3ExprCollSeq(). This time with a test case (engineered by Dan). FossilOrigin-Name: 907f7965b335d8d5441f2e386bb190d1f93ffcd45ca98d2d1c621dede491fc5e
* Change sqlite3SelectDup() to always return NULL if an OOM has occurred.drh2019-10-09
| | | FossilOrigin-Name: 01ba4641ab436c6065c8725908fc0913f2abded4ea62e004b7534e0116b9451a
* Fix a problem with running ALTER TABLE ADD COLUMN statements within a ↵dan2019-10-07
| | | | | transaction that writes to one or more virtual tables. FossilOrigin-Name: 31e85fbbc4cfd09a98b4a6dc6624f863816f376c6a4eef1fafc657c8e1abbc36
* Validate the type, name, and tbl_name fields of the sqlite_master table whendrh2019-08-12
| | | | | loading the schema, unless writable_schema is engaged. FossilOrigin-Name: 724f4df9ccc2b683f7091a3f7a8c20ee210f44d7a610cd1b4c49da1c274add08
* Ensure that sqlite3RenameExprUnmap() does an unmap of the result set aliasdrh2019-06-15
| | | | | | names in subqueries when ALTER TABLE fails because of a syntax error in a trigger. FossilOrigin-Name: d3b6f1665f6fb5fc5cf1c0864d779d0b24746ada530f755c7b6ff34766bd2188
* Mark an unreachable branch with an ALWAYS macro.drh2019-06-11
| | | FossilOrigin-Name: d4755aca4b435eed62b54af84013f7f176d3fa5b7b1c243555d59de5749fcde5
* Have the ALTER TABLE code handle the case where an entire expression that ↵dan2019-06-11
| | | | | includes a sub-select is excluded from a view, trigger or index. FossilOrigin-Name: f2c8179f3c0b77f10da3f9b0771db4dec30d0bbf0b7f4751ce439bfb08da8f6f
* Fix a problem with renaming a table that starts with "sqlite". Fix for ↵dan2019-04-19
| | | | | ticket [f00d7b65]. FossilOrigin-Name: a2ead8aa4517b63cda7bf84464326e9cb5e228224caa603568c0e04ea44e6588
* Ensure that ALTER TABLE commands open statement transactions. Fix for ↵dan2019-03-15
| | | | | [596d059a]. FossilOrigin-Name: 0f2129f59f7df929106e2af876c2976dea6528c1dc1850d64cddb256f20e121a
* Fix a fairly obscure problem allowing an "ALTER TABLE RENAME col TO ..." ↵dan2019-01-18
| | | | | statement to modify the schema in such a way as to break a reference within a trigger program. FossilOrigin-Name: 64bec9e6214c6932fab5a3fb8c569ae14cd2d603bd0f8b26104815c3bb9d396a
* Move a local variable declaration into the outermost scope in which itdrh2019-01-13
| | | | | is used. This fixes an ASAN warning. FossilOrigin-Name: ac3b6021d9437ab1c027850d321f0a3e575b008763d8d515e2347f7d4e7c294b
* Enhance the ALTER TABLE RENAME COLUMN feature so that it works on tablesdrh2019-01-09
| | | | | | that have redundant UNIQUE and/or PRIMARY KEY constraints. Fix for ticket [bc8d94f0fbd633fd9a051e3] FossilOrigin-Name: f09aa3248e2b4a32ff5b5d37084cb2a27445322cb06a3354cef723f4f0b2cd34
* In defensive mode, do not allow shadow tables to be renamed using ALTER TABLE.dan2018-12-18
| | | FossilOrigin-Name: 23e200da5cfbde0798e67cd9e016e4a1cd73b67981e1af841493fcd123d8f547
* Fix a potential NULL pointer dereference that can occur in ALTER TABLEdrh2018-12-06
| | | | | following an OOM. Test case in TH3. FossilOrigin-Name: ea50815bf80ab0d36891518f209acbcd3d6d8d84529741bffd4e841874c78aff
* Ensure that ALTER TABLE modifies table and column names embedded in WITHdan2018-12-05
| | | | | clauses that are part of views and triggers. FossilOrigin-Name: f44bc7a8b3fac82aa5598e9bdaf65ea4dd3c331cf90c1d5ba26ff1698e92c230
* Do not allow direct access to internal-use SQL functions such asdrh2018-11-26
| | | | | | sqlite_rename_column() and sqlite3_rename_table() except when the new SQLITE_TESTCTRL_INTERNAL_FUNCTIONS flag is set. FossilOrigin-Name: 6e1330545e7b74fe5f1f20751a3425e2788441485fc07fcb7626e448c72027ce
* Minor comment enhancement in alter.c. No changes to code.drh2018-11-26
| | | FossilOrigin-Name: 12920bcb99b25e147e1877ee001bc551a743e3530c954fe2b45a18a4eef9eeff
* When a table is renamed using "ALTER TABLE RENAME TO", update any REFERENCESdan2018-11-09
| | | | | | | | clauses that refer to the table, unless "PRAGMA legacy_alter_table" is true and "PRAGMA foreign_keys" is set to false (i.e. so that when "PRAGMA legacy_alter_table" is set behaviour is still compatible with versions 3.24 and earlier). FossilOrigin-Name: ae9638e9c0ad0c366f93c88a850f6b4cc86881e9f3f9f1e39574d9d83ddd8a6a
* Add an ALWAYS on an unreachable branch in the ALTER TABLE logic.drh2018-10-03
| | | FossilOrigin-Name: ebcd4523171f0988ff08e2bf36fb8a0caa40efe7ac7556b4eb206784969b03e4
* Fix a problem with ALTER TABLE commands when the schema features an INSTEAD ofdan2018-10-01
| | | | | trigger that uses NEW.* or OLD.*. FossilOrigin-Name: c52f457e56eb9d573eb67093731eb231aaf6fd6dbdc397e6f948b82736fbe3ab
* Add the "PRAGMA legacy_alter_table=ON" command to enable the pre-3.25.0drh2018-09-20
|\ | | | | | | | | | | | | behavior of ALTER TABLE that does not modify the bodies of triggers or views or the WHERE clause of a partial index. Enable the legacy behavior by default when running the xRename method of virtual tables. FossilOrigin-Name: 7edd26ed27ed1e7eab603058f7d55f2eac45e7bd1908bfa5f32293611883b157
| * By default, make all "ALTER TABLE RENAME" statements executed within a virtualdan2018-09-20
| | | | | | | | | | table xRename() method exhibit the legacy behaviour. FossilOrigin-Name: 71947337e98b90debb13b390119bc2a6b39dd41535151b836071ee327a31e45d
| * Add a PRAGMA that restores the legacy ALTER TABLE RENAME TO behaviour.dan2018-09-20
| | | | | | FossilOrigin-Name: 5acad2e92c11c209bedc6ac8a709595e8070eed028ffc82af61499e5ceaa5e2b
* | Combine the Expr.pTab and Expr.pWin fields into a union named "y". Add a newdrh2018-09-20
|/ | | | | | | 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. FossilOrigin-Name: ad130bb86e74e6ce165fdbdce3a19699510f0e62071c1c7923b5a4538d888c7c
* Minor modification to the fix on this branch to avoid adding extra conditionaldan2018-09-17
| | | | | compilation macros. FossilOrigin-Name: 4d8be404dab265b51e5a6a95e83be85c22512e19a437191690c7d845c87ff259
* Restrict the scope of internal-use functions in alter.c.drh2018-09-12
| | | FossilOrigin-Name: 4396914f8e1a847d86c22fb0b91e7431cf19aa260cbec520af3564248d6897ad