summaryrefslogtreecommitdiff
path: root/sql/item.cc
diff options
context:
space:
mode:
authorunknown <knielsen@knielsen-hq.org>2012-08-24 14:26:23 +0200
committerunknown <knielsen@knielsen-hq.org>2012-08-24 14:26:23 +0200
commit4092d08bb87ce3e68f450745538164a8749fbac5 (patch)
tree11c7dfc8f5c3db1f7474cbb34b27b676e68e3f39 /sql/item.cc
parent4201939d575e3530d3c5e0fd9668d11062f70d79 (diff)
parentfc666a0df6c69a620d3cffacd78e2569fb0ac410 (diff)
downloadmariadb-git-4092d08bb87ce3e68f450745538164a8749fbac5.tar.gz
Merge into latest 5.3
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 a5cdcf44d85..f10c491853e 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)
{