Skip to content

Commit 32d0414

Browse files
committed
test: cover MySQL 9 vector boundaries with table options
Signed-off-by: minleejae <mmj9808@gmail.com>
1 parent 8b9fb01 commit 32d0414

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

‎src/test/java/net/sf/jsqlparser/statement/create/MySqlSharedTableOptionTest.java‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,17 @@ void rejectsMissingOrWrongCreateValues(String option) {
8383
() -> CCJSqlParserUtil.parse("CREATE TABLE t (id INT) " + option));
8484
}
8585

86+
@ParameterizedTest
87+
@ValueSource(strings = {"VECTOR", "VECTOR(0)", "VECTOR(1)", "VECTOR(2048)", "VECTOR(16383)"})
88+
void preservesMySql9VectorColumnsBeforeTableOptions(String type) throws JSQLParserException {
89+
CreateTable table = (CreateTable) CCJSqlParserUtil.parse(
90+
"CREATE TABLE t (v " + type + ") ENCRYPTION='N'");
91+
assertEquals(type, table.getColumnDefinitions().get(0).getColDataType().toString()
92+
.replace(" ", ""));
93+
assertEquals(TableOption.Kind.ENCRYPTION, table.getTableOptions().get(0).getKind());
94+
roundTrip(table);
95+
}
96+
8697
private static void roundTrip(Statement statement) throws JSQLParserException {
8798
StringBuilder out = new StringBuilder();
8899
statement.accept(new StatementDeParser(out));

0 commit comments

Comments
 (0)