aboutsummaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorrowanbeentje <rowan@beent.je>2009-07-09 00:15:44 +0000
committerrowanbeentje <rowan@beent.je>2009-07-09 00:15:44 +0000
commit26675cbe2b899dc1aa6613f8345097eca1d92a94 (patch)
tree075be54042f5682e2901e134b4334d824a5e0e82 /Source
parent3c85831742d01fd4dbf35b819038900018bb3a5d (diff)
downloadsequelpro-26675cbe2b899dc1aa6613f8345097eca1d92a94.tar.gz
sequelpro-26675cbe2b899dc1aa6613f8345097eca1d92a94.tar.bz2
sequelpro-26675cbe2b899dc1aa6613f8345097eca1d92a94.zip
- Commit the second part of r995 (oops), addressing database selection issues
Diffstat (limited to 'Source')
-rw-r--r--Source/CMMCPConnection.h1
-rw-r--r--Source/SPConnectionController.m2
-rw-r--r--Source/TableDocument.m2
3 files changed, 3 insertions, 2 deletions
diff --git a/Source/CMMCPConnection.h b/Source/CMMCPConnection.h
index 7c6fc4d0..2c505dd5 100644
--- a/Source/CMMCPConnection.h
+++ b/Source/CMMCPConnection.h
@@ -123,6 +123,7 @@
- (int) getMaxAllowedPacket;
- (BOOL) isMaxAllowedPacketEditable;
- (int) setMaxAllowedPacketTo:(int)newSize resetSize:(BOOL)reset;
+- (NSString *)findSocketPath;
- (void)willPerformQuery:(NSNotification *)notification;
diff --git a/Source/SPConnectionController.m b/Source/SPConnectionController.m
index b5c53aba..2c5da3c7 100644
--- a/Source/SPConnectionController.m
+++ b/Source/SPConnectionController.m
@@ -324,7 +324,7 @@
return;
}
}
- if (![[self database] isEqualToString:@""]) {
+ if ([self database] && ![[self database] isEqualToString:@""]) {
if (![mySQLConnection selectDB:[self database]]) {
[self failConnectionWithTitle:NSLocalizedString(@"Could not select database", @"message when database selection failed") errorMessage:[NSString stringWithFormat:NSLocalizedString(@"Connected to host, but unable to connect to database %@.\n\nBe sure that the database exists and that you have the necessary privileges.\n\nMySQL said: %@", @"message of panel when connection to db failed"), [self database], [mySQLConnection getLastErrorMessage]] detail:nil];
if (sshTunnel) [sshTunnel release], sshTunnel = nil;
diff --git a/Source/TableDocument.m b/Source/TableDocument.m
index 1df0698a..42d1309d 100644
--- a/Source/TableDocument.m
+++ b/Source/TableDocument.m
@@ -147,7 +147,7 @@
}
// Update the selected database if appropriate
- if (![[connectionController database] isEqualToString:@""]) {
+ if ([connectionController database] && ![[connectionController database] isEqualToString:@""]) {
if (selectedDatabase) [selectedDatabase release], selectedDatabase = nil;
selectedDatabase = [[connectionController database] retain];
}