fix: always allow metadata queries by olavloite · Pull Request #2580 · googleapis/java-spanner (original) (raw)

olavloite

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.

@olavloite

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.

olavloite

@@ -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.

olavloite

@@ -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.

@gcf-owl-bot

olavloite

@@ -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.

olavloite

@@ -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.

@olavloite

@olavloite

…is/java-spanner into allow-internal-metadata-queries

rajatbhatta

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.

@olavloite @rajatbhatta

Co-authored-by: Rajat Bhatta 93644539+rajatbhatta@users.noreply.github.com

@olavloite

@olavloite olavloite deleted the allow-internal-metadata-queries branch

August 11, 2023 17:07