[MDEV-18974] Result difference with --embedded --ps-protocol Created: 2019-03-20  Updated: 2019-04-01  Resolved: 2019-04-01

Status: Closed
Project: MariaDB Server
Component/s: Protocol, Tests
Affects Version/s: 10.4
Fix Version/s: 10.4.4

Type: Bug Priority: Major
Reporter: Marko Mäkelä Assignee: Marko Mäkelä
Resolution: Fixed Votes: 0
Labels: None

Issue Links:
Relates
relates to MDEV-15945 --ps-protocol does not test some queries Closed

 Description   

After a merge of 10.3 117291db8b35ddb4cd8c89ee4d8de888160b7163 to 10.4, the following tests would fail when running with --ps-protocol:

CURRENT_TEST: archive.rnd_pos
--- /mariadb/10.4m/mysql-test/suite/archive/rnd_pos.result	2019-03-20 09:43:25.226868080 +0200
+++ /mariadb/10.4m/mysql-test/suite/archive/rnd_pos.reject	2019-03-20 10:11:19.318393810 +0200
@@ -23,7 +23,7 @@
 set max_length_for_sort_data = default;
 show status where variable_name like '%tmp%' and value != 0;
 Variable_name	Value
-Created_tmp_tables	1
+Created_tmp_tables	2
 Handler_tmp_write	10
 Rows_tmp_read	20
 alter table t1 partition by hash (c1) partitions 3;
@@ -50,7 +50,7 @@
 set max_length_for_sort_data = default;
 show status where variable_name like '%tmp%' and value != 0;
 Variable_name	Value
-Created_tmp_tables	1
+Created_tmp_tables	2
 Handler_tmp_write	10
 Rows_tmp_read	20
 drop table t1;
 
mysqltest: Result content mismatch
--- /mariadb/10.4m/mysql-test/main/profiling.result	2019-03-20 09:43:25.126866180 +0200
+++ /mariadb/10.4m/mysql-test/main/profiling.reject	2019-03-20 10:11:02.058449801 +0200
@@ -133,36 +133,36 @@
 insert into t3 values (1), (2), (3);
 show profiles;
 Query_ID	Duration	Query
