aboutsummaryrefslogtreecommitdiffstats
path: root/Source/SPIndexesController.m
diff options
context:
space:
mode:
Diffstat (limited to 'Source/SPIndexesController.m')
-rw-r--r--Source/SPIndexesController.m16
1 files changed, 9 insertions, 7 deletions
diff --git a/Source/SPIndexesController.m b/Source/SPIndexesController.m
index 5cca12f9..93466c27 100644
--- a/Source/SPIndexesController.m
+++ b/Source/SPIndexesController.m
@@ -166,7 +166,8 @@ static const NSString *SPNewIndexKeyBlockSize = @"IndexKeyBlockSize";
// Check whether a save of the current field row is required.
if (![tableStructure saveRowOnDeselect]) return;
- isMyISAMTale = [[[tableData statusValues] objectForKey:@"Engine"] isEqualToString:@"MyISAM"];
+ isMyISAMTable = [[[tableData statusValues] objectForKey:@"Engine"] isEqualToString:@"MyISAM"];
+ isInnoDBTable = [[[tableData statusValues] objectForKey:@"Engine"] isEqualToString:@"InnoDB"];
// Reset visibility of the primary key item
[[[indexTypePopUpButton menu] itemWithTag:SPPrimaryKeyMenuTag] setHidden:NO];
@@ -236,7 +237,7 @@ static const NSString *SPNewIndexKeyBlockSize = @"IndexKeyBlockSize";
#ifndef SP_CODA
// MyISAM and InnoDB tables only support BTREE storage types so disable the storage type popup button
// as it's the default anyway.
- [indexStorageTypePopUpButton setEnabled:(!(isMyISAMTale || [[[tableData statusValues] objectForKey:@"Engine"] isEqualToString:@"InnoDB"]))];
+ [indexStorageTypePopUpButton setEnabled:(!(isMyISAMTable || isInnoDBTable))];
// The ability to specify an index's key block size was added in MySQL 5.1.10 so disable the textfield
// if it's not supported.
@@ -328,10 +329,8 @@ static const NSString *SPNewIndexKeyBlockSize = @"IndexKeyBlockSize";
}
#ifndef SP_CODA
- NSString *engine = [[tableData statusValues] objectForKey:@"Engine"];
-
// Specifiying an index storage type (i.e. HASH or BTREE) is not permitted with SPATIAL indexes
- [indexStorageTypePopUpButton setEnabled:(indexType != SPSpatialMenuTag) && !(isMyISAMTale || [engine isEqualToString:@"InnoDB"])];
+ [indexStorageTypePopUpButton setEnabled:(indexType != SPSpatialMenuTag) && !(isMyISAMTable || isInnoDBTable)];
#endif
}
@@ -768,8 +767,8 @@ static const NSString *SPNewIndexKeyBlockSize = @"IndexKeyBlockSize";
[indexTypePopUpButton removeItemAtIndex:[indexTypePopUpButton indexOfItemWithTag:SPFullTextMenuTag]];
}
- // FULLTEXT and SPATIAL index types are only available using the MyISAM engine
- if (isMyISAMTale) {
+ // SPATIAL index types are only available using the MyISAM engine
+ if (isMyISAMTable) {
if ([[dbDocument serverSupport] supportsSpatialExtensions]) {
NSMenuItem *spatialMenuItem = [[[NSMenuItem alloc] init] autorelease];
@@ -778,7 +777,10 @@ static const NSString *SPNewIndexKeyBlockSize = @"IndexKeyBlockSize";
[[indexTypePopUpButton menu] addItem:spatialMenuItem];
}
+ }
+ // FULLTEXT only works with MyISAM and (InnoDB since 5.6.4)
+ if(isMyISAMTable || (isInnoDBTable && [[dbDocument serverSupport] supportsFulltextOnInnoDB])) {
NSMenuItem *fullTextMenuItem = [[[NSMenuItem alloc] init] autorelease];
[fullTextMenuItem setTitle:NSLocalizedString(@"FULLTEXT", @"full text index menu item title")];