Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
fixed spotcheck formatting issues
  • Loading branch information
Tanish0019 committed Feb 8, 2024
commit 4f10cf56e5127239495b99071aa436e7e97a9a9f
Original file line number Diff line number Diff line change
Expand Up @@ -774,7 +774,7 @@ public ColumnDataType(
@Override
public String toString() {
return getColumnName() + (withType ? " TYPE " : getColDataType() == null ? "" : " ")
+ toStringDataTypeAndSpec();
+ toStringDataTypeAndSpec();
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,10 @@ public String toString() {
}

public String toStringDataTypeAndSpec() {
return (colDataType == null ? "" : colDataType) + (columnSpecs != null && !columnSpecs.isEmpty()
? " " + PlainSelect.getStringList(columnSpecs, false, false)
: "");
return (colDataType == null ? "" : colDataType)
+ (columnSpecs != null && !columnSpecs.isEmpty()
? " " + PlainSelect.getStringList(columnSpecs, false, false)
: "");
}

public ColumnDefinition withColumnName(String columnName) {
Expand Down
3 changes: 1 addition & 2 deletions src/main/jjtree/net/sf/jsqlparser/parser/JSqlParserCC.jjt
Original file line number Diff line number Diff line change
Expand Up @@ -6273,8 +6273,7 @@ AlterExpression AlterExpression():
)

(
LOOKAHEAD(2)
(<K_PRIMARY> <K_KEY> columnNames=ColumnsNamesList() { alterExp.setPkColumns(columnNames); })
LOOKAHEAD(2) (<K_PRIMARY> <K_KEY> columnNames=ColumnsNamesList() { alterExp.setPkColumns(columnNames); })

constraints=AlterExpressionConstraintState() { alterExp.setConstraints(constraints); }
[<K_USING> sk4=RelObjectName() { alterExp.addParameters("USING", sk4); }]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,7 @@ public void testAlterTableModifyColumn2() throws JSQLParserException {
@Test
public void testAlterTableModifyColumn3() throws JSQLParserException {
Alter alter =
(Alter) CCJSqlParserUtil.parse("ALTER TABLE mytable modify col1 NULL");
(Alter) CCJSqlParserUtil.parse("ALTER TABLE mytable modify col1 NULL");
AlterExpression alterExpression = alter.getAlterExpressions().get(0);

// COLUMN keyword DOES NOT appear in deparsed statement, modify becomes all caps
Expand All @@ -377,7 +377,7 @@ public void testAlterTableModifyColumn3() throws JSQLParserException {
@Test
public void testAlterTableModifyColumn4() throws JSQLParserException {
Alter alter =
(Alter) CCJSqlParserUtil.parse("ALTER TABLE mytable modify col1 DEFAULT 0");
(Alter) CCJSqlParserUtil.parse("ALTER TABLE mytable modify col1 DEFAULT 0");
AlterExpression alterExpression = alter.getAlterExpressions().get(0);

// COLUMN keyword DOES NOT appear in deparsed statement, modify becomes all caps
Expand Down