diff options
author | Bibiko <bibiko@eva.mpg.de> | 2009-06-12 18:23:34 +0000 |
---|---|---|
committer | Bibiko <bibiko@eva.mpg.de> | 2009-06-12 18:23:34 +0000 |
commit | f6da47de43fce8af785dfdc4672ebbb18f7ff118 (patch) | |
tree | d06a2a9241be15f2f920ce91a70a05bb4ea5e512 | |
parent | fa8a025d389f3915caf2d20fd0afed9936e6c55b (diff) | |
download | sequelpro-f6da47de43fce8af785dfdc4672ebbb18f7ff118.tar.gz sequelpro-f6da47de43fce8af785dfdc4672ebbb18f7ff118.tar.bz2 sequelpro-f6da47de43fce8af785dfdc4672ebbb18f7ff118.zip |
• fixed position for scanning error 2006 to increase max_allowed_packet
-rw-r--r-- | Source/CMMCPConnection.m | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/Source/CMMCPConnection.m b/Source/CMMCPConnection.m index 624ad6c3..db45a3d8 100644 --- a/Source/CMMCPConnection.m +++ b/Source/CMMCPConnection.m @@ -664,16 +664,16 @@ static void forcePingTimeout(int signalNumber); // If there was an error, check whether it was a connection-related error if (0 != queryResultCode && [CMMCPConnection isErrorNumberConnectionError:[self getLastErrorID]]) { - // Check the connection and see if it can be restored. This triggers reconnects as necessary, and - // should only return false if a disconnection has been requested - in which case return nil. - if (![self checkConnection]) return nil; - - // Try to increase max_allowed_packet for error 2006 + // Try to increase max_allowed_packet for error 2006 BEFORE check connection if(isMaxAllowedPacketEditable && queryResultCode == 1 && [self getLastErrorID] == 2006) { currentMaxAllowedPacket = [self getMaxAllowedPacket]; - [self setMaxAllowedPacketTo:strlen([self cStringFromString:query])+1024]; + [self setMaxAllowedPacketTo:strlen(theCQuery)+1024]; } + // Check the connection and see if it can be restored. This triggers reconnects as necessary, and + // should only return false if a disconnection has been requested - in which case return nil. + if (![self checkConnection]) return nil; + // The connection has been restored - re-run the query queryStartDate = [NSDate date]; queryResultCode = mysql_query(mConnection, theCQuery); |