aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Source/TableDocument.m7
-rw-r--r--Source/TableDump.m6
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.