Skip to content

Commit 5fc7ce8

Browse files
committed
fixes #830
1 parent 914ee73 commit 5fc7ce8

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

src/main/jjtree/net/sf/jsqlparser/parser/JSqlParserCC.jjt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3674,7 +3674,7 @@ ColDataType ColDataType():
36743674
(
36753675
(tk=<K_CHARACTER> | tk=<K_BIT>) [tk2=<K_VARYING>] { colDataType.setDataType(tk.image + (tk2!=null?" " + tk2.image:"")); }
36763676
| tk=<K_DOUBLE> [LOOKAHEAD(2) tk2=<K_PRECISION>] { colDataType.setDataType(tk.image + (tk2!=null?" " + tk2.image:"")); }
3677-
| ( tk=<S_IDENTIFIER> | tk=<K_DATETIMELITERAL> | tk=<K_XML> | tk=<K_INTERVAL> | tk=<DT_ZONE> | tk=<K_CHAR> | tk=<K_SET> )
3677+
| ( tk=<S_IDENTIFIER> | tk=<K_DATETIMELITERAL> | tk=<K_DATE_LITERAL> | tk=<K_XML> | tk=<K_INTERVAL> | tk=<DT_ZONE> | tk=<K_CHAR> | tk=<K_SET> )
36783678
{ colDataType.setDataType(tk.image); }
36793679
| tk=<K_UNSIGNED> tk2=<S_IDENTIFIER> {colDataType.setDataType(tk.image + " " + tk2.image);}
36803680
| tk=<K_SIGNED> tk2=<S_IDENTIFIER> {colDataType.setDataType(tk.image + " " + tk2.image);}

src/test/java/net/sf/jsqlparser/statement/create/CreateTableTest.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -542,4 +542,14 @@ public void testCreateTableIssue798_2() throws JSQLParserException {
542542
public void testCreateTableIssue113() throws JSQLParserException {
543543
assertSqlCanBeParsedAndDeparsed("CREATE TABLE foo (reason character varying (255) DEFAULT 'Test' :: character varying NOT NULL)");
544544
}
545+
546+
@Test
547+
public void testCreateTableIssue830() throws JSQLParserException {
548+
assertSqlCanBeParsedAndDeparsed("CREATE TABLE testyesr (id int, yy year)");
549+
}
550+
551+
@Test
552+
public void testCreateTableIssue830_2() throws JSQLParserException {
553+
assertSqlCanBeParsedAndDeparsed("CREATE TABLE testyesr (id int, yy year, mm month, dd day)");
554+
}
545555
}

0 commit comments

Comments
 (0)