Re: Bug in PL/PgSQL "SELECT .. INTO" statement parser

Lists: pgsql-bugs
From: Oleg Serov <serovov(at)gmail(dot)com>
To: pgsql-bugs(at)postgresql(dot)org
Subject: Bug in PL/PgSQL "SELECT .. INTO" statement parser
Date: 2009-01-21 11:55:41
Message-ID: cec7c6df0901210355w10d6dc91udde3b850ec9088e2@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-bugs

Here is an example:

CREATE TABLE test2 (
id BIGINT,
chunk_id BIGINT
);
CREATE TABLE test1 (
id BIGINT
);

CREATE OR REPLACE FUNCTION "bug" () RETURNS pg_catalog.void AS
$body$
DECLARE
row_test1 test1%rowtype;
row_test2 test2%rowtype;
BEGIN
SELECT test1, chunk_ad
FROM test1 JOIN test2 ON(chunk.id = test2.chunk_id)
LIMIT 1
INTO row_test1, row_test2;

END;
$body$
LANGUAGE 'plpgsql' VOLATILE CALLED ON NULL INPUT SECURITY DEFINER;

Will throw error:
ERROR: LIMIT #,# syntax is not supported
HINT: Use separate LIMIT and OFFSET clauses.
QUERY: SELECT test1, chunk_ad FROM test1 JOIN test2 ON(chunk.id =
test2.chunk_id) LIMIT 1, 0, $1
CONTEXT: SQL statement in PL/PgSQL function "bug" near line 8

********** Ошибка **********

ERROR: LIMIT #,# syntax is not supported
SQL state: 42601
Подсказка:Use separate LIMIT and OFFSET clauses.
Контекст:SQL statement in PL/PgSQL function "bug" near line 8


From: Oleg Serov <serovov(at)gmail(dot)com>
To: pgsql-bugs(at)postgresql(dot)org
Subject: Re: Bug in PL/PgSQL "SELECT .. INTO" statement parser
Date: 2009-01-21 11:57:14
Message-ID: cec7c6df0901210357v4d0053a0sc3d14c9553444790@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-bugs

Sorry, but is not important, i forgot to remove original table name
"chunk_ad", but is not affected to the bug..

2009/1/21 Oleg Serov <serovov(at)gmail(dot)com>:
> Here is an example:
>
> CREATE TABLE test2 (
> id BIGINT,
> chunk_id BIGINT
> );
> CREATE TABLE test1 (
> id BIGINT
> );
>
> CREATE OR REPLACE FUNCTION "bug" () RETURNS pg_catalog.void AS
> $body$
> DECLARE
> row_test1 test1%rowtype;
> row_test2 test2%rowtype;
> BEGIN
> SELECT test1, chunk_ad
> FROM test1 JOIN test2 ON(chunk.id = test2.chunk_id)
> LIMIT 1
> INTO row_test1, row_test2;
>
> END;
> $body$
> LANGUAGE 'plpgsql' VOLATILE CALLED ON NULL INPUT SECURITY DEFINER;
>
> Will throw error:
> ERROR: LIMIT #,# syntax is not supported
> HINT: Use separate LIMIT and OFFSET clauses.
> QUERY: SELECT test1, chunk_ad FROM test1 JOIN test2 ON(chunk.id =
> test2.chunk_id) LIMIT 1, 0, $1
> CONTEXT: SQL statement in PL/PgSQL function "bug" near line 8
>
> ********** Ошибка **********
>
> ERROR: LIMIT #,# syntax is not supported
> SQL state: 42601
> Подсказка:Use separate LIMIT and OFFSET clauses.
> Контекст:SQL statement in PL/PgSQL function "bug" near line 8
>


From: Oleg Serov <serovov(at)gmail(dot)com>
To: pgsql-bugs(at)postgresql(dot)org
Subject: Re: Bug in PL/PgSQL "SELECT .. INTO" statement parser
Date: 2010-02-26 14:32:51
Message-ID: cec7c6df1002260632g3b14ea30v1b799bb2edc7b815@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-bugs

Up. Anybody will answer on this bug report?

2009/1/21 Oleg Serov <serovov(at)gmail(dot)com>

