Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

roachtest: schemachange/mixed-versions: check version for JSON types #101638

Merged
merged 1 commit into from
Apr 20, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions pkg/workload/schemachange/operation_generator.go
Original file line number Diff line number Diff line change
Expand Up @@ -1333,15 +1333,15 @@ func (og *operationGenerator) createTable(ctx context.Context, tx pgx.Tx) (*opSt
}()
// Forward indexes for arrays were added in 23.1, so check the index
// definitions for them in mixed version states.
forwardIndexesOnArraysNotSupported, err := isClusterVersionLessThan(
forwardIndexesOnNewTypesSupported, err := isClusterVersionLessThan(
ctx,
tx,
clusterversion.ByKey(clusterversion.V23_1))
if err != nil {
return nil, err
}
hasUnsupportedForwardQueries, err := func() (bool, error) {
if !forwardIndexesOnArraysNotSupported {
hasUnsupportedForwardIdxQueries, err := func() (bool, error) {
if !forwardIndexesOnNewTypesSupported {
return false, nil
}
colInfoMap := make(map[tree.Name]*tree.ColumnTableDef)
Expand All @@ -1363,7 +1363,8 @@ func (og *operationGenerator) createTable(ctx context.Context, tx pgx.Tx) (*opSt
if err != nil {
return false, err
}
if typ.Family() == types.ArrayFamily {
if typ.Family() == types.ArrayFamily ||
typ.Family() == types.JsonFamily {
return true, err
}
}
Expand Down Expand Up @@ -1394,7 +1395,7 @@ func (og *operationGenerator) createTable(ctx context.Context, tx pgx.Tx) (*opSt
codesWithConditions{
{code: pgcode.Syntax, condition: hasUnsupportedTSQuery},
{code: pgcode.FeatureNotSupported, condition: hasUnsupportedTSQuery},
{code: pgcode.FeatureNotSupported, condition: hasUnsupportedForwardQueries},
{code: pgcode.FeatureNotSupported, condition: hasUnsupportedForwardIdxQueries},
}.add(opStmt.potentialExecErrors)
// Descriptor ID generator may be temporarily unavailable, so
// allow uncategorized errors temporarily.
Expand Down