-10	#	insert into t1 select * from t1
-11	#	select count(*) from t1
-12	#	insert into t1 select * from t1
-13	#	insert into t1 select * from t1
-14	#	insert into t1 select * from t1
-15	#	select count(*) from t1
-16	#	insert into t1 select * from t1
-17	#	insert into t1 select * from t1
-18	#	insert into t1 select * from t1
-19	#	select count(*) from t1
-20	#	select sum(a) from t1
-21	#	select sum(a) from t1 group by b
-22	#	select sum(a) + sum(b) from t1 group by b
-23	#	select max(x) from (select sum(a) as x from t1 group by b) as teeone
-24	#	select '0123456789001234567890012345678900123456789001234567890012345678900123456789001234567890012345678900123456789001234567890012345678900123456789001234567890012345678900123456789001234567890012345678900123456789001234567890012345678900123456789001234567890012345678900123456789001234567890012345
-25	#	select * from information_schema.profiling
-26	#	select query_id, state, duration from information_schema.profiling
-27	#	select query_id, sum(duration) from information_schema.profiling group by query_id
-28	#	select query_id, count(*) from information_schema.profiling group by query_id
-29	#	select sum(duration) from information_schema.profiling
-30	#	select query_id, count(*), sum(duration) from information_schema.profiling group by query_id
-31	#	select CPU_user, CPU_system, Context_voluntary, Context_involuntary, Block_ops_in, Block_ops_out, Messages_sent, Messages_received, Page_faults_major, Page_faults_minor, Swaps, Source_function, Source_file, Source_line from information_schema.profiling
-32	#	drop table if exists t1, t2, t3
-33	#	SHOW WARNINGS
-34	#	create table t1 (id int )
-35	#	create table t2 (id int not null)
-36	#	create table t3 (id int not null primary key)
-37	#	insert into t1 values (1), (2), (3)
-38	#	insert into t2 values (1), (2), (3)
-39	#	insert into t3 values (1), (2), (3)
+25	#	show profile for query 15
+26	#	show profile cpu for query 15
+27	#	show profile cpu, block io for query 15
+28	#	show profile cpu for query 9 limit 2 offset 2
+29	#	show profile cpu for query 10 limit 0
+30	#	show profile cpu for query 65534
+31	#	show profile memory
+32	#	show profile block io
+33	#	show profile context switches
+34	#	show profile page faults
+35	#	show profile ipc
+36	#	show profile swaps limit 1 offset 2
+37	#	show profile source
+38	#	show profile all for query 0 limit 0
+39	#	show profile all for query 15
+40	#	select * from information_schema.profiling
+41	#	select query_id, state, duration from information_schema.profiling
+42	#	select query_id, sum(duration) from information_schema.profiling group by query_id
+43	#	select query_id, count(*) from information_schema.profiling group by query_id
+44	#	select sum(duration) from information_schema.profiling
+45	#	select query_id, count(*), sum(duration) from information_schema.profiling group by query_id
+46	#	select CPU_user, CPU_system, Context_voluntary, Context_involuntary, Block_ops_in, Block_ops_out, Messages_sent, Messages_received, Page_faults_major, Page_faults_minor, Swaps, Source_function, Source_file, Source_line from information_schema.profiling
+47	#	drop table if exists t1, t2, t3
+48	#	SHOW WARNINGS
+49	#	create table t1 (id int )
+50	#	create table t2 (id int not null)
+51	#	create table t3 (id int not null primary key)
+52	#	insert into t1 values (1), (2), (3)
+53	#	insert into t2 values (1), (2), (3)
+54	#	insert into t3 values (1), (2), (3)
 select * from t1;
 id
 1
@@ -170,36 +170,36 @@
 3
 show profiles;
 Query_ID	Duration	Query
-11	#	select count(*) from t1
-12	#	insert into t1 select * from t1
-13	#	insert into t1 select * from t1
-14	#	insert into t1 select * from t1
-15	#	select count(*) from t1
-16	#	insert into t1 select * from t1
-17	#	insert into t1 select * from t1
-18	#	insert into t1 select * from t1
-19	#	select count(*) from t1
-20	#	select sum(a) from t1
-21	#	select sum(a) from t1 group by b
-22	#	select sum(a) + sum(b) from t1 group by b
-23	#	select max(x) from (select sum(a) as x from t1 group by b) as teeone
-24	#	select '0123456789001234567890012345678900123456789001234567890012345678900123456789001234567890012345678900123456789001234567890012345678900123456789001234567890012345678900123456789001234567890012345678900123456789001234567890012345678900123456789001234567890012345678900123456789001234567890012345
-25	#	select * from information_schema.profiling
-26	#	select query_id, state, duration from information_schema.profiling
-27	#	select query_id, sum(duration) from information_schema.profiling group by query_id
-28	#	select query_id, count(*) from information_schema.profiling group by query_id
-29	#	select sum(duration) from information_schema.profiling
-30	#	select query_id, count(*), sum(duration) from information_schema.profiling group by query_id
-31	#	select CPU_user, CPU_system, Context_voluntary, Context_involuntary, Block_ops_in, Block_ops_out, Messages_sent, Messages_received, Page_faults_major, Page_faults_minor, Swaps, Source_function, Source_file, Source_line from information_schema.profiling
-32	#	drop table if exists t1, t2, t3
-33	#	SHOW WARNINGS
-34	#	create table t1 (id int )
-35	#	create table t2 (id int not null)
-36	#	create table t3 (id int not null primary key)
-37	#	insert into t1 values (1), (2), (3)
-38	#	insert into t2 values (1), (2), (3)
-39	#	insert into t3 values (1), (2), (3)
-40	#	select * from t1
+26	#	show profile cpu for query 15
+27	#	show profile cpu, block io for query 15
+28	#	show profile cpu for query 9 limit 2 offset 2
+29	#	show profile cpu for query 10 limit 0
+30	#	show profile cpu for query 65534
+31	#	show profile memory
+32	#	show profile block io
+33	#	show profile context switches
+34	#	show profile page faults
+35	#	show profile ipc
+36	#	show profile swaps limit 1 offset 2
+37	#	show profile source
+38	#	show profile all for query 0 limit 0
+39	#	show profile all for query 15
+40	#	select * from information_schema.profiling
+41	#	select query_id, state, duration from information_schema.profiling
+42	#	select query_id, sum(duration) from information_schema.profiling group by query_id
+43	#	select query_id, count(*) from information_schema.profiling group by query_id
+44	#	select sum(duration) from information_schema.profiling
+45	#	select query_id, count(*), sum(duration) from information_schema.profiling group by query_id
+46	#	select CPU_user, CPU_system, Context_voluntary, Context_involuntary, Block_ops_in, Block_ops_out, Messages_sent, Messages_received, Page_faults_major, Page_faults_minor, Swaps, Source_function, Source_file, Source_line from information_schema.profiling
+47	#	drop table if exists t1, t2, t3
+48	#	SHOW WARNINGS
+49	#	create table t1 (id int )
+50	#	create table t2 (id int not null)
+51	#	create table t3 (id int not null primary key)
+52	#	insert into t1 values (1), (2), (3)
+53	#	insert into t2 values (1), (2), (3)
+54	#	insert into t3 values (1), (2), (3)
+55	#	select * from t1
 This ^^ should end in "select * from t1;"
 delete from t1;
 insert into t1 values (1), (2), (3);
