aboutsummaryrefslogtreecommitdiffstats
path: root/Source/SPTableData.m
diff options
context:
space:
mode:
authorrowanbeentje <rowan@beent.je>2009-08-13 00:57:43 +0000
committerrowanbeentje <rowan@beent.je>2009-08-13 00:57:43 +0000
commit19d3956c14f63872981ab292e7498ac4505e1fae (patch)
tree98874e4ab50559fc360ea6874f6ee41c1f134f2d /Source/SPTableData.m
parent3946e0c6c1e26af2b65590a1f0f50ab25c1c3bfb (diff)
downloadsequelpro-19d3956c14f63872981ab292e7498ac4505e1fae.tar.gz
sequelpro-19d3956c14f63872981ab292e7498ac4505e1fae.tar.bz2
sequelpro-19d3956c14f63872981ab292e7498ac4505e1fae.zip
- Rework TableContent row count fetching, loading it in the correct locations, and correcting the logic for fetching the count of rows so that the query is not used where not necessary.
- Update the Table Info pane and tab with a new row count if one is known - this addresses Issue #141 - This reverts r1090, and so needs to be discussed with stuart02 - the rest of the row logic changes may have fixed the 'larger issue' described there?
Diffstat (limited to 'Source/SPTableData.m')
-rw-r--r--Source/SPTableData.m11
1 files changed, 9 insertions, 2 deletions
diff --git a/Source/SPTableData.m b/Source/SPTableData.m
index 007dd201..e61eb552 100644
--- a/Source/SPTableData.m
+++ b/Source/SPTableData.m
@@ -746,14 +746,21 @@
if ([status objectForKey:@"Type"]) {
[status setObject:[status objectForKey:@"Type"] forKey:@"Engine"];
}
-
+
+ // Add a note for whether the row count is accurate or not - only for MyISAM
+ if ([[status objectForKey:@"Engine"] isEqualToString:@"MyISAM"]) {
+ [status setObject:@"y" forKey:@"RowsCountAccurate"];
+ } else {
+ [status setObject:@"n" forKey:@"RowsCountAccurate"];
+ }
+
// [status objectForKey:@"Rows"] is NULL then try to get the number of rows via SELECT COUNT(*) FROM `foo`
// this happens e.g. for db "information_schema"
if([[status objectForKey:@"Rows"] isKindOfClass:[NSNull class]]) {
tableStatusResult = [mySQLConnection queryString:[NSString stringWithFormat:@"SELECT COUNT(*) FROM %@", [escapedTableName backtickQuotedString] ]];
if ([[mySQLConnection getLastErrorMessage] isEqualToString:@""])
[status setObject:[[tableStatusResult fetchRowAsArray] objectAtIndex:0] forKey:@"Rows"];
-
+ [status setObject:@"y" forKey:@"RowsCountAccurate"];
}
return TRUE;