mirror of
https://github.com/postgres/postgres.git
synced 2025-06-26 12:21:12 +03:00
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.
This commit is contained in:
@ -7,7 +7,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/rewrite/rewriteManip.c,v 1.54 2001/01/24 19:43:05 momjian Exp $
|
* $Header: /cvsroot/pgsql/src/backend/rewrite/rewriteManip.c,v 1.55 2001/01/27 01:44:20 tgl Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -589,6 +589,20 @@ AddQual(Query *parsetree, Node *qual)
|
|||||||
if (qual == NULL)
|
if (qual == NULL)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
if (parsetree->commandType == CMD_UTILITY)
|
||||||
|
{
|
||||||
|
/*
|
||||||
|
* Noplace to put the qual on a utility statement.
|
||||||
|
*
|
||||||
|
* For now, we expect utility stmt to be a NOTIFY, so give a
|
||||||
|
* specific error message for that case.
|
||||||
|
*/
|
||||||
|
if (parsetree->utilityStmt && IsA(parsetree->utilityStmt, NotifyStmt))
|
||||||
|
elog(ERROR, "Conditional NOTIFY is not implemented");
|
||||||
|
else
|
||||||
|
elog(ERROR, "Conditional utility statements are not implemented");
|
||||||
|
}
|
||||||
|
|
||||||
/* INTERSECT want's the original, but we need to copy - Jan */
|
/* INTERSECT want's the original, but we need to copy - Jan */
|
||||||
copy = copyObject(qual);
|
copy = copyObject(qual);
|
||||||
|
|
||||||
@ -616,6 +630,20 @@ AddHavingQual(Query *parsetree, Node *havingQual)
|
|||||||
if (havingQual == NULL)
|
if (havingQual == NULL)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
if (parsetree->commandType == CMD_UTILITY)
|
||||||
|
{
|
||||||
|
/*
|
||||||
|
* Noplace to put the qual on a utility statement.
|
||||||
|
*
|
||||||
|
* For now, we expect utility stmt to be a NOTIFY, so give a
|
||||||
|
* specific error message for that case.
|
||||||
|
*/
|
||||||
|
if (parsetree->utilityStmt && IsA(parsetree->utilityStmt, NotifyStmt))
|
||||||
|
elog(ERROR, "Conditional NOTIFY is not implemented");
|
||||||
|
else
|
||||||
|
elog(ERROR, "Conditional utility statements are not implemented");
|
||||||
|
}
|
||||||
|
|
||||||
/* INTERSECT want's the original, but we need to copy - Jan */
|
/* INTERSECT want's the original, but we need to copy - Jan */
|
||||||
copy = copyObject(havingQual);
|
copy = copyObject(havingQual);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user