diff options
author | rowanbeentje <rowan@beent.je> | 2011-08-07 21:43:23 +0000 |
---|---|---|
committer | rowanbeentje <rowan@beent.je> | 2011-08-07 21:43:23 +0000 |
commit | 2b94680bc07b670402f065e37ddca883d260dc9f (patch) | |
tree | 8428534b7324c7ebaa20eda0f81dad20549439ad /Source | |
parent | 2fe0f6e25814b1add160cdda67b94f82b39423b0 (diff) | |
download | sequelpro-2b94680bc07b670402f065e37ddca883d260dc9f.tar.gz sequelpro-2b94680bc07b670402f065e37ddca883d260dc9f.tar.bz2 sequelpro-2b94680bc07b670402f065e37ddca883d260dc9f.zip |
Fix encoding issues, particularly giving errors when selecting tables and displaying NULLs within tables when the connection encoding is incorrectly detected (Issue #1100):
- No longer rely on a combination of mysql_options(..., MYSQL_SET_CHARSET_NAME, ...utf8...) and mysql_character_set_name() to detect the connection encoding; this incorrectly misses init_connect commands; instead use SHOW_VARIABLES a$
- Combine initial version check/timezone check/encoding check on startup, reducing connection queries and thus improving connection speed
- Add support for abbreviated MySQL timezone definitions
- Combine MCPKit's -connect and -connectWithLogin:password:host:port:socket: methods to reduce code duplication and fix argument handling for the latter method
Diffstat (limited to 'Source')
-rw-r--r-- | Source/SPDatabaseDocument.m | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/Source/SPDatabaseDocument.m b/Source/SPDatabaseDocument.m index c211376d..308826e0 100644 --- a/Source/SPDatabaseDocument.m +++ b/Source/SPDatabaseDocument.m @@ -438,6 +438,10 @@ static NSString *SPCreateSyntx = @"SPCreateSyntax"; if ([encodingType intValue] != SPEncodingAutodetect) { [self setConnectionEncoding:[self mysqlEncodingFromEncodingTag:encodingType] reloadingViews:NO]; + } else { +#endif + [[self onMainThread] updateEncodingMenuWithSelectedEncoding:[self encodingTagFromMySQLEncoding:[mySQLConnection encoding]]]; +#ifndef SP_REFACTOR } #endif @@ -531,7 +535,7 @@ static NSString *SPCreateSyntx = @"SPCreateSyntax"; } } - (void)[self databaseEncoding]; + if ([self database]) (void)[self databaseEncoding]; #endif #ifdef SP_REFACTOR /* glue */ if ( delegate && [delegate respondsToSelector:@selector(databaseDocumentDidConnect:)] ) |