aboutsummaryrefslogtreecommitdiffstats
path: root/Source/SPFieldMapperController.m
diff options
context:
space:
mode:
authorstuconnolly <stuart02@gmail.com>2010-10-07 18:56:33 +0000
committerstuconnolly <stuart02@gmail.com>2010-10-07 18:56:33 +0000
commit44a5f9e552b3d5e1f9ef1c6d11f34e893d67e85b (patch)
treec833ba970d8cae5f756a31bc274e365c0a44b3bf /Source/SPFieldMapperController.m
parent95d2e4acc393e91aa70ed4c71daa1f776454a936 (diff)
downloadsequelpro-44a5f9e552b3d5e1f9ef1c6d11f34e893d67e85b.tar.gz
sequelpro-44a5f9e552b3d5e1f9ef1c6d11f34e893d67e85b.tar.bz2
sequelpro-44a5f9e552b3d5e1f9ef1c6d11f34e893d67e85b.zip
Various improvements to server capability/version checking, including:
- Add a new ServerSupport class, for which an instance is created upon each new connection and is then subsequently accessible via SPDatabaseDocument. - Replace the majority of manual version checking with calls to properties in the above new class. - Improve the user manager's compatibility with MySQL 3 and 4 servers. Fixes issue #811 Other changes include: - Disable the encoding popup button when adding a new table or database to servers running pre MySQL 4.1 as it only contains one option, 'Default'. - Fix various potential memory leaks discovered during static analysis. - General tidy up and comments.
Diffstat (limited to 'Source/SPFieldMapperController.m')
-rw-r--r--Source/SPFieldMapperController.m5
1 files changed, 3 insertions, 2 deletions
diff --git a/Source/SPFieldMapperController.m b/Source/SPFieldMapperController.m
index ac6f46e7..171155d7 100644
--- a/Source/SPFieldMapperController.m
+++ b/Source/SPFieldMapperController.m
@@ -819,7 +819,9 @@
[fieldMappingTableColumnNames removeAllObjects];
[fieldMappingTableDefaultValues removeAllObjects];
[fieldMappingTableTypes removeAllObjects];
+
BOOL serverGreaterThanVersion4 = ([mySQLConnection serverMajorVersion] >= 5) ? YES : NO;
+
if([importFieldNamesHeaderSwitch state] == NSOnState) {
for(id h in NSArrayObjectAtIndex(fieldMappingImportArray, 0)) {
[fieldMappingTableColumnNames addObject:h];
@@ -1010,6 +1012,7 @@
// Retrieve the server-supported encodings and add them to the menu
NSArray *encodings = [databaseDataInstance getDatabaseCharacterSetEncodings];
NSString *utf8MenuItemTitle = nil;
+
if ([encodings count] > 0
&& ([mySQLConnection serverMajorVersion] > 4
|| ([mySQLConnection serverMajorVersion] == 4 && [mySQLConnection serverMinorVersion] >= 1)))
@@ -1032,7 +1035,6 @@
}
[newTableInfoEncodingPopup selectItemWithTitle:[prefs objectForKey:SPLastImportIntoNewTableEncoding]];
-
}
[NSApp beginSheet:newTableInfoWindow
@@ -1047,7 +1049,6 @@
- (IBAction)addGlobalSourceVariable:(id)sender
{
-
addGlobalSheetIsOpen = YES;
[NSApp beginSheet:globalValuesSheet