aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorstuconnolly <stuart02@gmail.com>2009-05-19 18:16:38 +0000
committerstuconnolly <stuart02@gmail.com>2009-05-19 18:16:38 +0000
commit6350ce999b2921b0501e9afc5158ded8dffcd7fd (patch)
tree1b513a4a8284b6715c09be6bca731f9ab7ebdc97
parent391e0a1421134f350c9dd27a6c37f46830d8a010 (diff)
downloadsequelpro-6350ce999b2921b0501e9afc5158ded8dffcd7fd.tar.gz
sequelpro-6350ce999b2921b0501e9afc5158ded8dffcd7fd.tar.bz2
sequelpro-6350ce999b2921b0501e9afc5158ded8dffcd7fd.zip
In the table information pane check that the 'Rows' field reported by SHOW TABLE STATUS is not NULL before being displayed. Row count for tables in information_schema are always NULL.
-rw-r--r--Source/SPTableInfo.m12
1 files changed, 7 insertions, 5 deletions
diff --git a/Source/SPTableInfo.m b/Source/SPTableInfo.m
index a6576e4c..e9f3e3a1 100644
--- a/Source/SPTableInfo.m
+++ b/Source/SPTableInfo.m
@@ -104,10 +104,8 @@
if ([tableListInstance tableName]) {
if ([[tableListInstance tableName] isEqualToString:@""]) {
[info addObject:@"multiple tables"];
-
}
else {
-
// Retrieve the table status information via the data cache
tableStatus = [tableDataInstance statusValues];
@@ -117,21 +115,25 @@
return;
}
- // Check for "Create_time" == NULL
+ // Check for 'Create_time' == NULL
if (![[tableStatus objectForKey:@"Create_time"] isNSNull]) {
// Add the creation date to the infoTable
[info addObject:[NSString stringWithFormat:@"created: %@", [self _getUserDefinedDateStringFromMySQLDate:[tableStatus objectForKey:@"Create_time"]]]];
}
- // Check for "Update_time" == NULL - InnoDB tables don't have an update time
+ // Check for 'Update_time' == NULL - InnoDB tables don't have an update time
if (![[tableStatus objectForKey:@"Update_time"] isNSNull]) {
// Add the update date to the infoTable
[info addObject:[NSString stringWithFormat:@"updated: %@", [self _getUserDefinedDateStringFromMySQLDate:[tableStatus objectForKey:@"Update_time"]]]];
}
+
+ // Check for 'Rows' == NULL - information_schema database doesn't report row count for it's tables
+ if (![[tableStatus objectForKey:@"Rows"] isNSNull]) {
+ [info addObject:[NSString stringWithFormat:@"rows: ~%@", [tableStatus objectForKey:@"Rows"]]];
+ }
- [info addObject:[NSString stringWithFormat:@"rows: ~%@", [tableStatus objectForKey:@"Rows"]]];
[info addObject:[NSString stringWithFormat:@"size: %@", [NSString stringForByteSize:[[tableStatus objectForKey:@"Data_length"] intValue]]]];
[info addObject:[NSString stringWithFormat:@"encoding: %@", [tableDataInstance tableEncoding]]];