From 27c7baef4a847d3894bc47f8ea2cf3e5284caae2 Mon Sep 17 00:00:00 2001 From: rowanbeentje Date: Thu, 30 Sep 2010 21:38:19 +0000 Subject: - Make the initial maximum packet fetch fail silently if it fails, defaulting to the default MySQL max packet size (1MB). This improves compatibility with MySQL-like systems like sphinx, addressing Issue #844. --- Frameworks/MCPKit/MCPFoundationKit/MCPConnection.m | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) (limited to 'Frameworks/MCPKit/MCPFoundationKit/MCPConnection.m') diff --git a/Frameworks/MCPKit/MCPFoundationKit/MCPConnection.m b/Frameworks/MCPKit/MCPFoundationKit/MCPConnection.m index 2008a3aa..15eaae82 100644 --- a/Frameworks/MCPKit/MCPFoundationKit/MCPConnection.m +++ b/Frameworks/MCPKit/MCPFoundationKit/MCPConnection.m @@ -140,7 +140,7 @@ static BOOL sTruncateLongFieldInLogs = YES; lockQuerying = NO; connectionThreadId = 0; - maxAllowedPacketSize = -1; + maxAllowedPacketSize = 1048576; lastQueryExecutionTime = 0; lastQueryErrorId = 0; lastQueryErrorMessage = nil; @@ -458,17 +458,11 @@ static BOOL sTruncateLongFieldInLogs = YES; [self timeZone]; // Getting the timezone used by the server. // Only attempt to set the max allowed packet if we have a connection + // The fetches may fail, in which case the class default (which should match + // the MySQL default) will be used. if (mConnection != NULL) { - isMaxAllowedPacketEditable = [self isMaxAllowedPacketEditable]; - - if (![self fetchMaxAllowedPacket]) { - [self setLastErrorMessage:nil]; - - lastQueryErrorId = mysql_errno(mConnection); - - mConnected = NO; - } + [self fetchMaxAllowedPacket]; } else { mConnected = NO; -- cgit v1.2.3