aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorstuconnolly <stuart02@gmail.com>2012-03-17 18:14:59 +0000
committerstuconnolly <stuart02@gmail.com>2012-03-17 18:14:59 +0000
commit8244c7c382113ce3fedc331f7901c1afa712134b (patch)
treea19a46d80942c6441fab0b3a4255d74ec01043d1
parente26e22d9d6a6641cfc0a35e8ae31c12aee8bea5b (diff)
downloadsequelpro-8244c7c382113ce3fedc331f7901c1afa712134b.tar.gz
sequelpro-8244c7c382113ce3fedc331f7901c1afa712134b.tar.bz2
sequelpro-8244c7c382113ce3fedc331f7901c1afa712134b.zip
Add constants for MySQL 'system' databases.
-rw-r--r--Source/SPConstants.h7
-rw-r--r--Source/SPConstants.m19
-rw-r--r--Source/SPDatabaseDocument.m9
-rw-r--r--Source/SPExtendedTableInfo.m4
4 files changed, 32 insertions, 7 deletions
diff --git a/Source/SPConstants.h b/Source/SPConstants.h
index 342cc056..4b2d87a3 100644
--- a/Source/SPConstants.h
+++ b/Source/SPConstants.h
@@ -235,6 +235,11 @@ extern NSString *SPKillProcessConnectionMode;
// Default monospaced font name
extern NSString *SPDefaultMonospacedFontName;
+// System database names
+extern NSString *SPMySQLDatabase;
+extern NSString *SPMySQLInformationSchemaDatabase;
+extern NSString *SPMySQLPerformanceSchemaDatabase;
+
// Table view drag types
extern NSString *SPDefaultPasteboardDragType;
extern NSString *SPFavoritesPasteboardDragType;
@@ -571,7 +576,7 @@ extern const NSInteger SPBundleRedirectActionShowAsTextTooltip;
extern const NSInteger SPBundleRedirectActionShowAsHTMLTooltip;
extern const NSInteger SPBundleRedirectActionLastCode;
-// sequel URL scheme
+// URL scheme
extern NSString *SPURLSchemeQueryInputPathHeader;
extern NSString *SPURLSchemeQueryResultPathHeader;
extern NSString *SPURLSchemeQueryResultStatusPathHeader;
diff --git a/Source/SPConstants.m b/Source/SPConstants.m
index 674410d2..7fa35505 100644
--- a/Source/SPConstants.m
+++ b/Source/SPConstants.m
@@ -35,6 +35,11 @@ NSString *SPKillProcessConnectionMode = @"SPKillProcessConnectionMode
// Default monospaced font name
NSString *SPDefaultMonospacedFontName = @"Monaco";
+// System database names
+NSString *SPMySQLDatabase = @"mysql";
+NSString *SPMySQLInformationSchemaDatabase = @"information_schema";
+NSString *SPMySQLPerformanceSchemaDatabase = @"performance_schema";
+
// Table view drag types
NSString *SPDefaultPasteboardDragType = @"SequelProPasteboard";
NSString *SPFavoritesPasteboardDragType = @"SPFavoritesPasteboard";
@@ -226,7 +231,17 @@ NSString *SPMainToolbarTableInfo = @"SwitchToTableInfoToolbarIte
NSString *SPMainToolbarTableRelations = @"SwitchToTableRelationsToolbarItemIdentifier";
NSString *SPMainToolbarTableTriggers = @"SwitchToTableTriggersToolbarItemIdentifier";
NSString *SPMainToolbarUserManager = @"SwitchToUserManagerToolbarItemIdentifier";
-NSString **SPViewModeToMainToolbarMap[] = {nil, &SPMainToolbarTableStructure, &SPMainToolbarTableContent, &SPMainToolbarCustomQuery, &SPMainToolbarTableInfo, &SPMainToolbarTableRelations, &SPMainToolbarTableTriggers};
+
+NSString **SPViewModeToMainToolbarMap[] =
+{
+ nil,
+ &SPMainToolbarTableStructure,
+ &SPMainToolbarTableContent,
+ &SPMainToolbarCustomQuery,
+ &SPMainToolbarTableInfo,
+ &SPMainToolbarTableRelations,
+ &SPMainToolbarTableTriggers
+};
// Preferences toolbar
NSString *SPPreferenceToolbarGeneral = @"SPPreferenceToolbarGeneral";
@@ -383,7 +398,7 @@ const NSInteger SPBundleRedirectActionShowAsTextTooltip = 207;
const NSInteger SPBundleRedirectActionShowAsHTMLTooltip = 208;
const NSInteger SPBundleRedirectActionLastCode = 208;
-// sequel URL scheme
+// URL scheme
NSString *SPURLSchemeQueryInputPathHeader = @"/tmp/SP_QUERY_";
NSString *SPURLSchemeQueryResultPathHeader = @"/tmp/SP_QUERY_RESULT_";
NSString *SPURLSchemeQueryResultStatusPathHeader = @"/tmp/SP_QUERY_RESULT_STATUS_";
diff --git a/Source/SPDatabaseDocument.m b/Source/SPDatabaseDocument.m
index da2dbaf7..09f24d7a 100644
--- a/Source/SPDatabaseDocument.m
+++ b/Source/SPDatabaseDocument.m
@@ -613,9 +613,12 @@ static NSString *SPCreateSyntx = @"SPCreateSyntax";
// If the database is either information_schema or mysql then it is classed as a
// system table; similarly, for 5.5.3+, performance_schema
- if ([databaseName isEqualToString:@"information_schema"] || [databaseName isEqualToString:@"mysql"] || [databaseName isEqualToString:@"performance_schema"]) {
- [allSystemDatabases addObject:databaseName];
- } else {
+ if ([database isEqualToString:SPMySQLDatabase] ||
+ [database isEqualToString:SPMySQLInformationSchemaDatabase] ||
+ [database isEqualToString:SPMySQLPerformanceSchemaDatabase]) {
+ [allSystemDatabases addObject:database];
+ }
+ else {
[allDatabases addObject:databaseName];
}
}
diff --git a/Source/SPExtendedTableInfo.m b/Source/SPExtendedTableInfo.m
index 5cd867ce..9baaecab 100644
--- a/Source/SPExtendedTableInfo.m
+++ b/Source/SPExtendedTableInfo.m
@@ -563,7 +563,9 @@ static NSString *SPUpdateTableTypeNewType = @"SPUpdateTableTypeNewType";
// 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.
// also affects mysql and performance_schema
- BOOL isSystemSchemaDb = ([[tableDocumentInstance database] isEqualToString:@"information_schema"] || [[tableDocumentInstance database] isEqualToString:@"performance_schema"] || [[tableDocumentInstance database] isEqualToString:@"mysql"]);
+ BOOL isSystemSchemaDb = ([[tableDocumentInstance database] isEqualToString:SPMySQLInformationSchemaDatabase] ||
+ [[tableDocumentInstance database] isEqualToString:SPMySQLPerformanceSchemaDatabase] ||
+ [[tableDocumentInstance database] isEqualToString:SPMySQLDatabase]);
if ([[databaseDataInstance getDatabaseStorageEngines] count] && [statusFields objectForKey:@"Engine"]) {
[tableTypePopUpButton setEnabled:(!isSystemSchemaDb)];