fix(test): Adapt base type creation test for Cloudberry#30
Merged
gfphoenix78 merged 1 commit intoapache:sync-with-upstreamfrom Aug 28, 2025
Merged
fix(test): Adapt base type creation test for Cloudberry#30gfphoenix78 merged 1 commit intoapache:sync-with-upstreamfrom
gfphoenix78 merged 1 commit intoapache:sync-with-upstreamfrom
Conversation
This commit resolves an integration test failure for PrintCreateBaseTypeStatement when running against Cloudberry, which is based on PostgreSQL 14. PostgreSQL 14 enforces stricter validation for `CREATE TYPE`. It now requires that a type specified with an `ELEMENT` parameter must also have an associated subscripting function. This requirement is not enforced in PostgreSQL 12 (on which GPDB 7 is based), which allowed `ELEMENT` as a metadata-only attribute. To ensure compatibility, this change conditionally modifies the `baseType` struct in the `BeforeEach` block. When running on Cloudberry, the `Element` field is set to an empty string. This ensures that the auto-generated `CREATE TYPE` statement is valid for PostgreSQL 14, allowing the test to pass while preserving the original logic for GPDB 7.
gfphoenix78
approved these changes
Aug 28, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This commit resolves an integration test failure for PrintCreateBaseTypeStatement when running against Cloudberry, which is based on PostgreSQL 14.
PostgreSQL 14 enforces stricter validation for
CREATE TYPE. It now requires that a type specified with anELEMENTparameter must also have an associated subscripting function. This requirement is not enforced in PostgreSQL 12 (on which GPDB 7 is based), which allowedELEMENTas a metadata-only attribute.To ensure compatibility, this change conditionally modifies the
baseTypestruct in theBeforeEachblock. When running on Cloudberry, theElementfield is set to an empty string. This ensures that the auto-generatedCREATE TYPEstatement is valid for PostgreSQL 14, allowing the test to pass while preserving the original logic for GPDB 7.