Skip to content

Commit 72a51e5

Browse files
fix: allow DATA as ColumnType() keyword
- fixes #1969 Signed-off-by: Andreas Reichel <[email protected]>
1 parent 8dcfb4a commit 72a51e5

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

+2
Original file line numberDiff line numberDiff line change
@@ -4361,6 +4361,7 @@ Expression PrimaryExpression() #PrimaryExpression:
43614361
if (not) {
43624362
retval = new NotExpression(retval, exclamationMarkNot);
43634363
}
4364+
linkAST(retval, jjtThis);
43644365
return retval;
43654366
}
43664367
}
@@ -5743,6 +5744,7 @@ ColDataType ColDataType():
57435744
| tk=<K_JSON>
57445745
| tk=<K_STRING>
57455746
| tk=<K_PUBLIC>
5747+
| tk=<K_DATA>
57465748
) { schema = tk.image; }
57475749
[ "." type = RelObjectName() { schema += "." + type; } ]
57485750
{ colDataType.setDataType(schema); }

src/test/java/net/sf/jsqlparser/expression/CastExpressionTest.java

+6
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,10 @@ public void testCastToRowConstructorIssue1267() throws JSQLParserException {
2424
TestUtils.assertExpressionCanBeParsedAndDeparsed("CAST(ROW(dataid, value, calcMark) AS ROW(datapointid CHAR, value CHAR, calcMark CHAR))", true);
2525
TestUtils.assertExpressionCanBeParsedAndDeparsed("CAST(ROW(dataid, value, calcMark) AS testcol)", true);
2626
}
27+
28+
@Test
29+
void testDataKeywordIssue1969() throws Exception {
30+
String sqlStr = "SELECT * FROM myschema.myfunction('test'::data.text_not_null)";
31+
TestUtils.assertSqlCanBeParsedAndDeparsed(sqlStr, true);
32+
}
2733
}

0 commit comments

Comments
 (0)