Skip to content

Conversation

@zachmu
Copy link
Member

@zachmu zachmu commented Sep 29, 2023

Also fixed a bug where we allowed multiple column names with the same case-insensitive name

Fixes dolthub/dolt#6611

@zachmu zachmu requested a review from max-hoffman September 29, 2023 22:11
Copy link
Contributor

@max-hoffman max-hoffman left a comment

Choose a reason for hiding this comment

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

This improves correctness but the implementation is counterproductive to the ongoing refactors. Validation should happen before query rewrites. For ex, you don't need a new rule to validate the ident when converting ast.RenameTable to plan.RenameTable. Named rules are useful when series of seemingly OK individual transforms in combination create problems. Validation doesn't benefit from rule names for context, errors are typed and provide all of the necessary context.

var scripts = []queries.ScriptTest{
{
Name: "add new generated column",
Name: "Identifier lengths",
Copy link
Contributor

Choose a reason for hiding this comment

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

changes to this file make PRs in GItHub harder to read and usually cause merge conflicts

@zachmu zachmu closed this Oct 2, 2023
@zachmu zachmu force-pushed the zachmu/identifiers branch from 53cdfb4 to c571c3c Compare October 2, 2023 18:07
@zachmu zachmu reopened this Oct 2, 2023
@zachmu
Copy link
Member Author

zachmu commented Oct 2, 2023

This improves correctness but the implementation is counterproductive to the ongoing refactors. Validation should happen before query rewrites. For ex, you don't need a new rule to validate the ident when converting ast.RenameTable to plan.RenameTable. Named rules are useful when series of seemingly OK individual transforms in combination create problems. Validation doesn't benefit from rule names for context, errors are typed and provide all of the necessary context.

Discussed offline. I initially made this change in part, but on consideration this pattern of erroring on statements during parse that used to parse correctly can be very dangerous for backwards compatibility, since existing databases definitions will no longer parse without error in contexts where they need to. To move more validation logic into the parser safely, we need to also support permissive parsing modes to prevent existing databases from tripping newly added validations.

@zachmu zachmu merged commit d1b11dc into main Oct 2, 2023
@Hydrocharged Hydrocharged deleted the zachmu/identifiers branch February 7, 2024 13:46
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.

Creating attribute with more than 64 character is allowed but causes error.

2 participants