Skip to content

[Bug] enable_nereids_planner session variable forward not take effect #26781

@swjtu-zhanglei

Description

@swjtu-zhanglei

Search before asking

  • I had searched in the issues and found no similar issues.

Version

ca47d75 master

What's Wrong?

1、build a fe cluster with 1 master and 1 observer
2、connet the master fe and set global enable_nereids_planner = false (default is true)
3、connect to observer and execute stmts
`create table t1_cte (
id int,
id1 int,
c1 bigint,
c2 string,
c3 double,
c4 date
) unique key (id, id1)
distributed by hash(id, id1)
properties(
"replication_num"="1",
"function_column.sequence_col" = "c4",
"enable_unique_key_merge_on_write" = "true"
);

create table t2_cte (
id int,
c1 bigint,
c2 string,
c3 double,
c4 date
) unique key (id)
distributed by hash(id)
properties(
"replication_num"="1"
);

create table t3_cte (
id int
) distributed by hash(id)
properties(
"replication_num"="1"
);

INSERT INTO t1_cte VALUES
(1, 10, 1, '1', 1.0, '2000-01-01'),
(2, 20, 2, '2', 2.0, '2000-01-02'),
(3, 30, 3, '3', 3.0, '2000-01-03');

INSERT INTO t2_cte VALUES
(1, 10, '10', 10.0, '2000-01-10'),
(2, 20, '20', 20.0, '2000-01-20'),
(3, 30, '30', 30.0, '2000-01-30'),
(4, 4, '4', 4.0, '2000-01-04'),
(5, 5, '5', 5.0, '2000-01-05');

INSERT INTO t3_cte VALUES
(1),
(4),
(5);

set enable_nereids_planner=true;
set enable_fallback_to_original_planner=false;
set enable_nereids_dml=true;

with cte as (select * from t3_cte)
delete from t1_cte
using t2_cte join cte on t2_cte.id = cte.id
where t1_cte.id = t2_cte.id;`

4、the stmt will get error :
`mysql> with cte as (select * from t3_cte)
-> delete from t1_cte
-> using t2_cte join cte on t2_cte.id = cte.id
-> where t1_cte.id = t2_cte.id;
ERROR 1105 (HY000): errCode = 2, detailMessage = Syntax error in line 2:
delete from t1_cte
^
Encountered: DELETE
Expected: COMMA

`

What You Expected?

mysql> with cte as (select * from t3_cte)
-> delete from t1_cte
-> using t2_cte join cte on t2_cte.id = cte.id
-> where t1_cte.id = t2_cte.id;

Query OK, 1 row affected (2.31 sec)
{'label':'label_e937565baa42456c_8ed5554ea7fb8902', 'status':'VISIBLE', 'txnId':'32193964512130048'}

How to Reproduce?

No response

Anything Else?

No response

Are you willing to submit PR?

  • Yes I am willing to submit a PR!

Code of Conduct

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