diff options
author | stuconnolly <stuart02@gmail.com> | 2010-04-23 13:49:12 +0000 |
---|---|---|
committer | stuconnolly <stuart02@gmail.com> | 2010-04-23 13:49:12 +0000 |
commit | b0195c5305a4fc3db4ffaa113ce4d246bd4dec66 (patch) | |
tree | f8228614a23e69380fa31453cd93f8396a17da48 /Frameworks/MCPKit/MCPFoundationKit/MCPConnection.m | |
parent | 598adc2028c9a250ad68b100f8e9def6c2850b8c (diff) | |
download | sequelpro-b0195c5305a4fc3db4ffaa113ce4d246bd4dec66.tar.gz sequelpro-b0195c5305a4fc3db4ffaa113ce4d246bd4dec66.tar.bz2 sequelpro-b0195c5305a4fc3db4ffaa113ce4d246bd4dec66.zip |
Only attempt to check or set the max allowed packet if there is an active connection as well as only displaying dialogs when there is a window visible. Fixes http://spbug.com/l/113.
Diffstat (limited to 'Frameworks/MCPKit/MCPFoundationKit/MCPConnection.m')
-rw-r--r-- | Frameworks/MCPKit/MCPFoundationKit/MCPConnection.m | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/Frameworks/MCPKit/MCPFoundationKit/MCPConnection.m b/Frameworks/MCPKit/MCPFoundationKit/MCPConnection.m index a94584ee..4b5ac737 100644 --- a/Frameworks/MCPKit/MCPFoundationKit/MCPConnection.m +++ b/Frameworks/MCPKit/MCPFoundationKit/MCPConnection.m @@ -388,16 +388,23 @@ static BOOL sTruncateLongFieldInLogs = YES; connectionThreadId = mConnection->thread_id; [self timeZone]; // Getting the timezone used by the server. - isMaxAllowedPacketEditable = [self isMaxAllowedPacketEditable]; - - if (![self fetchMaxAllowedPacket]) { - [self setLastErrorMessage:nil]; + // Only attempt to set the max allowed packet if we have a connection + if (mConnection != NULL) { - lastQueryErrorId = mysql_errno(mConnection); + isMaxAllowedPacketEditable = [self isMaxAllowedPacketEditable]; - return mConnected = NO; + if (![self fetchMaxAllowedPacket]) { + [self setLastErrorMessage:nil]; + + lastQueryErrorId = mysql_errno(mConnection); + + mConnected = NO; + } + } + else { + mConnected = NO; + isMaxAllowedPacketEditable = NO; } - return mConnected; } |