* out of its tuple
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/utils/adt/ruleutils.c,v 1.56 2000/07/06 05:48:11 tgl Exp $
+ * $Header: /cvsroot/pgsql/src/backend/utils/adt/ruleutils.c,v 1.57 2000/07/06 23:03:37 tgl Exp $
*
* This software is copyrighted by Jan Wieck - Hamburg.
*
query = (Query *) lfirst(actions);
- if (ev_type != '1' || ev_attr >= 0 || !is_instead || strcmp(ev_qual, "<>"))
+ if (ev_type != '1' || ev_attr >= 0 || !is_instead ||
+ strcmp(ev_qual, "<>") != 0)
{
appendStringInfo(buf, "Not a view");
return;
rte = (RangeTblEntry *) lfirst(l);
if (rte->ref == NULL)
continue;
- if (!strcmp(rte->ref->relname, "*NEW*"))
+ if (strcmp(rte->ref->relname, "*NEW*") == 0)
continue;
- if (!strcmp(rte->ref->relname, "*OLD*"))
+ if (strcmp(rte->ref->relname, "*OLD*") == 0)
continue;
rt_constonly = FALSE;
sep = " ";
foreach(l, query->targetList)
{
- bool tell_as = FALSE;
+ bool tell_as = false;
tle = (TargetEntry *) lfirst(l);
appendStringInfo(buf, sep);
/* Check if we must say AS ... */
if (!IsA(tle->expr, Var))
- tell_as = strcmp(tle->resdom->resname, "?column?");
+ tell_as = (strcmp(tle->resdom->resname, "?column?") != 0);
else
{
Var *var = (Var *) (tle->expr);
rte = get_rte_for_var(var, context);
attname = get_attribute_name(rte->relid, var->varattno);
- if (strcmp(attname, tle->resdom->resname))
- tell_as = TRUE;
+ tell_as = (strcmp(attname, tle->resdom->resname) != 0);
}
/* and do if so */
if (rte->ref == NULL)
continue;
- if (!strcmp(rte->ref->relname, "*NEW*"))
+ if (strcmp(rte->ref->relname, "*NEW*") == 0)
continue;
- if (!strcmp(rte->ref->relname, "*OLD*"))
+ if (strcmp(rte->ref->relname, "*OLD*") == 0)
continue;
appendStringInfo(buf, sep);
rte = (RangeTblEntry *) lfirst(l);
if (rte->ref == NULL)
continue;
- if (!strcmp(rte->ref->relname, "*NEW*"))
+ if (strcmp(rte->ref->relname, "*NEW*") == 0)
continue;
- if (!strcmp(rte->ref->relname, "*OLD*"))
+ if (strcmp(rte->ref->relname, "*OLD*") == 0)
continue;
rt_constonly = FALSE;
if (rte->ref == NULL)
appendStringInfo(buf, "%s.",
quote_identifier(rte->relname));
- else if (!strcmp(rte->ref->relname, "*NEW*"))
+ else if (strcmp(rte->ref->relname, "*NEW*") == 0)
appendStringInfo(buf, "new.");
- else if (!strcmp(rte->ref->relname, "*OLD*"))
+ else if (strcmp(rte->ref->relname, "*OLD*") == 0)
appendStringInfo(buf, "old.");
else
appendStringInfo(buf, "%s.",
*/
if (procStruct->pronargs == 1 && procStruct->proargtypes[0] == InvalidOid)
{
- if (!strcmp(proname, "nullvalue"))
+ if (strcmp(proname, "nullvalue") == 0)
{
appendStringInfoChar(buf, '(');
get_rule_expr((Node *) lfirst(expr->args), context);
appendStringInfo(buf, " ISNULL)");
return;
}
- if (!strcmp(proname, "nonnullvalue"))
+ if (strcmp(proname, "nonnullvalue") == 0)
{
appendStringInfoChar(buf, '(');
get_rule_expr((Node *) lfirst(expr->args), context);