Commit ca75b62d authored by sergefp@mysql.com's avatar sergefp@mysql.com

Correct handling of parameter variables with NULL values in PREPARE queries

parent 1f8505d6
......@@ -66,6 +66,7 @@ NULL
NULL
NULL
NULL
set @nullvar=1;
set @nullvar=NULL;
execute stmt5 using @nullvar;
? + a
......@@ -74,4 +75,12 @@ NULL
NULL
NULL
NULL
set @nullvar2=NULL;
execute stmt5 using @nullvar2;
? + a
NULL
NULL
NULL
NULL
NULL
drop table t1;
......@@ -68,8 +68,12 @@ execute stmt5 using @a;
execute stmt5 using @no_such_var;
set @nullvar=1;
set @nullvar=NULL;
execute stmt5 using @nullvar;
set @nullvar2=NULL;
execute stmt5 using @nullvar2;
drop table t1;
......@@ -661,7 +661,8 @@ static bool insert_params_from_vars(Prepared_statement *stmt,
varname= var_it++;
if ((entry= (user_var_entry*)hash_search(&stmt->thd->user_vars,
(byte*) varname->str,
varname->length)))
varname->length))
&& entry->value)
{
param->item_result_type= entry->type;
switch (entry->type)
......@@ -710,7 +711,8 @@ static bool insert_params_from_vars_with_log(Prepared_statement *stmt,
varname= var_it++;
if ((entry= (user_var_entry*)hash_search(&stmt->thd->user_vars,
(byte*) varname->str,
varname->length)))
varname->length))
&& entry->value)
{
param->item_result_type= entry->type;
switch (entry->type)
......
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