Skip to content

Commit

Permalink
*fix generation not nil stmt with nil valuse in genSinglePartitionQuery.
Browse files Browse the repository at this point in the history
  • Loading branch information
dkropachev committed May 17, 2023
1 parent a7ac7f3 commit 252c05b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions schema.go
Original file line number Diff line number Diff line change
Expand Up @@ -720,6 +720,7 @@ func (s *Schema) genSinglePartitionQuery(t *Table, g *Generator, r *rand.Rand, p

tableName := t.Name
partitionKeys := t.PartitionKeys
values := valuesWithToken.Value.Copy()
if len(t.MaterializedViews) > 0 && r.Int()%2 == 0 {
view := r.Intn(len(t.MaterializedViews))
tableName = t.MaterializedViews[view].Name
Expand All @@ -734,13 +735,13 @@ func (s *Schema) genSinglePartitionQuery(t *Table, g *Generator, r *rand.Rand, p
}
if (ColumnDef{}) != mvCol {
mvValues = appendValue(mvCol.Type, r, p, mvValues)
mvValues = append(mvValues, valuesWithToken.Value...)
values = append(mvValues, values...)
}

return &Stmt{
ValuesWithToken: valuesWithToken,
Query: builder,
Values: mvValues,
Values: values,
Types: typs,
QueryType: SelectStatementType,
}
Expand Down

0 comments on commit 252c05b

Please sign in to comment.