Commit f7166269 authored by unknown's avatar unknown
Browse files

Bug#2451 ALTER doesn't result in an error on CHARACTER SET and COLLATION conflict

parent 3d2e2ddd
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -318,4 +318,5 @@
#define ER_WARN_INVALID_TIMESTAMP 1299
#define ER_INVALID_CHARACTER_STRING 1300
#define ER_WARN_ALLOWED_PACKET_OVERFLOWED 1301
#define ER_ERROR_MESSAGES 302
#define ER_CONFLICTING_DECLARATIONS 1302
#define ER_ERROR_MESSAGES 303
+8 −0
Original line number Diff line number Diff line
@@ -54,4 +54,12 @@ t1 CREATE TABLE `t1` (
  `a` char(10) collate latin1_german1_ci default NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_german1_ci
DROP TABLE t1;
create table t1 (a char) character set latin1 character set latin2;
ERROR HY000: Conflicting declarations: 'CHARACTER SET latin1' and 'CHARACTER SET latin2'
create table t1 (a char) character set latin1 collate latin2_bin;
ERROR 42000: COLLATION 'latin2_bin' is not valid for CHARACTER SET 'latin1'
create database d1 default character set latin1 character set latin2;
ERROR HY000: Conflicting declarations: 'CHARACTER SET latin1' and 'CHARACTER SET latin2'
create database d1 default character set latin1 collate latin2_bin;
ERROR 42000: COLLATION 'latin2_bin' is not valid for CHARACTER SET 'latin1'
DROP DATABASE mysqltest1;
+12 −0
Original line number Diff line number Diff line
@@ -71,6 +71,18 @@ SHOW CREATE TABLE t1;
DROP TABLE t1;

#
# Bug#
# CREATE TABLE and CREATE DATABASE didn't fail in some cases
#
--error 1302
create table t1 (a char) character set latin1 character set latin2;
--error 1253
create table t1 (a char) character set latin1 collate latin2_bin;
--error 1302
create database d1 default character set latin1 character set latin2;
--error 1253
create database d1 default character set latin1 collate latin2_bin; 

#
#
DROP DATABASE mysqltest1;
+1 −0
Original line number Diff line number Diff line
@@ -314,3 +314,4 @@ character-set=latin2
"Invalid TIMESTAMP value in column '%s' at row %ld",
"Invalid %s character string: '%.64s'",
"Result of %s() was larger than max_allowed_packet (%ld) - truncated"
"Conflicting declarations: '%s' and '%s'"
+1 −0
Original line number Diff line number Diff line
@@ -308,3 +308,4 @@ character-set=latin1
"Invalid TIMESTAMP value in column '%s' at row %ld",
"Invalid %s character string: '%.64s'",
"Result of %s() was larger than max_allowed_packet (%ld) - truncated"
"Conflicting declarations: '%s' and '%s'"
Loading