File tree Expand file tree Collapse file tree 2 files changed +17
-10
lines changed
main/jjtree/net/sf/jsqlparser/parser
test/java/net/sf/jsqlparser/statement/create/table Expand file tree Collapse file tree 2 files changed +17
-10
lines changed Original file line number Diff line number Diff line change @@ -7983,11 +7983,8 @@ ColumnDefinition ColumnDefinition(): {
79837983 List<String> parameter;
79847984} {
79857985 columnName=RelObjectName()
7986-
7987- colDataType = ColDataType()
7988-
7986+ colDataType=ColDataType()
79897987 ( LOOKAHEAD(2) parameter=CreateParameter() { columnSpecs.addAll(parameter); } )*
7990-
79917988 {
79927989 coldef = new ColumnDefinition();
79937990 coldef.setColumnName(columnName);
@@ -8366,13 +8363,13 @@ ColDataType ColDataType():
83668363 (
83678364 <K_STRUCT>
83688365 "("
8369- ( tk=<S_IDENTIFIER> | tk=<S_QUOTED_IDENTIFIER> )
8370- colDataType = ColDataType() { argumentsStringList.add( tk.image + " " + colDataType.toString()); }
8371- [
8366+ type = RelObjectNameExt2( )
8367+ colDataType = ColDataType() { argumentsStringList.add( type + " " + colDataType.toString()); }
8368+ (
83728369 ","
8373- ( tk=<S_IDENTIFIER> | tk=<S_QUOTED_IDENTIFIER> )
8374- colDataType = ColDataType() { argumentsStringList.add( tk.image + " " + colDataType.toString()); }
8375- ]
8370+ type = RelObjectNameExt2( )
8371+ colDataType = ColDataType() { argumentsStringList.add( type + " " + colDataType.toString()); }
8372+ )*
83768373 ")" { colDataType = new ColDataType("STRUCT"); }
83778374 )
83788375 |
Original file line number Diff line number Diff line change @@ -47,4 +47,14 @@ void testIssue1879() throws JSQLParserException {
4747 public void testNestedCast () throws JSQLParserException {
4848 assertSqlCanBeParsedAndDeparsed ("SELECT acolumn::bit(64)::int(64) FROM mytable" );
4949 }
50+
51+ @ Test
52+ void testStruct () throws JSQLParserException {
53+ String sqlStr =
54+ "CREATE TABLE IT.u (\n " +
55+ " details struct( id varchar(255), name varchar(255)) NOT NULL,\n " +
56+ " name VARCHAR(255) NOT NULL\n " +
57+ " );\n " ;
58+ assertSqlCanBeParsedAndDeparsed (sqlStr , true );
59+ }
5060}
You can’t perform that action at this time.
0 commit comments