diff options
author | unknown <bar@bar.mysql.r18.ru> | 2003-03-17 21:56:34 +0400 |
---|---|---|
committer | unknown <bar@bar.mysql.r18.ru> | 2003-03-17 21:56:34 +0400 |
commit | 84f0e1172981750a85bae8090548784f0aefa1e2 (patch) | |
tree | 1220cb8b5a2d5a6f85c1ee028fa98cf95cf2f38c /sql/item.cc | |
parent | 3ca97c63ba7dc4533b9b8b520263a6f6ee74efc8 (diff) | |
download | mariadb-git-84f0e1172981750a85bae8090548784f0aefa1e2.tar.gz |
mysql-test/t/ctype_many.test:
Automatic client-server charset recoding has been added
mysys/charset.c:
Automatic client-server charset recoding has been added
sql/item.cc:
Automatic client-server charset recoding has been added
sql/item.h:
Automatic client-server charset recoding has been added
sql/item_cmpfunc.cc:
Automatic client-server charset recoding has been added
sql/item_func.cc:
Automatic client-server charset recoding has been added
sql/item_strfunc.cc:
Automatic client-server charset recoding has been added
sql/mysqld.cc:
Automatic client-server charset recoding has been added
sql/protocol.cc:
Automatic client-server charset recoding has been added
sql/sql_string.cc:
Automatic client-server charset recoding has been added
sql/sql_yacc.yy:
Automatic client-server charset recoding has been added
strings/ctype-utf8.c:
Automatic client-server charset recoding has been added
Diffstat (limited to 'sql/item.cc')
-rw-r--r-- | sql/item.cc | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/sql/item.cc b/sql/item.cc index 28fcabfe1b8..6dbe026515d 100644 --- a/sql/item.cc +++ b/sql/item.cc @@ -90,19 +90,23 @@ bool Item::check_cols(uint c) return 0; } -void Item::set_name(const char *str,uint length) +void Item::set_name(const char *str,uint length, CHARSET_INFO *cs) { if (!length) - name= (char*) str; // Used by AS - else + length= str ? strlen(str) : 0; + while (length && !my_isgraph(cs,*str)) + { // Fix problem with yacc + length--; + str++; + } + if (!my_charset_same(cs, system_charset_info)) { - while (length && !my_isgraph(system_charset_info,*str)) - { // Fix problem with yacc - length--; - str++; - } - name=sql_strmake(str,min(length,MAX_FIELD_WIDTH)); + String tmp; + tmp.copy(str, length, cs, system_charset_info); + name=sql_strmake(tmp.ptr(),min(tmp.length(),MAX_FIELD_WIDTH)); } + else + name=sql_strmake(str,min(length,MAX_FIELD_WIDTH)); } /* |