-
Notifications
You must be signed in to change notification settings - Fork 123
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: always allow metadata queries #2580
Conversation
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 | |||
} | |||
|
|||
/** |
There was a problem hiding this comment.
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<ResultSet> executeQueryAsync( | |||
final ParsedStatement statement, | |||
AnalyzeMode analyzeMode, | |||
QueryOption... options) { | |||
if (options != null) { |
There was a problem hiding this comment.
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() { |
There was a problem hiding this comment.
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() { |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
google-cloud-spanner/src/main/java/com/google/cloud/spanner/connection/ConnectionImpl.java
Outdated
Show resolved
Hide resolved
Co-authored-by: Rajat Bhatta <[email protected]>
🤖 I have created a release *beep* *boop* --- ## [6.45.1](https://togithub.com/googleapis/java-spanner/compare/v6.45.0...v6.45.1) (2023-08-11) ### Bug Fixes * Always allow metadata queries ([#2580](https://togithub.com/googleapis/java-spanner/issues/2580)) ([ebb17fc](https://togithub.com/googleapis/java-spanner/commit/ebb17fc8aeac5fc75e4f135f33dba970f2480585)) --- This PR was generated with [Release Please](https://togithub.com/googleapis/release-please). See [documentation](https://togithub.com/googleapis/release-please#release-please).
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.