[#7518] ALTER TABLE .. MODIFY i [ NOT ] NULL (Oracle syntax of setting / dropping NOT NULL)

This commit is contained in:
Lukas Eder 2018-09-26 11:24:07 +02:00
parent 9c2a993020
commit dc523e4772
2 changed files with 3 additions and 2 deletions

View File

@ -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

View File

@ -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));