Skip to content

Commit 3bceb1c

Browse files
craig[bot]fqazi
andcommitted
Merge #157924
157924: workload/schemachanger: version gate INSPECT command r=fqazi a=fqazi Previously, the schema changer workload was incorrectly executing the INSPECT command in a mixed version setting. This patch adds version gate to add expected errors if INSPECT is not supported at the current version. Fixes: #156704 Release note: None Co-authored-by: Faizan Qazi <[email protected]>
2 parents 2e5f8a0 + 8a08bd9 commit 3bceb1c

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

pkg/workload/schemachange/operation_generator.go

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3508,6 +3508,17 @@ func (og *operationGenerator) inspect(ctx context.Context, tx pgx.Tx) (*opStmt,
35083508
sb.WriteString(" WITH OPTIONS DETACHED")
35093509
stmt.sql = sb.String()
35103510

3511+
// If INSPECT is not supported yet, so we expect a syntax error or feature
3512+
// not supported.
3513+
isInspectUnsupported, err := isClusterVersionLessThan(ctx, tx, clusterversion.V25_4.Version())
3514+
if err != nil {
3515+
return nil, err
3516+
}
3517+
if isInspectUnsupported {
3518+
stmt.expectedExecErrors.add(pgcode.FeatureNotSupported)
3519+
stmt.expectedExecErrors.add(pgcode.Syntax)
3520+
}
3521+
35113522
return stmt, nil
35123523
}
35133524

0 commit comments

Comments
 (0)