@@ -25,12 +25,13 @@ import (
2525 "cloud.google.com/go/spanner/apiv1/spannerpb"
2626 "github.com/google/go-cmp/cmp"
2727 "github.com/google/go-cmp/cmp/cmpopts"
28+ "github.com/googleapis/go-sql-spanner/connectionstate"
2829 "google.golang.org/grpc/codes"
2930 "google.golang.org/protobuf/types/known/structpb"
3031)
3132
3233func TestStatementExecutor_StartBatchDdl (t * testing.T ) {
33- c := & conn {retryAborts : true , logger : noopLogger }
34+ c := & conn {retryAborts : true , logger : noopLogger , state : createInitialConnectionState ( connectionstate . TypeNonTransactional , map [ string ]connectionstate. ConnectionPropertyValue {}) }
3435 s := & statementExecutor {}
3536 ctx := context .Background ()
3637
@@ -61,7 +62,7 @@ func TestStatementExecutor_StartBatchDdl(t *testing.T) {
6162}
6263
6364func TestStatementExecutor_StartBatchDml (t * testing.T ) {
64- c := & conn {retryAborts : true , logger : noopLogger }
65+ c := & conn {retryAborts : true , logger : noopLogger , state : createInitialConnectionState ( connectionstate . TypeNonTransactional , map [ string ]connectionstate. ConnectionPropertyValue {}) }
6566 s := & statementExecutor {}
6667 ctx := context .Background ()
6768
@@ -98,7 +99,7 @@ func TestStatementExecutor_StartBatchDml(t *testing.T) {
9899}
99100
100101func TestStatementExecutor_RetryAbortsInternally (t * testing.T ) {
101- c := & conn {retryAborts : true , logger : noopLogger }
102+ c := & conn {retryAborts : true , logger : noopLogger , state : createInitialConnectionState ( connectionstate . TypeNonTransactional , map [ string ]connectionstate. ConnectionPropertyValue {}) }
102103 s := & statementExecutor {}
103104 ctx := context .Background ()
104105 for i , test := range []struct {
@@ -154,7 +155,7 @@ func TestStatementExecutor_RetryAbortsInternally(t *testing.T) {
154155}
155156
156157func TestStatementExecutor_AutocommitDmlMode (t * testing.T ) {
157- c := & conn {logger : noopLogger , connector : & connector {}}
158+ c := & conn {logger : noopLogger , connector : & connector {}, state : createInitialConnectionState ( connectionstate . TypeNonTransactional , map [ string ]connectionstate. ConnectionPropertyValue {}) }
158159 _ = c .ResetSession (context .Background ())
159160 s := & statementExecutor {}
160161 ctx := context .Background ()
@@ -211,7 +212,7 @@ func TestStatementExecutor_AutocommitDmlMode(t *testing.T) {
211212}
212213
213214func TestStatementExecutor_ReadOnlyStaleness (t * testing.T ) {
214- c := & conn {logger : noopLogger }
215+ c := & conn {logger : noopLogger , state : createInitialConnectionState ( connectionstate . TypeNonTransactional , map [ string ]connectionstate. ConnectionPropertyValue {}) }
215216 s := & statementExecutor {}
216217 ctx := context .Background ()
217218 for i , test := range []struct {
@@ -282,7 +283,7 @@ func TestStatementExecutor_ReadOnlyStaleness(t *testing.T) {
282283func TestShowCommitTimestamp (t * testing.T ) {
283284 t .Parallel ()
284285
285- c := & conn {retryAborts : true , logger : noopLogger }
286+ c := & conn {retryAborts : true , logger : noopLogger , state : createInitialConnectionState ( connectionstate . TypeNonTransactional , map [ string ]connectionstate. ConnectionPropertyValue {}) }
286287 s := & statementExecutor {}
287288 ctx := context .Background ()
288289
@@ -328,7 +329,7 @@ func TestShowCommitTimestamp(t *testing.T) {
328329}
329330
330331func TestStatementExecutor_ExcludeTxnFromChangeStreams (t * testing.T ) {
331- c := & conn {retryAborts : true , logger : noopLogger }
332+ c := & conn {retryAborts : true , logger : noopLogger , state : createInitialConnectionState ( connectionstate . TypeNonTransactional , map [ string ]connectionstate. ConnectionPropertyValue {}) }
332333 s := & statementExecutor {}
333334 ctx := context .Background ()
334335 for i , test := range []struct {
@@ -384,7 +385,7 @@ func TestStatementExecutor_ExcludeTxnFromChangeStreams(t *testing.T) {
384385}
385386
386387func TestStatementExecutor_MaxCommitDelay (t * testing.T ) {
387- c := & conn {logger : noopLogger }
388+ c := & conn {logger : noopLogger , state : createInitialConnectionState ( connectionstate . TypeNonTransactional , map [ string ]connectionstate. ConnectionPropertyValue {}) }
388389 s := & statementExecutor {}
389390 ctx := context .Background ()
390391 for i , test := range []struct {
@@ -457,7 +458,7 @@ func TestStatementExecutor_SetTransactionTag(t *testing.T) {
457458 {"" , "tag-with-missing-opening-quote'" , true },
458459 {"" , "'tag-with-missing-closing-quote" , true },
459460 } {
460- c := & conn {retryAborts : true , logger : noopLogger }
461+ c := & conn {retryAborts : true , logger : noopLogger , state : createInitialConnectionState ( connectionstate . TypeNonTransactional , map [ string ]connectionstate. ConnectionPropertyValue {}) }
461462 s := & statementExecutor {}
462463
463464 it , err := s .ShowTransactionTag (ctx , c , "" , ExecOptions {}, nil )
@@ -517,7 +518,7 @@ func TestStatementExecutor_SetTransactionTag(t *testing.T) {
517518
518519func TestStatementExecutor_UsesExecOptions (t * testing.T ) {
519520 ctx := context .Background ()
520- c := & conn {retryAborts : true , logger : noopLogger }
521+ c := & conn {retryAborts : true , logger : noopLogger , state : createInitialConnectionState ( connectionstate . TypeNonTransactional , map [ string ]connectionstate. ConnectionPropertyValue {}) }
521522 s := & statementExecutor {}
522523
523524 it , err := s .ShowTransactionTag (ctx , c , "" , ExecOptions {DecodeOption : DecodeOptionProto , ReturnResultSetMetadata : true , ReturnResultSetStats : true }, nil )
0 commit comments