mirror of
https://github.com/MariaDB/server.git
synced 2025-11-30 05:23:50 +03:00
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.
This commit is contained in:
@@ -1,12 +1,13 @@
|
|||||||
include/master-slave.inc
|
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]
|
||||||
|
connection master;
|
||||||
drop table if exists t1;
|
drop table if exists t1;
|
||||||
|
connection master;
|
||||||
create procedure save_read_stats()
|
create procedure save_read_stats()
|
||||||
begin
|
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';
|
where table_schema=database() and table_name='t1';
|
||||||
select variable_value into @rr from information_schema.global_status
|
select variable_value into @rr from information_schema.global_status
|
||||||
where variable_name='rocksdb_rows_read';
|
where variable_name='rocksdb_rows_read';
|
||||||
@@ -17,7 +18,10 @@ where variable_name='rocksdb_rows_deleted';
|
|||||||
end//
|
end//
|
||||||
create procedure get_read_stats()
|
create procedure get_read_stats()
|
||||||
begin
|
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
|
information_schema.table_statistics
|
||||||
where table_schema=database() and table_name='t1';
|
where table_schema=database() and table_name='t1';
|
||||||
select variable_value - @rr as rows_read from
|
select variable_value - @rr as rows_read from
|
||||||
@@ -33,7 +37,9 @@ end//
|
|||||||
create table t1 (id int primary key, value int);
|
create table t1 (id int primary key, value int);
|
||||||
insert into t1 values (1,1), (2,2), (3,3), (4,4), (5,5);
|
insert into t1 values (1,1), (2,2), (3,3), (4,4), (5,5);
|
||||||
include/sync_slave_sql_with_master.inc
|
include/sync_slave_sql_with_master.inc
|
||||||
|
connection slave;
|
||||||
call save_read_stats();
|
call save_read_stats();
|
||||||
|
connection master;
|
||||||
update t1 set value=value+1 where id=1;
|
update t1 set value=value+1 where id=1;
|
||||||
update t1 set value=value+1 where id=3;
|
update t1 set value=value+1 where id=3;
|
||||||
select * from t1;
|
select * from t1;
|
||||||
@@ -44,8 +50,9 @@ id value
|
|||||||
4 4
|
4 4
|
||||||
5 5
|
5 5
|
||||||
include/sync_slave_sql_with_master.inc
|
include/sync_slave_sql_with_master.inc
|
||||||
|
connection slave;
|
||||||
call get_read_stats();
|
call get_read_stats();
|
||||||
rows_requested
|
rows_read_userstat
|
||||||
2
|
2
|
||||||
rows_read
|
rows_read
|
||||||
2
|
2
|
||||||
@@ -61,6 +68,7 @@ id value
|
|||||||
4 4
|
4 4
|
||||||
5 5
|
5 5
|
||||||
call save_read_stats();
|
call save_read_stats();
|
||||||
|
connection master;
|
||||||
delete from t1 where id in (4,5);
|
delete from t1 where id in (4,5);
|
||||||
select * from t1;
|
select * from t1;
|
||||||
id value
|
id value
|
||||||
@@ -68,8 +76,9 @@ id value
|
|||||||
2 2
|
2 2
|
||||||
3 4
|
3 4
|
||||||
include/sync_slave_sql_with_master.inc
|
include/sync_slave_sql_with_master.inc
|
||||||
|
connection slave;
|
||||||
call get_read_stats();
|
call get_read_stats();
|
||||||
rows_requested
|
rows_read_userstat
|
||||||
2
|
2
|
||||||
rows_read
|
rows_read
|
||||||
2
|
2
|
||||||
@@ -82,6 +91,7 @@ id value
|
|||||||
1 2
|
1 2
|
||||||
2 2
|
2 2
|
||||||
3 4
|
3 4
|
||||||
|
connection master;
|
||||||
drop table t1;
|
drop table t1;
|
||||||
drop procedure save_read_stats;
|
drop procedure save_read_stats;
|
||||||
drop procedure get_read_stats;
|
drop procedure get_read_stats;
|
||||||
|
|||||||
@@ -6,7 +6,9 @@
|
|||||||
delimiter //;
|
delimiter //;
|
||||||
create procedure save_read_stats()
|
create procedure save_read_stats()
|
||||||
begin
|
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';
|
where table_schema=database() and table_name='t1';
|
||||||
select variable_value into @rr from information_schema.global_status
|
select variable_value into @rr from information_schema.global_status
|
||||||
where variable_name='rocksdb_rows_read';
|
where variable_name='rocksdb_rows_read';
|
||||||
@@ -18,7 +20,10 @@ end//
|
|||||||
|
|
||||||
create procedure get_read_stats()
|
create procedure get_read_stats()
|
||||||
begin
|
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
|
information_schema.table_statistics
|
||||||
where table_schema=database() and table_name='t1';
|
where table_schema=database() and table_name='t1';
|
||||||
select variable_value - @rr as rows_read from
|
select variable_value - @rr as rows_read from
|
||||||
|
|||||||
@@ -0,0 +1 @@
|
|||||||
|
--userstat=ON
|
||||||
Reference in New Issue
Block a user