git.postgresql.org Git - postgresql.git/commitdiff

git projects / postgresql.git / commitdiff
? search:
summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 87cd901)
Fix overly enthusiastic Assert introduced in 8.1: it's expecting a
Sun, 1 Oct 2006 17:23:38 +0000 (17:23 +0000)
Sun, 1 Oct 2006 17:23:38 +0000 (17:23 +0000)
CaseTestExpr, but forgot that the optimizer is sometimes able to replace
CaseTestExpr by Const.


diff --git a/src/backend/utils/adt/ruleutils.c b/src/backend/utils/adt/ruleutils.c
index a88f5ef93c6b41b5bca191608a0e318c7f5f992e..821cc99e9f268afe7f974487bb295dd7443239dc 100644 (file)
--- a/src/backend/utils/adt/ruleutils.c
+++ b/src/backend/utils/adt/ruleutils.c
@@ -2,7 +2,7 @@
* ruleutils.c - Functions to convert stored expressions/querytrees
* back to source text
*
- * $PostgreSQL: pgsql/src/backend/utils/adt/ruleutils.c,v 1.232 2006年08月21日 00:57:25 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/utils/adt/ruleutils.c,v 1.233 2006年10月01日 17:23:38 tgl Exp $
**********************************************************************/
#include "postgres.h"
@@ -3584,14 +3584,18 @@ get_rule_expr(Node *node, deparse_context *context,
* the optimizer's simplify_boolean_equality() may
* have reduced this to just "CaseTestExpr" or
* "NOT CaseTestExpr", for which we have to show
- * "TRUE" or "FALSE".
+ * "TRUE" or "FALSE". Also, depending on context
+ * the original CaseTestExpr might have been reduced
+ * to a Const (but we won't see "WHEN Const").
*/
if (IsA(w, OpExpr))
{
Node *rhs;
Assert(IsA(linitial(((OpExpr *) w)->args),
- CaseTestExpr));
+ CaseTestExpr) ||
+ IsA(linitial(((OpExpr *) w)->args),
+ Const));
rhs = (Node *) lsecond(((OpExpr *) w)->args);
get_rule_expr(rhs, context, false);
}
This is the main PostgreSQL git repository.
RSS Atom

AltStyle によって変換されたページ (->オリジナル) /