Thread: BUG #5301: difference of behaviour between 8.3 and 8.4 on IS NULL with sub rows of nulls

BUG #5301: difference of behaviour between 8.3 and 8.4 on IS NULL with sub rows of nulls

From
"Jehan-Guillaume (ioguix) de Rorthais"
Date:
The following bug has been logged online:

Bug reference:      5301
Logged by:          Jehan-Guillaume (ioguix) de Rorthais
Email address:      ioguix@free.fr
PostgreSQL version: 8.3
Operating system:   Linux
Description:        difference of behaviour between 8.3 and 8.4 on IS NULL
with sub rows of nulls
Details:

Following this discussion on -hacker mailing-list:
http://archives.postgresql.org/pgsql-hackers/2010-01/msg01828.php

...as I am not sure this issue has been tracked and fixed I open a bug
report to keep it in the loop.
Please, close this bug report if it was actualy fixed in the meantime.

Behaviour in regard to IS NULL with ROWS of NULL values is inconsistent
between 8.3 and 8.4.

Here is the test case:

<~~~~~~~~~~~~~~~~~~~~~~~~
$ psql -p 5433 -U postgres -h localhost -c \
'SELECT substring(version() from 0 for 15),
  ROW(NULL,NULL) IS NULL, ROW(ROW(NULL),NULL) IS NULL;'

   substring    | ?column? | ?column?
----------------+----------+----------
 PostgreSQL 8.3 | t        | f
(1 ligne)

$ psql -p 5434 -U postgres -h localhost -c \
'SELECT substring(version() from 0 for 15),
  ROW(NULL,NULL) IS NULL, ROW(ROW(NULL),NULL) IS NULL;'

   substring    | ?column? | ?column?
----------------+----------+----------
 PostgreSQL 8.4 | t        | t
(1 ligne)
~~~~~~~~~~~~~~~~~~~~~~~~>


and here is another test case where 8.3 is inconsistent with *himself* this
time:

<~~~~~~~~~~~~~~~~~~~~~~~~~~~~
postgres=# SELECT substring(version(),12,5);
 substring
-----------
 8.3.9
(1 ligne)

postgres=# SELECT ROW(ROW(NULL),NULL) IS NULL FROM (SELECT 1) t;
 ?column?
----------
 t
(1 ligne)

postgres=# SELECT ROW(ROW(NULL),NULL) IS NULL;
 ?column?
----------
 f
(1 ligne)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~>
"Jehan-Guillaume (ioguix) de Rorthais" <ioguix@free.fr> wrote:

> and here is another test case where 8.3 is inconsistent with
> *himself* this time:

Sounds like an argument that the behavior *should* have changed in
8.4.  We don't like to introduce behavioral changes which might
break something in a minor release, so I doubt we'd change that in
8.3; but on a major release like 8.4, this sort of fix is fair game.

So you found broken behavior in 8.3 which we can't fix without
risking breaking users' applications, and a fix implemented in 8.4
when such risk is acceptable?

Is there something else?

-Kevin