cockroachdb / cockroach

CockroachDB — the cloud native, distributed SQL database designed for high availability, effortless scale, and control over data placement.
https://www.cockroachlabs.com
Other
30.22k stars 3.82k forks source link

plpgsql: variables in the INTO clause are case sensitive #126727

Open DrewKimball opened 5 months ago

DrewKimball commented 5 months ago

Variables names in PL/pgSQL are meant to be case-insensitive unless surrounded by double quotes, just like identifiers in SQL. However, this is currently not the case when the variable is used as the target of an INTO clause for a SQL exec statement or FETCH statement:

root@localhost:26257/defaultdb> CREATE PROCEDURE p() LANGUAGE PLpgSQL AS $$ DECLARE foo INT; BEGIN SELECT 1 INTO FOO; END $$;
ERROR: "FOO" is not a known variable
SQLSTATE: 42601

We should ensure that PL/pgSQL variables have correct casing behavior in all contexts.

Jira issue: CRDB-40753

blathers-crl[bot] commented 5 months ago

Hi @DrewKimball, please add branch-* labels to identify which branch(es) this C-bug affects.

:owl: Hoot! I am a Blathers, a bot for CockroachDB. My owner is dev-inf.