@@ -214,72 +214,72 @@
 3
 show profiles;
 Query_ID	Duration	Query
-15	#	select count(*) from t1
-16	#	insert into t1 select * from t1
-17	#	insert into t1 select * from t1
-18	#	insert into t1 select * from t1
-19	#	select count(*) from t1
-20	#	select sum(a) from t1
-21	#	select sum(a) from t1 group by b
-22	#	select sum(a) + sum(b) from t1 group by b
-23	#	select max(x) from (select sum(a) as x from t1 group by b) as teeone
-24	#	select '0123456789001234567890012345678900123456789001234567890012345678900123456789001234567890012345678900123456789001234567890012345678900123456789001234567890012345678900123456789001234567890012345678900123456789001234567890012345678900123456789001234567890012345678900123456789001234567890012345
-25	#	select * from information_schema.profiling
-26	#	select query_id, state, duration from information_schema.profiling
-27	#	select query_id, sum(duration) from information_schema.profiling group by query_id
-28	#	select query_id, count(*) from information_schema.profiling group by query_id
-29	#	select sum(duration) from information_schema.profiling
-30	#	select query_id, count(*), sum(duration) from information_schema.profiling group by query_id
-31	#	select CPU_user, CPU_system, Context_voluntary, Context_involuntary, Block_ops_in, Block_ops_out, Messages_sent, Messages_received, Page_faults_major, Page_faults_minor, Swaps, Source_function, Source_file, Source_line from information_schema.profiling
-32	#	drop table if exists t1, t2, t3
-33	#	SHOW WARNINGS
-34	#	create table t1 (id int )
-35	#	create table t2 (id int not null)
-36	#	create table t3 (id int not null primary key)
-37	#	insert into t1 values (1), (2), (3)
-38	#	insert into t2 values (1), (2), (3)
-39	#	insert into t3 values (1), (2), (3)
-40	#	select * from t1
-41	#	delete from t1
-42	#	insert into t1 values (1), (2), (3)
-43	#	insert into t1 values (1), (2), (3)
-44	#	select * from t1
+30	#	show profile cpu for query 65534
+31	#	show profile memory
+32	#	show profile block io
+33	#	show profile context switches
+34	#	show profile page faults
+35	#	show profile ipc
+36	#	show profile swaps limit 1 offset 2
+37	#	show profile source
+38	#	show profile all for query 0 limit 0
+39	#	show profile all for query 15
+40	#	select * from information_schema.profiling
+41	#	select query_id, state, duration from information_schema.profiling
+42	#	select query_id, sum(duration) from information_schema.profiling group by query_id
+43	#	select query_id, count(*) from information_schema.profiling group by query_id
+44	#	select sum(duration) from information_schema.profiling
+45	#	select query_id, count(*), sum(duration) from information_schema.profiling group by query_id
+46	#	select CPU_user, CPU_system, Context_voluntary, Context_involuntary, Block_ops_in, Block_ops_out, Messages_sent, Messages_received, Page_faults_major, Page_faults_minor, Swaps, Source_function, Source_file, Source_line from information_schema.profiling
+47	#	drop table if exists t1, t2, t3
+48	#	SHOW WARNINGS
+49	#	create table t1 (id int )
+50	#	create table t2 (id int not null)
+51	#	create table t3 (id int not null primary key)
+52	#	insert into t1 values (1), (2), (3)
+53	#	insert into t2 values (1), (2), (3)
+54	#	insert into t3 values (1), (2), (3)
+55	#	select * from t1
+56	#	delete from t1
+57	#	insert into t1 values (1), (2), (3)
+58	#	insert into t1 values (1), (2), (3)
+59	#	select * from t1
 set session profiling = OFF;
 select sum(id) from t1;
 sum(id)
 12
 show profiles;
 Query_ID	Duration	Query
