Skip to content
Merged
Show file tree
Hide file tree
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 @@ -153,7 +153,7 @@ private Subfield.PathElement matchDollarPathElement()

private static boolean isUnquotedPathCharacter(char c)
{
return c == ':' || c == '$' || c == '-' || c == '/' || c == '@' || c == '|' || c == '#' || c == ' ' || isUnquotedSubscriptCharacter(c);
return c == ':' || c == '$' || c == '-' || c == '/' || c == '@' || c == '|' || c == '#' || c == ' ' || c == '<' || c == '>' || isUnquotedSubscriptCharacter(c);
}

private Subfield.PathElement matchUnquotedSubscript()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,19 @@ public void testColumnNames()
assertPath(new Subfield("a and b", ImmutableList.of()));
}

@Test
public void testAngleBracketsInColumnNames()
{
assertPath(new Subfield("<>col", ImmutableList.of()));
assertPath(new Subfield("col<with>brackets", ImmutableList.of()));
assertPath(new Subfield("<>col", ImmutableList.of(new NestedField("<>field"))));
assertPath(new Subfield("table", ImmutableList.of(new NestedField("<>field"))));
assertPath(new Subfield("table", ImmutableList.of(new Subfield.StringSubscript("<>value>"))));
assertPath(new Subfield("<table>", ImmutableList.of(
new NestedField("<field>"),
new Subfield.StringSubscript("<value>"))));
}

@Test
public void testInvalidPaths()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2051,6 +2051,15 @@ public void testHiddenColumns()
testDataSequenceNumberHiddenColumn();
}

@Test
public void testDeleteWithSpecialCharacterColumnName()
{
assertUpdate("CREATE TABLE test_special_character_column_name (\"<age>\" int, name varchar)");
assertUpdate("INSERT INTO test_special_character_column_name VALUES (1, 'abc'), (2, 'def'), (3, 'ghi')", 3);
assertUpdate("DELETE FROM test_special_character_column_name where \"<age>\" = 2", 1);
assertUpdate("DROP TABLE IF EXISTS test_special_character_column_name");
}

@Test
public void testDeletedHiddenColumn()
{
Expand Down
Loading