forked from mysql/mysql-server
-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #236 from PeterWeiWang/mysql-8.0.25-olap-kp
support for parallel queries
- Loading branch information
Showing
93 changed files
with
44,261 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# Tests in this file are disabled for --pq debug test. | ||
auth_sec.server_withssl_client_withssl : BUG#000 origin code failed |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# Tests in this file are disabled for --pq test. | ||
innodb.innodb_buffer_pool_resize : BUG#000 origin code failed | ||
innodb.innodb_buffer_pool_resize_with_chunks : BUG#000 origin code failed | ||
main.mysql_load_data_local_dir : BUG#000 origin code failed | ||
main.mtr_unit_tests : BUG#000 origin code failed | ||
main.dd_pfs : BUG#000 origin code failed | ||
main.file_contents : BUG#000 origin code failed | ||
main.read_only_ddl : BUG#000 origin code failed | ||
secondary_engine.cost_threshold : BUG#000 origin code failed | ||
sys_vars.innodb_buffer_pool_size_basic : BUG#000 origin code failed | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# Tests in this file are disabled for ASAN runs in pushbuild. | ||
# This is in addition to tests disabled by normal disabled.def files | ||
parallel_query.pq_demon : BUG#194 skip example | ||
innodb.lock_contention : BUG#000 DEBUG_SYNC | ||
perfschema.table_aggregate_hist_2u_2t : BUG#245 PFS | ||
perfschema.table_aggregate_global_4u_3t : BUG#245 PFS | ||
perfschema.misc : BUG#245 PFS | ||
perfschema.table_aggregate_global_2u_2t : BUG#245 PFS | ||
main.events_1 : BUG#255 EVENT DATETIME | ||
main.range_with_memory_limit : BUG#258 ANALYZE_TABLE | ||
main.filesort_debug : BUG#254 DEBUG_SYNC | ||
main.events_bugs : Bug#39863 events_bugs | ||
main.events_1 : BUG#255 EVENT DATETIME | ||
main.kill_debug : BUG#291 issue-291 DEBUG_EXE | ||
main.mysql_client_test : BUG#293 issue-293 PTHREAD_JOIN | ||
perfschema.idx_compare_ees_by_thread_by_error : BUG#294 issue-294 PFS |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
if ($PQ_TEST) | ||
{ | ||
--skip cannot run in '--pq' option | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
if (!$PQ_TEST) | ||
{ | ||
--skip Test needs '--pq' option | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
if (!$PQ_TEST) | ||
{ | ||
--skip Test needs '--pq' option | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,116 @@ | ||
create table t1(id int, a varchar(10)); | ||
insert into t1 values(1, 'aa'), (2, 'bb'); | ||
set @saved_force_parallel_execute = @@force_parallel_execute; | ||
set session force_parallel_execute = 1; | ||
explain select * from t1 limit 1; | ||
id select_type table partitions type possible_keys key key_len ref rows filtered Extra | ||
1 SIMPLE <gather2> NULL ALL NULL NULL NULL NULL 2 100.00 Parallel execute (1 workers) | ||
2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 2 100.00 NULL | ||
Warnings: | ||
Note 1003 /* select#1 */ select `test`.`t1`.`id` AS `id`,`test`.`t1`.`a` AS `a` from `test`.`t1` limit 1 | ||
select * from t1 limit 1; | ||
id a | ||
1 aa | ||
show status like "PQ_memory_used"; | ||
Variable_name Value | ||
PQ_memory_used 0 | ||
set session debug=""; | ||
set session debug="+d, dup_thd_abort"; | ||
explain select * from t1 limit 1; | ||
ERROR HY000: Failed to parallel execute. this SQL is not supported. | ||
select * from t1 limit 1; | ||
ERROR HY000: Failed to parallel execute. this SQL is not supported. | ||
show status like "PQ_memory_used"; | ||
Variable_name Value | ||
PQ_memory_used 0 | ||
set session debug=""; | ||
set session debug="+d, dup_join_abort"; | ||
explain select * from t1 limit 1; | ||
ERROR HY000: Failed to parallel execute. this SQL is not supported. | ||
select * from t1 limit 1; | ||
ERROR HY000: Failed to parallel execute. this SQL is not supported. | ||
show status like "PQ_memory_used"; | ||
Variable_name Value | ||
PQ_memory_used 0 | ||
set session debug=""; | ||
set session debug="+d, dup_select_abort1"; | ||
explain select * from t1 limit 1; | ||
ERROR HY000: Failed to parallel execute. this SQL is not supported. | ||
select * from t1 limit 1; | ||
ERROR HY000: Failed to parallel execute. this SQL is not supported. | ||
show status like "PQ_memory_used"; | ||
Variable_name Value | ||
PQ_memory_used 0 | ||
set session debug=""; | ||
set session debug="+d, dup_select_abort2"; | ||
explain select * from t1 limit 1; | ||
ERROR HY000: Failed to parallel execute. this SQL is not supported. | ||
select * from t1 limit 1; | ||
ERROR HY000: Failed to parallel execute. this SQL is not supported. | ||
show status like "PQ_memory_used"; | ||
Variable_name Value | ||
PQ_memory_used 0 | ||
set session debug="+d, pq_leader_abort1"; | ||
explain select * from t1 limit 1; | ||
ERROR HY000: Failed to parallel execute. this SQL is not supported. | ||
select * from t1 limit 1; | ||
ERROR HY000: Failed to parallel execute. this SQL is not supported. | ||
show status like "PQ_memory_used"; | ||
Variable_name Value | ||
PQ_memory_used 0 | ||
set session debug=""; | ||
set session debug="+d, pq_leader_abort2"; | ||
explain select * from t1 limit 1; | ||
ERROR HY000: Failed to parallel execute. this SQL is not supported. | ||
select * from t1 limit 1; | ||
ERROR HY000: Failed to parallel execute. this SQL is not supported. | ||
show status like "PQ_memory_used"; | ||
Variable_name Value | ||
PQ_memory_used 0 | ||
set session debug=""; | ||
explain select * from t1 limit 1; | ||
id select_type table partitions type possible_keys key key_len ref rows filtered Extra | ||
1 SIMPLE <gather2> NULL ALL NULL NULL NULL NULL 2 100.00 Parallel execute (1 workers) | ||
2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 2 100.00 NULL | ||
Warnings: | ||
Note 1003 /* select#1 */ select `test`.`t1`.`id` AS `id`,`test`.`t1`.`a` AS `a` from `test`.`t1` limit 1 | ||
select * from t1 limit 1; | ||
id a | ||
1 aa | ||
show status like "PQ_memory_used"; | ||
Variable_name Value | ||
PQ_memory_used 0 | ||
drop table t1; | ||
CREATE TABLE t1(f1 INT, f2 INT); | ||
INSERT INTO t1 VALUES | ||
(1,1),(2,2),(3,3); | ||
CREATE TABLE t2(f1 INT NOT NULL, f2 INT NOT NULL, f3 CHAR(200), KEY(f1, f2)); | ||
INSERT INTO t2 VALUES | ||
(1,1, 'qwerty'),(1,2, 'qwerty'),(1,3, 'qwerty'), | ||
(2,1, 'qwerty'),(2,2, 'qwerty'),(2,3, 'qwerty'), (2,4, 'qwerty'),(2,5, 'qwerty'), | ||
(3,1, 'qwerty'),(3,4, 'qwerty'), | ||
(4,1, 'qwerty'),(4,2, 'qwerty'),(4,3, 'qwerty'), (4,4, 'qwerty'), | ||
(1,1, 'qwerty'),(1,2, 'qwerty'),(1,3, 'qwerty'), | ||
(2,1, 'qwerty'),(2,2, 'qwerty'),(2,3, 'qwerty'), (2,4, 'qwerty'),(2,5, 'qwerty'), | ||
(3,1, 'qwerty'),(3,4, 'qwerty'), | ||
(4,1, 'qwerty'),(4,2, 'qwerty'),(4,3, 'qwerty'), (4,4, 'qwerty'); | ||
CREATE TABLE t3 (f1 INT NOT NULL, f2 INT, f3 VARCHAR(32), | ||
PRIMARY KEY(f1), KEY f2_idx(f1), KEY f3_idx(f3)); | ||
INSERT INTO t3 VALUES | ||
(1, 1, 'qwerty'), (2, 1, 'ytrewq'), | ||
(3, 2, 'uiop'), (4, 2, 'poiu'), (5, 2, 'lkjh'), | ||
(6, 2, 'uiop'), (7, 2, 'poiu'), (8, 2, 'lkjh'), | ||
(9, 2, 'uiop'), (10, 2, 'poiu'), (11, 2, 'lkjh'), | ||
(12, 2, 'uiop'), (13, 2, 'poiu'), (14, 2, 'lkjh'); | ||
INSERT INTO t3 SELECT f1 + 20, f2, f3 FROM t3; | ||
INSERT INTO t3 SELECT f1 + 40, f2, f3 FROM t3; | ||
SELECT /*+ BKA() */ t2.f1, t2.f2, t2.f3 FROM t1,t2 | ||
WHERE t1.f1=t2.f1 AND t2.f2 BETWEEN t1.f1 and t1.f2 and t2.f2 + 1 >= t1.f1 + 1; | ||
f1 f2 f3 | ||
1 1 qwerty | ||
2 2 qwerty | ||
1 1 qwerty | ||
2 2 qwerty | ||
drop table t1, t2, t3; | ||
set session force_parallel_execute = @saved_force_parallel_execute; | ||
# restart |
34 changes: 34 additions & 0 deletions
34
mysql-test/suite/parallel_query/r/pq_aggr_no_record.result-pq
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# check aggregation when innodb return zero line | ||
CREATE TABLE records_in_range_test ( | ||
c1 VARCHAR(16), | ||
c2 VARCHAR(512), | ||
PRIMARY KEY (c1) | ||
) ENGINE=INNODB; | ||
INSERT INTO records_in_range_test VALUES | ||
('ccc', REPEAT('v', 512)), | ||
('kkk01', REPEAT('v', 512)), | ||
('kkk02', REPEAT('v', 512)), | ||
('kkk03', REPEAT('v', 512)), | ||
('kkk04', REPEAT('v', 512)), | ||
('kkk05', REPEAT('v', 512)), | ||
('kkk06', REPEAT('v', 512)), | ||
('kkk07', REPEAT('v', 512)), | ||
('kkk08', REPEAT('v', 512)), | ||
('mmm', REPEAT('v', 512)), | ||
('nnn', REPEAT('v', 512)), | ||
('uuu01', REPEAT('v', 512)), | ||
('uuu02', REPEAT('v', 512)), | ||
('uuu03', REPEAT('v', 512)), | ||
('uuu04', REPEAT('v', 512)), | ||
('uuu05', REPEAT('v', 512)), | ||
('uuu06', REPEAT('v', 512)), | ||
('uuu07', REPEAT('v', 512)), | ||
('uuu08', REPEAT('v', 512)), | ||
('xxx', REPEAT('v', 512)); | ||
SELECT COUNT(*) FROM records_in_range_test WHERE c1 < 'ccc'; | ||
COUNT(*) | ||
0 | ||
SELECT COUNT(*) FROM records_in_range_test WHERE c1 < 'xxx'; | ||
COUNT(*) | ||
19 | ||
drop table records_in_range_test; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
create database pq_test; | ||
use pq_test; | ||
DROP TABLE IF EXISTS t1; | ||
CREATE TABLE t2(d varchar(17) PRIMARY KEY) ENGINE=innodb DEFAULT CHARSET=utf8; | ||
Warnings: | ||
Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. | ||
CREATE TABLE t3(a int PRIMARY KEY) ENGINE=innodb; | ||
INSERT INTO t3 VALUES (22),(44),(33),(55),(66); | ||
INSERT INTO t2 VALUES ('jejdkrun87'),('adfd72nh9k'), ('adfdpplkeock'),('adfdijnmnb78k'),('adfdijn0loKNHJik'); | ||
CREATE TABLE t1(a int, b blob, c text, d text NOT NULL) ENGINE=innodb DEFAULT CHARSET=utf8 STATS_PERSISTENT=0; | ||
Warnings: | ||
Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. | ||
INSERT INTO t1 SELECT a,LEFT(REPEAT(d,100*a),65535),REPEAT(d,20*a),d FROM t2,t3 order by a, d; | ||
DROP TABLE t2, t3; | ||
DELETE FROM t1 WHERE d='null'; | ||
DELETE FROM t1 WHERE a%2; | ||
CHECK TABLE t1; | ||
Table Op Msg_type Msg_text | ||
pq_test.t1 check status OK | ||
ALTER TABLE t1 ADD PRIMARY KEY (a,b(255),c(255)), ADD KEY (b(767)); | ||
set force_parallel_execute=1; | ||
set parallel_cost_threshold=0; | ||
SELECT COUNT(*) FROM t1 WHERE a=44; | ||
COUNT(*) | ||
5 | ||
drop table pq_test.t1; | ||
drop database pq_test; |
Oops, something went wrong.