-15	#	select count(*) from t1
-16	#	insert into t1 select * from t1
-17	#	insert into t1 select * from t1
-18	#	insert into t1 select * from t1
-19	#	select count(*) from t1
-20	#	select sum(a) from t1
-21	#	select sum(a) from t1 group by b
-22	#	select sum(a) + sum(b) from t1 group by b
-23	#	select max(x) from (select sum(a) as x from t1 group by b) as teeone
-24	#	select '0123456789001234567890012345678900123456789001234567890012345678900123456789001234567890012345678900123456789001234567890012345678900123456789001234567890012345678900123456789001234567890012345678900123456789001234567890012345678900123456789001234567890012345678900123456789001234567890012345
-25	#	select * from information_schema.profiling
-26	#	select query_id, state, duration from information_schema.profiling
-27	#	select query_id, sum(duration) from information_schema.profiling group by query_id
-28	#	select query_id, count(*) from information_schema.profiling group by query_id
-29	#	select sum(duration) from information_schema.profiling
-30	#	select query_id, count(*), sum(duration) from information_schema.profiling group by query_id
-31	#	select CPU_user, CPU_system, Context_voluntary, Context_involuntary, Block_ops_in, Block_ops_out, Messages_sent, Messages_received, Page_faults_major, Page_faults_minor, Swaps, Source_function, Source_file, Source_line from information_schema.profiling
-32	#	drop table if exists t1, t2, t3
-33	#	SHOW WARNINGS
-34	#	create table t1 (id int )
-35	#	create table t2 (id int not null)
-36	#	create table t3 (id int not null primary key)
-37	#	insert into t1 values (1), (2), (3)
-38	#	insert into t2 values (1), (2), (3)
-39	#	insert into t3 values (1), (2), (3)
-40	#	select * from t1
-41	#	delete from t1
-42	#	insert into t1 values (1), (2), (3)
-43	#	insert into t1 values (1), (2), (3)
-44	#	select * from t1
+30	#	show profile cpu for query 65534
+31	#	show profile memory
+32	#	show profile block io
+33	#	show profile context switches
+34	#	show profile page faults
+35	#	show profile ipc
+36	#	show profile swaps limit 1 offset 2
+37	#	show profile source
+38	#	show profile all for query 0 limit 0
+39	#	show profile all for query 15
+40	#	select * from information_schema.profiling
+41	#	select query_id, state, duration from information_schema.profiling
+42	#	select query_id, sum(duration) from information_schema.profiling group by query_id
+43	#	select query_id, count(*) from information_schema.profiling group by query_id
+44	#	select sum(duration) from information_schema.profiling
+45	#	select query_id, count(*), sum(duration) from information_schema.profiling group by query_id
+46	#	select CPU_user, CPU_system, Context_voluntary, Context_involuntary, Block_ops_in, Block_ops_out, Messages_sent, Messages_received, Page_faults_major, Page_faults_minor, Swaps, Source_function, Source_file, Source_line from information_schema.profiling
+47	#	drop table if exists t1, t2, t3
+48	#	SHOW WARNINGS
+49	#	create table t1 (id int )
+50	#	create table t2 (id int not null)
+51	#	create table t3 (id int not null primary key)
+52	#	insert into t1 values (1), (2), (3)
+53	#	insert into t2 values (1), (2), (3)
+54	#	insert into t3 values (1), (2), (3)
+55	#	select * from t1
+56	#	delete from t1
+57	#	insert into t1 values (1), (2), (3)
+58	#	insert into t1 values (1), (2), (3)
+59	#	select * from t1
 set session profiling = ON;
 select @@profiling;
 @@profiling
 
