From a45f89fecc9314aab976f0a474d4bfd3358837b9 Mon Sep 17 00:00:00 2001 From: rowanbeentje Date: Thu, 22 Nov 2012 01:26:29 +0000 Subject: - Tweak handling of tables which have been deleted while they were being used, preventing hangs (Issue #1429) --- Source/SPTableData.m | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'Source/SPTableData.m') 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]; } -- cgit v1.2.3