summaryrefslogtreecommitdiff
path: root/sql/item_strfunc.h
diff options
context:
space:
mode:
authorunknown <bar@mysql.com>2005-06-06 16:54:15 +0500
committerunknown <bar@mysql.com>2005-06-06 16:54:15 +0500
commite7300f13465e8e218351f61a4bef6b8133ed79b4 (patch)
tree901c99571e02ef1768a731b79400976f99f118e3 /sql/item_strfunc.h
parent29f18223aaec312d214658ffc59694a0ab6be6d7 (diff)
downloadmariadb-git-e7300f13465e8e218351f61a4bef6b8133ed79b4.tar.gz
Bug#8610: The ucs2_turkish_ci collation fails with upper('i')
UPPER/LOWER now can return a string with different length. mi_test1.c: Adding new arguments. Many files: Changeing caseup/casedn to return a result with different length than argument. sql_string.h: Removing unused method, mysql_priv.h: Removing unused method strings/ctype-big5.c: Changeing caseup/casedn to return a result with different length than argument. strings/ctype-bin.c: Changeing caseup/casedn to return a result with different length than argument. strings/ctype-cp932.c: Changeing caseup/casedn to return a result with different length than argument. strings/ctype-czech.c: Changeing caseup/casedn to return a result with different length than argument. strings/ctype-euc_kr.c: Changeing caseup/casedn to return a result with different length than argument. strings/ctype-extra.c: Changeing caseup/casedn to return a result with different length than argument. strings/ctype-eucjpms.c: Changeing caseup/casedn to return a result with different length than argument. strings/ctype-gb2312.c: Changeing caseup/casedn to return a result with different length than argument. strings/ctype-gbk.c: Changeing caseup/casedn to return a result with different length than argument. strings/ctype-latin1.c: Changeing caseup/casedn to return a result with different length than argument. strings/ctype-mb.c: Changeing caseup/casedn to return a result with different length than argument. strings/ctype-simple.c: Changeing caseup/casedn to return a result with different length than argument. strings/ctype-sjis.c: Changeing caseup/casedn to return a result with different length than argument. strings/ctype-tis620.c: Changeing caseup/casedn to return a result with different length than argument. strings/ctype-uca.c: Changeing caseup/casedn to return a result with different length than argument. strings/ctype-ucs2.c: Changeing caseup/casedn to return a result with different length than argument. strings/ctype-ujis.c: Changeing caseup/casedn to return a result with different length than argument. strings/ctype-utf8.c: Changeing caseup/casedn to return a result with different length than argument. strings/ctype-win1250ch.c: Changeing caseup/casedn to return a result with different length than argument. sql/item_strfunc.cc: Changeing caseup/casedn to return a result with different length than argument. sql/item_strfunc.h: Changeing caseup/casedn to return a result with different length than argument. sql/mysql_priv.h: Removing unused method sql/sql_string.h: Removing unused method, client/sql_string.h: Changeing caseup/casedn to return a result with different length than argument. include/m_ctype.h: Changeing caseup/casedn to return a result with different length than argument. myisam/mi_test1.c: Adding new arguments. mysql-test/r/ctype_uca.result: UPPER/LOWER now can return a string with different length. mysql-test/t/ctype_uca.test: UPPER/LOWER now can return a string with different length.
Diffstat (limited to 'sql/item_strfunc.h')
-rw-r--r--sql/item_strfunc.h27
1 files changed, 20 insertions, 7 deletions
diff --git a/sql/item_strfunc.h b/sql/item_strfunc.h
index 95979408ccb..6df90cebdff 100644
--- a/sql/item_strfunc.h
+++ b/sql/item_strfunc.h
@@ -133,13 +133,14 @@ public:
class Item_str_conv :public Item_str_func
{
+protected:
+ uint multiply;
+ uint (*converter)(CHARSET_INFO *cs, char *src, uint srclen,
+ char *dst, uint dstlen);
+ String tmp_value;
public:
Item_str_conv(Item *item) :Item_str_func(item) {}
- void fix_length_and_dec()
- {
- collation.set(args[0]->collation);
- max_length = args[0]->max_length;
- }
+ String *val_str(String *);
};
@@ -147,16 +148,28 @@ class Item_func_lcase :public Item_str_conv
{
public:
Item_func_lcase(Item *item) :Item_str_conv(item) {}
- String *val_str(String *);
const char *func_name() const { return "lcase"; }
+ void fix_length_and_dec()
+ {
+ collation.set(args[0]->collation);
+ multiply= collation.collation->casedn_multiply;
+ converter= collation.collation->cset->casedn;
+ max_length= args[0]->max_length * multiply;
+ }
};
class Item_func_ucase :public Item_str_conv
{
public:
Item_func_ucase(Item *item) :Item_str_conv(item) {}
- String *val_str(String *);
const char *func_name() const { return "ucase"; }
+ void fix_length_and_dec()
+ {
+ collation.set(args[0]->collation);
+ multiply= collation.collation->caseup_multiply;
+ converter= collation.collation->cset->caseup;
+ max_length= args[0]->max_length * multiply;
+ }
};