8000 bad planner tree sent to executor in some MULTIEXPR scenario · Issue #7676 · citusdata/citus · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
bad planner tree sent to executor in some MULTIEXPR scenario #7676
Closed
@c2main

Description

@c2main

While working on #7675 I found another bug:

CREATE TABLE test_ref_multiexpr (
    id bigint primary key
  , col_int integer
  , col_bool bool
  , col_text text
  , col_timestamp timestamp
  );
select create_reference_table('test_ref_multiexpr');
 create_reference_table
---------------------------------------------------------------------

(1 row)

insert into test_ref_multiexpr values (1, 1, true, 'one', now());
set client_min_messages to 'DEBUG4';

update test_ref_multiexpr
SET (col_timestamp)
  = (SELECT now())
returning id, col_int, col_bool;

ERROR:  unrecognized paramkind: 3

In citus_clauses.c, citus_evaluate_expr() is based on PostgreSQL executor to evaluate expressions, and (if I understood correctly), it'll execute function on local node before sending to other nodes, so we have the same value (now() being a good example).

The problem is similar to the other bug but at a distinct stage: citus is feeding an executor with an half processed rewriter tree which is not yet a planner tree good enough for being an executor tree. This pramkind:3 error is because in executor we do not handle MULTIEXPR, I think here it should already been computed and flatten.

Using the executor works well overall, I'm still unsure on the "good fix" for this case, as it looks like rewriting this part is essentially what has been avoided by using the executor in the first place...

It's tempting to just use upstream code like it's done in ruleutils, but with clauses.c or setrefs.c or similar upstream code...

Suggestions welcome!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0