possible wierd boolean bug?

Поиск
Список
Период
Сортировка
От Merlin Moncure
Тема possible wierd boolean bug?
Дата
Msg-id 6EE64EF3AB31D5448D0007DD34EEB3412A7566@Herge.rcsinc.local
обсуждение исходный текст
Ответы Re: possible wierd boolean bug?
Список pgsql-hackers
I have a strange but reproducible problem where a query does not seem to
return the same results.

esp=# select 1::int4, * from data1.po_line_file
esp-#   where pol_po_no =  '00000002' and
esp-#           (pol_po_no =  '00000002' and pol_po_rel_no =  0) and
esp-#           (pol_po_no =  '00000002' and pol_po_rel_no =  0 and
pol_item_no =  '1570')
esp-#   limit 1 ;
[fields omitted]
(0 rows)

esp=# select 1::int4, * from data1.po_line_file
esp-#   where --pol_po_no =  '00000002' and
esp-#           --(pol_po_no =  '00000002' and pol_po_rel_no =  0) and
esp-#           (pol_po_no =  '00000002' and pol_po_rel_no =  0 and
pol_item_no =  '1570')
esp-#   limit 1 ;
[fields omitted, note commented redundant clauses]
(1 row)

The obviously silly Boolean clause here was sql that was generated by a
driver.  I recoded the driver to make more intelligent sql and now the
problem is gone, at least from my application.  Note that the same query
form but with different tables/fields works correctly 99.99999% of the
time, just not this time...I'm just curious as to how two seemingly
equivalent statements could produce different results...perhpaps I
missed something?

Merlin



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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: tuple properties out of TupleTableSlot
Следующее
От: Tom Lane
Дата:
Сообщение: Re: join selectivity