aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBibiko <bibiko@eva.mpg.de>2010-09-10 07:10:11 +0000
committerBibiko <bibiko@eva.mpg.de>2010-09-10 07:10:11 +0000
commit52c071008bab2661edd6bafb6b55412bc6ac84b5 (patch)
treefa2bfb4b265ece01e7927d7bf4f7e91069e09a6c
parent60e9f96d82d7f619883e411a7a37f27c2790c5a0 (diff)
downloadsequelpro-52c071008bab2661edd6bafb6b55412bc6ac84b5.tar.gz
sequelpro-52c071008bab2661edd6bafb6b55412bc6ac84b5.tar.bz2
sequelpro-52c071008bab2661edd6bafb6b55412bc6ac84b5.zip
• fixed _supportsEncoding setting to dis/enable safely Database > View Using Encoding
-rw-r--r--Source/SPDatabaseDocument.m7
1 files changed, 6 insertions, 1 deletions
diff --git a/Source/SPDatabaseDocument.m b/Source/SPDatabaseDocument.m
index 47f915c3..648a7691 100644
--- a/Source/SPDatabaseDocument.m
+++ b/Source/SPDatabaseDocument.m
@@ -86,6 +86,7 @@
_isConnected = NO;
_isWorkingLevel = 0;
_isSavedInBundle = NO;
+ _supportsEncoding = NO;
databaseListIsSelectable = YES;
_queryMode = SPInterfaceQueryMode;
chooseDatabaseButton = nil;
@@ -777,6 +778,8 @@
break;
}
}
+
+ (void*)[self databaseEncoding];
}
- (MCPConnection *) getConnection {
@@ -1697,6 +1700,8 @@
MCPResult *charSetResult;
NSString *mysqlEncoding = nil;
+ _supportsEncoding = YES;
+
// MySQL >= 4.1
if ([mySQLConnection serverMajorVersion] > 4
|| ([mySQLConnection serverMajorVersion] == 4 && [mySQLConnection serverMinorVersion] >= 1))
@@ -1704,7 +1709,6 @@
charSetResult = [mySQLConnection queryString:@"SHOW VARIABLES LIKE 'character_set_database'"];
[charSetResult setReturnDataAsStrings:YES];
mysqlEncoding = [[charSetResult fetchRowAsDictionary] objectForKey:@"Value"];
- _supportsEncoding = (mysqlEncoding != nil);
// mysql 4.0 or older -> only default character set possible, cannot choose others using "set names xy"
} else {
@@ -1715,6 +1719,7 @@
if ( !mysqlEncoding ) {
NSLog(@"Error: no character encoding found, mysql version is %@", [self mySQLVersion]);
mysqlEncoding = @"latin1";
+ _supportsEncoding = NO;
}
return mysqlEncoding;