mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
MDEV-30539 EXPLAIN EXTENDED: no message with queries for DML statements
EXPLAIN EXTENDED for an UPDATE/DELETE/INSERT/REPLACE statement did not produce the warning containing the text representation of the query obtained after the optimization phase. Such warning was produced for SELECT statements, but not for DML statements. The patch fixes this defect of EXPLAIN EXTENDED for DML statements.
This commit is contained in:
@ -1371,7 +1371,8 @@ produce_explain_and_leave:
|
||||
goto err;
|
||||
|
||||
emit_explain_and_leave:
|
||||
int err2= thd->lex->explain->send_explain(thd);
|
||||
bool extended= thd->lex->describe & DESCRIBE_EXTENDED;
|
||||
int err2= thd->lex->explain->send_explain(thd, extended);
|
||||
|
||||
delete select;
|
||||
free_underlaid_joins(thd, select_lex);
|
||||
@ -1445,6 +1446,8 @@ bool mysql_prepare_update(THD *thd, TABLE_LIST *table_list,
|
||||
|
||||
|
||||
select_lex->fix_prepare_information(thd, conds, &fake_conds);
|
||||
if (!thd->lex->upd_del_where)
|
||||
thd->lex->upd_del_where= *conds;
|
||||
DBUG_RETURN(FALSE);
|
||||
}
|
||||
|
||||
@ -1974,7 +1977,10 @@ bool mysql_multi_update(THD *thd, TABLE_LIST *table_list, List<Item> *fields,
|
||||
else
|
||||
{
|
||||
if (thd->lex->describe || thd->lex->analyze_stmt)
|
||||
res= thd->lex->explain->send_explain(thd);
|
||||
{
|
||||
bool extended= thd->lex->describe & DESCRIBE_EXTENDED;
|
||||
res= thd->lex->explain->send_explain(thd, extended);
|
||||
}
|
||||
}
|
||||
thd->abort_on_warning= 0;
|
||||
DBUG_RETURN(res);
|
||||
|
Reference in New Issue
Block a user