-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Closed
Copy link
Description
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:
create table test(id int);
insert into test values(1),(2),(3),(4),(5),(6);
create table test_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 in set (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 in set (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
- I agree to follow this project's Code of Conduct