diff --git a/contrib/babelfishpg_tds/src/backend/tds/tdsresponse.c b/contrib/babelfishpg_tds/src/backend/tds/tdsresponse.c index b0e4c3a20c..7de75e43be 100644 --- a/contrib/babelfishpg_tds/src/backend/tds/tdsresponse.c +++ b/contrib/babelfishpg_tds/src/backend/tds/tdsresponse.c @@ -705,7 +705,7 @@ resolve_numeric_typmod_from_exp(Plan *plan, Node *expr) outerplan = outerPlan(plan); /* If this var referes to tuple returned by its outer plan then find the original tle from it */ - if (plan && outerplan && (IsA(outerplan, Gather) || IsA(plan, Gather))) + if (plan != NULL && var->varno == OUTER_VAR) { Assert(plan); Assert(outerplan); @@ -718,7 +718,7 @@ resolve_numeric_typmod_from_exp(Plan *plan, Node *expr) // { // Assert(plan); // return (resolve_numeric_typmod_outer_var(plan, var->varattno)); - // } // if gather node then + // } // if gather node then // outerplan = outerPlan(plan); // Assert(outerplan); // tle = get_tle_by_resno(outerplan->targetlist, var->varattno); @@ -1962,8 +1962,6 @@ PrepareRowDescription(TupleDesc typeinfo, PlannedStmt *plannedstmt, List *target /* * Get the IO function info from our type cache */ - if (atttypmod == TSQLMaxTypmod) - atttypmod = -1; finfo = TdsLookupTypeFunctionsByOid(atttypid, &atttypmod); /* atttypid = getBaseTypeAndTypmod(atttypid, &atttypmod); */ #if 0