Skip to content

Conversation

@ryzhyk
Copy link
Contributor

@ryzhyk ryzhyk commented Oct 24, 2025

SqlIdentifier must convert the name to a canonical form during construction for PartialEq, etc. to be sound.

SqlIdentifier must convert the name to a canonical form during construction for
PartialEq, etc. to be sound.

Signed-off-by: Leonid Ryzhyk <[email protected]>
@ryzhyk ryzhyk requested review from Copilot and gz October 24, 2025 23:49
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR fixes the SqlIdentifier implementation to ensure sound equality comparison semantics. The key issue was that the constructor wasn't normalizing identifiers to their canonical form, which could cause PartialEq and related traits to behave incorrectly when comparing case-insensitive identifiers with different casing.

Key changes:

  • Modified SqlIdentifier::new() to convert case-insensitive identifiers to lowercase during construction

gz

This comment was marked as outdated.

Copy link
Contributor

@gz gz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok so it does change the semantics of sql_name

@ryzhyk
Copy link
Contributor Author

ryzhyk commented Oct 25, 2025

ok so it does change the semantics of sql_name

Yes, and I think it leaves less space for errors by eliminating the non-canonical representation of case-insensitive identifiers.

@blp blp requested a review from gz November 14, 2025 18:22
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.

3 participants