COPY_NODE_FIELD(arg);
COPY_SCALAR_FIELD(nulltesttype);
COPY_SCALAR_FIELD(argisrow);
+ COPY_LOCATION_FIELD(location);
return newnode;
}
COPY_NODE_FIELD(arg);
COPY_SCALAR_FIELD(booltesttype);
+ COPY_LOCATION_FIELD(location);
return newnode;
}
COMPARE_NODE_FIELD(arg);
COMPARE_SCALAR_FIELD(nulltesttype);
COMPARE_SCALAR_FIELD(argisrow);
+ COMPARE_LOCATION_FIELD(location);
return true;
}
{
COMPARE_NODE_FIELD(arg);
COMPARE_SCALAR_FIELD(booltesttype);
+ COMPARE_LOCATION_FIELD(location);
return true;
}
}
break;
case T_NullTest:
- /* just use argument's location */
- loc = exprLocation((Node *) ((const NullTest *) expr)->arg);
+ {
+ const NullTest *nexpr = (const NullTest *) expr;
+
+ /* Much as above */
+ loc = leftmostLoc(nexpr->location,
+ exprLocation((Node *) nexpr->arg));
+ }
break;
case T_BooleanTest:
- /* just use argument's location */
- loc = exprLocation((Node *) ((const BooleanTest *) expr)->arg);
+ {
+ const BooleanTest *bexpr = (const BooleanTest *) expr;
+
+ /* Much as above */
+ loc = leftmostLoc(bexpr->location,
+ exprLocation((Node *) bexpr->arg));
+ }
break;
case T_CoerceToDomain:
{
WRITE_NODE_FIELD(arg);
WRITE_ENUM_FIELD(nulltesttype, NullTestType);
WRITE_BOOL_FIELD(argisrow);
+ WRITE_LOCATION_FIELD(location);
}
static void
WRITE_NODE_FIELD(arg);
WRITE_ENUM_FIELD(booltesttype, BoolTestType);
+ WRITE_LOCATION_FIELD(location);
}
static void
READ_NODE_FIELD(arg);
READ_ENUM_FIELD(nulltesttype, NullTestType);
READ_BOOL_FIELD(argisrow);
+ READ_LOCATION_FIELD(location);
READ_DONE();
}
READ_NODE_FIELD(arg);
READ_ENUM_FIELD(booltesttype, BoolTestType);
+ READ_LOCATION_FIELD(location);
READ_DONE();
}
ntest->arg = copyObject(mminfo->target);
/* we checked it wasn't a rowtype in find_minmax_aggs_walker */
ntest->argisrow = false;
+ ntest->location = -1;
/* User might have had that in WHERE already */
if (!list_member((List *) parse->jointree->quals, ntest))
newexpr->nulltesttype = (expr->nulltesttype == IS_NULL ?
IS_NOT_NULL : IS_NULL);
newexpr->argisrow = expr->argisrow;
+ newexpr->location = expr->location;
return (Node *) newexpr;
}
}
(int) expr->booltesttype);
break;
}
+ newexpr->location = expr->location;
return (Node *) newexpr;
}
break;
newntest->arg = (Expr *) relem;
newntest->nulltesttype = ntest->nulltesttype;
newntest->argisrow = type_is_rowtype(exprType(relem));
+ newntest->location = ntest->location;
newargs = lappend(newargs, newntest);
}
/* If all the inputs were constants, result is TRUE */
newntest->arg = (Expr *) arg;
newntest->nulltesttype = ntest->nulltesttype;
newntest->argisrow = ntest->argisrow;
+ newntest->location = ntest->location;
return (Node *) newntest;
}
case T_BooleanTest:
newbtest = makeNode(BooleanTest);
newbtest->arg = (Expr *) arg;
newbtest->booltesttype = btest->booltesttype;
+ newbtest->location = btest->location;
return (Node *) newbtest;
}
case T_PlaceHolderVar:
0);
ntest->nulltesttype = IS_NOT_NULL;
ntest->argisrow = type_is_rowtype(att->atttypid);
+ ntest->location = -1;
result = lappend(result, ntest);
}
}
NullTest *n = makeNode(NullTest);
n->arg = (Expr *) $1;
n->nulltesttype = IS_NULL;
+ n->location = @2;
$$ = (Node *)n;
}
| a_expr ISNULL
NullTest *n = makeNode(NullTest);
n->arg = (Expr *) $1;
n->nulltesttype = IS_NULL;
+ n->location = @2;
$$ = (Node *)n;
}
| a_expr IS NOT NULL_P %prec IS
NullTest *n = makeNode(NullTest);
n->arg = (Expr *) $1;
n->nulltesttype = IS_NOT_NULL;
+ n->location = @2;
$$ = (Node *)n;
}
| a_expr NOTNULL
NullTest *n = makeNode(NullTest);
n->arg = (Expr *) $1;
n->nulltesttype = IS_NOT_NULL;
+ n->location = @2;
$$ = (Node *)n;
}
| row OVERLAPS row
BooleanTest *b = makeNode(BooleanTest);
b->arg = (Expr *) $1;
b->booltesttype = IS_TRUE;
+ b->location = @2;
$$ = (Node *)b;
}
| a_expr IS NOT TRUE_P %prec IS
BooleanTest *b = makeNode(BooleanTest);
b->arg = (Expr *) $1;
b->booltesttype = IS_NOT_TRUE;
+ b->location = @2;
$$ = (Node *)b;
}
| a_expr IS FALSE_P %prec IS
BooleanTest *b = makeNode(BooleanTest);
b->arg = (Expr *) $1;
b->booltesttype = IS_FALSE;
+ b->location = @2;
$$ = (Node *)b;
}
| a_expr IS NOT FALSE_P %prec IS
BooleanTest *b = makeNode(BooleanTest);
b->arg = (Expr *) $1;
b->booltesttype = IS_NOT_FALSE;
+ b->location = @2;
$$ = (Node *)b;
}
| a_expr IS UNKNOWN %prec IS
BooleanTest *b = makeNode(BooleanTest);
b->arg = (Expr *) $1;
b->booltesttype = IS_UNKNOWN;
+ b->location = @2;
$$ = (Node *)b;
}
| a_expr IS NOT UNKNOWN %prec IS
BooleanTest *b = makeNode(BooleanTest);
b->arg = (Expr *) $1;
b->booltesttype = IS_NOT_UNKNOWN;
+ b->location = @2;
$$ = (Node *)b;
}
| a_expr IS DISTINCT FROM a_expr %prec IS
NullTest *n = makeNode(NullTest);
n->nulltesttype = IS_NULL;
+ n->location = a->location;
if (exprIsNullConstant(lexpr))
n->arg = (Expr *) rexpr;
invqual = makeNode(BooleanTest);
invqual->arg = (Expr *) qual;
invqual->booltesttype = IS_NOT_TRUE;
+ invqual->location = -1;
AddQual(parsetree, (Node *) invqual);
}
*/
/* yyyymmddN */
-#define CATALOG_VERSION_NO 201502191
+#define CATALOG_VERSION_NO 201502221
#endif
Expr *arg; /* input expression */
NullTestType nulltesttype; /* IS NULL, IS NOT NULL */
bool argisrow; /* T if input is of a composite type */
+ int location; /* token location, or -1 if unknown */
} NullTest;
/*
Expr xpr;
Expr *arg; /* input expression */
BoolTestType booltesttype; /* test type */
+ int location; /* token location, or -1 if unknown */
} BooleanTest;
/*