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

Bug#43385 Cannot ALTER DATABASE ... UPGRADE DATA DIRECTORY NAME when Views exist

allow 'rename view' for ALTER ...UPGRADE DATA DIRECTORY NAME command.
it's safe because a view has valid internal db&table names in this case.


mysql-test/r/upgrade.result:
  test result
mysql-test/t/upgrade.test:
  test case
sql/sql_rename.cc:
  allow 'rename view' for ALTER ...UPGRADE DATA DIRECTORY NAME command.
  it's safe because a view has valid internal db&table names in this case.
This commit is contained in:
Sergey Glukhov
2009-04-10 14:25:48 +05:00
parent 214bd5a121
commit bb08984f07
3 changed files with 57 additions and 2 deletions

View File

@@ -301,8 +301,13 @@ do_rename(THD *thd, TABLE_LIST *ren_table, char *new_db, char *new_table_name,
}
break;
case FRMTYPE_VIEW:
/* change of schema is not allowed */
if (strcmp(ren_table->db, new_db))
/*
change of schema is not allowed
except of ALTER ...UPGRADE DATA DIRECTORY NAME command
because a view has valid internal db&table names in this case.
*/
if (thd->lex->sql_command != SQLCOM_ALTER_DB_UPGRADE &&
strcmp(ren_table->db, new_db))
my_error(ER_FORBID_SCHEMA_CHANGE, MYF(0), ren_table->db,
new_db);
else