message: properly transform constants if not named
diff: @@ -20,15 +20,12 @@ unique_ptr<PragmaStatement> Transformer::TransformPragma(PGNode *node) {
  for (auto cell = stmt->args->head; cell != nullptr; cell = cell->next) {
  auto node = reinterpret_cast<PGNode *>(cell->data.ptr_value);
  auto expr = TransformExpression(node);
  - if (stmt->kind == PG_PRAGMA_TYPE_CALL) {
  +
  + string name;
  + Value val;
  if (expr->type == ExpressionType::COMPARE_EQUAL) {
  auto &comp = (ComparisonExpression &)*expr;
  - info.named_parameters[comp.left->ToString()] = Value(comp.right->ToString());
  - } else {
  - if (info.named_parameters.size() > 0)
  - throw BinderException("Unnamed parameters cannot come after named parameters");
  - info.parameters.push_back(Value(expr->ToString()));
  - }
  + info.named_parameters[comp.left->ToString()] = comp.right->ToString();
  } else if (node->type == T_PGAConst) {
  auto constant = TransformConstant((PGAConst *)node);
  info.parameters.push_back(((ConstantExpression &)*constant).value);
  @@ -40,7 +37,7 @@ unique_ptr<PragmaStatement> Transformer::TransformPragma(PGNode *node) {
  // now parse the pragma type
  switch (stmt->kind) {
  case PG_PRAGMA_TYPE_NOTHING:
  - if (info.parameters.size() > 0) {
  + if (info.parameters.size() > 0 || info.named_parameters.size() > 0) {
  throw ParserException("PRAGMA statement that is not a call or assignment cannot contain parameters");
  }
  break;
  @@ -48,6 +45,9 @@ unique_ptr<PragmaStatement> Transformer::TransformPragma(PGNode *node) {
  if (info.parameters.size() != 1) {
  throw ParserException("PRAGMA statement with assignment should contain exactly one parameter");
  }
  + if (info.named_parameters.size() > 0) {
  + throw ParserException("PRAGMA statement with assignment cannot have named parameters");
  + }
  break;
  case PG_PRAGMA_TYPE_CALL:
  break;
  