summaryrefslogtreecommitdiff
path: root/sql/item.cc
diff options
context:
space:
mode:
authorunknown <knielsen@knielsen-hq.org>2012-08-24 12:57:19 +0200
committerunknown <knielsen@knielsen-hq.org>2012-08-24 12:57:19 +0200
commit89e4d23f3b3984abe0f29adb8c024a105d3b5d49 (patch)
tree854aecb31ad17de61cf4eef1cad3d6d19211a33d /sql/item.cc
parent1fd8150a5b5e3f56aa3c253225929a07ee9a4026 (diff)
parent96703a63da2211cefcc480fa4f135acd94743622 (diff)
downloadmariadb-git-89e4d23f3b3984abe0f29adb8c024a105d3b5d49.tar.gz
Merge into latest 5.2.
Diffstat (limited to 'sql/item.cc')
-rw-r--r--sql/item.cc18
1 files changed, 17 insertions, 1 deletions
diff --git a/sql/item.cc b/sql/item.cc
index fe3660e2d8e..4f0f837f462 100644
--- a/sql/item.cc
+++ b/sql/item.cc
@@ -769,15 +769,31 @@ void Item::set_name(const char *str, uint length, CHARSET_INFO *cs)
if (!my_charset_same(cs, system_charset_info))
{
size_t res_length;
- name= sql_strmake_with_convert(str, name_length= length, cs,
+ name= sql_strmake_with_convert(str, length, cs,
MAX_ALIAS_NAME, system_charset_info,
&res_length);
+ name_length= res_length;
}
else
name= sql_strmake(str, (name_length= min(length,MAX_ALIAS_NAME)));
}
+void Item::set_name_no_truncate(const char *str, uint length, CHARSET_INFO *cs)
+{
+ if (!my_charset_same(cs, system_charset_info))
+ {
+ size_t res_length;
+ name= sql_strmake_with_convert(str, length, cs,
+ UINT_MAX, system_charset_info,
+ &res_length);
+ name_length= res_length;
+ }
+ else
+ name= sql_strmake(str, (name_length= length));
+}
+
+
/**
@details
This function is called when: