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

Function execute_drop_table

sql/ddl_log.cc:1160–1187  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1158
1159
1160static 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/*

Callers 1

ddl_log_execute_actionFunction · 0.85

Calls 5

get_hlindex_keys_by_openFunction · 0.85
strmovFunction · 0.85
my_snprintfFunction · 0.85
non_existing_table_errorFunction · 0.85
drop_tableMethod · 0.45

Tested by

no test coverage detected