Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MDEV-35510 ASAN build crashes during bootstrap #3739

Open
wants to merge 1 commit into
base: 11.4
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions sql/sql_class.h
Original file line number Diff line number Diff line change
Expand Up @@ -7435,6 +7435,7 @@ class multi_delete :public select_result_interceptor
public:
multi_delete(THD *thd_arg, TABLE_LIST *dt, uint num_of_tables);
~multi_delete();
void cleanup();
int prepare(List<Item> &list, SELECT_LEX_UNIT *u) override;
int send_data(List<Item> &items) override;
bool initialize_tables (JOIN *join) override;
Expand Down Expand Up @@ -7489,6 +7490,7 @@ class multi_update :public select_result_interceptor
List<Item> *fields, List<Item> *values,
enum_duplicates handle_duplicates, bool ignore);
~multi_update();
void cleanup();
bool init(THD *thd);
bool init_for_single_table(THD *thd);
int prepare(List<Item> &list, SELECT_LEX_UNIT *u) override;
Expand Down
8 changes: 7 additions & 1 deletion sql/sql_delete.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1158,6 +1158,12 @@ multi_delete::initialize_tables(JOIN *join)


multi_delete::~multi_delete()
{
cleanup();
}


void multi_delete::cleanup()
{
for (table_being_deleted= delete_tables;
table_being_deleted;
Expand Down Expand Up @@ -1854,7 +1860,7 @@ bool Sql_cmd_delete::execute_inner(THD *thd)
if (result)
{
res= false;
delete result;
result->cleanup();
}

status_var_add(thd->status_var.rows_sent, thd->get_sent_row_count());
Expand Down
16 changes: 12 additions & 4 deletions sql/sql_update.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2250,6 +2250,12 @@ int multi_update::prepare2(JOIN *join)


multi_update::~multi_update()
{
cleanup();
}


void multi_update::cleanup()
{
TABLE_LIST *table;
for (table= update_tables ; table; table= table->next_local)
Expand All @@ -2270,10 +2276,12 @@ multi_update::~multi_update()
}
}
}
if (copy_field)
delete [] copy_field;
if (copy_field) {
delete[] copy_field;
copy_field= nullptr;
}
thd->count_cuted_fields= CHECK_FIELD_IGNORE; // Restore this setting
DBUG_ASSERT(trans_safe || !updated ||
DBUG_ASSERT(trans_safe || !updated ||
thd->transaction->all.modified_non_trans_table);
}

Expand Down Expand Up @@ -3127,7 +3135,7 @@ bool Sql_cmd_update::execute_inner(THD *thd)
if (result)
{
res= false;
delete result;
result->cleanup();
}

status_var_add(thd->status_var.rows_sent, thd->get_sent_row_count());
Expand Down