Skip to content
This repository was archived by the owner on Apr 7, 2026. It is now read-only.

fix: support DDL/ClientSideStatement through Connection#executeUpdate API#2324

Closed
rajatbhatta wants to merge 6 commits into
googleapis:mainfrom
rajatbhatta:fix-pstmt-ddl-execute-update
Closed

fix: support DDL/ClientSideStatement through Connection#executeUpdate API#2324
rajatbhatta wants to merge 6 commits into
googleapis:mainfrom
rajatbhatta:fix-pstmt-ddl-execute-update

Conversation

@rajatbhatta

@rajatbhatta rajatbhatta commented Mar 7, 2023

Copy link
Copy Markdown
Contributor

DDL statements and ClientSideStatements which return no result are now supported through executeUpdate API in ConnectionImpl and should return 0L in that case.

We add this change to the corresponding async API (executeUpdateAsync) too.

This change will be propagated to executeUpdate APIs through Statement and PreparedStatement in JDBC.

DDL statements are now supported through executeUpdate API in ConnectionImpl and should return 0L in that case.

This change will be propagated to executeUpdate APIs through Statement and PreparedStatement in JDBC.
@product-auto-label product-auto-label Bot added size: s Pull request size is small. api: spanner Issues related to the googleapis/java-spanner API. labels Mar 7, 2023
…date API

DDL statements and ClientSideStatements which return no result are now supported through executeUpdate API in ConnectionImpl and should return 0L in that case.

We add this change to the corresponding async API (executeUpdateAsync) too.

This change will be propagated to executeUpdate APIs through Statement and PreparedStatement in JDBC.
@product-auto-label product-auto-label Bot added size: m Pull request size is medium. and removed size: s Pull request size is small. labels Mar 8, 2023
@rajatbhatta rajatbhatta changed the title fix: support DDL through ConnectionImpl.executeUpdate API fix: support DDL/ClientSideStatement through ConnectionImpl.executeUpdate API Mar 8, 2023
@product-auto-label product-auto-label Bot added size: l Pull request size is large. and removed size: m Pull request size is medium. labels Mar 8, 2023
@rajatbhatta rajatbhatta added the owlbot:run Add this label to trigger the Owlbot post processor. label Mar 8, 2023
@gcf-owl-bot gcf-owl-bot Bot removed the owlbot:run Add this label to trigger the Owlbot post processor. label Mar 8, 2023
@rajatbhatta rajatbhatta added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Mar 8, 2023
@rajatbhatta rajatbhatta marked this pull request as ready for review March 9, 2023 00:00
@rajatbhatta rajatbhatta requested review from a team and olavloite March 9, 2023 00:00
@olavloite olavloite changed the title fix: support DDL/ClientSideStatement through ConnectionImpl.executeUpdate API fix: support DDL/ClientSideStatement through Connection#executeUpdate API Mar 9, 2023
long updateCount = updateCountFuture.get();
assertEquals(updateCount, 0L);
} catch (ExecutionException | InterruptedException e) {
// pass

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that this should cause a test failure. We don't expect this call to fail.

}
}
} catch (ExecutionException | InterruptedException e) {
// pass

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should cause a test failure and not be silently ignored.

},
connection,
ErrorCode.FAILED_PRECONDITION);
} else if (type == StatementType.DDL) {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change also requires that we re-generate the generated tests. You can do that with the following Maven command:

mvn -Ddo_log_statements=true exec:java -Dexec.mainClass=com.google.cloud.spanner.connection.SqlTestScriptsGenerator -Dexec.classpathScope="test"

See

* mvn -Ddo_log_statements=true exec:java -Dexec.mainClass=com.google.cloud.spanner.connection.SqlTestScriptsGenerator -Dexec.classpathScope="test"

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is done. Thanks for pointing it out.

@product-auto-label product-auto-label Bot added size: xl Pull request size is extra large. and removed size: l Pull request size is large. labels Mar 9, 2023
@yoshi-kokoro yoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Mar 9, 2023
@arpan14

arpan14 commented Feb 23, 2024

Copy link
Copy Markdown
Contributor

Closing due to inactivity.

@arpan14 arpan14 closed this Feb 23, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

api: spanner Issues related to the googleapis/java-spanner API. size: xl Pull request size is extra large.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants