Commit e300f0c9 authored by Monty's avatar Monty

MDEV-15133 array bound (bulk) parameters of NULL propagate on next rows

null_value was not properly reset when setting parameter value
parent 0c1f2206
......@@ -3781,6 +3781,7 @@ void Item_param::set_int(longlong i, uint32 max_length_arg)
max_length= max_length_arg;
decimals= 0;
maybe_null= 0;
null_value= 0;
fix_type(Item::INT_ITEM);
DBUG_VOID_RETURN;
}
......@@ -3795,6 +3796,7 @@ void Item_param::set_double(double d)
max_length= DBL_DIG + 8;
decimals= NOT_FIXED_DEC;
maybe_null= 0;
null_value= 0;
fix_type(Item::REAL_ITEM);
DBUG_VOID_RETURN;
}
......@@ -3827,6 +3829,7 @@ void Item_param::set_decimal(const char *str, ulong length)
my_decimal_precision_to_length_no_truncation(value.m_decimal.precision(),
decimals, unsigned_flag);
maybe_null= 0;
null_value= 0;
fix_type(Item::DECIMAL_ITEM);
DBUG_VOID_RETURN;
}
......@@ -3843,6 +3846,7 @@ void Item_param::set_decimal(const my_decimal *dv, bool unsigned_arg)
unsigned_flag= unsigned_arg;
max_length= my_decimal_precision_to_length(value.m_decimal.intg + decimals,
decimals, unsigned_flag);
null_value= 0;
fix_type(Item::DECIMAL_ITEM);
}
......@@ -3862,6 +3866,7 @@ void Item_param::set_time(const MYSQL_TIME *tm,
{
DBUG_ASSERT(value.type_handler()->cmp_type() == TIME_RESULT);
value.time= *tm;
null_value= 0;
fix_temporal(max_length_arg, decimals_arg);
}
......@@ -3896,6 +3901,7 @@ void Item_param::set_time(MYSQL_TIME *tm, timestamp_type time_type,
set_zero_time(&value.time, MYSQL_TIMESTAMP_ERROR);
}
maybe_null= 0;
null_value= 0;
fix_temporal(max_length_arg,
tm->second_part > 0 ? TIME_SECOND_PART_DIGITS : 0);
DBUG_VOID_RETURN;
......@@ -3932,6 +3938,7 @@ bool Item_param::set_str(const char *str, ulong length,
collation.set(tocs, DERIVATION_COERCIBLE);
max_length= length;
maybe_null= 0;
null_value= 0;
/* max_length and decimals are set after charset conversion */
/* sic: str may be not null-terminated, don't add DBUG_PRINT here */
fix_type(Item::STRING_ITEM);
......@@ -3967,6 +3974,7 @@ bool Item_param::set_longdata(const char *str, ulong length)
DBUG_RETURN(TRUE);
state= LONG_DATA_VALUE;
maybe_null= 0;
null_value= 0;
fix_type(Item::STRING_ITEM);
DBUG_RETURN(FALSE);
......
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