summaryrefslogtreecommitdiff
path: root/sql/sql_table.cc
diff options
context:
space:
mode:
authorunknown <mskold/marty@mysql.com/linux.site>2006-12-19 15:53:46 +0100
committerunknown <mskold/marty@mysql.com/linux.site>2006-12-19 15:53:46 +0100
commit1e10672496fbce277cab2f38a98476e6c25ee2f5 (patch)
treeb2e6376d81b4875d99b6b50f86e69c1b964b1c7c /sql/sql_table.cc
parent17472067297969aa5d8d8cc462279907f3638776 (diff)
downloadmariadb-git-1e10672496fbce277cab2f38a98476e6c25ee2f5.tar.gz
bug#24667 After ALTER TABLE operation ndb_dd table becomes regular ndb: copy tablespace from old table in copying alter table
Diffstat (limited to 'sql/sql_table.cc')
-rw-r--r--sql/sql_table.cc11
1 files changed, 10 insertions, 1 deletions
diff --git a/sql/sql_table.cc b/sql/sql_table.cc
index c8f6e09fecb..930c84361ed 100644
--- a/sql/sql_table.cc
+++ b/sql/sql_table.cc
@@ -5307,7 +5307,7 @@ bool mysql_alter_table(THD *thd,char *new_db, char *new_name,
int error;
char tmp_name[80],old_name[32],new_name_buff[FN_REFLEN];
char new_alias_buff[FN_REFLEN], *table_name, *db, *new_alias, *alias;
- char index_file[FN_REFLEN], data_file[FN_REFLEN];
+ char index_file[FN_REFLEN], data_file[FN_REFLEN], tablespace[FN_LEN];
char path[FN_REFLEN];
char reg_path[FN_REFLEN+1];
ha_rows copied,deleted;
@@ -5630,6 +5630,15 @@ view_err:
if (!(used_fields & HA_CREATE_USED_KEY_BLOCK_SIZE))
create_info->key_block_size= table->s->key_block_size;
+ if (!create_info->tablespace)
+ {
+ /*
+ Regular alter table of disk stored table (no tablespace change)
+ Copy tablespace name
+ */
+ if (table->file->get_tablespace_name(thd, (char *) &tablespace))
+ create_info->tablespace= (char *) &tablespace;
+ }
restore_record(table, s->default_values); // Empty record for DEFAULT
List_iterator<Alter_drop> drop_it(alter_info->drop_list);
List_iterator<create_field> def_it(fields);