roxen.lists.roxen.general

Subject Author Date
Re: [PATCH 02/17] Simplify logic, drop redundant code Henrik_Grubbström <grubba[at]roxen[dot]com> 20-01-2009
On Tue, 20 Jan 2009, Stephen R. van den Berg wrote:

>
[...]
>       val = map(val, lambda(mixed x) {
> -		       if (x) return x;
> -		       // Might be a dbnull object which considers
> -		       // itself false (e.g. in the oracle glue).
> -		       if ((x != 0) && stringp(x->type))
> -			 // Transform NULLString to "".
> -			 return x->type;
> -		       // It's 0 or a null object. Treat it as the value
> +		       // If it's a null object. Treat it as the value
> 		       // doesn't exist at all (ideally there should be
> 		       // some sort of dbnull value at the rxml level
> 		       // too to tell these cases apart).
> -		       return RXML.nil;
> +		       return x ? x : RXML.nil;
> 		     });

This patch is unsafe, since it changes the handling of "" for results from 
Oracle (Oracle doesn't differentiate between "" and NULL for string fields).

>

--
Henrik Grubbström					<grubba[at]roxen.com>
Roxen Internet Software AB