Skip to content

Commit

Permalink
SNOW-695007 Fix DatabaseMetaDataInternalIt:testGetTables test in prep…
Browse files Browse the repository at this point in the history
…aration for rollout of hybrid table infoschema views (#1218)

Fix DatabaseMetaDataInternalIt:testGetTables to have a smaller scope of when it disables ENABLE_KEY_VALUE_TABLE so that it will not break when we start to roll out hybrid tables information_schema views.
  • Loading branch information
sfc-gh-twarszawski authored Jan 13, 2023
1 parent 5111355 commit 8c0a9ce
Showing 1 changed file with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -442,10 +442,6 @@ public void testGetTables() throws SQLException {

// set parameter
stmt.execute("alter session set ENABLE_DRIVER_TERSE_SHOW = true;");
// SNOW-487548: disable the key-value feature to hide is_hybrid column
// in show tables command. The column is controlled by two parameters:
// enable_key_value_table and qa_mode.
stmt.execute("alter session set ENABLE_KEY_VALUE_TABLE = false;");
stmt.execute("alter session set qa_mode = false;");

databaseMetaData = connection.getMetaData();
Expand Down Expand Up @@ -498,6 +494,10 @@ public void testGetTables() throws SQLException {
resultSet = databaseMetaData.getTables("JDBC_DB1", "JDBC%", null, new String[] {"TABLE"});
assertEquals(3, getSizeOfResultSet(resultSet));

// SNOW-487548: disable the key-value feature to hide is_hybrid column
// in show tables command. The column is controlled by two parameters:
// enable_key_value_table and qa_mode.
stmt.execute("alter session set ENABLE_KEY_VALUE_TABLE = false;");
resultSet =
databaseMetaData.getTables("JDBC_DB1", "JDBC_SCH%", "J_BC_TBL122", new String[] {"TABLE"});
resultSet.next();
Expand All @@ -506,6 +506,7 @@ public void testGetTables() throws SQLException {
assertEquals("JDBC_TBL122", resultSet.getString(3));
assertEquals("TABLE", resultSet.getString(4));
assertEquals("", resultSet.getString(5));
stmt.execute("alter session unset ENABLE_KEY_VALUE_TABLE;");

resultSet = databaseMetaData.getTables("JDBC_DB1", null, "JDBC_TBL211", new String[] {"TABLE"});
assertEquals(0, getSizeOfResultSet(resultSet));
Expand Down

0 comments on commit 8c0a9ce

Please sign in to comment.