From d53b0df83b77422a2f37e8c53843313ae1a186b5 Mon Sep 17 00:00:00 2001 From: stuconnolly Date: Wed, 1 Jul 2009 18:23:51 +0000 Subject: When displaying the add new table sheet use SPDatabaseData to get the available storage engines instead of the information_schema.engines table, which doesn't exist in versions other than MySQL 5. --- Source/TablesList.h | 1 + Source/TablesList.m | 11 +++++------ 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'Source') diff --git a/Source/TablesList.h b/Source/TablesList.h index 032f7f15..8a13e487 100644 --- a/Source/TablesList.h +++ b/Source/TablesList.h @@ -46,6 +46,7 @@ enum sp_table_types IBOutlet id tableDumpInstance; IBOutlet id tableDataInstance; IBOutlet id extendedTableInfoInstance; + IBOutlet id databaseDataInstance; IBOutlet id tableWindow; IBOutlet id copyTableSheet; diff --git a/Source/TablesList.m b/Source/TablesList.m index d07fe544..ae438dec 100644 --- a/Source/TablesList.m +++ b/Source/TablesList.m @@ -35,6 +35,7 @@ #import "SPStringAdditions.h" #import "SPArrayAdditions.h" #import "RegexKitLite.h" +#import "SPDatabaseData.h" @implementation TablesList @@ -209,17 +210,15 @@ // Populate the table type (engine) popup button [tableTypeButton removeAllItems]; - CMMCPResult *engines = [mySQLConnection queryString:@"SELECT engine FROM information_schema.engines"]; - - [engines dataSeek:0]; - + NSArray *engines = [databaseDataInstance getDatabaseStorageEngines]; + // Add default menu item [tableTypeButton addItemWithTitle:@"Default"]; [[tableTypeButton menu] addItem:[NSMenuItem separatorItem]]; - for (int i = 0; i < [engines numOfRows]; i++) + for (NSDictionary *engine in engines) { - [tableTypeButton addItemWithTitle:[[engines fetchRowAsArray] objectAtIndex:0]]; + [tableTypeButton addItemWithTitle:[engine objectForKey:@"Engine"]]; } [NSApp beginSheet:tableSheet -- cgit v1.2.3