diff options
author | rowanbeentje <rowan@beent.je> | 2010-09-30 21:38:19 +0000 |
---|---|---|
committer | rowanbeentje <rowan@beent.je> | 2010-09-30 21:38:19 +0000 |
commit | 27c7baef4a847d3894bc47f8ea2cf3e5284caae2 (patch) | |
tree | 4de315e4c67696ceb242ef8dc897effcac1ffc5d /Frameworks/MCPKit/MCPFoundationKit | |
parent | 6eacb2d632d0ff3f5b6ec6c29752189fb6e7db15 (diff) | |
download | sequelpro-27c7baef4a847d3894bc47f8ea2cf3e5284caae2.tar.gz sequelpro-27c7baef4a847d3894bc47f8ea2cf3e5284caae2.tar.bz2 sequelpro-27c7baef4a847d3894bc47f8ea2cf3e5284caae2.zip |
- 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.
Diffstat (limited to 'Frameworks/MCPKit/MCPFoundationKit')
-rw-r--r-- | Frameworks/MCPKit/MCPFoundationKit/MCPConnection.m | 14 |
1 files changed, 4 insertions, 10 deletions
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; |