1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-09 22:24:09 +03:00

MDEV-34046 Parameterized PS converts error to warning, causes

replication problems

DELETE HISTORY did not process parameterized PS properly as the
history expression was checked on prepare stage when the parameters
was not yet substituted. In that case check_units() succeeded as there
is no invalid type: Item_param has type_handler_null which is
inherited from string type and this is valid type for history
expression. The warning was thrown when the expression was evaluated
for comparison on delete execution (when the parameter was already
substituted).

The fix postpones check_units() until the first PS execution. We have
to postpone where conditions processing until the first execution and
update select_lex.where on every execution as it is reset to the state
after prepare.
This commit is contained in:
Aleksey Midenkov
2025-06-11 16:38:10 +03:00
parent bff9b1e472
commit f1f9284181
6 changed files with 357 additions and 5 deletions

View File

@@ -393,7 +393,10 @@ bool mysql_delete(THD *thd, TABLE_LIST *table_list, COND *conds,
}
if (delete_history)
{
DBUG_ASSERT(conds);
table->vers_write= false;
}
if (returning)
(void) result->prepare(returning->item_list, NULL);