[#7518] ALTER TABLE .. MODIFY i [ NOT ] NULL (Oracle syntax of setting / dropping NOT NULL)
This commit is contained in:
parent
9c2a993020
commit
dc523e4772
@ -68,6 +68,7 @@ alterTableStatement = 'ALTER TABLE' [ 'IF EXISTS' ] tableName break
|
||||
(
|
||||
[ [ 'SET DATA' ] 'TYPE' ] dataType [ [ 'NOT' ] 'NULL' ]
|
||||
| ( 'SET' | 'DROP' ) 'NOT NULL'
|
||||
| [ 'NOT' ] 'NULL'
|
||||
| [ 'RENAME' ] ( 'TO' | 'AS' ) identifier
|
||||
)
|
||||
| column
|
||||
|
||||
@ -3166,9 +3166,9 @@ final class ParserImpl implements Parser {
|
||||
TableField<?, ?> field = parseFieldName(ctx);
|
||||
|
||||
if (!paren)
|
||||
if (parseKeywordIf(ctx, "DROP NOT NULL"))
|
||||
if (parseKeywordIf(ctx, "DROP NOT NULL") || parseKeywordIf(ctx, "NULL"))
|
||||
return s1.alter(field).dropNotNull();
|
||||
else if (parseKeywordIf(ctx, "SET NOT NULL"))
|
||||
else if (parseKeywordIf(ctx, "SET NOT NULL") || parseKeywordIf(ctx, "NOT NULL"))
|
||||
return s1.alter(field).setNotNull();
|
||||
else if (parseKeywordIf(ctx, "TO") || parseKeywordIf(ctx, "RENAME TO") || parseKeywordIf(ctx, "RENAME AS"))
|
||||
return s1.renameColumn(field).to(parseFieldName(ctx));
|
||||
|
||||
Loading…
Reference in New Issue
Block a user