1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-08 11:22:35 +03:00

MDEV-31982 Remove check_db_name() from prepare_db_action()

- Adding a new class Lex_ident_db, to store normalized database names:
  lower-cased if lower-case-table-name says so,
  and checked to be a valid database name using Lex_ident_fs::check_db_name()

- Reusing the new class in parameters to functions:
    prepare_db_action()
    mysql_create_db()
    mysql_alter_db()
    mysql_rm_db()
    mysql_upgrade_db()

This change removed two old-style check_db_name() calls.
This commit is contained in:
Alexander Barkov
2023-08-22 15:53:27 +04:00
parent ebbf5662ef
commit d15e290285
6 changed files with 142 additions and 129 deletions

View File

@@ -6078,6 +6078,26 @@ void THD::get_definer(LEX_USER *definer, bool role)
}
bool THD::check_slave_ignored_db_with_error(const Lex_ident_db &db) const
{
#ifdef HAVE_REPLICATION
if (slave_thread)
{
Rpl_filter *rpl_filter;
rpl_filter= system_thread_info.rpl_sql_info->rpl_filter;
if (!rpl_filter->db_ok(db.str) ||
!rpl_filter->db_ok_with_wild_table(db.str))
{
my_message(ER_SLAVE_IGNORED_TABLE,
ER_THD(this, ER_SLAVE_IGNORED_TABLE), MYF(0));
return true;
}
}
#endif
return false;
}
/**
Mark transaction to rollback and mark error as fatal to a sub-statement.