The Wayback Machine - https://web.archive.org/web/20201011181101/https://github.com/JSQLParser/JSqlParser/issues/599
Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modify column with "NULL" or "NOT NULL" is not getting parsed. #599

Open
VaibhavJain opened this issue Mar 28, 2018 · 2 comments
Open

Modify column with "NULL" or "NOT NULL" is not getting parsed. #599

VaibhavJain opened this issue Mar 28, 2018 · 2 comments

Comments

@VaibhavJain
Copy link

@VaibhavJain VaibhavJain commented Mar 28, 2018

Actual Behavior

On parsing statement ALTER TABLE MODIFY NOT NULL getting ParseException

`Caused by: net.sf.jsqlparser.parser.ParseException: Encountered " "NOT" "NOT "" at line 1, column 51.
Was expecting one of:
"XML" ...
"INTERVAL" ...
"CHARACTER" ...
"BIT" ...
<K_DATETIMELITERAL> ...
"DOUBLE" ...
<DT_ZONE> ...
<S_IDENTIFIER> ...

at net.sf.jsqlparser.parser.CCJSqlParser.generateParseException(CCJSqlParser.java:16869)
at net.sf.jsqlparser.parser.CCJSqlParser.jj_consume_token(CCJSqlParser.java:16722)
at net.sf.jsqlparser.parser.CCJSqlParser.ColDataType(CCJSqlParser.java:9265)
at net.sf.jsqlparser.parser.CCJSqlParser.AlterExpressionColumnDataType(CCJSqlParser.java:9862)
at net.sf.jsqlparser.parser.CCJSqlParser.AlterExpression(CCJSqlParser.java:10042)
at net.sf.jsqlparser.parser.CCJSqlParser.AlterTable(CCJSqlParser.java:10279)
at net.sf.jsqlparser.parser.CCJSqlParser.SingleStatement(CCJSqlParser.java:156)
at net.sf.jsqlparser.parser.CCJSqlParser.Statement(CCJSqlParser.java:81)
at net.sf.jsqlparser.parser.CCJSqlParserUtil.parse(CCJSqlParserUtil.java:54) `

Expected Behavior

It should identify "NOT NULL"/"NULL" has been added.

Steps to Reproduce the Problem

1.Statement stmt = CCJSqlParserUtil.parse("ALTER TABLE TableName MODIFY ColumnName NOT NULL");

Specifications

  • Version: 1.1
  • Platform: Java 8 on windows
  • Subsystem:
@wumpz wumpz added this to todo in Todo Apr 6, 2018
@wumpz
Copy link
Member

@wumpz wumpz commented Apr 13, 2018

As far as I know is the modify command not supported (yet). Do you want to provide a PR with an initial start supporting this?

@yarnping
Copy link

@yarnping yarnping commented Jun 17, 2019

@VaibhavJain what kind of db related to this sql statement?

@wumpz wumpz removed this from todo in Todo Aug 12, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.