mirror of
https://git.postgresql.org/git/postgresql.git
synced 2024-12-21 08:29:39 +08:00
Fix crash when trying to display a NOTIFY rule action.
Fixes oversight in commit 2ffa740be9
.
Per report from Josh Kupershmidt.
I think we've broken this case before, so let's add a regression test
this time.
This commit is contained in:
parent
6563fb2b45
commit
403bd6a18b
@ -2564,14 +2564,19 @@ set_deparse_for_query(deparse_namespace *dpns, Query *query,
|
||||
dpns->rtable_columns = lappend(dpns->rtable_columns,
|
||||
palloc0(sizeof(deparse_columns)));
|
||||
|
||||
/* Detect whether global uniqueness of USING names is needed */
|
||||
dpns->unique_using = has_unnamed_full_join_using((Node *) query->jointree);
|
||||
/* If it's a utility query, it won't have a jointree */
|
||||
if (query->jointree)
|
||||
{
|
||||
/* Detect whether global uniqueness of USING names is needed */
|
||||
dpns->unique_using =
|
||||
has_unnamed_full_join_using((Node *) query->jointree);
|
||||
|
||||
/*
|
||||
* Select names for columns merged by USING, via a recursive pass over the
|
||||
* query jointree.
|
||||
*/
|
||||
set_using_names(dpns, (Node *) query->jointree);
|
||||
/*
|
||||
* Select names for columns merged by USING, via a recursive pass over
|
||||
* the query jointree.
|
||||
*/
|
||||
set_using_names(dpns, (Node *) query->jointree);
|
||||
}
|
||||
|
||||
/*
|
||||
* Now assign remaining column aliases for each RTE. We do this in a
|
||||
|
@ -2573,6 +2573,7 @@ select * from rules_log;
|
||||
11 | 13 | new
|
||||
(12 rows)
|
||||
|
||||
create rule r3 as on delete to rules_src do notify rules_src_deletion;
|
||||
\d+ rules_src
|
||||
Table "public.rules_src"
|
||||
Column | Type | Modifiers | Storage | Stats target | Description
|
||||
@ -2584,6 +2585,9 @@ Rules:
|
||||
ON UPDATE TO rules_src DO INSERT INTO rules_log (f1, f2, tag) VALUES (old.f1,old.f2,'old'::text), (new.f1,new.f2,'new'::text)
|
||||
r2 AS
|
||||
ON UPDATE TO rules_src DO VALUES (old.f1,old.f2,'old'::text), (new.f1,new.f2,'new'::text)
|
||||
r3 AS
|
||||
ON DELETE TO rules_src DO
|
||||
NOTIFY rules_src_deletion
|
||||
Has OIDs: no
|
||||
|
||||
--
|
||||
|
@ -970,6 +970,7 @@ create rule r2 as on update to rules_src do also
|
||||
update rules_src set f2 = f2 / 10;
|
||||
select * from rules_src;
|
||||
select * from rules_log;
|
||||
create rule r3 as on delete to rules_src do notify rules_src_deletion;
|
||||
\d+ rules_src
|
||||
|
||||
--
|
||||
|
Loading…
Reference in New Issue
Block a user