Skip to content
Open
Changes from all commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -2317,6 +2317,18 @@ public void testAlterTableAddConstraint() {
String sql = "alter table employees drop CONSTRAINT employees_ibfk_2";
StringBuffer clickHouseQuery = new StringBuffer();
mySQLDDLParserService.parseSql(sql, "employees", clickHouseQuery);

Assert.assertTrue(clickHouseQuery.toString().equalsIgnoreCase("ALTER TABLE employees.employees DROP CONSTRAINT IF EXISTS employees_ibfk_2"));
}

@Test
public void testAlterTableAddColumnAlgorithm() {
String sql = "ALTER TABLE test_lot ADD COLUMN event_ref_type_id INTEGER, algorithm=instant, ADD COLUMN event_ref_id BIGINT, algorithm=instant;";

StringBuffer clickHouseQuery = new StringBuffer();
mySQLDDLParserService.parseSql(sql, "test_db", clickHouseQuery);

Assert.assertTrue(clickHouseQuery.toString().equalsIgnoreCase(
"ALTER TABLE employees.test_lot ADD COLUMN event_ref_type_id Nullable(Int32)"));
}
}
Loading