Repository navigation
fix: preserve case for pseudo-reserved word identifiers in AST nodes - #273
Open
JonathanPerry651 wants to merge 1 commit into
Conversation
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.
Fixes #272
Summary
Fixes a regression exposed in
v1.26.0(after adding<GRAPH: "graph">and other pseudo-reserved tokens inbe2c24e, combined with reference validation in7368ef3) where lowercase identifiers matching pseudo-reserved keywords (such as a table namedgraph) were uppercased toGRAPHby AST nodes callingAstTreeUtils.tokensToString(...)with the defaultupperCaseReserved = true.Changes
upperCaseReserved = falsewhen rendering identifier/object-name nodes:ASTtable(CREATE [SEARCH] INDEX ... ON <table>)ASTtable_name(ALTER TABLE <table> ...)ASTtable_interleave_clause(INTERLEAVE IN [PARENT] <table>)ASTindex_interleave_clause(CREATE [SEARCH] INDEX ..., INTERLEAVE IN <table>)ASTforeign_key&ASTcheck_constraint(CONSTRAINT <name>)ASTalter_database_statement(ALTER DATABASE <dbname>)ASTannotation&ASTannotation_paramASTrow_deletion_policy_clausefrom its child AST nodes so function/column names preserve case whileINTERVAL ... DAYremains uppercased.STRUCTfields inASTcolumn_typeusing their childASTname/ASTcolumn_typenodes so struct field names preserve case while field types remain uppercased.ddlParserValidation.txt,DdlDiffValidationTest, andDdlDiffTestcovering lowercasegraphacross tables, indexes, search indexes, interleaving, constraints, row deletion policies,STRUCTfields,ALTER TABLE, andALTER DATABASE.Verification
mvn -B verify --file pom.xml:google-checkstyleandlicence-header)