diff options
author | unknown <bar@bar.intranet.mysql.r18.ru> | 2004-03-30 22:18:49 +0500 |
---|---|---|
committer | unknown <bar@bar.intranet.mysql.r18.ru> | 2004-03-30 22:18:49 +0500 |
commit | 6b8d6d2a43beca924e655cdd071022860f4288a3 (patch) | |
tree | 62f884fec7065b163344f180ab61f36cb73d4e08 | |
parent | acd4d158cc0706ec9502a7063079802c48c673b0 (diff) | |
download | mariadb-git-6b8d6d2a43beca924e655cdd071022860f4288a3.tar.gz |
ALTER TABLE t1 CONVERT TO should also change the default character set.
Forgot to do it in the previous commit.
-rw-r--r-- | mysql-test/r/alter_table.result | 2 | ||||
-rw-r--r-- | mysql-test/t/alter_table.test | 2 | ||||
-rw-r--r-- | sql/sql_yacc.yy | 8 |
3 files changed, 8 insertions, 4 deletions
diff --git a/mysql-test/r/alter_table.result b/mysql-test/r/alter_table.result index 5166e3bf8cb..a7c1dbde697 100644 --- a/mysql-test/r/alter_table.result +++ b/mysql-test/r/alter_table.result @@ -360,7 +360,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` char(10) character set koi8r default NULL ) 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; Table Create Table t1 CREATE TABLE `t1` ( diff --git a/mysql-test/t/alter_table.test b/mysql-test/t/alter_table.test index 658796e4a85..32654bb0bc4 100644 --- a/mysql-test/t/alter_table.test +++ b/mysql-test/t/alter_table.test @@ -214,7 +214,7 @@ select a,hex(a) from t1; show create table t1; alter table t1 DEFAULT CHARACTER SET latin1; 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; alter table t1 DEFAULT CHARACTER SET cp1251; show create table t1; diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy index ea2c7efb607..58d22091e28 100644 --- a/sql/sql_yacc.yy +++ b/sql/sql_yacc.yy @@ -1797,8 +1797,12 @@ alter_list_item: $5->name,$4->csname); YYABORT; } - Lex->create_info.table_charset= $5; - Lex->create_info.used_fields|= HA_CREATE_USED_CHARSET; + LEX *lex= Lex; + 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; } | order_clause { Lex->simple_alter=0; }; |