diff --git a/storage/rocksdb/mysql-test/rocksdb/r/rpl_row_stats.result b/storage/rocksdb/mysql-test/rocksdb/r/rpl_row_stats.result index a95642096f5..a14d2693ad3 100644 --- a/storage/rocksdb/mysql-test/rocksdb/r/rpl_row_stats.result +++ b/storage/rocksdb/mysql-test/rocksdb/r/rpl_row_stats.result @@ -1,12 +1,13 @@ include/master-slave.inc -Warnings: -Note #### Sending passwords in plain text without SSL/TLS is extremely insecure. -Note #### Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information. [connection master] +connection master; drop table if exists t1; +connection master; create procedure save_read_stats() begin -select rows_requested into @rq from information_schema.table_statistics +/*select rows_requested into @rq from information_schema.table_statistics +where table_schema=database() and table_name='t1';*/ +select rows_read into @rr_is from information_schema.table_statistics where table_schema=database() and table_name='t1'; select variable_value into @rr from information_schema.global_status where variable_name='rocksdb_rows_read'; @@ -17,7 +18,10 @@ where variable_name='rocksdb_rows_deleted'; end// create procedure get_read_stats() begin -select rows_requested - @rq as rows_requested from +/*select rows_requested - @rq as rows_requested from +information_schema.table_statistics +where table_schema=database() and table_name='t1';*/ +select rows_read - @rr_is as rows_read_userstat from information_schema.table_statistics where table_schema=database() and table_name='t1'; select variable_value - @rr as rows_read from @@ -33,7 +37,9 @@ end// create table t1 (id int primary key, value int); insert into t1 values (1,1), (2,2), (3,3), (4,4), (5,5); include/sync_slave_sql_with_master.inc +connection slave; call save_read_stats(); +connection master; update t1 set value=value+1 where id=1; update t1 set value=value+1 where id=3; select * from t1; @@ -44,8 +50,9 @@ id value 4 4 5 5 include/sync_slave_sql_with_master.inc +connection slave; call get_read_stats(); -rows_requested +rows_read_userstat 2 rows_read 2 @@ -61,6 +68,7 @@ id value 4 4 5 5 call save_read_stats(); +connection master; delete from t1 where id in (4,5); select * from t1; id value @@ -68,8 +76,9 @@ id value 2 2 3 4 include/sync_slave_sql_with_master.inc +connection slave; call get_read_stats(); -rows_requested +rows_read_userstat 2 rows_read 2 @@ -82,6 +91,7 @@ id value 1 2 2 2 3 4 +connection master; drop table t1; drop procedure save_read_stats; drop procedure get_read_stats; diff --git a/storage/rocksdb/mysql-test/rocksdb/t/init_stats_procedure.inc b/storage/rocksdb/mysql-test/rocksdb/t/init_stats_procedure.inc index c798bb91cfa..dda253bc346 100644 --- a/storage/rocksdb/mysql-test/rocksdb/t/init_stats_procedure.inc +++ b/storage/rocksdb/mysql-test/rocksdb/t/init_stats_procedure.inc @@ -6,7 +6,9 @@ delimiter //; create procedure save_read_stats() begin - select rows_requested into @rq from information_schema.table_statistics + /*select rows_requested into @rq from information_schema.table_statistics + where table_schema=database() and table_name='t1';*/ + select rows_read into @rr_is from information_schema.table_statistics where table_schema=database() and table_name='t1'; select variable_value into @rr from information_schema.global_status where variable_name='rocksdb_rows_read'; @@ -18,7 +20,10 @@ end// create procedure get_read_stats() begin - select rows_requested - @rq as rows_requested from + /*select rows_requested - @rq as rows_requested from + information_schema.table_statistics + where table_schema=database() and table_name='t1';*/ + select rows_read - @rr_is as rows_read_userstat from information_schema.table_statistics where table_schema=database() and table_name='t1'; select variable_value - @rr as rows_read from diff --git a/storage/rocksdb/mysql-test/rocksdb/t/rpl_row_stats-slave.opt b/storage/rocksdb/mysql-test/rocksdb/t/rpl_row_stats-slave.opt new file mode 100644 index 00000000000..039295e140d --- /dev/null +++ b/storage/rocksdb/mysql-test/rocksdb/t/rpl_row_stats-slave.opt @@ -0,0 +1 @@ +--userstat=ON