ALTER TABLE t1 CONVERT TO should also change the default character set.

Forgot to do it in the previous commit.
parent dba73e1c
...@@ -360,7 +360,7 @@ Table Create Table ...@@ -360,7 +360,7 @@ Table Create Table
t1 CREATE TABLE `t1` ( t1 CREATE TABLE `t1` (
`a` char(10) character set koi8r default NULL `a` char(10) character set koi8r default NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 ) ENGINE=MyISAM DEFAULT CHARSET=latin1
alter table t1 CONVERT TO CHARACTER SET latin1, DEFAULT CHARACTER SET latin1; alter table t1 CONVERT TO CHARACTER SET latin1;
show create table t1; show create table t1;
Table Create Table Table Create Table
t1 CREATE TABLE `t1` ( t1 CREATE TABLE `t1` (
......
...@@ -214,7 +214,7 @@ select a,hex(a) from t1; ...@@ -214,7 +214,7 @@ select a,hex(a) from t1;
show create table t1; show create table t1;
alter table t1 DEFAULT CHARACTER SET latin1; alter table t1 DEFAULT CHARACTER SET latin1;
show create table t1; show create table t1;
alter table t1 CONVERT TO CHARACTER SET latin1, DEFAULT CHARACTER SET latin1; alter table t1 CONVERT TO CHARACTER SET latin1;
show create table t1; show create table t1;
alter table t1 DEFAULT CHARACTER SET cp1251; alter table t1 DEFAULT CHARACTER SET cp1251;
show create table t1; show create table t1;
......
...@@ -1797,8 +1797,12 @@ alter_list_item: ...@@ -1797,8 +1797,12 @@ alter_list_item:
$5->name,$4->csname); $5->name,$4->csname);
YYABORT; YYABORT;
} }
Lex->create_info.table_charset= $5; LEX *lex= Lex;
Lex->create_info.used_fields|= HA_CREATE_USED_CHARSET; lex->create_info.table_charset= $5;
lex->create_info.used_fields|= HA_CREATE_USED_CHARSET;
lex->create_info.default_table_charset= $5;
lex->create_info.used_fields|= HA_CREATE_USED_DEFAULT_CHARSET;
lex->simple_alter= 0;
} }
| create_table_options_space_separated { Lex->simple_alter=0; } | create_table_options_space_separated { Lex->simple_alter=0; }
| order_clause { Lex->simple_alter=0; }; | order_clause { Lex->simple_alter=0; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment