summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--BitKeeper/etc/logging_ok1
-rw-r--r--include/m_ctype.h1
-rw-r--r--include/my_sys.h1
-rw-r--r--mysys/charset.c4
-rw-r--r--sql/item_func.cc2
-rw-r--r--sql/item_strfunc.cc2
-rw-r--r--sql/sql_yacc.yy6
7 files changed, 12 insertions, 5 deletions
diff --git a/BitKeeper/etc/logging_ok b/BitKeeper/etc/logging_ok
index 148c96de0bc..754cca32249 100644
--- a/BitKeeper/etc/logging_ok
+++ b/BitKeeper/etc/logging_ok
@@ -65,6 +65,7 @@ monty@work.mysql.com
mwagner@cash.mwagner.org
mwagner@evoq.mwagner.org
mwagner@work.mysql.com
+mysql@home.(none)
nick@mysql.com
nick@nick.leippe.com
papa@gbichot.local
diff --git a/include/m_ctype.h b/include/m_ctype.h
index 43338c1942d..8833b7df47e 100644
--- a/include/m_ctype.h
+++ b/include/m_ctype.h
@@ -199,6 +199,7 @@ extern CHARSET_INFO my_charset_latin1_de;
extern CHARSET_INFO my_charset_sjis;
extern CHARSET_INFO my_charset_tis620;
extern CHARSET_INFO my_charset_ucs2;
+extern CHARSET_INFO my_charset_ucse;
extern CHARSET_INFO my_charset_ujis;
extern CHARSET_INFO my_charset_utf8;
extern CHARSET_INFO my_charset_win1250ch;
diff --git a/include/my_sys.h b/include/my_sys.h
index e53e2442983..7d754912823 100644
--- a/include/my_sys.h
+++ b/include/my_sys.h
@@ -215,6 +215,7 @@ extern CHARSET_INFO *get_charset_by_csname(const char *cs_name,
extern void free_charsets(void);
extern char *list_charsets(myf want_flags); /* my_free() this string... */
extern char *get_charsets_dir(char *buf);
+extern my_bool my_charset_same(CHARSET_INFO *cs1, CHARSET_INFO *cs2);
/* statistics */
diff --git a/mysys/charset.c b/mysys/charset.c
index 9b628ce0177..87fb7846553 100644
--- a/mysys/charset.c
+++ b/mysys/charset.c
@@ -33,6 +33,10 @@
- Setting server default character set
*/
+my_bool my_charset_same(CHARSET_INFO *cs1, CHARSET_INFO *cs2)
+{
+ return ((cs1 == cs2) || !strcmp(cs1->csname,cs2->csname));
+}
static void set_max_sort_char(CHARSET_INFO *cs)
{
diff --git a/sql/item_func.cc b/sql/item_func.cc
index 0361fd0db65..8fb97dc2873 100644
--- a/sql/item_func.cc
+++ b/sql/item_func.cc
@@ -136,7 +136,7 @@ Item_func::fix_fields(THD *thd, TABLE_LIST *tables, Item **ref)
}
else if ((*arg)->coercibility < coercibility)
{
- if (strcmp(charset()->csname,(*arg)->charset()->csname))
+ if (!my_charset_same(charset(),(*arg)->charset()))
{
set_charset(&my_charset_bin);
coercibility= COER_NOCOLL;
diff --git a/sql/item_strfunc.cc b/sql/item_strfunc.cc
index f049c13c974..80d85e565e7 100644
--- a/sql/item_strfunc.cc
+++ b/sql/item_strfunc.cc
@@ -2216,7 +2216,7 @@ bool Item_func_set_collation::fix_fields(THD *thd,struct st_table_list *tables,
return 1;
}
- if (strcmp(args[0]->charset()->csname,set_collation->csname))
+ if (!my_charset_same(args[0]->charset(),set_collation))
{
my_error(ER_COLLATION_CHARSET_MISMATCH, MYF(0),
set_collation->name,args[0]->charset()->csname);
diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy
index fac3315f5c9..7db398e7810 100644
--- a/sql/sql_yacc.yy
+++ b/sql/sql_yacc.yy
@@ -1284,7 +1284,7 @@ attribute:
| COMMENT_SYM text_literal { Lex->comment= $2; }
| COLLATE_SYM collation_name
{
- if (Lex->charset && strcmp(Lex->charset->csname,$2->csname))
+ if (Lex->charset && !my_charset_same(Lex->charset,$2))
{
net_printf(YYTHD,ER_COLLATION_CHARSET_MISMATCH,
$2->name,Lex->charset->csname);
@@ -4250,7 +4250,7 @@ option_value:
CHARSET_INFO *cs= $2 ? $2 : thd->db_charset;
CHARSET_INFO *cl= $3 ? $3 : cs;
- if ((cl != cs) && strcmp(cs->csname,cl->csname))
+ if (!my_charset_same(cs,cl))
{
net_printf(YYTHD,ER_COLLATION_CHARSET_MISMATCH,
cl->name,cs->csname);
@@ -4279,7 +4279,7 @@ option_value:
YYABORT;
}
}
- else if ((cl != cs) && strcmp(cs->csname,cl->csname))
+ else if (!my_charset_same(cs,cl))
{
net_printf(YYTHD,ER_COLLATION_CHARSET_MISMATCH,
cl->name,cs->csname);