@@ -4507,7 +4507,7 @@ TABLE *select_create::create_table_from_items(THD *thd, List<Item> *items,
4507
4507
if (!(thd->variables .option_bits & OPTION_EXPLICIT_DEF_TIMESTAMP))
4508
4508
promote_first_timestamp_column (&alter_info->create_list );
4509
4509
4510
- if (create_info->fix_create_fields (thd, alter_info, *create_table ))
4510
+ if (create_info->fix_create_fields (thd, alter_info, *table_list ))
4511
4511
DBUG_RETURN (NULL );
4512
4512
4513
4513
while ((item=it++))
@@ -4548,20 +4548,20 @@ TABLE *select_create::create_table_from_items(THD *thd, List<Item> *items,
4548
4548
}
4549
4549
4550
4550
if (create_info->check_fields (thd, alter_info,
4551
- create_table ->table_name ,
4552
- create_table ->db ))
4551
+ table_list ->table_name ,
4552
+ table_list ->db ))
4553
4553
DBUG_RETURN (NULL );
4554
4554
4555
4555
DEBUG_SYNC (thd," create_table_select_before_create" );
4556
4556
4557
4557
/* Check if LOCK TABLES + CREATE OR REPLACE of existing normal table*/
4558
- if (thd->locked_tables_mode && create_table ->table &&
4558
+ if (thd->locked_tables_mode && table_list ->table &&
4559
4559
!create_info->tmp_table ())
4560
4560
{
4561
4561
/* Remember information about the locked table */
4562
4562
create_info->pos_in_locked_tables =
4563
- create_table ->table ->pos_in_locked_tables ;
4564
- create_info->mdl_ticket = create_table ->table ->mdl_ticket ;
4563
+ table_list ->table ->pos_in_locked_tables ;
4564
+ create_info->mdl_ticket = table_list ->table ->mdl_ticket ;
4565
4565
}
4566
4566
4567
4567
/*
@@ -4582,48 +4582,48 @@ TABLE *select_create::create_table_from_items(THD *thd, List<Item> *items,
4582
4582
*/
4583
4583
4584
4584
if (!mysql_create_table_no_lock (thd, &ddl_log_state_create, &ddl_log_state_rm,
4585
- &create_table ->db ,
4586
- &create_table ->table_name ,
4585
+ &table_list ->db ,
4586
+ &table_list ->table_name ,
4587
4587
create_info, alter_info, NULL ,
4588
- C_ORDINARY_CREATE, create_table ))
4588
+ C_ORDINARY_CREATE, table_list ))
4589
4589
{
4590
4590
DEBUG_SYNC (thd," create_table_select_before_open" );
4591
4591
4592
4592
/*
4593
4593
If we had a temporary table or a table used with LOCK TABLES,
4594
4594
it was closed by mysql_create()
4595
4595
*/
4596
- create_table ->table = 0 ;
4596
+ table_list ->table = 0 ;
4597
4597
4598
4598
if (!create_info->tmp_table ())
4599
4599
{
4600
4600
Open_table_context ot_ctx (thd, MYSQL_OPEN_REOPEN);
4601
4601
TABLE_LIST::enum_open_strategy save_open_strategy;
4602
4602
4603
4603
/* Force the newly created table to be opened */
4604
- save_open_strategy= create_table ->open_strategy ;
4605
- create_table ->open_strategy = TABLE_LIST::OPEN_NORMAL;
4604
+ save_open_strategy= table_list ->open_strategy ;
4605
+ table_list ->open_strategy = TABLE_LIST::OPEN_NORMAL;
4606
4606
/*
4607
4607
Here we open the destination table, on which we already have
4608
4608
an exclusive metadata lock.
4609
4609
*/
4610
- if (open_table (thd, create_table , &ot_ctx))
4610
+ if (open_table (thd, table_list , &ot_ctx))
4611
4611
{
4612
- quick_rm_table (thd, create_info->db_type , &create_table ->db ,
4613
- table_case_name (create_info, &create_table ->table_name ),
4612
+ quick_rm_table (thd, create_info->db_type , &table_list ->db ,
4613
+ table_case_name (create_info, &table_list ->table_name ),
4614
4614
0 );
4615
4615
}
4616
4616
/* Restore */
4617
- create_table ->open_strategy = save_open_strategy;
4617
+ table_list ->open_strategy = save_open_strategy;
4618
4618
}
4619
4619
else
4620
4620
{
4621
4621
/*
4622
4622
The pointer to the newly created temporary table has been stored in
4623
4623
table->create_info.
4624
4624
*/
4625
- create_table ->table = create_info->table ;
4626
- if (!create_table ->table )
4625
+ table_list ->table = create_info->table ;
4626
+ if (!table_list ->table )
4627
4627
{
4628
4628
/*
4629
4629
This shouldn't happen as creation of temporary table should make
@@ -4635,9 +4635,9 @@ TABLE *select_create::create_table_from_items(THD *thd, List<Item> *items,
4635
4635
}
4636
4636
}
4637
4637
else
4638
- create_table ->table = 0 ; // Create failed
4638
+ table_list ->table = 0 ; // Create failed
4639
4639
4640
- if (unlikely (!(table= create_table ->table )))
4640
+ if (unlikely (!(table= table_list ->table )))
4641
4641
{
4642
4642
if (likely (!thd->is_error ())) // CREATE ... IF NOT EXISTS
4643
4643
my_ok (thd); // succeed, but did nothing
@@ -4679,7 +4679,7 @@ TABLE *select_create::create_table_from_items(THD *thd, List<Item> *items,
4679
4679
mysql_unlock_tables (thd, *lock);
4680
4680
*lock= 0 ;
4681
4681
}
4682
- drop_open_table (thd, table, &create_table ->db , &create_table ->table_name );
4682
+ drop_open_table (thd, table, &table_list ->db , &table_list ->table_name );
4683
4683
ddl_log_complete (&ddl_log_state_rm);
4684
4684
ddl_log_complete (&ddl_log_state_create);
4685
4685
DBUG_RETURN (NULL );
@@ -4726,10 +4726,10 @@ int select_create::postlock(THD *thd, TABLE **tables)
4726
4726
NOTE: for row format CREATE TABLE must be logged before row data.
4727
4727
*/
4728
4728
int error;
4729
- TABLE_LIST *save_next_global= create_table ->next_global ;
4730
- create_table ->next_global = select_tables;
4731
- error= thd->decide_logging_format (create_table );
4732
- create_table ->next_global = save_next_global;
4729
+ TABLE_LIST *save_next_global= table_list ->next_global ;
4730
+ table_list ->next_global = select_tables;
4731
+ error= thd->decide_logging_format (table_list );
4732
+ table_list ->next_global = save_next_global;
4733
4733
4734
4734
if (unlikely (error))
4735
4735
return error;
@@ -4768,7 +4768,7 @@ select_create::prepare(List<Item> &_values, SELECT_LEX_UNIT *u)
4768
4768
if (create_info->or_replace ())
4769
4769
{
4770
4770
/* Original table was deleted. We have to log it */
4771
- log_drop_table (thd, &create_table ->db , &create_table ->table_name ,
4771
+ log_drop_table (thd, &table_list ->db , &table_list ->table_name ,
4772
4772
&create_info->org_storage_engine_name ,
4773
4773
create_info->db_type == partition_hton,
4774
4774
&create_info->org_tabledef_version ,
@@ -4788,7 +4788,7 @@ select_create::prepare(List<Item> &_values, SELECT_LEX_UNIT *u)
4788
4788
list to keep them inaccessible from inner statements.
4789
4789
e.g. CREATE TEMPORARY TABLE `t1` AS SELECT * FROM `t1`;
4790
4790
*/
4791
- saved_tmp_table_share= thd->save_tmp_table_share (create_table ->table );
4791
+ saved_tmp_table_share= thd->save_tmp_table_share (table_list ->table );
4792
4792
}
4793
4793
4794
4794
if (extra_lock)
@@ -5087,8 +5087,8 @@ bool select_create::send_eof()
5087
5087
*/
5088
5088
wsrep_key_arr_t key_arr= {0 , 0 };
5089
5089
wsrep_prepare_keys_for_isolation (thd,
5090
- create_table ->db .str ,
5091
- create_table ->table_name .str ,
5090
+ table_list ->db .str ,
5091
+ table_list ->table_name .str ,
5092
5092
table_list,
5093
5093
&key_arr);
5094
5094
int rcode= wsrep_thd_append_key (thd, key_arr.keys , key_arr.keys_len ,
@@ -5144,8 +5144,8 @@ bool select_create::send_eof()
5144
5144
else
5145
5145
lex_string_set (&ddl_log.org_storage_engine_name ,
5146
5146
ha_resolve_storage_engine_name (create_info->db_type ));
5147
- ddl_log.org_database = create_table ->db ;
5148
- ddl_log.org_table = create_table ->table_name ;
5147
+ ddl_log.org_database = table_list ->db ;
5148
+ ddl_log.org_table = table_list ->table_name ;
5149
5149
ddl_log.org_table_id = create_info->tabledef_version ;
5150
5150
backup_log_ddl (&ddl_log);
5151
5151
}
@@ -5260,7 +5260,7 @@ void select_create::abort_result_set()
5260
5260
m_plock= NULL ;
5261
5261
}
5262
5262
5263
- drop_open_table (thd, table, &create_table ->db , &create_table ->table_name );
5263
+ drop_open_table (thd, table, &table_list ->db , &table_list ->table_name );
5264
5264
table=0 ; // Safety
5265
5265
if (thd->log_current_statement ())
5266
5266
{
@@ -5275,7 +5275,7 @@ void select_create::abort_result_set()
5275
5275
ddl_log_update_xid (&ddl_log_state_create, thd->binlog_xid );
5276
5276
ddl_log_update_xid (&ddl_log_state_rm, thd->binlog_xid );
5277
5277
debug_crash_here (" ddl_log_create_before_binlog" );
5278
- log_drop_table (thd, &create_table ->db , &create_table ->table_name ,
5278
+ log_drop_table (thd, &table_list ->db , &table_list ->table_name ,
5279
5279
&create_info->org_storage_engine_name ,
5280
5280
create_info->db_type == partition_hton,
5281
5281
&create_info->tabledef_version ,
@@ -5291,8 +5291,8 @@ void select_create::abort_result_set()
5291
5291
ddl_log.query = { C_STRING_WITH_LEN (" DROP_AFTER_CREATE" ) };
5292
5292
ddl_log.org_partitioned = (create_info->db_type == partition_hton);
5293
5293
ddl_log.org_storage_engine_name = create_info->org_storage_engine_name ;
5294
- ddl_log.org_database = create_table ->db ;
5295
- ddl_log.org_table = create_table ->table_name ;
5294
+ ddl_log.org_database = table_list ->db ;
5295
+ ddl_log.org_table = table_list ->table_name ;
5296
5296
ddl_log.org_table_id = create_info->tabledef_version ;
5297
5297
backup_log_ddl (&ddl_log);
5298
5298
}
0 commit comments