summaryrefslogtreecommitdiff
path: root/sql/item_strfunc.h
diff options
context:
space:
mode:
authorbar@mysql.com <>2005-03-04 14:20:49 +0400
committerbar@mysql.com <>2005-03-04 14:20:49 +0400
commit7e8e033290b57d26fac64efcf98294b0258d1454 (patch)
tree2441bab602265c2b1dba098f2faeade8b9cc33df /sql/item_strfunc.h
parent0f3b5b7ccb8f8aa245413b20d84d8e617fa9f957 (diff)
downloadmariadb-git-7e8e033290b57d26fac64efcf98294b0258d1454.tar.gz
type_blob.result, func_system.result, func_str.result, ctype_collate.result:
fixing test results accordingly. func_system.test: New test that illegal mix of collations does not happen anymore. item_strfunc.h: safe_charset_converter() was added for system constants. item_strfunc.cc: safe_charset_converter() was added for system constants. item_func.cc, item.h, item.cc: Bug#8291: Illegal collation mix with USER() function. After discussion with PeterG and Serge, a new coercibility level for "system constants" was introduced, between COERRIBLE and IMPLICIT. Thus: SELECT col1 = USER() FROM t1; - is done according to col1 collation. SELECT 'string' = USER(); - is done according to USER() collation. At the same time, "nagg" and "strong" members were removed as unused. item_create.cc: Version is a system constant too.
Diffstat (limited to 'sql/item_strfunc.h')
-rw-r--r--sql/item_strfunc.h16
1 files changed, 12 insertions, 4 deletions
diff --git a/sql/item_strfunc.h b/sql/item_strfunc.h
index c1c0969672c..0c3ed32fb68 100644
--- a/sql/item_strfunc.h
+++ b/sql/item_strfunc.h
@@ -337,10 +337,18 @@ public:
};
-class Item_func_database :public Item_str_func
+class Item_func_sysconst :public Item_str_func
{
public:
- Item_func_database() { collation.set(system_charset_info,DERIVATION_IMPLICIT); }
+ Item_func_sysconst()
+ { collation.set(system_charset_info,DERIVATION_SYSCONST); }
+ Item *safe_charset_converter(CHARSET_INFO *tocs);
+};
+
+class Item_func_database :public Item_func_sysconst
+{
+public:
+ Item_func_database() :Item_func_sysconst() {}
String *val_str(String *);
void fix_length_and_dec()
{
@@ -350,10 +358,10 @@ public:
const char *func_name() const { return "database"; }
};
-class Item_func_user :public Item_str_func
+class Item_func_user :public Item_func_sysconst
{
public:
- Item_func_user() { collation.set(system_charset_info, DERIVATION_IMPLICIT); }
+ Item_func_user() :Item_func_sysconst() {}
String *val_str(String *);
void fix_length_and_dec()
{