[MDEV-13627] Support for ALTER TABLE MODIFY NOT NULL syntax Created: 2017-08-23 Updated: 2023-01-16 |
|
| Status: | Open |
| Project: | MariaDB Server |
| Component/s: | Data Definition - Alter Table, Server |
| Fix Version/s: | None |
| Type: | Task | Priority: | Minor |
| Reporter: | Anders Karlsson | Assignee: | Unassigned |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Description |
|
Oracle supports a useful ALTER TABLE syntax that allows you to add / remove a NOT NULL constraint of a column wihile retaining the original datatype, i.e.
This is rather useful in some cases. |
| Comments |
| Comment by Sergei Golubchik [ 2017-08-23 ] | |
|
FWIW, SQL Standard syntax is
| |
| Comment by Anders Karlsson [ 2017-08-23 ] | |
|
That is true, I did check first but only in SQL:99, I see now that it is there in more recent versions of the SQL standard. In any case, the syntax I show is the Oracle one and the SQL:2011 one is different, but it is still a useful command, if for no other reasons so for Oracle compatibility. | |
| Comment by Sergei Golubchik [ 2017-08-24 ] | |
|
Right. First, Oracle compatibility isn't bad per se (esp. taking into account 10.3 work). Second, we don't do ALTER TABLE according to SQL standard (yet). No ALTER COLUMN, for example, no SET. So doing it SQL Standard way would be strange and inconsistent. I'd say, we should support all ALTER TABLE standard syntax (not in this MDEV), but not introduce it piece-wise. |