-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(spanner/spannertest): support queries in ExecuteSql (#3640)
Normal queries from the Spanner client use the ExecuteStreamingSql method, while DML statements use ExecuteSql. This distinction was also built into spannertest where ExecuteSql would only support DML statements and required a transaction to be specified. The session pool however uses ExecuteSql to execute a simple `SELECT 1` query without specifying any transaction. This would cause a nil pointer dereference. This PR introduces support for queries in the ExecuteSql method. The current logic assumes that the statement is a query if the transaction is a single- use read-only transaction. Fixes #3639
- Loading branch information
Showing
2 changed files
with
119 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters