3
3
* out of its tuple
4
4
*
5
5
* IDENTIFICATION
6
- * $Header: /cvsroot/pgsql/src/backend/utils/adt/ruleutils.c,v 1.56 2000/07/0605:48:11 tgl Exp $
6
+ * $Header: /cvsroot/pgsql/src/backend/utils/adt/ruleutils.c,v 1.57 2000/07/0623:03:37 tgl Exp $
7
7
*
8
8
* This software is copyrighted by Jan Wieck - Hamburg.
9
9
*
@@ -818,7 +818,8 @@ make_viewdef(StringInfo buf, HeapTuple ruletup, TupleDesc rulettc)
818
818
819
819
query = (Query * )lfirst (actions );
820
820
821
- if (ev_type != '1' || ev_attr >=0 || !is_instead || strcmp (ev_qual ,"<>" ))
821
+ if (ev_type != '1' || ev_attr >=0 || !is_instead ||
822
+ strcmp (ev_qual ,"<>" )!= 0 )
822
823
{
823
824
appendStringInfo (buf ,"Not a view" );
824
825
return ;
@@ -929,9 +930,9 @@ get_select_query_def(Query *query, deparse_context *context)
929
930
rte = (RangeTblEntry * )lfirst (l );
930
931
if (rte -> ref == NULL )
931
932
continue ;
932
- if (! strcmp (rte -> ref -> relname ,"*NEW*" ))
933
+ if (strcmp (rte -> ref -> relname ,"*NEW*" )== 0 )
933
934
continue ;
934
- if (! strcmp (rte -> ref -> relname ,"*OLD*" ))
935
+ if (strcmp (rte -> ref -> relname ,"*OLD*" )== 0 )
935
936
continue ;
936
937
937
938
rt_constonly = FALSE;
@@ -948,7 +949,7 @@ get_select_query_def(Query *query, deparse_context *context)
948
949
sep = " " ;
949
950
foreach (l ,query -> targetList )
950
951
{
951
- bool tell_as = FALSE ;
952
+ bool tell_as = false ;
952
953
953
954
tle = (TargetEntry * )lfirst (l );
954
955
appendStringInfo (buf ,sep );
@@ -959,16 +960,15 @@ get_select_query_def(Query *query, deparse_context *context)
959
960
960
961
/* Check if we must say AS ... */
961
962
if (!IsA (tle -> expr ,Var ))
962
- tell_as = strcmp (tle -> resdom -> resname ,"?column?" );
963
+ tell_as = ( strcmp (tle -> resdom -> resname ,"?column?" ) != 0 );
963
964
else
964
965
{
965
966
Var * var = (Var * ) (tle -> expr );
966
967
char * attname ;
967
968
968
969
rte = get_rte_for_var (var ,context );
969
970
attname = get_attribute_name (rte -> relid ,var -> varattno );
970
- if (strcmp (attname ,tle -> resdom -> resname ))
971
- tell_as = TRUE;
971
+ tell_as = (strcmp (attname ,tle -> resdom -> resname )!= 0 );
972
972
}
973
973
974
974
/* and do if so */
@@ -990,9 +990,9 @@ get_select_query_def(Query *query, deparse_context *context)
990
990
991
991
if (rte -> ref == NULL )
992
992
continue ;
993
- if (! strcmp (rte -> ref -> relname ,"*NEW*" ))
993
+ if (strcmp (rte -> ref -> relname ,"*NEW*" )== 0 )
994
994
continue ;
995
- if (! strcmp (rte -> ref -> relname ,"*OLD*" ))
995
+ if (strcmp (rte -> ref -> relname ,"*OLD*" )== 0 )
996
996
continue ;
997
997
998
998
appendStringInfo (buf ,sep );
@@ -1107,9 +1107,9 @@ get_insert_query_def(Query *query, deparse_context *context)
1107
1107
rte = (RangeTblEntry * )lfirst (l );
1108
1108
if (rte -> ref == NULL )
1109
1109
continue ;
1110
- if (! strcmp (rte -> ref -> relname ,"*NEW*" ))
1110
+ if (strcmp (rte -> ref -> relname ,"*NEW*" )== 0 )
1111
1111
continue ;
1112
- if (! strcmp (rte -> ref -> relname ,"*OLD*" ))
1112
+ if (strcmp (rte -> ref -> relname ,"*OLD*" )== 0 )
1113
1113
continue ;
1114
1114
1115
1115
rt_constonly = FALSE;
@@ -1280,9 +1280,9 @@ get_rule_expr(Node *node, deparse_context *context)
1280
1280
if (rte -> ref == NULL )
1281
1281
appendStringInfo (buf ,"%s." ,
1282
1282
quote_identifier (rte -> relname ));
1283
- else if (! strcmp (rte -> ref -> relname ,"*NEW*" ))
1283
+ else if (strcmp (rte -> ref -> relname ,"*NEW*" )== 0 )
1284
1284
appendStringInfo (buf ,"new." );
1285
- else if (! strcmp (rte -> ref -> relname ,"*OLD*" ))
1285
+ else if (strcmp (rte -> ref -> relname ,"*OLD*" )== 0 )
1286
1286
appendStringInfo (buf ,"old." );
1287
1287
else
1288
1288
appendStringInfo (buf ,"%s." ,
@@ -1520,14 +1520,14 @@ get_func_expr(Expr *expr, deparse_context *context)
1520
1520
*/
1521
1521
if (procStruct -> pronargs == 1 && procStruct -> proargtypes [0 ]== InvalidOid )
1522
1522
{
1523
- if (! strcmp (proname ,"nullvalue" ))
1523
+ if (strcmp (proname ,"nullvalue" )== 0 )
1524
1524
{
1525
1525
appendStringInfoChar (buf ,'(' );
1526
1526
get_rule_expr ((Node * )lfirst (expr -> args ),context );
1527
1527
appendStringInfo (buf ," ISNULL)" );
1528
1528
return ;
1529
1529
}
1530
- if (! strcmp (proname ,"nonnullvalue" ))
1530
+ if (strcmp (proname ,"nonnullvalue" )== 0 )
1531
1531
{
1532
1532
appendStringInfoChar (buf ,'(' );
1533
1533
get_rule_expr ((Node * )lfirst (expr -> args ),context );