aboutsummaryrefslogtreecommitdiffstats
path: root/Source/SPIndexesController.m
diff options
context:
space:
mode:
authorMax <post@wickenrode.com>2015-04-06 18:23:11 +0200
committerMax <post@wickenrode.com>2015-04-06 18:23:11 +0200
commit8eadd956e7b28695a3204ed2ba695a771a2b8da4 (patch)
tree4a71937e3d2aa5b694fa05e7ad2e88fe347cbf74 /Source/SPIndexesController.m
parent8631b5a61843aa52662946093e8391ead3de5689 (diff)
downloadsequelpro-8eadd956e7b28695a3204ed2ba695a771a2b8da4.tar.gz
sequelpro-8eadd956e7b28695a3204ed2ba695a771a2b8da4.tar.bz2
sequelpro-8eadd956e7b28695a3204ed2ba695a771a2b8da4.zip
Add support for FULLTEXT indexes in InnoDB tables
Fixes #1917
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")];