1
0
mirror of https://github.com/MariaDB/server.git synced 2026-10-23 18:49:29 +03:00

Follow-up patch for lp:1312618 to fix a segfault.

This commit is contained in:
Nirbhay Choubey
2014-06-25 11:22:01 -04:00
parent c039d9667e
commit 9e1075eea0

View File

@@ -1473,20 +1473,23 @@ end:
thd->tx_read_only= false;
#ifdef WITH_WSREP
// sql_print_information("sizeof(LEX) = %d", sizeof(struct LEX));
// sizeof(LEX) = 4512, so it's relatively safe to allocate it on stack.
LEX lex;
lex.sql_command = SQLCOM_DROP_EVENT;
thd->lex = &lex;
WSREP_TO_ISOLATION_BEGIN(WSREP_MYSQL_DB, NULL, NULL);
if (WSREP(thd)) {
// sql_print_information("sizeof(LEX) = %d", sizeof(struct LEX));
// sizeof(LEX) = 4512, so it's relatively safe to allocate it on stack.
LEX *old_lex= thd->lex, new_lex;
new_lex.sql_command= SQLCOM_DROP_EVENT;
thd->lex= &new_lex;
WSREP_TO_ISOLATION_BEGIN(WSREP_MYSQL_DB, NULL, NULL);
thd->lex= old_lex;
}
#endif
ret= Events::drop_event(thd, dbname, name, FALSE);
#ifdef WITH_WSREP
#ifdef WITH_WSREP
WSREP_TO_ISOLATION_END;
error:
#endif
#endif
thd->tx_read_only= save_tx_read_only;
thd->security_ctx->master_access= saved_master_access;
}