Skip to content

Commit e0282d6

Browse files
craig[bot]fqazi
andcommitted
Merge #158765
158765: workload/schemachanger: add potential error for DETACHED flag in inspect r=fqazi a=fqazi 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 Co-authored-by: Faizan Qazi <[email protected]>
2 parents 274f78d + 348e80c commit e0282d6

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)