-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
schemachange/mixed-versions: handle possible syntax error for BIT(0) column usage #134407
schemachange/mixed-versions: handle possible syntax error for BIT(0) column usage #134407
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: complete! 0 of 0 LGTMs obtained (waiting on @DarrylWong, @spilchen, and @vidit-bhat)
pkg/workload/schemachange/operation_generator.go
line 1281 at r1 (raw file):
return false }() hasBit0Type := func() bool {
i think we'll want to block this in other places also, like in ADD COLUMN and SET DEFAULT
perhaps we could add one helper function where we check if the type is allowed so we can use it in a few places.
e66b80d
to
5750fb9
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice! thanks for the fix
// isMixedVersionTest works similarly to isClusterVersionLessThan, but without | ||
// specifying a version. It returns true if the cluster version is not the | ||
// latest, indicating a mixed-version test. | ||
func isMixedVersionTest(ctx context.Context, tx pgx.Tx) (bool, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
super nit: it could be called inMixedVersionState
, since technically the whole test could be considered a "mixed version test"
…column usage A recent fix enabled support for BIT(0) columns (see issue cockroachdb#132944), which has since been backported. However, since this backport hasn’t been released yet, running against an older down-level client may still trigger a syntax error. This change adds a temporary check to handle such errors until the backports for cockroachdb#132944 are publicly released. This adjustment will be backported to older branches, with slight variations per release: - release-24.3: Reuse the same fix as in master. - release-24.2: Use isClusterVersionLessThan with clusterversion.V24.2. - release-24.1: Use isClusterVersionLessThan with clusterversion.V24.1. - release-23.2: Use isClusterVersionLessThan with clusterversion.V23.2. Epic: None Release note: None Closes: cockroachdb#133339, cockroachdb#133790, cockroachdb#131162
5750fb9
to
b66f3b7
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: complete! 0 of 0 LGTMs obtained (waiting on @DarrylWong, @rafiss, and @vidit-bhat)
pkg/workload/schemachange/operation_generator.go
line 1281 at r1 (raw file):
Previously, rafiss (Rafi Shamim) wrote…
i think we'll want to block this in other places also, like in ADD COLUMN and SET DEFAULT
perhaps we could add one helper function where we check if the type is allowed so we can use it in a few places.
Done
pkg/workload/schemachange/operation_generator.go
line 4838 at r2 (raw file):
Previously, rafiss (Rafi Shamim) wrote…
super nit: it could be called
inMixedVersionState
, since technically the whole test could be considered a "mixed version test"
Good point.
TFTR! bors r+ |
Based on the specified backports for this PR, I applied new labels to the following linked issue(s). Please adjust the labels as needed to match the branches actually affected by the issue(s), including adding any known older branches. Issue #133339: branch-release-23.2, branch-release-24.1, branch-release-24.2. Issue #133790: branch-release-24.1, branch-release-24.2, branch-release-24.3. Issue #131162: branch-release-23.2, branch-release-24.1, branch-release-24.2, branch-release-24.3. 🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is dev-inf. |
Encountered an error creating backports. Some common things that can go wrong:
You might need to create your backport manually using the backport tool. error creating merge commit from b66f3b7 to blathers/backport-release-23.2-134407: POST https://api.github.com/repos/cockroachdb/cockroach/merges: 409 Merge conflict [] you may need to manually resolve merge conflicts with the backport tool. Backport to branch 23.2.x failed. See errors above. error creating merge commit from b66f3b7 to blathers/backport-release-24.1-134407: POST https://api.github.com/repos/cockroachdb/cockroach/merges: 409 Merge conflict [] you may need to manually resolve merge conflicts with the backport tool. Backport to branch 24.1.x failed. See errors above. 🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is dev-inf. |
A recent fix enabled support for BIT(0) columns (see issue #132944), which has since been backported. However, since this backport hasn’t been released yet, running against an older down-level client may still trigger a syntax error. This change adds a temporary check to handle such errors until the backports for #132944 are publicly released.
This adjustment will be backported to older branches, with slight variations per release:
Epic: None
Release note: None
Closes #133339
Closes #133790
Closes #131162