aboutsummaryrefslogtreecommitdiffstats
path: root/Source/TableStatus.m
diff options
context:
space:
mode:
authorrowanbeentje <rowan@beent.je>2009-03-28 02:33:59 +0000
committerrowanbeentje <rowan@beent.je>2009-03-28 02:33:59 +0000
commit7869b1fb325a9f761dc896b2be5b84be8b4d8f74 (patch)
treef51c26038641d9838abdc5c488b9b30c9c8ebe2c /Source/TableStatus.m
parent808a76c28f2346befc38a7b6e744987b2bedace1 (diff)
downloadsequelpro-7869b1fb325a9f761dc896b2be5b84be8b4d8f74.tar.gz
sequelpro-7869b1fb325a9f761dc896b2be5b84be8b4d8f74.tar.bz2
sequelpro-7869b1fb325a9f761dc896b2be5b84be8b4d8f74.zip
- The status tab now no longer crashes when viewing Views. (Resolves Issue #212)
- SQL dump now correctly exports the CREATE ALGORITHM statement for views, and no longer attempts to output data for views. Databases with views can now be exported/imported without errors.
Diffstat (limited to 'Source/TableStatus.m')
-rw-r--r--Source/TableStatus.m21
1 files changed, 14 insertions, 7 deletions
diff --git a/Source/TableStatus.m b/Source/TableStatus.m
index 4edaa4e0..36aa2043 100644
--- a/Source/TableStatus.m
+++ b/Source/TableStatus.m
@@ -64,11 +64,21 @@
{
// Store the table name away for future use...
selectedTable = aTable;
+
+ // Retrieve the table status information via the table data cache
+ statusFields = [tableDataInstance statusValues];
- // No table selected
- if([aTable isEqualToString:@""] || !aTable) {
- [tableName setStringValue:@"Name: --"];
- [tableType setStringValue:@"Type: --"];
+ // No table selected or view selected
+ if([aTable isEqualToString:@""] || !aTable || [[statusFields objectForKey:@"Engine"] isEqualToString:@"View"]) {
+
+ if ([[statusFields objectForKey:@"Engine"] isEqualToString:@"View"]) {
+ [tableName setStringValue:[NSString stringWithFormat:@"Name: %@", selectedTable]];
+ [tableType setStringValue:@"Type: View"];
+ } else {
+ [tableName setStringValue:@"Name: --"];
+ [tableType setStringValue:@"Type: --"];
+ }
+
[tableCreatedAt setStringValue:@"Created At: --"];
[tableUpdatedAt setStringValue:@"Updated At: --"];
@@ -90,9 +100,6 @@
return;
}
- // Retrieve the table status information via the table data cache
- statusFields = [tableDataInstance statusValues];
-
// Assign the table values...
[tableName setStringValue:[NSString stringWithFormat:@"Name: %@",selectedTable]];
[tableType setStringValue:[self formatValueWithKey:@"Engine" inDictionary:statusFields withLabel:@"Type"]];