Re: BUG #2503: Query results differ based on record count

Поиск
Список
Период
Сортировка
От Russell Francis
Тема Re: BUG #2503: Query results differ based on record count
Дата
Msg-id 44A423F0.6030206@ev.net
обсуждение исходный текст
Ответ на Re: BUG #2503: Query results differ based on record count of unrelated table.  (Alvaro Herrera <alvherre@commandprompt.com>)
Список pgsql-bugs
Alvaro Herrera wrote:
> Russell Francis wrote:
>=20
>> If a SELECT statement contains a table in it's FROM clause which has 0
>> records in it, the query will not return any results.  If a record is ad=
ded
>> to the table even though it shouldn't modify the results of query, the q=
uery
>> will return the expected result.
>>
>> The SQL statements below are a trimmed down test case which duplicates t=
his
>> issue.  The identical SELECT statements return different results dependi=
ng
>> on the record count of the unrelated table_b.
>>
>> SELECT table_a.* FROM table_a, table_b WHERE table_a.ta_col_a > 0;
>=20
> table_b is certainly not unrelated, as it appears in the FROM clause.
> So the query is correct to not show any result, per definition of
> cartesian product.
>=20

Alvaro,

Yes, you are correct.  Sorry.

Thanks,
Russ

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: BUG #2502: PQclear: "invalid next size"
Следующее
От: "Wagner Cipriano"
Дата:
Сообщение: BUG #2506: hash index