Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fetching more than all results in router executor queries fails spuriously #635

Closed
anarazel opened this issue Jul 1, 2016 · 0 comments
Closed

Comments

@anarazel
Copy link
Contributor

anarazel commented Jul 1, 2016

As reported by @onderkalaci in #578 (not really related to that issue), we currently don't handle fetching from a cursor that already returned all its rows correctly.

CREATE TABLE multiple_hash
(
    category text NOT NULL,
    data text NOT NULL 
);

INSERT INTO multiple_hash VALUES ('1', '1');
INSERT INTO multiple_hash VALUES ('1', '2');
INSERT INTO multiple_hash VALUES ('1', '3');
INSERT INTO multiple_hash VALUES ('1', '4');
INSERT INTO multiple_hash VALUES ('1', '5');
INSERT INTO multiple_hash VALUES ('1', '6');
INSERT INTO multiple_hash VALUES ('1', '7');

BEGIN;
DECLARE test_cursor CURSOR FOR 
    SELECT *
        FROM multiple_hash
        WHERE category = '0'
        ORDER BY category;

-- the same error exists on both `master` and `feature/returning` branches:
FETCH FORWARD 4 test_cursor;
FETCH FORWARD 4 test_cursor;
ERROR:  scan directions other than forward scans are unsupported

should be trivial to fix, by accepting NoMovementDirection as well, and returning without executing the query.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants