| 1158 | |
| 1159 | |
| 1160 | static int execute_drop_table(THD *thd, handlerton *hton, const LEX_CSTRING *db, |
| 1161 | const LEX_CSTRING *table, const char *path) |
| 1162 | { |
| 1163 | uint keys, total_keys; |
| 1164 | int error, first_error= 0; |
| 1165 | DBUG_ENTER("execute_drop_table"); |
| 1166 | |
| 1167 | if (get_hlindex_keys_by_open(thd, db, table, path, &keys, &total_keys) == 0) |
| 1168 | { |
| 1169 | char idx_path[FN_REFLEN + 1]; |
| 1170 | char *idx_path_end= strmov(idx_path, path); |
| 1171 | |
| 1172 | for (uint i= keys; i < total_keys; i++) |
| 1173 | { |
| 1174 | my_snprintf(idx_path_end, HLINDEX_BUF_LEN, HLINDEX_TEMPLATE, i); |
| 1175 | error= hton->drop_table(hton, idx_path); |
| 1176 | if (!non_existing_table_error(error) && !first_error) |
| 1177 | first_error= error; |
| 1178 | } |
| 1179 | } |
| 1180 | if (!first_error) |
| 1181 | { |
| 1182 | error= hton->drop_table(hton, path); |
| 1183 | if (!non_existing_table_error(error)) |
| 1184 | first_error= error; |
| 1185 | } |
| 1186 | DBUG_RETURN(first_error); |
| 1187 | } |
| 1188 | |
| 1189 | |
| 1190 | /* |
no test coverage detected