@ -92,6 +92,8 @@ static Expr *make_distinct_op(ParseState *pstate, List *opname,
* function argument to the required type ( via coerce_type ( ) )
* function argument to the required type ( via coerce_type ( ) )
* can apply transformExpr to an already - transformed subexpression .
* can apply transformExpr to an already - transformed subexpression .
* An example here is " SELECT count(*) + 1.0 FROM table " .
* An example here is " SELECT count(*) + 1.0 FROM table " .
* 3. CREATE TABLE t1 ( LIKE t2 INCLUDING INDEXES ) can pass in
* already - transformed index expressions .
* While it might be possible to eliminate these cases , the path of
* While it might be possible to eliminate these cases , the path of
* least resistance so far has been to ensure that transformExpr ( ) does
* least resistance so far has been to ensure that transformExpr ( ) does
* no damage if applied to an already - transformed tree . This is pretty
* no damage if applied to an already - transformed tree . This is pretty
@ -1775,11 +1777,17 @@ transformArrayExpr(ParseState *pstate, A_ArrayExpr *a,
static Node *
static Node *
transformRowExpr ( ParseState * pstate , RowExpr * r )
transformRowExpr ( ParseState * pstate , RowExpr * r )
{
{
RowExpr * newr = makeNode ( RowExpr ) ;
RowExpr * newr ;
char fname [ 16 ] ;
char fname [ 16 ] ;
int fnum ;
int fnum ;
ListCell * lc ;
ListCell * lc ;
/* If we already transformed this node, do nothing */
if ( OidIsValid ( r - > row_typeid ) )
return ( Node * ) r ;
newr = makeNode ( RowExpr ) ;
/* Transform the field expressions */
/* Transform the field expressions */
newr - > args = transformExpressionList ( pstate , r - > args , pstate - > p_expr_kind ) ;
newr - > args = transformExpressionList ( pstate , r - > args , pstate - > p_expr_kind ) ;
@ -1880,16 +1888,23 @@ transformMinMaxExpr(ParseState *pstate, MinMaxExpr *m)
static Node *
static Node *
transformXmlExpr ( ParseState * pstate , XmlExpr * x )
transformXmlExpr ( ParseState * pstate , XmlExpr * x )
{
{
XmlExpr * newx = makeNode ( XmlExpr ) ;
XmlExpr * newx ;
ListCell * lc ;
ListCell * lc ;
int i ;
int i ;
/* If we already transformed this node, do nothing */
if ( OidIsValid ( x - > type ) )
return ( Node * ) x ;
newx = makeNode ( XmlExpr ) ;
newx - > op = x - > op ;
newx - > op = x - > op ;
if ( x - > name )
if ( x - > name )
newx - > name = map_sql_identifier_to_xml_name ( x - > name , false , false ) ;
newx - > name = map_sql_identifier_to_xml_name ( x - > name , false , false ) ;
else
else
newx - > name = NULL ;
newx - > name = NULL ;
newx - > xmloption = x - > xmloption ;
newx - > xmloption = x - > xmloption ;
newx - > type = XMLOID ; /* this just marks the node as transformed */
newx - > typmod = - 1 ;
newx - > location = x - > location ;
newx - > location = x - > location ;
/*
/*