Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit60500d5

Browse files
committed
Fix breakage of rules using NOTIFY actions, per bug report and patch
from sergiop@sinectis.com.ar.
1 parent676cf18 commit60500d5

File tree

2 files changed

+28
-2
lines changed

2 files changed

+28
-2
lines changed

‎src/backend/rewrite/rewriteHandler.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/backend/rewrite/rewriteHandler.c,v 1.86 2000/12/07 01:22:25 tgl Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/rewrite/rewriteHandler.c,v 1.87 2001/01/0322:01:05 tgl Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -124,6 +124,7 @@ gatherRewriteMeta(Query *parsetree,
124124
* Note that if the rule refers to OLD, its jointree will add back
125125
* a reference to rt_index.
126126
*/
127+
if (sub_action->jointree!=NULL)
127128
{
128129
boolfound;
129130
List*newjointree=adjustJoinTreeList(parsetree,

‎src/backend/utils/adt/ruleutils.c

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
*back to source text
44
*
55
* IDENTIFICATION
6-
* $Header: /cvsroot/pgsql/src/backend/utils/adt/ruleutils.c,v 1.70 2000/11/18 04:40:18 tgl Exp $
6+
* $Header: /cvsroot/pgsql/src/backend/utils/adt/ruleutils.c,v 1.71 2001/01/03 22:01:05 tgl Exp $
77
*
88
* This software is copyrighted by Jan Wieck - Hamburg.
99
*
@@ -97,6 +97,7 @@ static void get_select_query_def(Query *query, deparse_context *context);
9797
staticvoidget_insert_query_def(Query*query,deparse_context*context);
9898
staticvoidget_update_query_def(Query*query,deparse_context*context);
9999
staticvoidget_delete_query_def(Query*query,deparse_context*context);
100+
staticvoidget_utility_query_def(Query*query,deparse_context*context);
100101
staticvoidget_basic_select_query(Query*query,deparse_context*context);
101102
staticvoidget_setop_query(Node*setOp,Query*query,
102103
deparse_context*context,booltoplevel);
@@ -874,6 +875,10 @@ get_query_def(Query *query, StringInfo buf, List *parentrtables)
874875
appendStringInfo(buf,"NOTHING");
875876
break;
876877

878+
caseCMD_UTILITY:
879+
get_utility_query_def(query,&context);
880+
break;
881+
877882
default:
878883
elog(ERROR,"get_ruledef of %s: query command type %d not implemented yet",
879884
rulename,query->commandType);
@@ -1310,6 +1315,26 @@ get_delete_query_def(Query *query, deparse_context *context)
13101315
}
13111316
}
13121317

1318+
1319+
/* ----------
1320+
* get_utility_query_def- Parse back a UTILITY parsetree
1321+
* ----------
1322+
*/
1323+
staticvoid
1324+
get_utility_query_def(Query*query,deparse_context*context)
1325+
{
1326+
StringInfobuf=context->buf;
1327+
1328+
if (query->utilityStmt&&IsA(query->utilityStmt,NotifyStmt))
1329+
{
1330+
NotifyStmt*stmt= (NotifyStmt*)query->utilityStmt;
1331+
appendStringInfo(buf,"NOTIFY %s",quote_identifier(stmt->relname));
1332+
}
1333+
else
1334+
elog(ERROR,"get_utility_query_def: unexpected statement type");
1335+
}
1336+
1337+
13131338
/*
13141339
* Find the RTE referenced by a (possibly nonlocal) Var.
13151340
*/

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp