Skip to content

workload/schemachange: exclude hidden columns from policy expressions#166329

Open
fqazi wants to merge 1 commit intocockroachdb:masterfrom
fqazi:fixPolicyExpression
Open

workload/schemachange: exclude hidden columns from policy expressions#166329
fqazi wants to merge 1 commit intocockroachdb:masterfrom
fqazi:fixPolicyExpression

Conversation

@fqazi
Copy link
Collaborator

@fqazi fqazi commented Mar 20, 2026

This commit updates tableColumnsShuffled to filter out hidden columns when gathering available columns for random policy expression generation.

Previously, the workload generator could generate policies referencing hidden columns (e.g., from hash-sharded indexes). However, the dropColumn error screening logic (which uses information_schema.columns) is blind to hidden columns, leading to false negatives where a column drop was attempted without expecting the policy dependency error.

Since dropColumn already ignores hidden columns when selecting a target to drop, ensuring policies only reference visible columns prevents this class of false-negative dependency bugs.

Fixes: #164725
Epic: None
Release note: None

This commit updates tableColumnsShuffled to filter out hidden columns
when gathering available columns for random policy expression generation.

Previously, the workload generator could generate policies referencing
hidden columns (e.g., from hash-sharded indexes). However, the
dropColumn error screening logic (which uses information_schema.columns)
is blind to hidden columns, leading to false negatives where a column
drop was attempted without expecting the policy dependency error.

Since dropColumn already ignores hidden columns when selecting a
target to drop, ensuring policies only reference visible columns
prevents this class of false-negative dependency bugs.

Fixes: cockroachdb#164725
Epic: None
Release note: None
@fqazi fqazi requested a review from a team March 20, 2026 18:58
@fqazi fqazi requested a review from a team as a code owner March 20, 2026 18:58
@fqazi fqazi requested review from DarrylWong and srosenberg and removed request for a team March 20, 2026 18:58
@trunk-io
Copy link
Contributor

trunk-io bot commented Mar 20, 2026

Merging to master in this repository is managed by Trunk.

  • To merge this pull request, check the box to the left or comment /trunk merge below.

@cockroach-teamcity
Copy link
Member

This change is Reviewable

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

pkg/ccl/testccl/workload/schemachange/schemachange_test: TestWorkload failed

2 participants