diff options
author | stuconnolly <stuart02@gmail.com> | 2009-11-11 00:14:50 +0000 |
---|---|---|
committer | stuconnolly <stuart02@gmail.com> | 2009-11-11 00:14:50 +0000 |
commit | f7f1c7bd05538feca61f735f6039e548f9d7ad5e (patch) | |
tree | 09bda39946d215114b161e45b5f23b2cdcaf4fc1 /Source | |
parent | 938e8654b76383396ee187ab751bb8fa6d67f37a (diff) | |
download | sequelpro-f7f1c7bd05538feca61f735f6039e548f9d7ad5e.tar.gz sequelpro-f7f1c7bd05538feca61f735f6039e548f9d7ad5e.tar.bz2 sequelpro-f7f1c7bd05538feca61f735f6039e548f9d7ad5e.zip |
During an import, before entering the loop to execute the current batch of queries, check that the current connection is active and if not bail from the method.
Diffstat (limited to 'Source')
-rw-r--r-- | Source/TableDocument.m | 7 | ||||
-rw-r--r-- | Source/TableDump.m | 6 |
2 files changed, 9 insertions, 4 deletions
diff --git a/Source/TableDocument.m b/Source/TableDocument.m index a4f078a3..e8187334 100644 --- a/Source/TableDocument.m +++ b/Source/TableDocument.m @@ -3575,11 +3575,10 @@ [NSApp endSheet:connectionErrorDialog]; [connectionErrorDialog orderOut:nil]; - // If "disconnect" was selected, trigger a window close. - if (connectionErrorCode == 2) { + // If 'disconnect' was selected, trigger a window close. + if (connectionErrorCode == MCPConnectionCheckDisconnect) { [self windowWillClose:nil]; - if (connectionErrorCode == MCPConnectionCheckDisconnect) - [tableWindow performSelector:@selector(close) withObject:nil afterDelay:0.0]; + [tableWindow performSelector:@selector(close) withObject:nil afterDelay:0.0]; } return connectionErrorCode; diff --git a/Source/TableDump.m b/Source/TableDump.m index f073f068..e8722174 100644 --- a/Source/TableDump.m +++ b/Source/TableDump.m @@ -630,6 +630,9 @@ dataBufferPosition -= dataBufferLastQueryEndPosition; dataBufferLastQueryEndPosition = 0; } + + // Before entering the following loop, check that we actually have a connection. If not, bail. + if (![mySQLConnection isConnected]) return; // Extract and process any complete SQL queries that can be found in the strings parsed so far while (query = [sqlParser trimAndReturnStringToCharacter:';' trimmingInclusively:YES returningInclusively:NO]) { @@ -929,6 +932,9 @@ } } if (!fieldMappingArray) continue; + + // Before entering the following loop, check that we actually have a connection. If not, bail. + if (![mySQLConnection isConnected]) return; // If we have more than the csvRowsPerQuery amount, or if we're at the end of the // available data, construct and run a query. |