summaryrefslogtreecommitdiff
path: root/sql/item.cc
diff options
context:
space:
mode:
authorAlexander Barkov <bar@mariadb.org>2017-11-18 00:19:46 +0400
committerAlexander Barkov <bar@mariadb.org>2017-11-18 00:19:46 +0400
commit4c2c5ec94e9b06a240629c43a9686b873bd7d3b3 (patch)
tree46f693e40a3aae0dbf71ff49e40406025142db40 /sql/item.cc
parent0d1e805aeb47c2ff9398ca87589a9bd7687f8f97 (diff)
downloadmariadb-git-4c2c5ec94e9b06a240629c43a9686b873bd7d3b3.tar.gz
MDEV-14434 Wrong result for CHARSET(CONCAT(?,const))
Diffstat (limited to 'sql/item.cc')
-rw-r--r--sql/item.cc5
1 files changed, 5 insertions, 0 deletions
diff --git a/sql/item.cc b/sql/item.cc
index e7816b34b7e..63373fc1b0d 100644
--- a/sql/item.cc
+++ b/sql/item.cc
@@ -3409,6 +3409,7 @@ void Item_param::set_int(longlong i, uint32 max_length_arg)
DBUG_ENTER("Item_param::set_int");
value.integer= (longlong) i;
state= INT_VALUE;
+ collation.set_numeric();
max_length= max_length_arg;
decimals= 0;
maybe_null= 0;
@@ -3421,6 +3422,7 @@ void Item_param::set_double(double d)
DBUG_ENTER("Item_param::set_double");
value.real= d;
state= REAL_VALUE;
+ collation.set_numeric();
max_length= DBL_DIG + 8;
decimals= NOT_FIXED_DEC;
maybe_null= 0;
@@ -3450,6 +3452,7 @@ void Item_param::set_decimal(const char *str, ulong length)
str2my_decimal(E_DEC_FATAL_ERROR, str, &decimal_value, &end);
state= DECIMAL_VALUE;
decimals= decimal_value.frac;
+ collation.set_numeric();
max_length=
my_decimal_precision_to_length_no_truncation(decimal_value.precision(),
decimals, unsigned_flag);
@@ -3465,6 +3468,7 @@ void Item_param::set_decimal(const my_decimal *dv, bool unsigned_arg)
my_decimal2decimal(dv, &decimal_value);
decimals= (uint8) decimal_value.frac;
+ collation.set_numeric();
unsigned_flag= unsigned_arg;
max_length= my_decimal_precision_to_length(decimal_value.intg + decimals,
decimals, unsigned_flag);
@@ -3475,6 +3479,7 @@ void Item_param::set_decimal(const my_decimal *dv, bool unsigned_arg)
void Item_param::fix_temporal(uint32 max_length_arg, uint decimals_arg)
{
state= TIME_VALUE;
+ collation.set_numeric();
max_length= max_length_arg;
decimals= decimals_arg;
fix_type(Item::DATE_ITEM);