aboutsummaryrefslogtreecommitdiffstats
path: root/Source/CMMCPConnection.m
diff options
context:
space:
mode:
authorBibiko <bibiko@eva.mpg.de>2009-06-12 18:23:34 +0000
committerBibiko <bibiko@eva.mpg.de>2009-06-12 18:23:34 +0000
commitf6da47de43fce8af785dfdc4672ebbb18f7ff118 (patch)
treed06a2a9241be15f2f920ce91a70a05bb4ea5e512 /Source/CMMCPConnection.m
parentfa8a025d389f3915caf2d20fd0afed9936e6c55b (diff)
downloadsequelpro-f6da47de43fce8af785dfdc4672ebbb18f7ff118.tar.gz
sequelpro-f6da47de43fce8af785dfdc4672ebbb18f7ff118.tar.bz2
sequelpro-f6da47de43fce8af785dfdc4672ebbb18f7ff118.zip
• fixed position for scanning error 2006 to increase max_allowed_packet
Diffstat (limited to 'Source/CMMCPConnection.m')
-rw-r--r--Source/CMMCPConnection.m12
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);