fix: always allow metadata queries by olavloite · Pull Request #2580 · googleapis/java-spanner (original) (raw)
Internal metadata queries should always be allowed, regardless of the type of transaction that is currently running or any special mode that has been set on the connection. Internal metadata queries are system queries that are generated by a connection to return metadata to an application, for example methods like getTables() in JDBC.
Internal metadata queries should always be allowed, regardless of the type of transaction that is currently running or any special mode that has been set on the connection. Internal metadata queries are system queries that are generated by a connection to return metadata to an application, for example methods like getTables() in JDBC.
@@ -133,17 +133,6 @@ enum BatchMode { |
---|
DML |
} |
/** |
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was dead code. Only the class in the public Connection
interface was used.
@@ -121,29 +118,6 @@ public ApiFuture executeQueryAsync( |
---|
final ParsedStatement statement, |
AnalyzeMode analyzeMode, |
QueryOption... options) { |
if (options != null) { |
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This special handling is no longer needed, as it is generically handled in the connection.
@@ -157,25 +157,6 @@ public void testExecuteCreateDatabase() { |
---|
.parse(Statement.of("CREATE DATABASE foo")))); |
} |
@Test |
public void testExecuteMetadataQuery() { |
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This test specifically checked whether a DDL batch could execute an internal metadata query. That is no longer needed, as a DDL batch no longer handles that special case itself. Instead, this is handled directly in the connection for all types of transactions.
@@ -157,25 +157,6 @@ public void testExecuteCreateDatabase() { |
---|
.parse(Statement.of("CREATE DATABASE foo")))); |
} |
@Test |
public void testExecuteMetadataQuery() { |
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This test specifically checked whether a DDL batch could execute an internal metadata query. That is no longer needed, as a DDL batch no longer handles that special case itself. Instead, this is handled directly in the connection for all types of transactions.
…is/java-spanner into allow-internal-metadata-queries
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, apart from just one nit.
Co-authored-by: Rajat Bhatta 93644539+rajatbhatta@users.noreply.github.com
olavloite deleted the allow-internal-metadata-queries branch