Skip to content

Commit

Permalink
Clean up leftover schema for BigQuery tests
Browse files Browse the repository at this point in the history
  • Loading branch information
anusudarsan committed Jan 28, 2025
1 parent 798eb19 commit 57a8c6c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -205,10 +205,14 @@ public void testTableNameClash()
@Test
public void testCreateSchema()
{
String schemaName = "Test_Create_Case_Sensitive_" + randomNameSuffix();
assertUpdate("CREATE SCHEMA " + schemaName.toLowerCase(ENGLISH));
assertQuery(format("SELECT schema_name FROM information_schema.schemata WHERE schema_name = '%s'", schemaName.toLowerCase(ENGLISH)), format("VALUES '%s'", schemaName.toLowerCase(ENGLISH)));
assertUpdate("DROP SCHEMA " + schemaName.toLowerCase(ENGLISH));
String schemaName = "Test_Create_Case_Sensitive_" + randomNameSuffix().toLowerCase(ENGLISH);
try {
assertUpdate("CREATE SCHEMA " + schemaName);
assertQuery(format("SELECT schema_name FROM information_schema.schemata WHERE schema_name = '%s'", schemaName), format("VALUES '%s'", schemaName));
}
finally {
assertUpdate("DROP SCHEMA IF EXISTS " + schemaName);
}
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -353,8 +353,8 @@ protected boolean isColumnNameRejected(Exception exception, String columnName, b
public void testStreamCommentTableSpecialCharacter()
{
String schemaName = "test_comment" + randomNameSuffix();
assertUpdate("CREATE SCHEMA " + schemaName);
try {
assertUpdate("CREATE SCHEMA " + schemaName);
assertUpdate("CREATE TABLE " + schemaName + ".test_comment_semicolon (a integer) COMMENT " + varcharLiteral("a;semicolon"));
assertUpdate("CREATE TABLE " + schemaName + ".test_comment_at (a integer) COMMENT " + varcharLiteral("an@at"));
assertUpdate("CREATE TABLE " + schemaName + ".test_comment_quote (a integer) COMMENT " + varcharLiteral("a\"quote"));
Expand All @@ -379,7 +379,7 @@ public void testStreamCommentTableSpecialCharacter()
"('test_comment_bracket', " + varcharLiteral("[square bracket]") + ")");
}
finally {
assertUpdate("DROP SCHEMA " + schemaName + " CASCADE");
assertUpdate("DROP SCHEMA IF EXISTS " + schemaName + " CASCADE");
}
}

Expand Down

0 comments on commit 57a8c6c

Please sign in to comment.