From fe08035c93883b457f03a913c2618fa1965c7248 Mon Sep 17 00:00:00 2001 From: helge Date: Fri, 29 Jul 2005 16:19:10 +0000 Subject: [PATCH] fixed NSData values with MySQL git-svn-id: http://svn.opengroupware.org/SOPE/trunk@946 e4a50df8-12e2-0310-a44c-efbce7f8a7e3 --- sope-gdl1/MySQL/ChangeLog | 9 +++++++++ sope-gdl1/MySQL/MySQL4Values.m | 6 ++++-- sope-gdl1/MySQL/NSData+MySQL4Val.m | 12 ++++++++++++ sope-gdl1/MySQL/README | 2 ++ sope-gdl1/MySQL/Version | 2 +- 5 files changed, 28 insertions(+), 3 deletions(-) diff --git a/sope-gdl1/MySQL/ChangeLog b/sope-gdl1/MySQL/ChangeLog index d4dd5e72..a88466e0 100644 --- a/sope-gdl1/MySQL/ChangeLog +++ b/sope-gdl1/MySQL/ChangeLog @@ -1,3 +1,12 @@ +2005-07-29 Helge Hess + + * v4.5.12 + + * NSData+MySQL4Val.m: fixed handling of NSData rows (proper init was + missing) + + * MySQL4Values.m: improved logging of unsupported types + 2005-07-27 Helge Hess * fixed gcc 4.0 warnings (char signedness) (v4.5.11) diff --git a/sope-gdl1/MySQL/MySQL4Values.m b/sope-gdl1/MySQL/MySQL4Values.m index f7395c72..6efd3480 100644 --- a/sope-gdl1/MySQL/MySQL4Values.m +++ b/sope-gdl1/MySQL/MySQL4Values.m @@ -81,8 +81,10 @@ [self release]; return nil; } - NSLog(@"WARNING(%s): falling back to NSString for MySQL4 value!", - __PRETTY_FUNCTION__); + NSLog(@"WARNING(%s): %@ falling back to NSString for MySQL4 value" + @" (type %i, 0x%08X, len=%d)", + __PRETTY_FUNCTION__, NSStringFromClass([self class]), + _type, _v, _len); [self release]; return [[NSString alloc] initWithMySQL4Type:_type value:_v length:_len]; diff --git a/sope-gdl1/MySQL/NSData+MySQL4Val.m b/sope-gdl1/MySQL/NSData+MySQL4Val.m index 13d6419b..8b62a596 100644 --- a/sope-gdl1/MySQL/NSData+MySQL4Val.m +++ b/sope-gdl1/MySQL/NSData+MySQL4Val.m @@ -30,6 +30,17 @@ @implementation NSData(MySQL4Values) +- (id)initWithMySQL4Type:(int)_type value:(const void *)_v length:(int)_len { + // Note: never used on lF (NSTemporaryString!) + if (_v == NULL) { + [self release]; + return nil; + } + + return [self initWithBytes:_v length:_len]; +} + +#if 0 // unused? - (id)initWithMySQL4Int:(int)_value { return [self initWithBytes:&_value length:sizeof(int)]; } @@ -42,6 +53,7 @@ - (id)initWithMySQL4Data:(const void *)_value length:(int)_length { return [self initWithBytes:_value length:_length]; } +#endif - (NSString *)stringValueForMySQL4Type:(NSString *)_type attribute:(EOAttribute *)_attribute diff --git a/sope-gdl1/MySQL/README b/sope-gdl1/MySQL/README index a7f99698..b06664ba 100644 --- a/sope-gdl1/MySQL/README +++ b/sope-gdl1/MySQL/README @@ -3,6 +3,8 @@ Note: this is far from being complete! The adaptor is currently a fork of the MySQL4 adaptor. +http://sql-info.de/mysql/gotchas.html + TODO ==== - implement diff --git a/sope-gdl1/MySQL/Version b/sope-gdl1/MySQL/Version index 6f0aa782..cda34ac9 100644 --- a/sope-gdl1/MySQL/Version +++ b/sope-gdl1/MySQL/Version @@ -1,3 +1,3 @@ # Version file -SUBMINOR_VERSION:=11 +SUBMINOR_VERSION:=12 -- 2.39.5