| 7143 | */ |
| 7144 | |
| 7145 | static 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 | /** |
no test coverage detected