Addendum for the fix for bug #42064:
In Prepared_statement::prepare() bail out as soon as parser_state.init() fails, trying to continue leads to crashes.
This commit is contained in:
parent
2400e54a12
commit
41c3732a75
@ -3034,15 +3034,20 @@ bool Prepared_statement::prepare(const char *packet, uint packet_len)
|
|||||||
thd->stmt_arena= this;
|
thd->stmt_arena= this;
|
||||||
|
|
||||||
Parser_state parser_state;
|
Parser_state parser_state;
|
||||||
if (!parser_state.init(thd, thd->query(), thd->query_length()))
|
if (parser_state.init(thd, thd->query(), thd->query_length()))
|
||||||
{
|
{
|
||||||
|
thd->restore_backup_statement(this, &stmt_backup);
|
||||||
|
thd->restore_active_arena(this, &stmt_backup);
|
||||||
|
thd->stmt_arena= old_stmt_arena;
|
||||||
|
DBUG_RETURN(TRUE);
|
||||||
|
}
|
||||||
|
|
||||||
parser_state.m_lip.stmt_prepare_mode= TRUE;
|
parser_state.m_lip.stmt_prepare_mode= TRUE;
|
||||||
lex_start(thd);
|
lex_start(thd);
|
||||||
|
|
||||||
error= parse_sql(thd, & parser_state, NULL) ||
|
error= parse_sql(thd, & parser_state, NULL) ||
|
||||||
thd->is_error() ||
|
thd->is_error() ||
|
||||||
init_param_array(this);
|
init_param_array(this);
|
||||||
}
|
|
||||||
|
|
||||||
lex->set_trg_event_type_for_tables();
|
lex->set_trg_event_type_for_tables();
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user