File tree Expand file tree Collapse file tree 2 files changed +11
-3
lines changed
main/jjtree/net/sf/jsqlparser/parser
test/java/net/sf/jsqlparser/test/create Expand file tree Collapse file tree 2 files changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -3105,8 +3105,8 @@ List<String> CreateParameter():
3105
3105
}
3106
3106
{
3107
3107
(
3108
- ((tk=<S_IDENTIFIER> { identifier.append(tk.image); }
3109
- ["." tk2=<S_IDENTIFIER> { identifier.append("."); identifier.append(tk2.image); }])
3108
+ ((( tk=<S_IDENTIFIER> | tk=<S_QUOTED_IDENTIFIER>) { identifier.append(tk.image); }
3109
+ ["." ( tk2=<S_IDENTIFIER> | tk2=<S_QUOTED_IDENTIFIER>) { identifier.append("."); identifier.append(tk2.image); }])
3110
3110
{ param.add(identifier.toString()); })
3111
3111
|
3112
3112
tk=<K_NULL> { param.add(tk.image); }
@@ -3178,7 +3178,7 @@ String AList():
3178
3178
{
3179
3179
"("
3180
3180
3181
- ( (tk=<S_LONG> | tk=<S_DOUBLE> | tk=<S_CHAR_LITERAL> | tk=<S_IDENTIFIER>) { retval.append(tk.image); }
3181
+ ( (tk=<S_LONG> | tk=<S_DOUBLE> | tk=<S_CHAR_LITERAL> | tk=<S_IDENTIFIER> | tk=<S_QUOTED_IDENTIFIER> ) { retval.append(tk.image); }
3182
3182
[("," {retval.append(",");} | "=" {retval.append("=");})] )*
3183
3183
3184
3184
")"
Original file line number Diff line number Diff line change @@ -268,6 +268,14 @@ public void testTimestampWithTimezone() throws JSQLParserException {
268
268
public void testCreateTableAsSelect3 () throws JSQLParserException {
269
269
assertSqlCanBeParsedAndDeparsed ("CREATE TABLE public.sales1 AS (SELECT * FROM public.sales)" );
270
270
}
271
+
272
+ public void testQuotedPKColumnsIssue491 () throws JSQLParserException {
273
+ assertSqlCanBeParsedAndDeparsed ("CREATE TABLE `FOO` (`ID` INT64, `NAME` STRING (100)) PRIMARY KEY (`ID`)" );
274
+ }
275
+
276
+ public void testQuotedPKColumnsIssue491_2 () throws JSQLParserException {
277
+ assertSqlCanBeParsedAndDeparsed ("CREATE TABLE `FOO` (`ID` INT64, `NAME` STRING (100), PRIMARY KEY (`ID`))" );
278
+ }
271
279
272
280
public void testRUBiSCreateList () throws Exception {
273
281
BufferedReader in = new BufferedReader (new InputStreamReader (CreateTableTest .class .
You can’t perform that action at this time.
0 commit comments