aboutsummaryrefslogtreecommitdiffstats
path: root/Source/SPDatabaseCopy.m
diff options
context:
space:
mode:
authorStuart Connolly <stuart02@gmail.com>2017-03-23 18:26:02 +0000
committerStuart Connolly <stuart02@gmail.com>2017-03-23 18:26:02 +0000
commitd37a2f490a271b6170a5c2978f505fb403d1ad64 (patch)
tree4b817ac830d64aeeab9cb4c2d80afea671b7a426 /Source/SPDatabaseCopy.m
parentbab93f8ce74a6644c9a3d8a50fa26230f127c550 (diff)
downloadsequelpro-d37a2f490a271b6170a5c2978f505fb403d1ad64.tar.gz
sequelpro-d37a2f490a271b6170a5c2978f505fb403d1ad64.tar.bz2
sequelpro-d37a2f490a271b6170a5c2978f505fb403d1ad64.zip
- #1235: Prevent renaming a database which contains any non-table objects as it's currently not supported.
- #1235: Inform the user when duplicating a database than any non-table objects won't be copied. - Add missing high resolution images to project. - Fix a potential memory leak inside SPCreateDatabaseInfo
Diffstat (limited to 'Source/SPDatabaseCopy.m')
-rw-r--r--Source/SPDatabaseCopy.m10
1 files changed, 6 insertions, 4 deletions
diff --git a/Source/SPDatabaseCopy.m b/Source/SPDatabaseCopy.m
index 94a5e896..976bd809 100644
--- a/Source/SPDatabaseCopy.m
+++ b/Source/SPDatabaseCopy.m
@@ -30,6 +30,7 @@
#import "SPDatabaseCopy.h"
#import "SPTableCopy.h"
+#import "SPCreateDatabaseInfo.h"
#import <SPMySQL/SPMySQL.h>
@@ -38,10 +39,11 @@
- (BOOL)copyDatabaseFrom:(SPCreateDatabaseInfo *)sourceDatabase to:(NSString *)targetDatabaseName withContent:(BOOL)copyWithContent
{
NSArray *tables = nil;
-
- // Check whether the source database exists and the target database doesn't.
- BOOL sourceExists = [[connection databases] containsObject:[sourceDatabase databaseName]];
- BOOL targetExists = [[connection databases] containsObject:targetDatabaseName];
+ NSArray *databases = [connection databases];
+
+ // Check whether the source database exists and the target database doesn't
+ BOOL sourceExists = [databases containsObject:[sourceDatabase databaseName]];
+ BOOL targetExists = [databases containsObject:targetDatabaseName];
if (!sourceExists || targetExists)
return NO;