summaryrefslogtreecommitdiff
path: root/sql/item.cc
diff options
context:
space:
mode:
authorunknown <knielsen@knielsen-hq.org>2012-08-24 14:02:32 +0200
committerunknown <knielsen@knielsen-hq.org>2012-08-24 14:02:32 +0200
commitfc666a0df6c69a620d3cffacd78e2569fb0ac410 (patch)
treea956401c47c0464ad21f91d7e864af1ab89e0469 /sql/item.cc
parente44a800d91a887119d3b612276b37f09b076fee1 (diff)
parent96703a63da2211cefcc480fa4f135acd94743622 (diff)
downloadmariadb-git-fc666a0df6c69a620d3cffacd78e2569fb0ac410.tar.gz
merge from 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 a549fde3f5c..657e89dff7b 100644
--- a/sql/item.cc
+++ b/sql/item.cc
@@ -942,15 +942,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));
+}
+
+
void Item::set_name_for_rollback(THD *thd, const char *str, uint length,
CHARSET_INFO *cs)
{