[Commits] c2f2d50: MDEV-9147: Character set is ignored in Dynamic Column for saved string

OleksandrByelkin sanja at mariadb.com
Mon Dec 14 16:02:40 EET 2015


revision-id: c2f2d50e376dfeadcf4c37afe51dc4bb0c32bbc4 (mariadb-10.0.22-41-gc2f2d50)
parent(s): 537c750e328cd080365e465acd4f0383bf0febf3
committer: Oleksandr Byelkin
timestamp: 2015-12-14 15:02:39 +0100
message:

MDEV-9147: Character set is ignored in Dynamic Column for saved string

Fixed moving charset from definition to the value.

---
 mysql-test/r/dyncol.result | 10 +++++-----
 sql/item_strfunc.cc        |  2 ++
 2 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/mysql-test/r/dyncol.result b/mysql-test/r/dyncol.result
index af7c3b7..72a468c 100644
--- a/mysql-test/r/dyncol.result
+++ b/mysql-test/r/dyncol.result
@@ -6,16 +6,16 @@ hex(COLUMN_CREATE(1, NULL AS char character set utf8))
 000000
 select hex(COLUMN_CREATE(1, "afaf" AS char character set utf8));
 hex(COLUMN_CREATE(1, "afaf" AS char character set utf8))
-0001000100030861666166
+0001000100032161666166
 select hex(COLUMN_CREATE(1, 1212 AS char character set utf8));
 hex(COLUMN_CREATE(1, 1212 AS char character set utf8))
-0001000100030831323132
+0001000100032131323132
 select hex(COLUMN_CREATE(1, 12.12 AS char character set utf8));
 hex(COLUMN_CREATE(1, 12.12 AS char character set utf8))
-0001000100030831322E3132
+0001000100032131322E3132
 select hex(COLUMN_CREATE(1, 99999999999999999999999999999 AS char character set utf8));
 hex(COLUMN_CREATE(1, 99999999999999999999999999999 AS char character set utf8))
-000100010003083939393939393939393939393939393939393939393939393939393939
+000100010003213939393939393939393939393939393939393939393939393939393939
 select hex(COLUMN_CREATE(1, NULL AS unsigned int));
 hex(COLUMN_CREATE(1, NULL AS unsigned int))
 000000
@@ -144,7 +144,7 @@ hex(COLUMN_CREATE(1, "afaf" AS char character set utf8,
 6, "2011-04-05" AS date,
 7, "- 0:45:49.000001" AS time,
 8, "2011-04-05 0:45:49.000001" AS datetime))
-01080001000300020029000300380004004A0005008C000600AE000700C7000800F5000861666166BC0478093D0AD7A3703D284002028C0C85B60F010010B7000485B60F010010B70000
+01080001000300020029000300380004004A0005008C000600AE000700C7000800F5002161666166BC0478093D0AD7A3703D284002028C0C85B60F010010B7000485B60F010010B70000
 explain extended
 select hex(COLUMN_CREATE(1, "afaf" AS char character set utf8,
 2, 1212 AS unsigned int,
diff --git a/sql/item_strfunc.cc b/sql/item_strfunc.cc
index 972ae5a..54ab8f6 100644
--- a/sql/item_strfunc.cc
+++ b/sql/item_strfunc.cc
@@ -4448,6 +4448,8 @@ bool Item_func_dyncol_create::prepare_arguments(bool force_names_arg)
     case DYN_COL_DYNCOL:
     case DYN_COL_STRING:
       res= args[valpos]->val_str(&tmp);
+      if (res && defs[i].cs)
+        res->set_charset(defs[i].cs);
       if (res &&
           (vals[i].x.string.value.str= sql_strmake(res->ptr(), res->length())))
       {


More information about the commits mailing list