> Sorry, but is not important, i forgot to remove original table name
> "chunk_ad", but is not affected to the bug..
>
> 2009/1/21 Oleg Serov <serovov(at)gmail(dot)com>:
> > Here is an example:
> >
> > CREATE TABLE test2 (
> > id BIGINT,
> > chunk_id BIGINT
> > );
> > CREATE TABLE test1 (
> > id BIGINT
> > );
> >
> > CREATE OR REPLACE FUNCTION "bug" () RETURNS pg_catalog.void AS
> > $body$
> > DECLARE
> > row_test1 test1%rowtype;
> > row_test2 test2%rowtype;
> > BEGIN
> > SELECT test1, chunk_ad
> > FROM test1 JOIN test2 ON(chunk.id = test2.chunk_id)
> > LIMIT 1
> > INTO row_test1, row_test2;
> >
> > END;
> > $body$
> > LANGUAGE 'plpgsql' VOLATILE CALLED ON NULL INPUT SECURITY DEFINER;
> >
> > Will throw error:
> > ERROR: LIMIT #,# syntax is not supported
> > HINT: Use separate LIMIT and OFFSET clauses.
> > QUERY: SELECT test1, chunk_ad FROM test1 JOIN test2 ON(chunk.id =
> > test2.chunk_id) LIMIT 1, 0, $1
> > CONTEXT: SQL statement in PL/PgSQL function "bug" near line 8
> >
> > ********** Ошибка **********
> >
> > ERROR: LIMIT #,# syntax is not supported
> > SQL state: 42601
> > Подсказка:Use separate LIMIT and OFFSET clauses.
> > Контекст:SQL statement in PL/PgSQL function "bug" near line 8
> >
>

--
С уважением

Олег Серов


From: Oleg Serov <serovov(at)gmail(dot)com>
To: pgsql-bugs(at)postgresql(dot)org
Subject: Re: Bug in PL/PgSQL "SELECT .. INTO" statement parser
Date: 2010-03-01 09:22:33
Message-ID: cec7c6df1003010122p494d07afn90ab189683a1cc43@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-bugs

Submitted as #*5352 bug.*

2010/2/26 Oleg Serov <serovov(at)gmail(dot)com>

> Up. Anybody will answer on this bug report?
>
>
> 2009/1/21 Oleg Serov <serovov(at)gmail(dot)com>
>
>> Sorry, but is not important, i forgot to remove original table name
>> "chunk_ad", but is not affected to the bug..
>>
>> 2009/1/21 Oleg Serov <serovov(at)gmail(dot)com>:
>> > Here is an example:
>> >
>> > CREATE TABLE test2 (
>> > id BIGINT,
>> > chunk_id BIGINT
>> > );
>> > CREATE TABLE test1 (
>> > id BIGINT
>> > );
>> >
>> > CREATE OR REPLACE FUNCTION "bug" () RETURNS pg_catalog.void AS
>> > $body$
>> > DECLARE
>> > row_test1 test1%rowtype;
>> > row_test2 test2%rowtype;
>> > BEGIN
>> > SELECT test1, chunk_ad
>> > FROM test1 JOIN test2 ON(chunk.id = test2.chunk_id)
>> > LIMIT 1
>> > INTO row_test1, row_test2;
>> >
>> > END;
>> > $body$
>> > LANGUAGE 'plpgsql' VOLATILE CALLED ON NULL INPUT SECURITY DEFINER;
>> >
>> > Will throw error:
>> > ERROR: LIMIT #,# syntax is not supported
>> > HINT: Use separate LIMIT and OFFSET clauses.
>> > QUERY: SELECT test1, chunk_ad FROM test1 JOIN test2 ON(chunk.id =
>> > test2.chunk_id) LIMIT 1, 0, $1
>> > CONTEXT: SQL statement in PL/PgSQL function "bug" near line 8
>> >
>> > ********** Ошибка **********
>> >
>> > ERROR: LIMIT #,# syntax is not supported
>> > SQL state: 42601
>> > Подсказка:Use separate LIMIT and OFFSET clauses.
>> > Контекст:SQL statement in PL/PgSQL function "bug" near line 8
>> >
>>
>
>
>
> --
> С уважением
>
> Олег Серов
>

--
С уважением

Олег Серов