Re: Is this a bug ?

Поиск
Список
Период
Сортировка
От Ron
Тема Re: Is this a bug ?
Дата
Msg-id 9df3ba0d-974d-f13d-ec91-bc22c3ab362b@gmail.com
обсуждение исходный текст
Ответ на Re: Is this a bug ?  (Geoff Winkless <pgsqladmin@geoff.dj>)
Ответы Re: Is this a bug ?  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: Is this a bug ?  (Fabio Ugo Venchiarutti <f.venchiarutti@ocado.com>)
Re: Is this a bug ?  (Geoff Winkless <pgsqladmin@geoff.dj>)
Re: Is this a bug ?  (Gaetano Mendola <mendola@gmail.com>)
Список pgsql-general
On 10/23/19 10:51 AM, Geoff Winkless wrote:
> On Wed, 23 Oct 2019 at 16:42, Ravi Krishna <sr_krishna@aol.com> wrote:
>
>> select count(*) from bugtest where fld1 in ('a','b','c'
>>                                              'd','e');
>>
>> Note the missing comma after 'c'.
>>
>> PG takes it a syntactically right SQL and gives 3 as output.
>>
>> In SQLServer it errors out SQL Error [102] [S0001]: Incorrect syntax near 'd'.
>>
>> Can't believe this bug was never found before.  We ended up wasting lot of time to figure this out.
> Simplify:
>
> select 'a'
> db-# 'b';
>   ?column?
> ----------
>   ab
> (1 row)
>
> This is not a bug.
>
> https://www.postgresql.org/docs/9.2/sql-syntax-lexical.html
>
> Two string constants that are only separated by whitespace with at
> least one newline are concatenated and effectively treated as if the
> string had been written as one constant.

Then -- since the 'e' is separated from 'd' by a comma, the result should be 
"4", not "3".

No doubt: it's a bug, no matter what the Pg devs say.

-- 
Angular momentum makes the world go 'round.



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

Предыдущее
От: Ravi Krishna
Дата:
Сообщение: Re: Is this a bug ?
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Is this a bug ?