func TestQueryWithNewColumn_CommitAborted(t *testing.T) {
	testRetryReadWriteTransactionWithQuery(t, func(server testutil.InMemSpannerServer) {
		// Let the query return an empty result set with only one column.
		server.PutStatementResult(testutil.SelectFooFromBar, &testutil.StatementResult{
			Type:      testutil.StatementResultResultSet,
			ResultSet: testutil.CreateSingleColumnResultSet([]int64{}, "FOO"),
		})
		server.PutExecutionTime(testutil.MethodCommitTransaction, testutil.SimulatedExecutionTime{
			Errors: []error{status.Error(codes.Aborted, "Aborted")},
		})
	}, codes.OK, -1, 2, 1,
		func(server testutil.InMemSpannerServer) {
			// Let the query return an empty result set with two columns during the retry.
			// This should cause a retry failure.
			server.PutStatementResult(testutil.SelectFooFromBar, &testutil.StatementResult{
				Type:      testutil.StatementResultResultSet,
				ResultSet: testutil.CreateTwoColumnResultSet([][2]int64{}, [2]string{"FOO", "BAR"}),
			})
		}, ErrAbortedDueToConcurrentModification)
}
// TestQueryWithNewColumn_CommitAborted tests the scenario where a query returns
// the same empty result set during a retry, but with a new column.
TestQueryWithNewColumn_CommitAborted tests the scenario where a query returns
the same empty result set during a retry, but with a new column.
// TestQueryWithNewColumn_CommitAborted tests the scenario where a query returns // the same empty result set during a retry but with a new column .
func TestQueryWithNewColumn_CommitAborted(t *testing.T) {
	testRetryReadWriteTransactionWithQuery(t, func(server testutil.InMemSpannerServer) {
		server.PutStatementResult(testutil.SelectFooFromBar, &testutil.StatementResult{
			Type:      testutil.StatementResultResultSet,
			ResultSet: testutil.CreateSingleColumnResultSet([]int64{}, "FOO"),
		})
		server.PutExecutionTime(testutil.MethodCommitTransaction, testutil.SimulatedExecutionTime{
			Errors: []error{status.Error(codes.Aborted, "Aborted")},
		})
	}, codes.OK, -1, 2, 1,
		func(server testutil.InMemSpannerServer) {
			server.PutStatementResult(testutil.SelectFooFromBar, &testutil.StatementResult{
				Type:      testutil.StatementResultResultSet,
				ResultSet: testutil.CreateTwoColumnResultSet([][2]int64{}, [2]string{"FOO", "BAR"}),
			})
		}, ErrAbortedDueToConcurrentModification)
}
func TestQueryWithNewColumn_CommitAborted ( t * testing . T ) { testRetryReadWriteTransactionWithQuery ( t , func ( server testutil . InMemSpannerServer ) { server . PutStatementResult ( testutil . SelectFooFromBar , & testutil . StatementResult { Type : testutil . StatementResultResultSet , ResultSet : testutil . CreateSingleColumnResultSet ( [ ] int64 { } , " " ) , } ) server . PutExecutionTime ( testutil . MethodCommitTransaction , testutil . SimulatedExecutionTime { Errors : [ ] error { status . Error ( codes . Aborted , " " ) } , } ) } , codes . OK , - 1 , 2 , 1 , func ( server testutil . InMemSpannerServer ) { server . PutStatementResult ( testutil . SelectFooFromBar , & testutil . StatementResult { Type : testutil . StatementResultResultSet , ResultSet : testutil . CreateTwoColumnResultSet ( [ ] [ 2 ] int64 { } , [ 2 ] string { " " , " " } ) , } ) } , ErrAbortedDueToConcurrentModification ) }
TestQueryWithNewColumn_CommitAborted tests the scenario where a query returns
the same empty result set during a retry, but with a new column.
TestQueryWithNewColumn_CommitAborted tests the scenario where a query returns the same empty result set during a retry but with a new column .
// Let the query return an empty result set with only one column. // Let the query return an empty result set with two columns during the retry. // This should cause a retry failure.