#include "optimizer/clauses.h"
#include "optimizer/var.h"
#include "parser/parse_clause.h"
+#include "parser/parse_collate.h"
#include "parser/parse_func.h"
#include "parser/parse_relation.h"
#include "parser/parsetree.h"
whenClause = transformWhereClause(pstate,
copyObject(stmt->whenClause),
"WHEN");
+ /* we have to fix its collations too */
+ assign_expr_collations(pstate, whenClause);
/*
* No subplans or aggregates, please
/* take care of the where clause */
if (stmt->whereClause)
+ {
stmt->whereClause = transformWhereClause(pstate,
stmt->whereClause,
"WHERE");
+ /* we have to fix its collations too */
+ assign_expr_collations(pstate, stmt->whereClause);
+ }
/* take care of any index expressions */
foreach(l, stmt->indexParams)
*whereClause = transformWhereClause(pstate,
(Node *) copyObject(stmt->whereClause),
"WHERE");
+ /* we have to fix its collations too */
+ assign_expr_collations(pstate, *whereClause);
if (list_length(pstate->p_rtable) != 2) /* naughty, naughty... */
ereport(ERROR,