Fix for bug #23782: Stored procedures: crash if variable in procedure

analyse

We have to call fix_fields() for procedure analyse' arguments as they may   
not be
fixed in some circumstances.

(as the crash appears when mysqld starts skipping binlog, a test case
will be added when we can --skip-bin-log in -master.opt)
parent b0977714
...@@ -87,6 +87,11 @@ proc_analyse_init(THD *thd, ORDER *param, select_result *result, ...@@ -87,6 +87,11 @@ proc_analyse_init(THD *thd, ORDER *param, select_result *result,
else if (param->next) else if (param->next)
{ {
// first parameter // first parameter
if (!(*param->item)->fixed && (*param->item)->fix_fields(thd, param->item))
{
DBUG_PRINT("info", ("fix_fields() for the first parameter failed"));
goto err;
}
if ((*param->item)->type() != Item::INT_ITEM || if ((*param->item)->type() != Item::INT_ITEM ||
(*param->item)->val_real() < 0) (*param->item)->val_real() < 0)
{ {
...@@ -101,6 +106,11 @@ proc_analyse_init(THD *thd, ORDER *param, select_result *result, ...@@ -101,6 +106,11 @@ proc_analyse_init(THD *thd, ORDER *param, select_result *result,
goto err; goto err;
} }
// second parameter // second parameter
if (!(*param->item)->fixed && (*param->item)->fix_fields(thd, param->item))
{
DBUG_PRINT("info", ("fix_fields() for the second parameter failed"));
goto err;
}
if ((*param->item)->type() != Item::INT_ITEM || if ((*param->item)->type() != Item::INT_ITEM ||
(*param->item)->val_real() < 0) (*param->item)->val_real() < 0)
{ {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment