Skip to content

CURSOR fetching error when used subquery with limit #34

@ereutt

Description

@ereutt

Steps to reproduce:

DECLARE ctest SCROLL CURSOR FOR SELECT 'aaaaa' FROM(SELECT relname FROM pg_class LIMIT 1) subquery;
 FETCH NEXT FROM ctest;

Expected:

 DECLARE CURSOR
 ?column? 
----------
 aaaaa
(1 row)

Actual:
ERROR: cache lookup failed for relation 0

This reproduced only for LIMIT in subquery. Cursors with subquery without LIMIT or LIMIT not in subquery are processed as expected

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions