Repository navigation
fix(databend): keep table names and bound values intact - #4041
Merged
Merged
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.
Summary
orders`backup, was browsed, filtered, edited and exported as another table: the app doubled the backtick, and Databend before 1.2.945 ends a backtick name at the next one. Such a name is now written in double quotes, the spelling the driver already used.\0, which Databend reads as one octal escape with the digits, so a grid edit or delete could match another row. NUL is now\x00, as Databend writes it.$$after a name or a number, and operators. A statement older and newer servers read differently, such as one behind/** note **/or/**/, is refused instead of bound.\x00takes.StarRocksLiteral.Test plan
apple/scripts/probes/check-databend-lexing.shpasses against Databend 1.2.880 and 1.2.958 in Docker. Rules from Databend's token.rs and quote.rs, with the changes in fc8867f and ce211e7.SQLQuotingRoundTripTests.databendIdentifierRoundTripreadsSQLQuoting.databendIdentifierback under both backtick rules, andDatabendLiteralTests.literalRoundTripreadsDatabendLiteral.inlineoutput back through a port ofQuotedString.DatabendIdentifierQuotingTests(browse, grid writes, builder, MCP export),DatabendLiteralTests(NUL, comment readings, hints, form feed, stage names,$$, operators, version floor),StarRocksLiteralTests,SQLWriteBatchBudgetTests.aNulIsChargedTheFourBytesDatabendWritesForIt.DatabendCatalogTests(backslashes kept),DatabendLiteralTests(\x00).