mirror of
https://git.postgresql.org/git/postgresql.git
synced 2026-02-09 01:07:42 +08:00
Fix thinko in tok_is_keyword(): it was looking at the wrong union variant
of YYSTYPE, and hence returning the wrong answer for cases where a plpgsql "unreserved keyword" really does conflict with a variable name. Obviously I didn't test this enough :-(. Per bug #5524 from Peter Gagarinov.
This commit is contained in:
@ -2916,6 +2916,20 @@ $$ language plpgsql;
|
||||
|
||||
select raise_test();
|
||||
|
||||
-- check cases where implicit SQLSTATE variable could be confused with
|
||||
-- SQLSTATE as a keyword, cf bug #5524
|
||||
create or replace function raise_test() returns void as $$
|
||||
begin
|
||||
perform 1/0;
|
||||
exception
|
||||
when sqlstate '22012' then
|
||||
raise notice using message = sqlstate;
|
||||
raise sqlstate '22012' using message = 'substitute message';
|
||||
end;
|
||||
$$ language plpgsql;
|
||||
|
||||
select raise_test();
|
||||
|
||||
drop function raise_test();
|
||||
|
||||
-- test CASE statement
|
||||
|
||||
Reference in New Issue
Block a user