Skip to content

Commit

Permalink
fix Bvt case in issue 14836 (matrixorigin#15914)
Browse files Browse the repository at this point in the history
changes:
1. move op `check statement_info result` to the end of bvt.

Approved by: @heni02
  • Loading branch information
xzxiong authored May 10, 2024
1 parent fb8da32 commit a2036c3
Show file tree
Hide file tree
Showing 10 changed files with 23 additions and 30 deletions.
11 changes: 1 addition & 10 deletions test/distributed/cases/log/query_version.result
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,9 @@ set @ts=now();
select @@version_comment limit 1;
@@version_comment
MatrixOne
select sleep(15) as s;
s
0
use system;
use mysql;
select * from user limit 0;
/* cloud_user */select * from user limit 0;
host user select_priv insert_priv update_priv delete_priv create_priv drop_priv reload_priv shutdown_priv process_priv file_priv grant_priv references_priv index_priv alter_priv show_db_priv super_priv create_tmp_table_priv lock_tables_priv execute_priv repl_slave_priv repl_client_priv create_view_priv show_view_priv create_routine_priv alter_routine_priv create_user_priv event_priv trigger_priv create_tablespace_priv ssl_type ssl_cipher x509_issuer x509_subject max_questions max_updates max_connections max_user_connections plugin authentication_string password_expired password_last_changed password_lifetime account_locked create_role_priv drop_role_priv password_reuse_history password_reuse_time password_require_current user_attributes
select sleep(15) as s;
s
0
select count(1) as cnt, statement_id, statement, status from system.statement_info group by statement_id, statement, status having count(1) > 1;
cnt statement_id statement status
select `database`, `aggr_count` from system.statement_info where statement LIKE '%select * from user limit 0%' order by request_at desc limit 1;
database aggr_count
mysql 0
9 changes: 4 additions & 5 deletions test/distributed/cases/log/query_version.sql
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,12 @@
set @ts=now();
select @@version_comment limit 1;

select sleep(15) as s;
-- fir pr #7971
use system;
use mysql;
select * from user limit 0;

select sleep(15) as s;
/* cloud_user */select * from user limit 0;

select count(1) as cnt, statement_id, statement, status from system.statement_info group by statement_id, statement, status having count(1) > 1;

select `database`, `aggr_count` from system.statement_info where statement LIKE '%select * from user limit 0%' order by request_at desc limit 1;
-- fix issue 14,836: move check-sql into ../zz_statement_query_type/query_version.*
-- select `database`, `aggr_count` from system.statement_info where statement LIKE '%select * from user limit 0%' order by request_at desc limit 1;
4 changes: 2 additions & 2 deletions test/distributed/cases/result_count/result_count.result
Original file line number Diff line number Diff line change
Expand Up @@ -136,8 +136,8 @@ UNNEST_DEFAULT 0 a $.a null 1 {"a": 1}
use system;
/* cloud_user */create account test_tenant_1 admin_name 'test_account' identified by '111';
/* cloud_user */drop account test_tenant_1;
select sleep(16);
sleep(16)
select sleep(18) s;
s
0
use system;
select statement, result_count from statement_info where account="bvt_result_count" and statement not like '%mo_ctl%' and length(statement) > 0 and status != 'Running' and aggr_count < 1 order by request_at desc limit 50;
Expand Down
2 changes: 1 addition & 1 deletion test/distributed/cases/result_count/result_count.sql
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ use system;
-- case 2: END

-- result check
select sleep(16);
select sleep(18) s;
use system;
-- check case 1
-- Reason for changing the sql.
Expand Down
9 changes: 0 additions & 9 deletions test/distributed/cases/sql_source_type/sql_source_type.result
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,4 @@ use ssb;
a
1
/* cloud_nonuser */ use system;/* cloud_user */show tables;
select sleep(16);
sleep(16)
0
select statement, sql_source_type from system.statement_info where account="bvt_sql_source_type" and status != 'Running' and statement not like '%mo_ctl%' order by request_at desc limit 4;
statement sql_source_type
show tables cloud_user_sql
use system cloud_nonuser_sql
select * from __mo_t1 cloud_user_sql
insert into __mo_t1 values(1) cloud_user_sql
drop account if exists bvt_sql_source_type;
5 changes: 2 additions & 3 deletions test/distributed/cases/sql_source_type/sql_source_type.sql
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,8 @@ use ssb;
/* cloud_nonuser */ use system;/* cloud_user */show tables;
-- @session

-- result check
select sleep(16);
select statement, sql_source_type from system.statement_info where account="bvt_sql_source_type" and status != 'Running' and statement not like '%mo_ctl%' order by request_at desc limit 4;
-- result check, issue 14,836 move into ../zz_statement_query_type
-- select statement, sql_source_type from system.statement_info where account="bvt_sql_source_type" and status != 'Running' and statement not like '%mo_ctl%' order by request_at desc limit 4;

-- cleanup
drop account if exists bvt_sql_source_type;
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
select `database`, `aggr_count` from system.statement_info where statement = 'select * from user limit 0' and sql_source_type = 'cloud_user_sql' order by request_at desc limit 1;
database aggr_count
mysql 0
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
-- for issue 14,836, prepare op in ../log/query_version.sql
select `database`, `aggr_count` from system.statement_info where statement = 'select * from user limit 0' and sql_source_type = 'cloud_user_sql' order by request_at desc limit 1;
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
select statement, sql_source_type from system.statement_info where account="bvt_sql_source_type" and status != 'Running' and statement not like '%mo_ctl%' order by request_at desc limit 4;
statement sql_source_type
show tables cloud_user_sql
use system cloud_nonuser_sql
select * from __mo_t1 cloud_user_sql
insert into __mo_t1 values(1) cloud_user_sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
-- result check, issue 14,836
select statement, sql_source_type from system.statement_info where account="bvt_sql_source_type" and status != 'Running' and statement not like '%mo_ctl%' order by request_at desc limit 4;

0 comments on commit a2036c3

Please sign in to comment.