aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitry Blokhin <santafox@gmail.com>2014-01-21 00:44:17 +0200
committerJonathan Marshall <jmarshall@xbmc.org>2014-02-06 09:27:32 +1300
commite240446aa4d81949934afeefc4c3ea6a32522b51 (patch)
treec83a42ba75acb768cce5bf4a635fa8b02459c0f7
parent4efda50a771f82ec87ed367fd1538f5244980f88 (diff)
[mysql] don't recreate views on copy() - they'll be dropped and recreated in the update routines
-rw-r--r--xbmc/dbwrappers/mysqldataset.cpp26
1 files changed, 2 insertions, 24 deletions
diff --git a/xbmc/dbwrappers/mysqldataset.cpp b/xbmc/dbwrappers/mysqldataset.cpp
index a39554cfad..c186fdf20b 100644
--- a/xbmc/dbwrappers/mysqldataset.cpp
+++ b/xbmc/dbwrappers/mysqldataset.cpp
@@ -284,30 +284,8 @@ int MysqlDatabase::copy(const char *backup_name) {
}
mysql_free_result(res);
- // after table are recreated and repopulated we can recreate views
- // grab a list of views and their definitions
- sprintf(sql, "SELECT TABLE_NAME, VIEW_DEFINITION FROM INFORMATION_SCHEMA.VIEWS WHERE TABLE_SCHEMA = '%s'", db.c_str());
- if ( (ret=query_with_reconnect(sql)) != MYSQL_OK )
- throw DbErrors("Can't determine views to recreate.");
-
- // get list of all views from old DB
- MYSQL_RES* resViews = mysql_store_result(conn);
-
- if (resViews)
- {
- while ( (row=mysql_fetch_row(resViews)) != NULL )
- {
- sprintf(sql, "CREATE VIEW %s.%s AS %s",
- backup_name, row[0], row[1]);
-
- if ( (ret=query_with_reconnect(sql)) != MYSQL_OK )
- {
- mysql_free_result(resViews);
- throw DbErrors("Can't create view '%s'\nError: %d", row[0], ret);
- }
- }
- mysql_free_result(resViews);
- }
+ // we don't recreate views, indicies, or triggers on copy
+ // as we'll be dropping and recreating them anyway
}
return 1;