summaryrefslogtreecommitdiff
path: root/sql/item.cc
diff options
context:
space:
mode:
authorGleb Shchepa <gleb.shchepa@oracle.com>2011-03-31 22:59:11 +0400
committerGleb Shchepa <gleb.shchepa@oracle.com>2011-03-31 22:59:11 +0400
commit7aa81e2a02e78200eec105b968bda675af6f4987 (patch)
treef09c53960c31ba8a4695072c75182ac99ea0d4ba /sql/item.cc
parentb8faa8f2c69a13c83d763f8d8605dcf3612c1257 (diff)
downloadmariadb-git-7aa81e2a02e78200eec105b968bda675af6f4987.tar.gz
Bug #11766094 - 59132: MIN() AND MAX() REMOVE UNSIGNEDNESS
In the string context the MIN() and MAX() functions don't take into account the unsignedness of the UNSIGNED BIGINT argument column. I.e.: CREATE TABLE t1 (a BIGINT UNSIGNED); INSERT INTO t1 VALUES (18446668621106209655); SELECT CONCAT(MAX(a)) FROM t1; returns -75452603341961. mysql-test/r/func_group.result: Test case for bug #11766094. mysql-test/t/func_group.test: Test case for bug #11766094. sql/item.cc: Bug #11766094 - 59132: MIN() AND MAX() REMOVE UNSIGNEDNESS The Item_cache_int::val_str() method has been modified to take into account the unsigned_flag value when converting data to string.
Diffstat (limited to 'sql/item.cc')
-rw-r--r--sql/item.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/sql/item.cc b/sql/item.cc
index f90cf562c0b..24c3107ece9 100644
--- a/sql/item.cc
+++ b/sql/item.cc
@@ -7109,7 +7109,7 @@ String *Item_cache_int::val_str(String *str)
DBUG_ASSERT(fixed == 1);
if (!value_cached && !cache_value())
return NULL;
- str->set(value, default_charset());
+ str->set_int(value, unsigned_flag, default_charset());
return str;
}