Skip Menu |

This queue is for tickets about the Rose-DB-Object CPAN distribution.

Report information
The Basics
Id: 99049
Status: rejected
Priority: 0/
Queue: Rose-DB-Object

People
Owner: Nobody in particular
Requestors: KOORCHIK [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: Inconsistent behavior of null in multi-value comparison
ORM creates an abstraction from Database and maps objects to database rows. Besides this, ORM provides a mechanism(QueryBuilder) to query objects from database in an abstracted way. QueryBuilder makes an excellent job and helps us to write queries easily. So, we write ATTRNAME => VALUE1 for single value comparison and "ATTRNAME => [VALUE1, VALUE2]" for multi-value comparison. With a single value comparison we do not care about NULLs, "ATTRNAME => undef" just works, but when we add additional value to comparison like "ATTRNAME => [undef, VALUE2]" it stops working. This behavior is not expected and looks inconsistent. It would be very nice to have multi-value comparison working correctly with undef(NULL). I know that the behavior is described in the documentation but what are the reason for it?
I don't understand your request. The current behavior is correct, as far as I'm concerned. Example: query => [ name => undef ], # WHERE NAME IS NULL query => [ name => [ undef, 'abc' ], # WHERE NAME IN (NULL, 'abc')
CC: KOORCHIK [...] cpan.org
Subject: Re: [rt.cpan.org #99049] Inconsistent behavior of null in multi-value comparison
Date: Sat, 8 Nov 2014 12:19:59 +0200
To: bug-Rose-DB-Object [...] rt.cpan.org
From: Виктор Турский <koorchik [...] gmail.com>
I mean that query => [ name => undef] # works query => [ name => [undef]] # does not work (because NULL != NULL) But with string values it works in both cases query => [ name => 'abc'] query => [ name => ['abc']] So, the behavior is inconsistent for ORM user. 2014-11-07 17:27 GMT+02:00 John Siracusa via RT < bug-Rose-DB-Object@rt.cpan.org>: Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=99049 > > > I don't understand your request. The current behavior is correct, as far > as I'm concerned. Example: > > query => [ name => undef ], # WHERE NAME IS NULL > > query => [ name => [ undef, 'abc' ], # WHERE NAME IN (NULL, 'abc') > > > >
-- Viktor Turskyi http://webbylab.com http://koorchik.blogspot.com