[OGo-GNUstep-Port] postgresql adapter exception while entering a project

Helge Hess gnustep-port@opengroupware.org
Sat, 9 Jun 2007 00:21:04 +0200


On Jun 8, 2007, at 21:14, Sebastian Reitenbach wrote:
> gnustep-port@opengroupware.org wrote:
>> On Jun 6, 2007, at 08:51, Sebastian Reitenbach wrote:
>>> I had to change the [NSNumber numberWithBool:YES] to [NSNumber
>>> numberWithInt:1] or numberWithInt:YES to make it work.
>>
>> Thats wrong. We need to find the place where the NSBoolNumber is
>> replaced with YES/NO. Maybe its in EOSQLQualifier.
>
> +NSNumber numberWithBool: returns different things in libFoundation  
> and
> gnustep-base.
>
> what happens when you run this on apple:
>
> #include <Foundation/Foundation.h>
>
> int main (int argc, char **argv) {
>         NSLog(@"numberWithInt: %@, numberWithBool: %@", [NSNumber
> numberWithInt:YES], [NSNumber numberWithBool:YES]);
>         NSLog(@"numberWithInt: %@, numberWithBool: %@", [NSNumber
> numberWithInt:NO], [NSNumber numberWithBool:NO]);
>         return 0;
> }

helge@mbp$ ./testbool
2007-06-09 00:19:13.793 testbool[517] *** _NSAutoreleaseNoPool():  
Object 0x303140 of class NSCFNumber autoreleased with no pool in  
place - just leaking
2007-06-09 00:19:13.793 testbool[517] numberWithInt: 1,  
numberWithBool: 1
2007-06-09 00:19:13.793 testbool[517] *** _NSAutoreleaseNoPool():  
Object 0x304450 of class NSCFNumber autoreleased with no pool in  
place - just leaking
2007-06-09 00:19:13.793 testbool[517] numberWithInt: 0,  
numberWithBool: 0

So its consistent with libFoundation and GNUstep is different. But I  
wouldn't really consider returning YES as wrong. The question is why  
the SQL generator uses -description instead of processing the type of  
the number and doing the right thing in the specific context.

Greets,
   Helge
-- 
Helge Hess
http://www.helgehess.eu/