Skip to content

Commit cd16a6d

Browse files
committed
fixes #113
1 parent 6e7b976 commit cd16a6d

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3651,6 +3651,7 @@ List<String> CreateParameter():
36513651
StringBuilder identifier = new StringBuilder("");
36523652
Expression exp = null;
36533653
List<String> param = new ArrayList<String>();
3654+
ColDataType colDataType;
36543655
}
36553656
{
36563657
(
@@ -3733,6 +3734,8 @@ List<String> CreateParameter():
37333734
tk=<K_USING> { param.add(tk.image); }
37343735
|
37353736
tk=<K_COLLATE> { param.add(tk.image); }
3737+
|
3738+
tk="::" colDataType = ColDataType() { param.add(tk.image); param.add(colDataType.toString()); }
37363739
)
37373740
{return param;}
37383741
}

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -537,4 +537,9 @@ public void testCreateTableIssue798_2() throws JSQLParserException {
537537
+ "KEY PARENT_DIRTY_IDX (DIRTY_STATUS)\n"
538538
+ ") ENGINE=InnoDB AUTO_INCREMENT=2663 DEFAULT CHARSET=utf8", true);
539539
}
540+
541+
@Test
542+
public void testCreateTableIssue113() throws JSQLParserException {
543+
assertSqlCanBeParsedAndDeparsed("CREATE TABLE foo (reason character varying (255) DEFAULT 'Test' :: character varying NOT NULL)");
544+
}
540545
}

0 commit comments

Comments
 (0)