-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MDEV-31606 Refactor check_db_name() to get a const argument
Problem: Under terms of MDEV-27490, we'll update Unicode version used to compare identifiers to 14.0.0. Unlike in the old Unicode version, in the new version a string can grow during lower-case. We cannot perform check_db_name() inplace any more. Change summary: - Allocate memory to store lower-cased identifiers in memory root - Removing check_db_name() performing both in-place lower-casing and validation at the same time. Splitting it into two separate stages: * creating a memory-root lower-cased copy of an identifier (using new MEM_ROOT functions and Query_arena wrapper methods) * performing validation on a constant string (using Lex_ident_fs methods) Implementation details: - Adding a mysys helper function to allocate lower-cased strings on MEM_ROOT: lex_string_casedn_root() and a Query_arena wrappers for it: make_ident_casedn() make_ident_opt_casedn() - Adding a Query_arena method to perform both MEM_ROOT lower-casing and database name validation at the same time: to_ident_db_internal_with_error() This method is very close to the old (pre-11.3) check_db_name(), but performs lower-casing to a newly allocated MEM_ROOT memory (instead of performing lower-casing the original string in-place). - Adding a Table_ident method which additionally handles derived table names: to_ident_db_internal_with_error() - Removing the old check_db_name()
- Loading branch information
Showing
15 changed files
with
244 additions
and
172 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.