Details
-
Task
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
None
Description
Let's turn the global function ok_for_lower_case_names() into a method in Lex_ident_fs:
#ifndef DBUG_OFF
|
/**
|
Verifies that database/table name is in lowercase, when it should be |
|
This is supposed to be used only inside DBUG_ASSERT() |
*/
|
bool Lex_ident_fs::ok_for_lower_case_names() const
|
{
|
if (!lower_case_table_names || !str) |
return true; |
DBNameBuffer buf(*this, lower_case_table_names);
|
return cmp(*this, buf.to_lex_cstring()) == 0; |
}
|
#endif
|
We'll add a new class Lex_ident_db soon, deriving from Lex_ident_fs.
It will perform DBUG_ASSERT(ok_for_lower_case_names()) in constructor.
Also, additionally, let's change a few functions and methods to get a database name as a `const LEX_CSTRING` instead of const char *:
bool lock_object_name(THD *thd, MDL_key::enum_mdl_namespace mdl_type, |
const char *db, const char *name) |
const LEX_CSTRING &db, const LEX_CSTRING &name); |
|
Events::drop_schema_events(THD *thd, const LEX_CSTRING &db_lex); |
|
bool lock_db_routines(THD *thd, const LEX_CSTRING &db); |
|
int sp_drop_db_routines(THD *thd, const LEX_CSTRING &db); |
|
void Query_cache::invalidate(THD *thd, const LEX_CSTRING &db) |
These functions and methods use ok_for_lower_case_names() inside. We'll change these functions/methods later to get the database name as Lex_ident_db instead of LEX_CSTRING.
This current change from `const char *` to `const LEX_CSTRING` will help to:
- avoid adding new strlen()
- remove some existing strlen()
- reduce the later patch which will add Lex_ident_db
Attachments
Issue Links
- blocks
-
MDEV-27490 Allow full utf8mb4 for identifiers
- Stalled
-
MDEV-31531 Remove my_casedn_str() and my_caseup_str()
- Closed
-
MDEV-31606 Refactor check_db_name() to get a const argument
- Closed
- causes
-
MDEV-32026 lowercase_table2.test failures in 11.3
- Closed