aboutsummaryrefslogtreecommitdiffstats
path: root/Source/SPTableData.m
diff options
context:
space:
mode:
authorrowanbeentje <rowan@beent.je>2012-11-22 01:26:29 +0000
committerrowanbeentje <rowan@beent.je>2012-11-22 01:26:29 +0000
commita45f89fecc9314aab976f0a474d4bfd3358837b9 (patch)
tree64c6583895c1e89b23c6e2df36e8301a54e4f1b2 /Source/SPTableData.m
parent7622f195887765e0a77d43bdeebec2d2992753f1 (diff)
downloadsequelpro-a45f89fecc9314aab976f0a474d4bfd3358837b9.tar.gz
sequelpro-a45f89fecc9314aab976f0a474d4bfd3358837b9.tar.bz2
sequelpro-a45f89fecc9314aab976f0a474d4bfd3358837b9.zip
- Tweak handling of tables which have been deleted while they were being used, preventing hangs (Issue #1429)
Diffstat (limited to 'Source/SPTableData.m')
-rw-r--r--Source/SPTableData.m10
1 files changed, 6 insertions, 4 deletions
diff --git a/Source/SPTableData.m b/Source/SPTableData.m
index 0c65e541..60c4b756 100644
--- a/Source/SPTableData.m
+++ b/Source/SPTableData.m
@@ -496,10 +496,8 @@
// Check for any errors, but only display them if a connection still exists
if ([mySQLConnection queryErrored]) {
if ([mySQLConnection isConnected]) {
- SPBeginAlertSheet(NSLocalizedString(@"Error retrieving table information", @"error retrieving table information message"), NSLocalizedString(@"OK", @"OK button"),
- nil, nil, [NSApp mainWindow], self, nil, nil,
- [NSString stringWithFormat:NSLocalizedString(@"An error occurred while retrieving the information for table '%@'. Please try again.\n\nMySQL said: %@", @"error retrieving table information informative message"),
- tableName, [mySQLConnection lastErrorMessage]]);
+ NSString *errorMessage = [NSString stringWithFormat:NSLocalizedString(@"An error occurred while retrieving the information for table '%@'. Please try again.\n\nMySQL said: %@", @"error retrieving table information informative message"),
+ tableName, [mySQLConnection lastErrorMessage]];
// If the current table doesn't exist anymore reload table list
if([mySQLConnection lastErrorID] == 1146) {
@@ -510,6 +508,10 @@
[[tableListInstance valueForKeyPath:@"tablesListView"] deselectAll:nil];
[tableListInstance updateTables:self];
}
+
+ SPBeginAlertSheet(NSLocalizedString(@"Error retrieving table information", @"error retrieving table information message"), NSLocalizedString(@"OK", @"OK button"),
+ nil, nil, [NSApp mainWindow], self, nil, nil, errorMessage);
+
if (changeEncoding) [mySQLConnection restoreStoredEncoding];
}