MCPcopy Create free account
hub / github.com/MariaDB/server / alter_close_table

Function alter_close_table

sql/sql_partition.cc:7145–7174  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

7143*/
7144
7145static int alter_close_table(ALTER_PARTITION_PARAM_TYPE *lpt)
7146{
7147 THD *thd= lpt->thd;
7148 TABLE_SHARE *share= lpt->table->s;
7149 DBUG_ENTER("alter_close_table");
7150
7151 TABLE *table= thd->open_tables;
7152 do {
7153 table= find_locked_table(table, share->db.str, share->table_name.str);
7154 if (!table)
7155 {
7156 DBUG_RETURN(0);
7157 }
7158
7159 if (table->db_stat)
7160 {
7161 if (int error= mysql_lock_remove(thd, thd->lock, table))
7162 {
7163 DBUG_RETURN(error);
7164 }
7165 if (int error= table->file->ha_close())
7166 {
7167 DBUG_RETURN(error);
7168 }
7169 table->db_stat= 0; // Mark file closed
7170 }
7171 } while ((table= table->next));
7172
7173 DBUG_RETURN(0);
7174}
7175
7176
7177/**

Callers 1

Calls 3

find_locked_tableFunction · 0.85
mysql_lock_removeFunction · 0.85
ha_closeMethod · 0.80

Tested by

no test coverage detected