mysqltest: Result length mismatch

The test main.profiling passes if at most one of --embedded --ps-protocol is specified.
The test archive.rnd_pos fails with --ps-protocol for both the embedded and non-embedded server.



 Comments   
Comment by Marko Mäkelä [ 2019-03-20 ]

My 10.3→10.4 merge included the following changes to temporarily work around this issue:

diff --git a/mysql-test/main/profiling.test b/mysql-test/main/profiling.test
index 1e1aada7c15..912e4f69798 100644
--- a/mysql-test/main/profiling.test
+++ b/mysql-test/main/profiling.test
@@ -60,6 +60,7 @@ select '012345678900123456789001234567890012345678900123456789001234567890012345
 --replace_column 2 #
 show profiles;
 
+--disable_ps_protocol
 --disable_result_log
 ###--replace_column 2 # 3 # 4 #
 show profile for query 15;
@@ -90,6 +91,7 @@ show profile all for query 0 limit 0;
 ###--replace_column 2 # 3 # 4 # 5 # 6 # 7 # 8 # 9 # 10 # 11 # 12 # 13 # 16 #
 show profile all for query 15;
 ###--replace_column 2 # 3 # 4 # 5 # 6 # 7 # 8 # 9 # 10 # 11 # 12 # 13 # 16 #
+--enable_ps_protocol
 
 select * from information_schema.profiling;
 select query_id, state, duration from information_schema.profiling;
diff --git a/mysql-test/suite/archive/rnd_pos.test b/mysql-test/suite/archive/rnd_pos.test
index 7a1d78ea003..8c7a0e16a79 100644
--- a/mysql-test/suite/archive/rnd_pos.test
+++ b/mysql-test/suite/archive/rnd_pos.test
@@ -13,7 +13,9 @@ explain partitions select c1,c3 from t1 order by c2;
 flush status;
 select c1,c3 from t1 order by c2;
 set max_length_for_sort_data = default;
+--disable_ps_protocol
 show status where variable_name like '%tmp%' and value != 0;
+--enable_ps_protocol
 
 alter table t1 partition by hash (c1) partitions 3;
 explain partitions select c1,c3 from t1 order by c2;
@@ -22,6 +24,8 @@ explain partitions select c1,c3 from t1 order by c2;
 flush status;
 select c1,c3 from t1 order by c2;
 set max_length_for_sort_data = default;
+--disable_ps_protocol
 show status where variable_name like '%tmp%' and value != 0;
+--enable_ps_protocol
 
 drop table t1;

Generated at Thu Feb 08 08:48:08 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.