Commit f4a07612 authored by unknown's avatar unknown

BUG#1662 - ALTER TABLE LIKE ignores DATA/INDEX DIRECTPORY

Produce a warning if DATA/INDEX DIRECTORY is specified in
ALTER TABLE statement.

Ignoring of these options is documented in the symbolic links
section of the manual.


mysql-test/r/symlink.result:
  Modified test result according to fix for BUG#1662.
sql/sql_parse.cc:
  Produce a warning if DATA/INDEX DIRECTORY is specified in
  ALTER TABLE statement.
parent 82d127b5
...@@ -65,18 +65,24 @@ t9 CREATE TABLE `t9` ( ...@@ -65,18 +65,24 @@ t9 CREATE TABLE `t9` (
) ENGINE=MyISAM AUTO_INCREMENT=16725 DEFAULT CHARSET=latin1 DATA DIRECTORY='TEST_DIR/var/tmp/' INDEX DIRECTORY='TEST_DIR/var/run/' ) ENGINE=MyISAM AUTO_INCREMENT=16725 DEFAULT CHARSET=latin1 DATA DIRECTORY='TEST_DIR/var/tmp/' INDEX DIRECTORY='TEST_DIR/var/run/'
drop database mysqltest; drop database mysqltest;
create table t1 (a int not null) engine=myisam; create table t1 (a int not null) engine=myisam;
Warnings:
Warning 0 DATA DIRECTORY option ignored
show create table t1; show create table t1;
Table Create Table Table Create Table
t1 CREATE TABLE `t1` ( t1 CREATE TABLE `t1` (
`a` int(11) NOT NULL default '0' `a` int(11) NOT NULL default '0'
) ENGINE=MyISAM DEFAULT CHARSET=latin1 ) ENGINE=MyISAM DEFAULT CHARSET=latin1
alter table t1 add b int; alter table t1 add b int;
Warnings:
Warning 0 DATA DIRECTORY option ignored
show create table t1; show create table t1;
Table Create Table Table Create Table
t1 CREATE TABLE `t1` ( t1 CREATE TABLE `t1` (
`a` int(11) NOT NULL default '0', `a` int(11) NOT NULL default '0',
`b` int(11) default NULL `b` int(11) default NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 ) ENGINE=MyISAM DEFAULT CHARSET=latin1
Warnings:
Warning 0 INDEX DIRECTORY option ignored
show create table t1; show create table t1;
Table Create Table Table Create Table
t1 CREATE TABLE `t1` ( t1 CREATE TABLE `t1` (
......
...@@ -2678,6 +2678,12 @@ unsent_create_error: ...@@ -2678,6 +2678,12 @@ unsent_create_error:
} }
} }
/* Don't yet allow changing of symlinks with ALTER TABLE */ /* Don't yet allow changing of symlinks with ALTER TABLE */
if (lex->create_info.data_file_name)
push_warning(thd, MYSQL_ERROR::WARN_LEVEL_WARN, 0,
"DATA DIRECTORY option ignored");
if (lex->create_info.index_file_name)
push_warning(thd, MYSQL_ERROR::WARN_LEVEL_WARN, 0,
"INDEX DIRECTORY option ignored");
lex->create_info.data_file_name=lex->create_info.index_file_name=0; lex->create_info.data_file_name=lex->create_info.index_file_name=0;
/* ALTER TABLE ends previous transaction */ /* ALTER TABLE ends previous transaction */
if (end_active_trans(thd)) if (end_active_trans(thd))
......
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