aboutsummaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
Diffstat (limited to 'Source')
-rw-r--r--Source/SPDatabaseDocument.m3
-rw-r--r--Source/SPExtendedTableInfo.m11
-rw-r--r--Source/SPTextView.m8
3 files changed, 15 insertions, 7 deletions
diff --git a/Source/SPDatabaseDocument.m b/Source/SPDatabaseDocument.m
index 8557eeba..1e568fec 100644
--- a/Source/SPDatabaseDocument.m
+++ b/Source/SPDatabaseDocument.m
@@ -493,7 +493,8 @@ YY_BUFFER_STATE yy_scan_string (const char *);
NSString *database = NSArrayObjectAtIndex([queryResult fetchRowAsArray], 0);
// If the database is either information_schema or mysql then it is classed as a system table
- if ([database isEqualToString:@"information_schema"] || [database isEqualToString:@"mysql"]) {
+ // 5.5.3+ performance_schema
+ if ([database isEqualToString:@"information_schema"] || [database isEqualToString:@"mysql"] || [database isEqualToString:@"performance_schema"]) {
[allSystemDatabases addObject:database];
}
else {
diff --git a/Source/SPExtendedTableInfo.m b/Source/SPExtendedTableInfo.m
index 1f67b95d..a765f6df 100644
--- a/Source/SPExtendedTableInfo.m
+++ b/Source/SPExtendedTableInfo.m
@@ -513,23 +513,24 @@
// If we are viewing tables in the information_schema database, then disable all controls that cause table
// changes as these tables are not modifiable by anyone.
- BOOL isInformationSchemaDb = [[tableDocumentInstance database] isEqualToString:@"information_schema"];
+ //also affects mysql and performance_schema
+ BOOL isSystemSchemaDb = ([[tableDocumentInstance database] isEqualToString:@"information_schema"] || [[tableDocumentInstance database] isEqualToString:@"performance_schema"] || [[tableDocumentInstance database] isEqualToString:@"mysql"]);
if ([[databaseDataInstance getDatabaseStorageEngines] count] && [statusFields objectForKey:@"Engine"]) {
- [tableTypePopUpButton setEnabled:(!isInformationSchemaDb)];
+ [tableTypePopUpButton setEnabled:(!isSystemSchemaDb)];
}
if ([[databaseDataInstance getDatabaseCharacterSetEncodings] count] && [tableDataInstance tableEncoding]) {
- [tableEncodingPopUpButton setEnabled:(!isInformationSchemaDb)];
+ [tableEncodingPopUpButton setEnabled:(!isSystemSchemaDb)];
}
if ([[databaseDataInstance getDatabaseCollationsForEncoding:[tableDataInstance tableEncoding]] count]
&& [statusFields objectForKey:@"Collation"])
{
- [tableCollationPopUpButton setEnabled:(!isInformationSchemaDb)];
+ [tableCollationPopUpButton setEnabled:(!isSystemSchemaDb)];
}
- [tableCommentsTextView setEditable:(!isInformationSchemaDb)];
+ [tableCommentsTextView setEditable:(!isSystemSchemaDb)];
}
#pragma mark -
diff --git a/Source/SPTextView.m b/Source/SPTextView.m
index ab37f464..af4356a2 100644
--- a/Source/SPTextView.m
+++ b/Source/SPTextView.m
@@ -351,8 +351,10 @@ NSInteger alphabeticSort(id string1, id string2, void *reverse)
// Put information_schema and/or mysql db at the end if not selected
+ // 5.5.3+ also has performance_schema
NSString* mysql_id = [NSString stringWithFormat:@"%@%@%@", connectionID, SPUniqueSchemaDelimiter, @"mysql"];
- NSString* inf_id = [NSString stringWithFormat:@"%@%@%@", connectionID, SPUniqueSchemaDelimiter, @"information_schema"];
+ NSString* inf_id = [NSString stringWithFormat:@"%@%@%@", connectionID, SPUniqueSchemaDelimiter, @"information_schema"];
+ NSString* perf_id = [NSString stringWithFormat:@"%@%@%@", connectionID, SPUniqueSchemaDelimiter, @"performance_schema"];
if(currentDb && ![currentDb isEqualToString:mysql_id] && [sortedDbs containsObject:mysql_id]) {
[sortedDbs removeObject:mysql_id];
[sortedDbs addObject:mysql_id];
@@ -361,6 +363,10 @@ NSInteger alphabeticSort(id string1, id string2, void *reverse)
[sortedDbs removeObject:inf_id];
[sortedDbs addObject:inf_id];
}
+ if(currentDb && ![currentDb isEqualToString:perf_id] && [sortedDbs containsObject:perf_id]) {
+ [sortedDbs removeObject:perf_id];
+ [sortedDbs addObject:perf_id];
+ }
BOOL aTableNameExists = NO;
if(!aDbName) {