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

@ -759,7 +759,7 @@ DATE_TIME_FORMAT
!parse_date_time_format(format_type, format_str,
format_length, &tmp))
{
tmp.format.str= (char*) format_str;
tmp.format.str= format_str;
tmp.format.length= format_length;
return date_time_format_copy((THD *)0, &tmp);
}
@ -787,6 +787,7 @@ DATE_TIME_FORMAT *date_time_format_copy(THD *thd, DATE_TIME_FORMAT *format)
{
DATE_TIME_FORMAT *new_format;
ulong length= sizeof(*format) + format->format.length + 1;
char *format_pos;
if (thd)
new_format= (DATE_TIME_FORMAT *) thd->alloc(length);
@ -795,14 +796,13 @@ DATE_TIME_FORMAT *date_time_format_copy(THD *thd, DATE_TIME_FORMAT *format)
if (new_format)
{
/* Put format string after current pos */
new_format->format.str= (char*) (new_format+1);
new_format->format.str= format_pos= (char*) (new_format+1);
memcpy((char*) new_format->positions, (char*) format->positions,
sizeof(format->positions));
new_format->time_separator= format->time_separator;
/* We make the string null terminated for easy printf in SHOW VARIABLES */
memcpy((char*) new_format->format.str, format->format.str,
format->format.length);
new_format->format.str[format->format.length]= 0;
memcpy(format_pos, format->format.str, format->format.length);
format_pos[format->format.length]= 0;
new_format->format.length= format->format.length;
}
return new_format;