diff options
author | unknown <bar@bar.myoffice.izhnet.ru> | 2007-08-03 15:30:31 +0500 |
---|---|---|
committer | unknown <bar@bar.myoffice.izhnet.ru> | 2007-08-03 15:30:31 +0500 |
commit | 0d1972aa72dd98a229a2a8c8faca46383bbcc572 (patch) | |
tree | c657f898b9581b0e2a19433212ad42eca9646b98 /sql/item.h | |
parent | 607ab14cf767ed0187e0c050ed61cb4ebaf34bb7 (diff) | |
parent | 53df09a9a6a99b82e2a8869eb16737a78772b29e (diff) | |
download | mariadb-git-0d1972aa72dd98a229a2a8c8faca46383bbcc572.tar.gz |
Merge mysql.com:/home/bar/mysql-work/mysql-5.0.b28875
into mysql.com:/home/bar/mysql-work/mysql-5.0-rpl
mysql-test/r/ctype_utf8.result:
Auto merged
mysql-test/t/ctype_utf8.test:
Auto merged
sql/item.cc:
Auto merged
sql/item.h:
Auto merged
sql/item_func.cc:
Auto merged
sql/item_strfunc.cc:
Auto merged
sql/item_timefunc.cc:
Auto merged
sql/sql_lex.cc:
Auto merged
sql/sql_lex.h:
Auto merged
sql/sql_yacc.yy:
Auto merged
strings/conf_to_src.c:
Auto merged
strings/ctype-extra.c:
Auto merged
mysql-test/r/ctype_ucs.result:
After merge fix
mysql-test/t/ctype_ucs.test:
After merge fix
Diffstat (limited to 'sql/item.h')
-rw-r--r-- | sql/item.h | 43 |
1 files changed, 36 insertions, 7 deletions
diff --git a/sql/item.h b/sql/item.h index 5b1a80a5f03..7d23bfe90de 100644 --- a/sql/item.h +++ b/sql/item.h @@ -49,29 +49,50 @@ class DTCollation { public: CHARSET_INFO *collation; enum Derivation derivation; + uint repertoire; + void set_repertoire_from_charset(CHARSET_INFO *cs) + { + repertoire= cs->state & MY_CS_PUREASCII ? + MY_REPERTOIRE_ASCII : MY_REPERTOIRE_UNICODE30; + } DTCollation() { collation= &my_charset_bin; derivation= DERIVATION_NONE; + repertoire= MY_REPERTOIRE_UNICODE30; } DTCollation(CHARSET_INFO *collation_arg, Derivation derivation_arg) { collation= collation_arg; derivation= derivation_arg; + set_repertoire_from_charset(collation_arg); } void set(DTCollation &dt) { collation= dt.collation; derivation= dt.derivation; + repertoire= dt.repertoire; } void set(CHARSET_INFO *collation_arg, Derivation derivation_arg) { collation= collation_arg; derivation= derivation_arg; + set_repertoire_from_charset(collation_arg); + } + void set(CHARSET_INFO *collation_arg, + Derivation derivation_arg, + uint repertoire_arg) + { + collation= collation_arg; + derivation= derivation_arg; + repertoire= repertoire_arg; } void set(CHARSET_INFO *collation_arg) - { collation= collation_arg; } + { + collation= collation_arg; + set_repertoire_from_charset(collation_arg); + } void set(Derivation derivation_arg) { derivation= derivation_arg; } bool aggregate(DTCollation &dt, uint flags= 0); @@ -1662,10 +1683,11 @@ class Item_string :public Item { public: Item_string(const char *str,uint length, - CHARSET_INFO *cs, Derivation dv= DERIVATION_COERCIBLE) + CHARSET_INFO *cs, Derivation dv= DERIVATION_COERCIBLE, + uint repertoire= MY_REPERTOIRE_UNICODE30) { - collation.set(cs, dv); - str_value.set_or_copy_aligned(str,length,cs); + str_value.set_or_copy_aligned(str, length, cs); + collation.set(cs, dv, repertoire); /* We have to have a different max_length than 'length' here to ensure that we get the right length if we do use the item @@ -1689,10 +1711,11 @@ public: fixed= 1; } Item_string(const char *name_par, const char *str, uint length, - CHARSET_INFO *cs, Derivation dv= DERIVATION_COERCIBLE) + CHARSET_INFO *cs, Derivation dv= DERIVATION_COERCIBLE, + uint repertoire= MY_REPERTOIRE_UNICODE30) { - collation.set(cs, dv); - str_value.set_or_copy_aligned(str,length,cs); + str_value.set_or_copy_aligned(str, length, cs); + collation.set(cs, dv, repertoire); max_length= str_value.numchars()*cs->mbmaxlen; set_name(name_par, 0, cs); decimals=NOT_FIXED_DEC; @@ -1708,6 +1731,12 @@ public: str_value.copy(str_arg, length_arg, collation.collation); max_length= str_value.numchars() * collation.collation->mbmaxlen; } + void set_repertoire_from_value() + { + collation.repertoire= my_string_repertoire(str_value.charset(), + str_value.ptr(), + str_value.length()); + } enum Type type() const { return STRING_ITEM; } double val_real(); longlong val_int(); |