diff options
author | rowanbeentje <rowan@beent.je> | 2009-03-28 01:48:37 +0000 |
---|---|---|
committer | rowanbeentje <rowan@beent.je> | 2009-03-28 01:48:37 +0000 |
commit | 808a76c28f2346befc38a7b6e744987b2bedace1 (patch) | |
tree | 49fdbed7febdf85bf6cc4dad76a89e2f87a80169 /Source/SPTableData.m | |
parent | 905a44014caa805f2b2621bedef3a76da259c8b1 (diff) | |
download | sequelpro-808a76c28f2346befc38a7b6e744987b2bedace1.tar.gz sequelpro-808a76c28f2346befc38a7b6e744987b2bedace1.tar.bz2 sequelpro-808a76c28f2346befc38a7b6e744987b2bedace1.zip |
- Add a preference (currently with no UI) for connection timeout
- Improve connection error messages slightly.
- Avoid reading prefs for every keepalive check - now sets connection timeout and keepalive interval on connection setup
- Fix and extend connection checks to avoid showing extra errors when the connection has been closed
Diffstat (limited to 'Source/SPTableData.m')
-rw-r--r-- | Source/SPTableData.m | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/Source/SPTableData.m b/Source/SPTableData.m index 1b4893ae..bc4820eb 100644 --- a/Source/SPTableData.m +++ b/Source/SPTableData.m @@ -266,7 +266,7 @@ // Check for any errors, but only display them if a connection still exists if (![[mySQLConnection getLastErrorMessage] isEqualToString:@""]) { - if (![mySQLConnection isConnected]) { + if ([mySQLConnection isConnected]) { NSRunAlertPanel(@"Error", [NSString stringWithFormat:@"An error occured while retrieving table information:\n\n%@", [mySQLConnection getLastErrorMessage]], @"OK", nil, nil); } return nil; @@ -439,7 +439,7 @@ // Check for any errors, but only display them if a connection still exists if (![[mySQLConnection getLastErrorMessage] isEqualToString:@""]) { - if (![mySQLConnection isConnected]) { + if ([mySQLConnection isConnected]) { NSRunAlertPanel(@"Error", [NSString stringWithFormat:@"An error occured while retrieving view information:\n\n%@", [mySQLConnection getLastErrorMessage]], @"OK", nil, nil); } return nil; @@ -519,9 +519,11 @@ // Run the status query and retrieve as a dictionary. CMMCPResult *tableStatusResult = [mySQLConnection queryString:[NSString stringWithFormat:@"SHOW TABLE STATUS LIKE '%@'", [tableListInstance tableName]]]; - // Check for any errors + // Check for any errors, only displaying them if the connection hasn't been terminated if (![[mySQLConnection getLastErrorMessage] isEqualToString:@""]) { - NSRunAlertPanel(@"Error", [NSString stringWithFormat:@"An error occured while retrieving table status:\n\n%@", [mySQLConnection getLastErrorMessage]], @"OK", nil, nil); + if ([mySQLConnection isConnected]) { + NSRunAlertPanel(@"Error", [NSString stringWithFormat:@"An error occured while retrieving table status:\n\n%@", [mySQLConnection getLastErrorMessage]], @"OK", nil, nil); + } return FALSE; } |