From 010f535b7fab476df41ff10288fedcf97404e563 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Thu, 13 Jul 2023 11:24:52 +0200 Subject: [PATCH] cleanup: remove redundant arguments --- sql/sql_insert.cc | 4 +--- sql/sql_table.cc | 19 +++++++------------ sql/sql_table.h | 4 +--- 3 files changed, 9 insertions(+), 18 deletions(-) diff --git a/sql/sql_insert.cc b/sql/sql_insert.cc index d1ef971898f..e4195b420e5 100644 --- a/sql/sql_insert.cc +++ b/sql/sql_insert.cc @@ -4523,9 +4523,7 @@ TABLE *select_create::create_table_from_items(THD *thd, List *items, open_table(). */ - if (!mysql_create_table_no_lock(thd, &create_table->db, - &create_table->table_name, - create_info, alter_info, NULL, + if (!mysql_create_table_no_lock(thd, create_info, alter_info, NULL, select_field_count, create_table)) { DEBUG_SYNC(thd,"create_table_select_before_open"); diff --git a/sql/sql_table.cc b/sql/sql_table.cc index 135788fb9e4..dce05d20dbb 100644 --- a/sql/sql_table.cc +++ b/sql/sql_table.cc @@ -5449,9 +5449,7 @@ warn: -1 Table was used with IF NOT EXISTS and table existed (warning, not error) */ -int mysql_create_table_no_lock(THD *thd, const LEX_CSTRING *db, - const LEX_CSTRING *table_name, - Table_specification_st *create_info, +int mysql_create_table_no_lock(THD *thd, Table_specification_st *create_info, Alter_info *alter_info, bool *is_trans, int create_table_mode, TABLE_LIST *table_list) { @@ -5459,6 +5457,8 @@ int mysql_create_table_no_lock(THD *thd, const LEX_CSTRING *db, uint not_used_2; int res; char path[FN_REFLEN + 1]; + const LEX_CSTRING *db= &table_list->db; + const LEX_CSTRING *table_name= &table_list->table_name; LEX_CUSTRING frm= {0,0}; if (create_info->tmp_table()) @@ -5635,11 +5635,8 @@ bool mysql_create_table(THD *thd, TABLE_LIST *create_table, /* We can abort create table for any table type */ thd->abort_on_warning= thd->is_strict_mode(); - if (mysql_create_table_no_lock(thd, &create_table->db, - &create_table->table_name, create_info, - alter_info, - &is_trans, create_table_mode, - create_table) > 0) + if (mysql_create_table_no_lock(thd, create_info, alter_info, &is_trans, + create_table_mode, create_table) > 0) { result= 1; goto err; @@ -6116,10 +6113,8 @@ bool mysql_create_like_table(THD* thd, TABLE_LIST* table, pos_in_locked_tables= local_create_info.table->pos_in_locked_tables; res= ((create_res= - mysql_create_table_no_lock(thd, &table->db, &table->table_name, - &local_create_info, &local_alter_info, - &is_trans, C_ORDINARY_CREATE, - table)) > 0); + mysql_create_table_no_lock(thd, &local_create_info, &local_alter_info, + &is_trans, C_ORDINARY_CREATE, table)) > 0); /* Remember to log if we deleted something */ do_logging= thd->log_current_statement; if (res) diff --git a/sql/sql_table.h b/sql/sql_table.h index 9fecef51c17..7dafe86e897 100644 --- a/sql/sql_table.h +++ b/sql/sql_table.h @@ -194,9 +194,7 @@ bool add_keyword_to_query(THD *thd, String *result, const LEX_CSTRING *keyword, #define C_ALTER_TABLE_FRM_ONLY -2 #define C_ASSISTED_DISCOVERY -3 -int mysql_create_table_no_lock(THD *thd, const LEX_CSTRING *db, - const LEX_CSTRING *table_name, - Table_specification_st *create_info, +int mysql_create_table_no_lock(THD *thd, Table_specification_st *create_info, Alter_info *alter_info, bool *is_trans, int create_table_mode, TABLE_LIST *table);