Skip to content

Commit 97ab8e9

Browse files
committed
fixes #926
1 parent d9da64b commit 97ab8e9

File tree

2 files changed

+17
-7
lines changed

2 files changed

+17
-7
lines changed

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

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4393,31 +4393,35 @@ List<String> CreateParameter():
43934393
tk=<K_EXCLUDE> { param.add(tk.image); }
43944394
|
43954395
tk=<K_WHERE> { param.add(tk.image); }
4396-
|
4396+
|
43974397
tk=<K_UNSIGNED> { param.add(tk.image); }
43984398
|
43994399
tk=<K_TEMP> { param.add(tk.image); }
44004400
|
44014401
tk=<K_TEMPORARY> { param.add(tk.image); }
4402-
|
4402+
|
44034403
tk=<K_PARTITION> { param.add(tk.image); }
4404-
|
4404+
|
44054405
tk=<K_BY> { param.add(tk.image); }
4406-
|
4406+
|
44074407
tk=<K_IN> { param.add(tk.image); }
4408-
|
4408+
|
44094409
tk=<K_TYPE> { param.add(tk.image); }
4410-
|
4410+
|
44114411
tk=<K_COMMENT> { param.add(tk.image); }
44124412
|
44134413
tk=<K_USING> { param.add(tk.image); }
44144414
|
44154415
tk=<K_COLLATE> { param.add(tk.image); }
44164416
|
44174417
tk=<K_ASC> { param.add(tk.image); }
4418-
|
4418+
|
44194419
tk=<K_DESC> { param.add(tk.image); }
44204420
|
4421+
tk=<K_TRUE> { param.add(tk.image); }
4422+
|
4423+
tk=<K_FALSE> { param.add(tk.image); }
4424+
|
44214425
tk="::" colDataType = ColDataType() { param.add(tk.image); param.add(colDataType.toString()); }
44224426
)
44234427
{return param;}

src/test/java/net/sf/jsqlparser/statement/alter/AlterTest.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -660,6 +660,12 @@ public void testIssue985_2() throws JSQLParserException {
660660
assertStatementCanBeDeparsedAs(parsed, statement, true);
661661
assertReferentialActionOnConstraint(parsed, Action.CASCADE, null);
662662
}
663+
664+
@Test
665+
public void testAlterTableDefaultValueTrueIssue926() throws JSQLParserException {
666+
Alter parsed = (Alter) CCJSqlParserUtil.parse("ALTER TABLE my_table ADD some_column BOOLEAN DEFAULT FALSE");
667+
assertStatementCanBeDeparsedAs(parsed, "ALTER TABLE my_table ADD COLUMN some_column BOOLEAN DEFAULT FALSE");
668+
}
663669

664670
private void assertReferentialActionOnConstraint(Alter parsed, Action onUpdate,
665671
Action onDelete) {

0 commit comments

Comments
 (0)