Re: Wrong output for 7.0.3 from NULL fields in CASE statement

Поиск
Список
Период
Сортировка
От Thomas Lockhart
Тема Re: Wrong output for 7.0.3 from NULL fields in CASE statement
Дата
Msg-id 3A9DF334.4664859D@alumni.caltech.edu
обсуждение исходный текст
Ответ на Wrong output for 7.0.3 from NULL fields in CASE statement  (pgsql-bugs@postgresql.org)
Список pgsql-bugs
> I am getting output that doesn't make sense from a simple SQL statement.
> I am expecting to get a '0'::text returned by this statement, but
> instead I'm getting very, very small numbers, or other weird things.
> It's a catch for NULL values and isn't interpreting them correctly when
> it gets them.

For a float8 field "d", I can reproduce this with a slightly simpler
case:

lockhart=# select case when (d = null) then 0 else d end from t1;
 text
------
 0
(1 row)

lockhart=# select case when (d = null) then '0' else d end from t1;
         text
-----------------------
 1.11784577978351e+253
(1 row)

I haven't tracked it down, but I'll guess that the automatic type
conversion logic is getting confused with the stringy form of zero.

I do not see the symptom in the current development tree.

                    - Thomas

В списке pgsql-bugs по дате отправления:

Предыдущее
От: Justin Clift
Дата:
Сообщение: Oops... sorry about that
Следующее
От: Nat Howard
Дата:
Сообщение: jdbc1 compile problem still present in beta5 (java 1.1.8/freebsd 4.2-STABLE)