summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
authorunknown <mysql@home.(none)>2003-03-16 17:19:24 +0400
committerunknown <mysql@home.(none)>2003-03-16 17:19:24 +0400
commited2bb40a9a87f51d724a56631459c77baf49e6b4 (patch)
treef73c3662ed4bfebf7b1ef0409380b4b6f60a23bd /sql
parent23f252855e5dcb18ac55cf9ce303f61c28e06421 (diff)
downloadmariadb-git-ed2bb40a9a87f51d724a56631459c77baf49e6b4.tar.gz
New function my_charset_same()
BitKeeper/etc/logging_ok: Logging to logging@openlogging.org accepted
Diffstat (limited to 'sql')
-rw-r--r--sql/item_func.cc2
-rw-r--r--sql/item_strfunc.cc2
-rw-r--r--sql/sql_yacc.yy6
3 files changed, 5 insertions, 5 deletions
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);