Commit edfe980a authored by Sergei Petrunia's avatar Sergei Petrunia

MariaRocks port: fix rocksdb.rpl_row_stats test

"Userstat" feature in MariaDB does not have
I_S.table_statistics.rows_requested column.

We'll use I_S.table_statistics.rows_read instead. The testcase
doesn't do anything where rows_requested != rows_read.
parent f89e0778
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;
......
......@@ -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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment