diff options
author | unknown <Sinisa@sinisa.nasamreza.org> | 2003-03-17 21:29:38 +0200 |
---|---|---|
committer | unknown <Sinisa@sinisa.nasamreza.org> | 2003-03-17 21:29:38 +0200 |
commit | 5154f5a4232c988c7882835335d1eb9dfc105919 (patch) | |
tree | 2c237228378a05d91df39cbeace7404f5c97aeeb /sql/item.cc | |
parent | 63f9958d91fdb4825968a30d712ae7ff7585b07a (diff) | |
parent | 89fee820fccf4d57f99738a10a8473519e0e718f (diff) | |
download | mariadb-git-5154f5a4232c988c7882835335d1eb9dfc105919.tar.gz |
Merge sinisa@bk-internal.mysql.com:/home/bk/mysql-4.1
into sinisa.nasamreza.org:/mnt/work/mysql-4.1
sql/item.cc:
Auto merged
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 96cfedf478e..7d9afce02a8 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)); } /* |