1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-08 11:22:35 +03:00

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

Forgot to do it in the previous commit.
This commit is contained in:
bar@bar.intranet.mysql.r18.ru
2004-03-30 22:18:49 +05:00
parent dba73e1c86
commit b92dd45da4
3 changed files with 8 additions and 4 deletions

View File

@@ -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` (

View File

@@ -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;

View File

@@ -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; };