Skip to content

Commit 348e80c

Browse files
committed
workload/schemachanger: add potential error for DETACHED flag in inspect
Previously, when running in a mixed version state the detached flag for INSPECT may not have been supported, specifically if we ran it against an older release. This patch adds a version gate to add a potential error when the DETACHED flag is specified on INSPECT on 25.4. Fixes: #158326 Release note: None
1 parent 804fa04 commit 348e80c

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

pkg/workload/schemachange/operation_generator.go

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3501,7 +3501,14 @@ func (og *operationGenerator) inspect(ctx context.Context, tx pgx.Tx) (*opStmt,
35013501
stmt.potentialExecErrors.addAll(codesWithConditions{
35023502
{pgcode.FeatureNotSupported, asof != ""},
35033503
})
3504-
3504+
// Detached flag was added in 26.1, so we expect errors till the user upgrades.
3505+
isDetachedUnsupported, err := isClusterVersionLessThan(ctx, tx, clusterversion.V26_1.Version())
3506+
if err != nil {
3507+
return nil, err
3508+
}
3509+
if isDetachedUnsupported {
3510+
stmt.potentialExecErrors.add(pgcode.FeatureNotSupported)
3511+
}
35053512
// Always run DETACHED as this allows us to use INSPECT inside of a
35063513
// transaction. We have post-processing at the end of the run to verify
35073514
// INSPECT didn't find any issues.

0 commit comments

Comments
 (0)