1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

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 "")
This commit is contained in:
Monty
2018-01-07 18:03:44 +02:00
parent 921c5e9314
commit a7e352b54d
145 changed files with 2361 additions and 2407 deletions

View File

@ -363,7 +363,7 @@ bool select_unit::flush()
bool
select_unit::create_result_table(THD *thd_arg, List<Item> *column_types,
bool is_union_distinct, ulonglong options,
const char *alias,
const LEX_CSTRING *alias,
bool bit_fields_as_long, bool create_table,
bool keep_row_order,
uint hidden)
@ -397,7 +397,7 @@ select_union_recursive::create_result_table(THD *thd_arg,
List<Item> *column_types,
bool is_union_distinct,
ulonglong options,
const char *alias,
const LEX_CSTRING *alias,
bool bit_fields_as_long,
bool create_table,
bool keep_row_order,
@ -405,14 +405,14 @@ select_union_recursive::create_result_table(THD *thd_arg,
{
if (select_unit::create_result_table(thd_arg, column_types,
is_union_distinct, options,
"", bit_fields_as_long,
&empty_clex_str, bit_fields_as_long,
create_table, keep_row_order,
hidden))
return true;
if (! (incr_table= create_tmp_table(thd_arg, &tmp_table_param, *column_types,
(ORDER*) 0, false, 1,
options, HA_POS_ERROR, "",
options, HA_POS_ERROR, &empty_clex_str,
!create_table, keep_row_order)))
return true;
@ -1010,7 +1010,7 @@ bool st_select_lex_unit::prepare(THD *thd_arg, select_result *sel_result,
goto err;
if (union_result->create_result_table(thd, &types,
MY_TEST(union_distinct),
create_options, derived->alias,
create_options, &derived->alias,
false,
instantiate_tmp_table, false,
0))
@ -1132,7 +1132,7 @@ cont:
bool error=
union_result->create_result_table(thd, &types,
MY_TEST(union_distinct),
create_options, "", false,
create_options, &empty_clex_str, false,
instantiate_tmp_table, false,
hidden);
if (intersect_mark)
@ -1147,8 +1147,10 @@ cont:
save_maybe_null= result_table_list.maybe_null_exec;
}
bzero((char*) &result_table_list, sizeof(result_table_list));
result_table_list.db= (char*) "";
result_table_list.table_name= result_table_list.alias= (char*) "union";
result_table_list.db.str= (char*) "";
result_table_list.db.length= 0;
result_table_list.table_name.str= result_table_list.alias.str= "union";
result_table_list.table_name.length= result_table_list.alias.length= sizeof("union")-1;
result_table_list.table= table= union_result->table;
if (fake_select_lex && !fake_select_lex->first_cond_optimization)
{