diff options
author | stuconnolly <stuart02@gmail.com> | 2009-07-20 18:10:50 +0000 |
---|---|---|
committer | stuconnolly <stuart02@gmail.com> | 2009-07-20 18:10:50 +0000 |
commit | a3c74feedbdd46f3c5c0bd5c7091931e930ff6b9 (patch) | |
tree | 731f70de77013c70e68e8ddd0e1f81f1739feb54 /Source/SPExtendedTableInfo.m | |
parent | 00423b8b7175607a05277f21cf16555bd0ee0286 (diff) | |
download | sequelpro-a3c74feedbdd46f3c5c0bd5c7091931e930ff6b9.tar.gz sequelpro-a3c74feedbdd46f3c5c0bd5c7091931e930ff6b9.tar.bz2 sequelpro-a3c74feedbdd46f3c5c0bd5c7091931e930ff6b9.zip |
Include a hard coded list of encodings and collations in SPDatabaseData to remove the depdendency on the information_schema database when its not available or accessible.
Diffstat (limited to 'Source/SPExtendedTableInfo.m')
-rw-r--r-- | Source/SPExtendedTableInfo.m | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/Source/SPExtendedTableInfo.m b/Source/SPExtendedTableInfo.m index 1bea535a..04070e93 100644 --- a/Source/SPExtendedTableInfo.m +++ b/Source/SPExtendedTableInfo.m @@ -216,7 +216,6 @@ [tableCommentsTextView setString:@""]; [tableCommentsTextView setEditable:NO]; - return; } @@ -224,7 +223,7 @@ NSArray *encodings = [databaseDataInstance getDatabaseCharacterSetEncodings]; NSArray *collations = [databaseDataInstance getDatabaseCollationsForEncoding:[tableDataInstance tableEncoding]]; - if ([engines count] > 0) { + if (([engines count] > 0) && ([statusFields objectForKey:@"Engine"])) { // Populate type popup button for (NSDictionary *engine in engines) { @@ -234,13 +233,16 @@ [tableTypePopUpButton selectItemWithTitle:[statusFields objectForKey:@"Engine"]]; [tableTypePopUpButton setEnabled:YES]; } + else { + [tableTypePopUpButton addItemWithTitle:@"Not available"]; + } if ([encodings count] > 0) { NSString *selectedTitle = @""; // Populate encoding popup button for (NSDictionary *encoding in encodings) - { + { NSString *menuItemTitle = [NSString stringWithFormat:@"%@ (%@)", [encoding objectForKey:@"DESCRIPTION"], [encoding objectForKey:@"CHARACTER_SET_NAME"]]; [tableEncodingPopUpButton addItemWithTitle:menuItemTitle]; @@ -253,17 +255,23 @@ [tableEncodingPopUpButton selectItemWithTitle:selectedTitle]; [tableEncodingPopUpButton setEnabled:YES]; } + else { + [tableEncodingPopUpButton addItemWithTitle:@"Not available"]; + } - if ([collations count] > 0) { + if (([collations count] > 0) && ([statusFields objectForKey:@"Collation"])) { // Populate collation popup button for (NSDictionary *collation in collations) { [tableCollationPopUpButton addItemWithTitle:[collation objectForKey:@"COLLATION_NAME"]]; } - + [tableCollationPopUpButton selectItemWithTitle:[statusFields objectForKey:@"Collation"]]; [tableCollationPopUpButton setEnabled:YES]; } + else { + [tableCollationPopUpButton addItemWithTitle:@"Not available"]; + } [tableCreatedAt setStringValue:[self _formatValueWithKey:@"Create_time" inDictionary:statusFields withLabel:@"Created at"]]; [tableUpdatedAt setStringValue:[self _formatValueWithKey:@"Update_time" inDictionary:statusFields withLabel:@"Updated at"]]; |