diff options
author | Monty <monty@mariadb.org> | 2018-01-30 21:32:19 +0200 |
---|---|---|
committer | Monty <monty@mariadb.org> | 2018-01-30 21:34:58 +0200 |
commit | e300f0c9612559bc5c80830f9b98e46bb010d7d1 (patch) | |
tree | d17837c466cc6f4ba3a79b315741dddeb749c69f /sql/item.cc | |
parent | 0c1f22061177fab63274a4429e38a4652964d7b8 (diff) | |
download | mariadb-git-e300f0c9612559bc5c80830f9b98e46bb010d7d1.tar.gz |
MDEV-15133 array bound (bulk) parameters of NULL propagate on next rows
null_value was not properly reset when setting parameter value
Diffstat (limited to 'sql/item.cc')
-rw-r--r-- | sql/item.cc | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/sql/item.cc b/sql/item.cc index 98d66df4682..f8f4b9fc5eb 100644 --- a/sql/item.cc +++ b/sql/item.cc @@ -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); |