Skip to content

Commit

Permalink
Avoid selecting unrelated schemas from the information_schema
Browse files Browse the repository at this point in the history
  • Loading branch information
findinpath committed Apr 7, 2022
1 parent b0bf19c commit a286d56
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,19 +52,19 @@ public void testSelect()
@Test
public void testReadInformationSchema()
{
assertThat(query("SELECT table_schema FROM hive.information_schema.tables WHERE table_name = 'region'"))
assertThat(query("SELECT table_schema FROM hive.information_schema.tables WHERE table_name = 'region' AND table_schema='" + schema + "'"))
.skippingTypesCheck()
.containsAll("VALUES '" + schema + "'");
assertThat(query("SELECT table_schema FROM iceberg.information_schema.tables WHERE table_name = 'nation'"))
assertThat(query("SELECT table_schema FROM iceberg.information_schema.tables WHERE table_name = 'nation' AND table_schema='" + schema + "'"))
.skippingTypesCheck()
.containsAll("VALUES '" + schema + "'");
assertThat(query("SELECT table_schema FROM hive_with_redirections.information_schema.tables WHERE table_name = 'region'"))
assertThat(query("SELECT table_schema FROM hive_with_redirections.information_schema.tables WHERE table_name = 'region' AND table_schema='" + schema + "'"))
.skippingTypesCheck()
.containsAll("VALUES '" + schema + "'");
assertThat(query("SELECT table_schema FROM hive_with_redirections.information_schema.tables WHERE table_name = 'nation'"))
assertThat(query("SELECT table_schema FROM hive_with_redirections.information_schema.tables WHERE table_name = 'nation' AND table_schema='" + schema + "'"))
.skippingTypesCheck()
.containsAll("VALUES '" + schema + "'");
assertThat(query("SELECT table_schema FROM iceberg_with_redirections.information_schema.tables WHERE table_name = 'region'"))
assertThat(query("SELECT table_schema FROM iceberg_with_redirections.information_schema.tables WHERE table_name = 'region' AND table_schema='" + schema + "'"))
.skippingTypesCheck()
.containsAll("VALUES '" + schema + "'");

Expand Down

0 comments on commit a286d56

Please sign in to comment.