Closed DrewKimball closed 9 months ago
Probably related:
CREATE OR REPLACE PROCEDURE get_rows() LANGUAGE plpgsql AS $$
DECLARE
v test2;
n INT;
i INT := 0;
BEGIN
n := (SELECT count(*) FROM test2);
WHILE i < n LOOP
SELECT ROW(x, y) INTO v FROM test2 ORDER BY y, x OFFSET i;
RAISE NOTICE 'v: %', v;
i := i + 1;
END LOOP;
END
$$;
CALL get_rows();
For the above, postgres fails with ERROR: 22P02: invalid input syntax for type integer: "(6,0)"
during the CALL statement, but CRDB happily prints tuples filled out with x
and y
values.
Hi @michae2, please add branch-* labels to identify which branch(es) this release-blocker affects.
:owl: Hoot! I am a Blathers, a bot for CockroachDB. My owner is dev-inf.
The SELECT INTO statement can assign the result of executing a single-row statement into a list of comma-separated variables, or a single composite variable (docs). Currently, we only allow the first, and incorrectly handle attempts to use the second form. Example:
Notice how the
v
variable seems to store the first integer column returned by the query, rather than a tuple with both thex
andy
column values.Jira issue: CRDB-33625