mirror of
https://github.com/MariaDB/server.git
synced 2025-08-08 11:22:35 +03:00
MDEV-8010 - Avoid sql_alloc() in Items (Patch #1)
Added mandatory thd parameter to Item (and all derivative classes) constructor. Added thd parameter to all routines that may create items. Also removed "current_thd" from Item::Item. This reduced number of pthread_getspecific() calls from 290 to 177 per OLTP RO transaction.
This commit is contained in:
@@ -3268,7 +3268,7 @@ mysql_prepare_create_table(THD *thd, HA_CREATE_INFO *create_info,
|
||||
pointer in the parsed tree of a prepared statement or a
|
||||
stored procedure statement.
|
||||
*/
|
||||
sql_field->def= sql_field->def->safe_charset_converter(save_cs);
|
||||
sql_field->def= sql_field->def->safe_charset_converter(thd, save_cs);
|
||||
|
||||
if (sql_field->def == NULL)
|
||||
{
|
||||
@@ -7414,7 +7414,7 @@ mysql_prepare_alter_table(THD *thd, TABLE *table,
|
||||
This field was not dropped and not changed, add it to the list
|
||||
for the new table.
|
||||
*/
|
||||
def= new Create_field(field, field);
|
||||
def= new Create_field(thd, field, field);
|
||||
new_create_list.push_back(def);
|
||||
alter_it.rewind(); // Change default if ALTER
|
||||
Alter_column *alter;
|
||||
@@ -9626,9 +9626,9 @@ bool mysql_checksum_table(THD *thd, TABLE_LIST *tables,
|
||||
*/
|
||||
DBUG_ASSERT(! thd->in_sub_stmt);
|
||||
|
||||
field_list.push_back(item = new Item_empty_string("Table", NAME_LEN*2));
|
||||
field_list.push_back(item = new Item_empty_string(thd, "Table", NAME_LEN*2));
|
||||
item->maybe_null= 1;
|
||||
field_list.push_back(item= new Item_int("Checksum",
|
||||
field_list.push_back(item= new Item_int(thd, "Checksum",
|
||||
(longlong) 1,
|
||||
MY_INT64_NUM_DECIMAL_DIGITS));
|
||||
item->maybe_null= 1;
|
||||
|
Reference in New Issue
Block a user