diff options
author | Monty <monty@mariadb.org> | 2018-01-07 18:03:44 +0200 |
---|---|---|
committer | Monty <monty@mariadb.org> | 2018-01-30 21:33:55 +0200 |
commit | a7e352b54ddfaf91c92951d605cb02a4ffd2676b (patch) | |
tree | dc76f140342938ed2a0fe0e005100402762d5308 /sql/rpl_rli.cc | |
parent | 921c5e931452301a09c84c53ffe35b81e6a1c71a (diff) | |
download | mariadb-git-a7e352b54ddfaf91c92951d605cb02a4ffd2676b.tar.gz |
Changed database, tablename and alias to be LEX_CSTRING
This was done in, among other things:
- thd->db and thd->db_length
- TABLE_LIST tablename, db, alias and schema_name
- Audit plugin database name
- lex->db
- All db and table names in Alter_table_ctx
- st_select_lex db
Other things:
- Changed a lot of functions to take const LEX_CSTRING* as argument
for db, table_name and alias. See init_one_table() as an example.
- Changed some function arguments from LEX_CSTRING to const LEX_CSTRING
- Changed some lists from LEX_STRING to LEX_CSTRING
- threads_mysql.result changed because process list_db wasn't always
correctly updated
- New append_identifier() function that takes LEX_CSTRING* as arguments
- Added new element tmp_buff to Alter_table_ctx to separate temp name
handling from temporary space
- Ensure we store the length after my_casedn_str() of table/db names
- Removed not used version of rename_table_in_stat_tables()
- Changed Natural_join_column::table_name and db_name() to never return
NULL (used for print)
- thd->get_db() now returns db as a printable string (thd->db.str or "")
Diffstat (limited to 'sql/rpl_rli.cc')
-rw-r--r-- | sql/rpl_rli.cc | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/sql/rpl_rli.cc b/sql/rpl_rli.cc index e03230081d5..04109ddadb4 100644 --- a/sql/rpl_rli.cc +++ b/sql/rpl_rli.cc @@ -1527,8 +1527,7 @@ scan_one_gtid_slave_pos_table(THD *thd, HASH *hash, DYNAMIC_ARRAY *array, int err= 0; thd->reset_for_next_command(); - tlist.init_one_table(STRING_WITH_LEN("mysql"), tablename->str, - tablename->length, NULL, TL_READ); + tlist.init_one_table(&MYSQL_SCHEMA_NAME, tablename, NULL, TL_READ); if ((err= open_and_lock_tables(thd, &tlist, FALSE, 0))) goto end; table_opened= true; @@ -1642,15 +1641,14 @@ static int scan_all_gtid_slave_pos_table(THD *thd, int (*cb)(THD *, LEX_CSTRING *, void *), void *cb_data) { - static LEX_CSTRING mysql_db_name= {C_STRING_WITH_LEN("mysql")}; char path[FN_REFLEN]; MY_DIR *dirp; thd->reset_for_next_command(); - if (lock_schema_name(thd, mysql_db_name.str)) + if (lock_schema_name(thd, MYSQL_SCHEMA_NAME.str)) return 1; - build_table_filename(path, sizeof(path) - 1, mysql_db_name.str, "", "", 0); + build_table_filename(path, sizeof(path) - 1, MYSQL_SCHEMA_NAME.str, "", "", 0); if (!(dirp= my_dir(path, MYF(MY_DONT_SORT)))) { my_error(ER_FILE_NOT_FOUND, MYF(0), path, my_errno); @@ -1665,7 +1663,7 @@ scan_all_gtid_slave_pos_table(THD *thd, int (*cb)(THD *, LEX_CSTRING *, void *), Discovered_table_list tl(thd, &files); int err; - err= ha_discover_table_names(thd, &mysql_db_name, dirp, &tl, false); + err= ha_discover_table_names(thd, &MYSQL_SCHEMA_NAME, dirp, &tl, false); my_dirend(dirp); close_thread_tables(thd); thd->mdl_context.release_transactional_locks(); @@ -1928,8 +1926,7 @@ find_gtid_pos_tables_cb(THD *thd, LEX_CSTRING *table_name, void *arg) int err; thd->reset_for_next_command(); - tlist.init_one_table(STRING_WITH_LEN("mysql"), table_name->str, - table_name->length, NULL, TL_READ); + tlist.init_one_table(&MYSQL_SCHEMA_NAME, table_name, NULL, TL_READ); if ((err= open_and_lock_tables(thd, &tlist, FALSE, 0))) goto end; table= tlist.table; |