Skip to content

Commit

Permalink
schemachange: remove create schema workload from 20.2
Browse files Browse the repository at this point in the history
The create schema method in workload/schemachange was not
backported to release 20.2. This change removes it to get
workload compiling.

Release note: None
  • Loading branch information
adityamaru committed Oct 23, 2020
1 parent d63c9f5 commit 7ae2daf
Showing 1 changed file with 0 additions and 14 deletions.
14 changes: 0 additions & 14 deletions pkg/workload/schemachange/schemachange.go
Original file line number Diff line number Diff line change
Expand Up @@ -410,9 +410,6 @@ func (w *schemaChangeWorker) randOp(tx *pgx.Tx) (string, string, error) {
case createEnum:
stmt, err = w.createEnum(tx)

case createSchema:
stmt, err = w.createSchema(tx)

case dropColumn:
stmt, err = w.dropColumn(tx)

Expand Down Expand Up @@ -1177,17 +1174,6 @@ func (w *schemaChangeWorker) randType(tx *pgx.Tx) (tree.ResolvableTypeReference,
return rowenc.RandSortingType(w.rng), nil
}

func (w *schemaChangeWorker) createSchema(tx *pgx.Tx) (string, error) {
schemaName, err := w.randSchema(tx, 10)
if err != nil {
return "", err
}

// TODO(jayshrivastava): Support authorization
stmt := rowenc.MakeSchemaName(w.rng.Intn(2) == 0, schemaName, "")
return tree.Serialize(stmt), nil
}

func (w *schemaChangeWorker) randSchema(tx *pgx.Tx, pctExisting int) (string, error) {
if w.rng.Intn(100) >= pctExisting {
return fmt.Sprintf("schema%d", atomic.AddInt64(w.seqNum, 1)), nil
Expand Down

0 comments on commit 7ae2daf

Please sign in to comment.