summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorunknown <bar@bar.mysql.r18.ru>2003-07-29 17:12:14 +0500
committerunknown <bar@bar.mysql.r18.ru>2003-07-29 17:12:14 +0500
commit8d7b54b7c225bb3395ea8fa0692c6799032d7304 (patch)
tree66fd9cf224c10568a1a31e3da1c92339f9439fa3
parent8713e9791ce79bd8f4e939c4c8e420809cd7832b (diff)
downloadmariadb-git-8d7b54b7c225bb3395ea8fa0692c6799032d7304.tar.gz
A new separate error message: Unknown collation 'blablabla'
-rw-r--r--include/mysqld_error.h3
-rw-r--r--mysql-test/r/ctype_collate.result6
-rw-r--r--mysql-test/r/variables.result2
-rw-r--r--mysql-test/t/ctype_collate.test7
-rw-r--r--mysql-test/t/variables.test2
-rw-r--r--sql/item_strfunc.cc8
-rw-r--r--sql/set_var.cc2
-rw-r--r--sql/share/czech/errmsg.txt1
-rw-r--r--sql/share/danish/errmsg.txt1
-rw-r--r--sql/share/dutch/errmsg.txt1
-rw-r--r--sql/share/english/errmsg.txt1
-rw-r--r--sql/share/estonian/errmsg.txt1
-rw-r--r--sql/share/french/errmsg.txt1
-rw-r--r--sql/share/german/errmsg.txt1
-rw-r--r--sql/share/greek/errmsg.txt1
-rw-r--r--sql/share/hungarian/errmsg.txt1
-rw-r--r--sql/share/italian/errmsg.txt1
-rw-r--r--sql/share/japanese/errmsg.txt1
-rw-r--r--sql/share/korean/errmsg.txt1
-rw-r--r--sql/share/norwegian-ny/errmsg.txt1
-rw-r--r--sql/share/norwegian/errmsg.txt1
-rw-r--r--sql/share/polish/errmsg.txt1
-rw-r--r--sql/share/portuguese/errmsg.txt1
-rw-r--r--sql/share/romanian/errmsg.txt1
-rw-r--r--sql/share/russian/errmsg.txt1
-rw-r--r--sql/share/serbian/errmsg.txt1
-rw-r--r--sql/share/slovak/errmsg.txt1
-rw-r--r--sql/share/spanish/errmsg.txt1
-rw-r--r--sql/share/swedish/errmsg.txt1
-rw-r--r--sql/share/ukrainian/errmsg.txt1
-rw-r--r--sql/sql_db.cc2
-rw-r--r--sql/sql_lex.cc2
-rw-r--r--sql/sql_yacc.yy2
33 files changed, 51 insertions, 8 deletions
diff --git a/include/mysqld_error.h b/include/mysqld_error.h
index 0468663239b..17ededfbb52 100644
--- a/include/mysqld_error.h
+++ b/include/mysqld_error.h
@@ -287,4 +287,5 @@
#define ER_CANT_AGGREGATE_3COLLATIONS 1268
#define ER_CANT_AGGREGATE_NCOLLATIONS 1269
#define ER_VARIABLE_IS_NOT_STRUCT 1270
-#define ER_ERROR_MESSAGES 271
+#define ER_UNKNOWN_COLLATION 1271
+#define ER_ERROR_MESSAGES 272
diff --git a/mysql-test/r/ctype_collate.result b/mysql-test/r/ctype_collate.result
index f895107239f..2c2eebc86fa 100644
--- a/mysql-test/r/ctype_collate.result
+++ b/mysql-test/r/ctype_collate.result
@@ -7,6 +7,10 @@ CREATE TABLE t2 (
latin1_f CHAR(32) CHARACTER SET latin1 COLLATE koi8r_general_ci NOT NULL
);
ERROR 42000: COLLATION 'koi8r_general_ci' is not valid for CHARACTER SET 'latin1'
+CREATE TABLE t2 (
+latin1_f CHAR(32) CHARACTER SET latin1 COLLATE some_non_existing_col NOT NULL
+);
+ERROR HY000: Unknown collation: 'some_non_existing_col'
INSERT INTO t1 (latin1_f) VALUES (_latin1'A');
INSERT INTO t1 (latin1_f) VALUES (_latin1'a');
INSERT INTO t1 (latin1_f) VALUES (_latin1'AD');
@@ -482,7 +486,7 @@ y
Z
z
SELECT DISTINCT latin1_f COLLATE koi8r FROM t1;
-ERROR 42000: COLLATION 'koi8r' is not valid for CHARACTER SET 'latin1'
+ERROR HY000: Unknown collation: 'koi8r'
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
diff --git a/mysql-test/r/variables.result b/mysql-test/r/variables.result
index 4db791c993e..ead09cc6ed7 100644
--- a/mysql-test/r/variables.result
+++ b/mysql-test/r/variables.result
@@ -184,6 +184,8 @@ set GLOBAL table_type=DEFAULT;
ERROR 42000: Variable 'table_type' doesn't have a default value
set character_set_client=UNKNOWN_CHARACTER_SET;
ERROR 42000: Unknown character set: 'UNKNOWN_CHARACTER_SET'
+set collation_connection=UNKNOWN_COLLATION;
+ERROR HY000: Unknown collation: 'UNKNOWN_COLLATION'
set global autocommit=1;
ERROR HY000: Variable 'autocommit' is a LOCAL variable and can't be used with SET GLOBAL
select @@global.timestamp;
diff --git a/mysql-test/t/ctype_collate.test b/mysql-test/t/ctype_collate.test
index 0cf531156a9..3fd9df0c6ce 100644
--- a/mysql-test/t/ctype_collate.test
+++ b/mysql-test/t/ctype_collate.test
@@ -12,6 +12,11 @@ CREATE TABLE t2 (
latin1_f CHAR(32) CHARACTER SET latin1 COLLATE koi8r_general_ci NOT NULL
);
+--error 1271
+CREATE TABLE t2 (
+ latin1_f CHAR(32) CHARACTER SET latin1 COLLATE some_non_existing_col NOT NULL
+);
+
INSERT INTO t1 (latin1_f) VALUES (_latin1'A');
INSERT INTO t1 (latin1_f) VALUES (_latin1'a');
@@ -93,7 +98,7 @@ SELECT DISTINCT latin1_f COLLATE latin1_swedish_ci FROM t1;
SELECT DISTINCT latin1_f COLLATE latin1_german2_ci FROM t1;
SELECT DISTINCT latin1_f COLLATE latin1_general_ci FROM t1;
SELECT DISTINCT latin1_f COLLATE latin1_bin FROM t1;
---error 1251
+--error 1271
SELECT DISTINCT latin1_f COLLATE koi8r FROM t1;
diff --git a/mysql-test/t/variables.test b/mysql-test/t/variables.test
index 7d4b25df0eb..16a192f1276 100644
--- a/mysql-test/t/variables.test
+++ b/mysql-test/t/variables.test
@@ -120,6 +120,8 @@ set SESSION query_cache_size=10000;
set GLOBAL table_type=DEFAULT;
--error 1115
set character_set_client=UNKNOWN_CHARACTER_SET;
+--error 1271
+set collation_connection=UNKNOWN_COLLATION;
--error 1228
set global autocommit=1;
--error 1228
diff --git a/sql/item_strfunc.cc b/sql/item_strfunc.cc
index 4e35e90b429..b4f4df6968d 100644
--- a/sql/item_strfunc.cc
+++ b/sql/item_strfunc.cc
@@ -2206,7 +2206,13 @@ void Item_func_set_collation::fix_length_and_dec()
set_collation= get_charset_by_csname(args[0]->charset()->csname,
MY_CS_BINSORT,MYF(0));
else
- set_collation= get_charset_by_name(colname,MYF(0));
+ {
+ if (!(set_collation= get_charset_by_name(colname,MYF(0))))
+ {
+ my_error(ER_UNKNOWN_COLLATION, MYF(0), colname);
+ return;
+ }
+ }
if (!set_collation || !my_charset_same(args[0]->charset(),set_collation))
{
diff --git a/sql/set_var.cc b/sql/set_var.cc
index cb6c875d513..6a6e010578f 100644
--- a/sql/set_var.cc
+++ b/sql/set_var.cc
@@ -1240,7 +1240,7 @@ bool sys_var_collation::check(THD *thd, set_var *var)
if (!(tmp=get_charset_by_name(res->c_ptr(),MYF(0))))
{
- my_error(ER_UNKNOWN_CHARACTER_SET, MYF(0), res->c_ptr());
+ my_error(ER_UNKNOWN_COLLATION, MYF(0), res->c_ptr());
return 1;
}
var->save_result.charset= tmp; // Save for update
diff --git a/sql/share/czech/errmsg.txt b/sql/share/czech/errmsg.txt
index 18f0a4a1193..b43c4b43b50 100644
--- a/sql/share/czech/errmsg.txt
+++ b/sql/share/czech/errmsg.txt
@@ -276,3 +276,4 @@ v/*
"Illegal mix of collations (%s,%s), (%s,%s), (%s,%s) for operation '%s'",
"Illegal mix of collations for operation '%s'",
"Variable '%-.64s' is not a variable component (Can't be used as XXXX.variable_name)",
+"Unknown collation: '%-.64s'",
diff --git a/sql/share/danish/errmsg.txt b/sql/share/danish/errmsg.txt
index 9366e71e7c9..2eb9e6d2219 100644
--- a/sql/share/danish/errmsg.txt
+++ b/sql/share/danish/errmsg.txt
@@ -270,3 +270,4 @@
"Illegal mix of collations (%s,%s), (%s,%s), (%s,%s) for operation '%s'",
"Illegal mix of collations for operation '%s'",
"Variable '%-.64s' is not a variable component (Can't be used as XXXX.variable_name)",
+"Unknown collation: '%-.64s'",
diff --git a/sql/share/dutch/errmsg.txt b/sql/share/dutch/errmsg.txt
index c43b84f1674..2a663a176f8 100644
--- a/sql/share/dutch/errmsg.txt
+++ b/sql/share/dutch/errmsg.txt
@@ -278,3 +278,4 @@
"Illegal mix of collations (%s,%s), (%s,%s), (%s,%s) for operation '%s'",
"Illegal mix of collations for operation '%s'",
"Variable '%-.64s' is not a variable component (Can't be used as XXXX.variable_name)",
+"Unknown collation: '%-.64s'",
diff --git a/sql/share/english/errmsg.txt b/sql/share/english/errmsg.txt
index 606c1a902a2..f4019d63055 100644
--- a/sql/share/english/errmsg.txt
+++ b/sql/share/english/errmsg.txt
@@ -272,3 +272,4 @@
"Illegal mix of collations (%s,%s), (%s,%s), (%s,%s) for operation '%s'",
"Illegal mix of collations for operation '%s'",
"Variable '%-.64s' is not a variable component (Can't be used as XXXX.variable_name)",
+"Unknown collation: '%-.64s'",
diff --git a/sql/share/estonian/errmsg.txt b/sql/share/estonian/errmsg.txt
index f453cc72f88..d3a38ede5bc 100644
--- a/sql/share/estonian/errmsg.txt
+++ b/sql/share/estonian/errmsg.txt
@@ -272,3 +272,4 @@
"Illegal mix of collations (%s,%s), (%s,%s), (%s,%s) for operation '%s'",
"Illegal mix of collations for operation '%s'",
"Variable '%-.64s' is not a variable component (Can't be used as XXXX.variable_name)",
+"Unknown collation: '%-.64s'",
diff --git a/sql/share/french/errmsg.txt b/sql/share/french/errmsg.txt
index ae9f91312fa..ccff24c5759 100644
--- a/sql/share/french/errmsg.txt
+++ b/sql/share/french/errmsg.txt
@@ -267,3 +267,4 @@
"Illegal mix of collations (%s,%s), (%s,%s), (%s,%s) for operation '%s'",
"Illegal mix of collations for operation '%s'",
"Variable '%-.64s' is not a variable component (Can't be used as XXXX.variable_name)",
+"Unknown collation: '%-.64s'",
diff --git a/sql/share/german/errmsg.txt b/sql/share/german/errmsg.txt
index 9d5a2d29ca3..52f3eb78c11 100644
--- a/sql/share/german/errmsg.txt
+++ b/sql/share/german/errmsg.txt
@@ -276,3 +276,4 @@
"Illegal mix of collations (%s,%s), (%s,%s), (%s,%s) for operation '%s'",
"Illegal mix of collations for operation '%s'",
"Variable '%-.64s' is not a variable component (Can't be used as XXXX.variable_name)",
+"Unknown collation: '%-.64s'",
diff --git a/sql/share/greek/errmsg.txt b/sql/share/greek/errmsg.txt
index dbfb605dac2..1ce052bdf22 100644
--- a/sql/share/greek/errmsg.txt
+++ b/sql/share/greek/errmsg.txt
@@ -267,3 +267,4 @@
"Illegal mix of collations (%s,%s), (%s,%s), (%s,%s) for operation '%s'",
"Illegal mix of collations for operation '%s'",
"Variable '%-.64s' is not a variable component (Can't be used as XXXX.variable_name)",
+"Unknown collation: '%-.64s'",
diff --git a/sql/share/hungarian/errmsg.txt b/sql/share/hungarian/errmsg.txt
index a06f679e81c..6143ea2a1c4 100644
--- a/sql/share/hungarian/errmsg.txt
+++ b/sql/share/hungarian/errmsg.txt
@@ -269,3 +269,4 @@
"Illegal mix of collations (%s,%s), (%s,%s), (%s,%s) for operation '%s'",
"Illegal mix of collations for operation '%s'",
"Variable '%-.64s' is not a variable component (Can't be used as XXXX.variable_name)",
+"Unknown collation: '%-.64s'",
diff --git a/sql/share/italian/errmsg.txt b/sql/share/italian/errmsg.txt
index 48f77490892..8164757d823 100644
--- a/sql/share/italian/errmsg.txt
+++ b/sql/share/italian/errmsg.txt
@@ -267,3 +267,4 @@
"Illegal mix of collations (%s,%s), (%s,%s), (%s,%s) for operation '%s'",
"Illegal mix of collations for operation '%s'",
"Variable '%-.64s' is not a variable component (Can't be used as XXXX.variable_name)",
+"Unknown collation: '%-.64s'",
diff --git a/sql/share/japanese/errmsg.txt b/sql/share/japanese/errmsg.txt
index 80af8a87c94..747d3611cc9 100644
--- a/sql/share/japanese/errmsg.txt
+++ b/sql/share/japanese/errmsg.txt
@@ -269,3 +269,4 @@
"Illegal mix of collations (%s,%s), (%s,%s), (%s,%s) for operation '%s'",
"Illegal mix of collations for operation '%s'",
"Variable '%-.64s' is not a variable component (Can't be used as XXXX.variable_name)",
+"Unknown collation: '%-.64s'",
diff --git a/sql/share/korean/errmsg.txt b/sql/share/korean/errmsg.txt
index 4c654819495..93d86d32937 100644
--- a/sql/share/korean/errmsg.txt
+++ b/sql/share/korean/errmsg.txt
@@ -267,3 +267,4 @@
"Illegal mix of collations (%s,%s), (%s,%s), (%s,%s) for operation '%s'",
"Illegal mix of collations for operation '%s'",
"Variable '%-.64s' is not a variable component (Can't be used as XXXX.variable_name)",
+"Unknown collation: '%-.64s'",
diff --git a/sql/share/norwegian-ny/errmsg.txt b/sql/share/norwegian-ny/errmsg.txt
index 7b4075ccb66..e9319246fc6 100644
--- a/sql/share/norwegian-ny/errmsg.txt
+++ b/sql/share/norwegian-ny/errmsg.txt
@@ -269,3 +269,4 @@
"Illegal mix of collations (%s,%s), (%s,%s), (%s,%s) for operation '%s'",
"Illegal mix of collations for operation '%s'",
"Variable '%-.64s' is not a variable component (Can't be used as XXXX.variable_name)",
+"Unknown collation: '%-.64s'",
diff --git a/sql/share/norwegian/errmsg.txt b/sql/share/norwegian/errmsg.txt
index d4bd7115e86..edb5854db7e 100644
--- a/sql/share/norwegian/errmsg.txt
+++ b/sql/share/norwegian/errmsg.txt
@@ -269,3 +269,4 @@
"Illegal mix of collations (%s,%s), (%s,%s), (%s,%s) for operation '%s'",
"Illegal mix of collations for operation '%s'",
"Variable '%-.64s' is not a variable component (Can't be used as XXXX.variable_name)",
+"Unknown collation: '%-.64s'",
diff --git a/sql/share/polish/errmsg.txt b/sql/share/polish/errmsg.txt
index 7066783850b..27b4d0d661f 100644
--- a/sql/share/polish/errmsg.txt
+++ b/sql/share/polish/errmsg.txt
@@ -271,3 +271,4 @@
"Illegal mix of collations (%s,%s), (%s,%s), (%s,%s) for operation '%s'",
"Illegal mix of collations for operation '%s'",
"Variable '%-.64s' is not a variable component (Can't be used as XXXX.variable_name)",
+"Unknown collation: '%-.64s'",
diff --git a/sql/share/portuguese/errmsg.txt b/sql/share/portuguese/errmsg.txt
index aa44f09ed0e..60ace09ab33 100644
--- a/sql/share/portuguese/errmsg.txt
+++ b/sql/share/portuguese/errmsg.txt
@@ -267,3 +267,4 @@
"Illegal mix of collations (%s,%s), (%s,%s), (%s,%s) for operation '%s'",
"Illegal mix of collations for operation '%s'",
"Variable '%-.64s' is not a variable component (Can't be used as XXXX.variable_name)",
+"Unknown collation: '%-.64s'",
diff --git a/sql/share/romanian/errmsg.txt b/sql/share/romanian/errmsg.txt
index e13711f054e..8824d64876a 100644
--- a/sql/share/romanian/errmsg.txt
+++ b/sql/share/romanian/errmsg.txt
@@ -271,3 +271,4 @@
"Illegal mix of collations (%s,%s), (%s,%s), (%s,%s) for operation '%s'",
"Illegal mix of collations for operation '%s'",
"Variable '%-.64s' is not a variable component (Can't be used as XXXX.variable_name)",
+"Unknown collation: '%-.64s'",
diff --git a/sql/share/russian/errmsg.txt b/sql/share/russian/errmsg.txt
index e0394941851..ddfc0a8f7de 100644
--- a/sql/share/russian/errmsg.txt
+++ b/sql/share/russian/errmsg.txt
@@ -269,3 +269,4 @@
"Illegal mix of collations (%s,%s), (%s,%s), (%s,%s) for operation '%s'",
"Illegal mix of collations for operation '%s'",
"Variable '%-.64s' is not a variable component (Can't be used as XXXX.variable_name)",
+"Unknown collation: '%-.64s'",
diff --git a/sql/share/serbian/errmsg.txt b/sql/share/serbian/errmsg.txt
index 1b07e0d2234..9e2a37e4053 100644
--- a/sql/share/serbian/errmsg.txt
+++ b/sql/share/serbian/errmsg.txt
@@ -263,3 +263,4 @@
"Illegal mix of collations (%s,%s), (%s,%s), (%s,%s) for operation '%s'",
"Illegal mix of collations for operation '%s'",
"Variable '%-.64s' is not a variable component (Can't be used as XXXX.variable_name)",
+"Unknown collation: '%-.64s'",
diff --git a/sql/share/slovak/errmsg.txt b/sql/share/slovak/errmsg.txt
index a812e5841e2..ed1d8cadb80 100644
--- a/sql/share/slovak/errmsg.txt
+++ b/sql/share/slovak/errmsg.txt
@@ -275,3 +275,4 @@
"Illegal mix of collations (%s,%s), (%s,%s), (%s,%s) for operation '%s'",
"Illegal mix of collations for operation '%s'",
"Variable '%-.64s' is not a variable component (Can't be used as XXXX.variable_name)",
+"Unknown collation: '%-.64s'",
diff --git a/sql/share/spanish/errmsg.txt b/sql/share/spanish/errmsg.txt
index e586e7777c1..5f3a2f38109 100644
--- a/sql/share/spanish/errmsg.txt
+++ b/sql/share/spanish/errmsg.txt
@@ -268,3 +268,4 @@
"Illegal mix of collations (%s,%s), (%s,%s), (%s,%s) for operation '%s'",
"Illegal mix of collations for operation '%s'",
"Variable '%-.64s' is not a variable component (Can't be used as XXXX.variable_name)",
+"Unknown collation: '%-.64s'",
diff --git a/sql/share/swedish/errmsg.txt b/sql/share/swedish/errmsg.txt
index 8029ab0d435..d108618834e 100644
--- a/sql/share/swedish/errmsg.txt
+++ b/sql/share/swedish/errmsg.txt
@@ -267,3 +267,4 @@
"Illegal mix of collations (%s,%s), (%s,%s), (%s,%s) for operation '%s'",
"Illegal mix of collations for operation '%s'",
"Variable '%-.64s' is not a variable component (Can't be used as XXXX.variable_name)",
+"Unknown collation: '%-.64s'",
diff --git a/sql/share/ukrainian/errmsg.txt b/sql/share/ukrainian/errmsg.txt
index d4ffae6e5ae..96b9f40feac 100644
--- a/sql/share/ukrainian/errmsg.txt
+++ b/sql/share/ukrainian/errmsg.txt
@@ -272,3 +272,4 @@
"Illegal mix of collations (%s,%s), (%s,%s), (%s,%s) for operation '%s'",
"Illegal mix of collations for operation '%s'",
"Variable '%-.64s' is not a variable component (Can't be used as XXXX.variable_name)",
+"Unknown collation: '%-.64s'",
diff --git a/sql/sql_db.cc b/sql/sql_db.cc
index 844fd05aefa..34e81402dd0 100644
--- a/sql/sql_db.cc
+++ b/sql/sql_db.cc
@@ -127,7 +127,7 @@ static bool load_db_opt(THD *thd, const char *path, HA_CREATE_INFO *create)
{
if (!(create->table_charset=get_charset_by_name(pos+1, MYF(0))))
{
- sql_print_error(ER(ER_UNKNOWN_CHARACTER_SET),pos+1);
+ sql_print_error(ER(ER_UNKNOWN_COLLATION),pos+1);
}
}
}
diff --git a/sql/sql_lex.cc b/sql/sql_lex.cc
index 16ebd758639..350ae8dc1f5 100644
--- a/sql/sql_lex.cc
+++ b/sql/sql_lex.cc
@@ -552,7 +552,7 @@ int yylex(void *arg, void *yythd)
/*
Note: "SELECT _bla AS 'alias'"
_bla should be considered as a IDENT if charset haven't been found.
- So we don't use MYF(MY_WME) with get_charset_by_name to avoid
+ So we don't use MYF(MY_WME) with get_charset_by_csname to avoid
producing an error.
*/
diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy
index a5ac04dc775..90c586dc2f1 100644
--- a/sql/sql_yacc.yy
+++ b/sql/sql_yacc.yy
@@ -1410,7 +1410,7 @@ collation_name:
{
if (!($$=get_charset_by_name($1.str,MYF(0))))
{
- net_printf(YYTHD,ER_UNKNOWN_CHARACTER_SET,$1.str);
+ net_printf(YYTHD,ER_UNKNOWN_COLLATION,$1.str);
YYABORT;
}
};