Skip to content

[Bug] sql_select_limit for INSERT behaves different on master/non-master fe #53354

Description

@dh-cloud

Search before asking

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

Version

2.1.10

What's Wrong?

sql_select_limit for INSERT..SELECT/CREATE TABLE AS SELECT behaves different on master/non-master fe.

On master fe, sql_select_limit can affect the number of inserted rows.
On non-master fe, sql_select_limit does not affect the number of inserted rows.

What You Expected?

No matter master fe or non-masterfe, sql_select_limit should have the same effect for INSERT..SELECT/CREATE TABLE AS SELECT.

How to Reproduce?

run SQLs:

createtabletest(id int);
insert into test values(1),(2),(3),(4),(5),(6);
createtabletest_new(id int);
set sql_select_limit=1;
select*from test;
insert into test_new select*from test;

On master:

mysql>set sql_select_limit=1;
Query OK, 0 rows affected (0.00 sec)
mysql>select*from test;
+------+
| id |
+------+
| 1 |
+------+1 row inset (0.04 sec)
mysql>insert into test_new select*from test;
Query OK, 1 row affected (0.59 sec)
{'label':'label_fdfe0bf2ed284b79_95d186162027f898', 'status':'VISIBLE', 'txnId':'46'}

On non-master fe:

mysql>set sql_select_limit=1;
Query OK, 0 rows affected (0.00 sec)
mysql>select*from test;
+------+
| id |
+------+
| 1 |
+------+1 row inset (0.04 sec)
mysql>insert into test_new select*from test;
Query OK, 6 rows affected (0.67 sec)
{'label':'label_58eb29f33a52411a_a1a2654648bffbe3', 'status':'VISIBLE', 'txnId':'38'}

Anything Else?

No response

Are you willing to submit PR?

  • Yes I am willing to submit a PR!

Code of Conduct

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions