3
3
* back to source text
4
4
*
5
5
* IDENTIFICATION
6
- * $PostgreSQL: pgsql/src/backend/utils/adt/ruleutils.c,v 1.179 2004/08/29 05:06:49 momjian Exp $
6
+ * $PostgreSQL: pgsql/src/backend/utils/adt/ruleutils.c,v 1.180 2004/09/01 23:58:38 tgl Exp $
7
7
*
8
8
* This software is copyrighted by Jan Wieck - Hamburg.
9
9
*
@@ -2202,15 +2202,15 @@ get_setop_query(Node *setOp, Query *query, deparse_context *context,
2202
2202
{
2203
2203
case SETOP_UNION :
2204
2204
appendContextKeyword (context , "UNION " ,
2205
- - PRETTYINDENT_STD , 0 , 0 );
2205
+ - PRETTYINDENT_STD , PRETTYINDENT_STD , 0 );
2206
2206
break ;
2207
2207
case SETOP_INTERSECT :
2208
2208
appendContextKeyword (context , "INTERSECT " ,
2209
- - PRETTYINDENT_STD , 0 , 0 );
2209
+ - PRETTYINDENT_STD , PRETTYINDENT_STD , 0 );
2210
2210
break ;
2211
2211
case SETOP_EXCEPT :
2212
2212
appendContextKeyword (context , "EXCEPT " ,
2213
- - PRETTYINDENT_STD , 0 , 0 );
2213
+ - PRETTYINDENT_STD , PRETTYINDENT_STD , 0 );
2214
2214
break ;
2215
2215
default :
2216
2216
elog (ERROR , "unrecognized set op: %d" ,
@@ -2220,7 +2220,7 @@ get_setop_query(Node *setOp, Query *query, deparse_context *context,
2220
2220
appendStringInfo (buf , "ALL " );
2221
2221
2222
2222
if (PRETTY_INDENT (context ))
2223
- appendStringInfoChar ( buf , '\n' );
2223
+ appendContextKeyword ( context , "" , 0 , 0 , 0 );
2224
2224
2225
2225
need_paren = !IsA (op -> rarg , RangeTblRef );
2226
2226
@@ -2869,22 +2869,18 @@ appendContextKeyword(deparse_context *context, const char *str,
2869
2869
if (PRETTY_INDENT (context ))
2870
2870
{
2871
2871
context -> indentLevel += indentBefore ;
2872
- if (context -> indentLevel < 0 )
2873
- context -> indentLevel = 0 ;
2874
2872
2875
2873
appendStringInfoChar (context -> buf , '\n' );
2876
2874
appendStringInfoSpaces (context -> buf ,
2877
- context -> indentLevel + indentPlus );
2878
- }
2879
-
2880
- appendStringInfoString (context -> buf , str );
2875
+ Max (context -> indentLevel , 0 ) + indentPlus );
2876
+ appendStringInfoString (context -> buf , str );
2881
2877
2882
- if (PRETTY_INDENT (context ))
2883
- {
2884
2878
context -> indentLevel += indentAfter ;
2885
2879
if (context -> indentLevel < 0 )
2886
2880
context -> indentLevel = 0 ;
2887
2881
}
2882
+ else
2883
+ appendStringInfoString (context -> buf , str );
2888
2884
}
2889
2885
2890
2886
/*
0 commit comments