aboutsummaryrefslogtreecommitdiffstats
path: root/Source/CMMCPConnection.m
diff options
context:
space:
mode:
authorrowanbeentje <rowan@beent.je>2009-04-06 23:54:25 +0000
committerrowanbeentje <rowan@beent.je>2009-04-06 23:54:25 +0000
commit6060ba57f5897bffdd35dbca438e6682b2960f75 (patch)
tree86c9d9e00b88f40c5f4cad36d050c07997f751b6 /Source/CMMCPConnection.m
parent16aee03a9c48ffdaf33fd3f2c99f7b5a933ca0ee (diff)
downloadsequelpro-6060ba57f5897bffdd35dbca438e6682b2960f75.tar.gz
sequelpro-6060ba57f5897bffdd35dbca438e6682b2960f75.tar.bz2
sequelpro-6060ba57f5897bffdd35dbca438e6682b2960f75.zip
- Select 'drop tables' option for MySQL export by default, to improve backup-type process and more closely match mysqldump, and correctly drop views
- Consistently set and restore the encoding appropriately for SQL import/export, and export to UTF8 files to correctly store all characters. Goes a good way towards addressing Issue #116.
Diffstat (limited to 'Source/CMMCPConnection.m')
-rw-r--r--Source/CMMCPConnection.m7
1 files changed, 7 insertions, 0 deletions
diff --git a/Source/CMMCPConnection.m b/Source/CMMCPConnection.m
index abb61d82..ac75819f 100644
--- a/Source/CMMCPConnection.m
+++ b/Source/CMMCPConnection.m
@@ -136,6 +136,7 @@ static void forcePingTimeout(int signalNumber);
- (BOOL) reconnect
{
NSString *currentEncoding = nil;
+ BOOL currentEncodingUsesLatin1Transport = NO;
NSString *currentDatabase = nil;
// Store the current database and encoding so they can be re-set if reconnection was successful
@@ -145,6 +146,9 @@ static void forcePingTimeout(int signalNumber);
if (delegate && [delegate valueForKey:@"_encoding"]) {
currentEncoding = [NSString stringWithString:[delegate valueForKey:@"_encoding"]];
}
+ if (delegate && [delegate boolForKey:@"_encodingViaLatin1"]) {
+ currentEncodingUsesLatin1Transport = [delegate boolForKey:@"_encodingViaLatin1"];
+ }
// Close the connection if it exists.
if (mConnected) {
@@ -176,6 +180,9 @@ static void forcePingTimeout(int signalNumber);
if (currentEncoding) {
[self queryString:[NSString stringWithFormat:@"SET NAMES '%@'", currentEncoding]];
[self setEncoding:[CMMCPConnection encodingForMySQLEncoding:[currentEncoding UTF8String]]];
+ if (currentEncodingUsesLatin1Transport) {
+ [self queryString:@"SET CHARACTER_SET_RESULTS=latin1"];
+ }
}
} else if (parentWindow) {