spanner: fix TestIntegration_SingleUse_ReadingWithLimit
Accidentally missed copy pasting the data input step during
@@ -368,7 +368,26 @@ func TestIntegration_SingleUse_ReadingWithLimit(t *testing.T) {
client, _, cleanup := prepareIntegrationTest(ctx, t, singerDBStatements)
defer cleanup()
- // Reading with limit.
+ writes := []struct {
+ row []interface{}
+ ts time.Time
+ }{
+ {row: []interface{}{1, "Marc", "Foo"}},
+ {row: []interface{}{2, "Tars", "Bar"}},
+ {row: []interface{}{3, "Alpha", "Beta"}},
+ {row: []interface{}{4, "Last", "End"}},
+ }
+ // Try to write four rows through the Apply API.
+ for i, w := range writes {
+ var err error
+ m := InsertOrUpdate("Singers",
+ []string{"SingerId", "FirstName", "LastName"},
+ w.row)
+ if writes[i].ts, err = client.Apply(ctx, []*Mutation{m}, ApplyAtLeastOnce()); err != nil {
+ t.Fatal(err)
+ }
+ }
+
su := client.Single()
const limit = 1
gotRows, err := readAll(su.ReadWithOptions(ctx, "Singers", KeySets(Key{1}, Key{3}, Key{4}),
