summaryrefslogtreecommitdiff
path: root/sql/parse_file.cc
diff options
context:
space:
mode:
authorSergey Glukhov <Sergey.Glukhov@sun.com>2009-04-13 18:09:10 +0500
committerSergey Glukhov <Sergey.Glukhov@sun.com>2009-04-13 18:09:10 +0500
commit19854c6d8c66bc848774b8ee4ad433aa229465de (patch)
treeb4749b2e890efcbe49fdddc527836b6733e5ae5a /sql/parse_file.cc
parent2187c60bf46c477ea8b0425fbabe6a4dde31c4d7 (diff)
downloadmariadb-git-19854c6d8c66bc848774b8ee4ad433aa229465de.tar.gz
Bug#43385 Cannot ALTER DATABASE ... UPGRADE DATA DIRECTORY NAME when Views exist(addon)
mysql_rename_view can not rename view if database is not the same. The fix is to add new argument 'new_db' to mysql_rename_view() and allow rename with different databases (only for ALTER DATABASE ... UPGRADE DATA DIRECTORY NAME). mysql-test/t/upgrade.test: test fix sql/parse_file.cc: mysql_rename_view can not rename view if database is not the same. The fix is to add new argument 'new_db' to mysql_rename_view() and allow rename with different databases (only for ALTER DATABASE ... UPGRADE DATA DIRECTORY NAME). sql/parse_file.h: mysql_rename_view can not rename view if database is not the same. The fix is to add new argument 'new_db' to mysql_rename_view() and allow rename with different databases (only for ALTER DATABASE ... UPGRADE DATA DIRECTORY NAME). sql/sql_rename.cc: mysql_rename_view can not rename view if database is not the same. The fix is to add new argument 'new_db' to mysql_rename_view() and allow rename with different databases (only for ALTER DATABASE ... UPGRADE DATA DIRECTORY NAME). sql/sql_view.cc: mysql_rename_view can not rename view if database is not the same. The fix is to add new argument 'new_db' to mysql_rename_view() and allow rename with different databases (only for ALTER DATABASE ... UPGRADE DATA DIRECTORY NAME). sql/sql_view.h: mysql_rename_view can not rename view if database is not the same. The fix is to add new argument 'new_db' to mysql_rename_view() and allow rename with different databases (only for ALTER DATABASE ... UPGRADE DATA DIRECTORY NAME).
Diffstat (limited to 'sql/parse_file.cc')
-rw-r--r--sql/parse_file.cc5
1 files changed, 3 insertions, 2 deletions
diff --git a/sql/parse_file.cc b/sql/parse_file.cc
index 07ea434e8e0..f2dbeba1bbf 100644
--- a/sql/parse_file.cc
+++ b/sql/parse_file.cc
@@ -302,6 +302,7 @@ err_w_file:
@thd thread handler
@param schema name of given schema
@param old_name original file name
+ @param new_db new schema
@param new_name new file name
@retval
@@ -311,14 +312,14 @@ err_w_file:
*/
my_bool rename_in_schema_file(THD *thd,
const char *schema, const char *old_name,
- const char *new_name)
+ const char *new_db, const char *new_name)
{
char old_path[FN_REFLEN], new_path[FN_REFLEN], arc_path[FN_REFLEN];
build_table_filename(old_path, sizeof(old_path) - 1,
schema, old_name, reg_ext, 0);
build_table_filename(new_path, sizeof(new_path) - 1,
- schema, new_name, reg_ext, 0);
+ new_db, new_name, reg_ext, 0);
if (my_rename(old_path, new_path, MYF(MY_WME)))
return 1;