diff options
Diffstat (limited to 'Source/SPTableData.m')
-rw-r--r-- | Source/SPTableData.m | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/Source/SPTableData.m b/Source/SPTableData.m index 2b07fbce..1807b66e 100644 --- a/Source/SPTableData.m +++ b/Source/SPTableData.m @@ -330,7 +330,7 @@ [theResult setReturnDataAsStrings:YES]; // Check for any errors, but only display them if a connection still exists - if (![[mySQLConnection getLastErrorMessage] isEqualToString:@""]) { + 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, nil, @@ -598,7 +598,7 @@ [theResult setReturnDataAsStrings:YES]; // Check for any errors, but only display them if a connection still exists - if (![[mySQLConnection getLastErrorMessage] isEqualToString:@""]) { + 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, nil, @@ -692,7 +692,7 @@ [theResult setReturnDataAsStrings:YES]; // Check for any errors, but only display them if a connection still exists - if (![[mySQLConnection getLastErrorMessage] isEqualToString:@""]) { + if ([mySQLConnection queryErrored]) { if ([mySQLConnection isConnected]) { SPBeginAlertSheet(NSLocalizedString(@"Error", @"error"), NSLocalizedString(@"OK", @"OK button"), nil, nil, [NSApp mainWindow], self, nil, nil, nil, @@ -711,7 +711,7 @@ [theResult setReturnDataAsStrings:YES]; // Check for any errors, but only display them if a connection still exists - if (![[mySQLConnection getLastErrorMessage] isEqualToString:@""]) { + if ([mySQLConnection queryErrored]) { if ([mySQLConnection isConnected]) { SPBeginAlertSheet(NSLocalizedString(@"Error", @"error"), NSLocalizedString(@"OK", @"OK button"), nil, nil, [NSApp mainWindow], self, nil, nil, nil, @@ -809,7 +809,7 @@ } // Check for any errors, only displaying them if the connection hasn't been terminated - if (![[mySQLConnection getLastErrorMessage] isEqualToString:@""]) { + if ([mySQLConnection queryErrored]) { if ([mySQLConnection isConnected]) { SPBeginAlertSheet(NSLocalizedString(@"Error", @"error"), NSLocalizedString(@"OK", @"OK button"), nil, nil, [NSApp mainWindow], self, nil, nil, nil, @@ -840,7 +840,7 @@ // this happens e.g. for db "information_schema" if([[status objectForKey:@"Rows"] isKindOfClass:[NSNull class]]) { tableStatusResult = [mySQLConnection queryString:[NSString stringWithFormat:@"SELECT COUNT(1) FROM %@", [escapedTableName backtickQuotedString] ]]; - if ([[mySQLConnection getLastErrorMessage] isEqualToString:@""]) + if (![mySQLConnection queryErrored]) [status setObject:[[tableStatusResult fetchRowAsArray] objectAtIndex:0] forKey:@"Rows"]; [status setObject:@"y" forKey:@"RowsCountAccurate"]; } @@ -1064,7 +1064,7 @@ if([r numOfRows] < 1) return nil; - if (![[mySQLConnection getLastErrorMessage] isEqualToString:@""]) { + if ([mySQLConnection queryErrored]) { if ([mySQLConnection isConnected]) NSRunAlertPanel(@"Error", [NSString stringWithFormat:@"An error occured while retrieving the PRIAMRY KEY data:\n\n%@", [mySQLConnection getLastErrorMessage]], @"OK", nil, nil); return nil; |