Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit c9c8d53

Browse files
committed
Refuse to try to attach a condition to a NOTIFY or other utility statement,
rather than coredumping (as prior 7.1 code did) or silently dropping the condition (as 7.0 did). This is annoying but there doesn't seem to be any good way to fix it, short of a major querytree restructuring.
1 parent c1a63c9 commit c9c8d53

File tree

1 file changed

+29
-1
lines changed

1 file changed

+29
-1
lines changed

src/backend/rewrite/rewriteManip.c

Lines changed: 29 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/rewriteManip.c,v 1.54 2001/01/24 19:43:05 momjian Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/rewrite/rewriteManip.c,v 1.55 2001/01/27 01:44:20 tgl Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -589,6 +589,20 @@ AddQual(Query *parsetree, Node *qual)
589589
if (qual == NULL)
590590
return;
591591

592+
if (parsetree->commandType == CMD_UTILITY)
593+
{
594+
/*
595+
* Noplace to put the qual on a utility statement.
596+
*
597+
* For now, we expect utility stmt to be a NOTIFY, so give a
598+
* specific error message for that case.
599+
*/
600+
if (parsetree->utilityStmt && IsA(parsetree->utilityStmt, NotifyStmt))
601+
elog(ERROR, "Conditional NOTIFY is not implemented");
602+
else
603+
elog(ERROR, "Conditional utility statements are not implemented");
604+
}
605+
592606
/* INTERSECT want's the original, but we need to copy - Jan */
593607
copy = copyObject(qual);
594608

@@ -616,6 +630,20 @@ AddHavingQual(Query *parsetree, Node *havingQual)
616630
if (havingQual == NULL)
617631
return;
618632

633+
if (parsetree->commandType == CMD_UTILITY)
634+
{
635+
/*
636+
* Noplace to put the qual on a utility statement.
637+
*
638+
* For now, we expect utility stmt to be a NOTIFY, so give a
639+
* specific error message for that case.
640+
*/
641+
if (parsetree->utilityStmt && IsA(parsetree->utilityStmt, NotifyStmt))
642+
elog(ERROR, "Conditional NOTIFY is not implemented");
643+
else
644+
elog(ERROR, "Conditional utility statements are not implemented");
645+
}
646+
619647
/* INTERSECT want's the original, but we need to copy - Jan */
620648
copy = copyObject(havingQual);
621649

0 commit comments

Comments
 (0)