Skip to content

Commit c5ef621

Browse files
committed
Merge branch 'merge/merge-tokudb-5.6' into 10.0
2 parents f35b0d8 + d4f0686 commit c5ef621

9 files changed

+173
-3
lines changed

mysql-test/extra/table_index_statistics.inc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ DROP TABLE t2;
4848

4949
# Bug 1183625 (handler::update_global_table_stats crash).
5050

51-
CREATE TABLE t2 (c1 INT UNSIGNED) ENGINE=InnoDB;
51+
CREATE TABLE t2 (c1 INT UNSIGNED);
5252

5353
ALTER TABLE t2 MODIFY c1 FLOAT;
5454

mysql-test/suite/innodb/r/table_index_statistics.result

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ ALTER TABLE t2 MODIFY c1 FLOAT;
3939
SELECT * FROM INFORMATION_SCHEMA.TABLE_STATISTICS WHERE TABLE_NAME='t2';
4040
TABLE_SCHEMA TABLE_NAME ROWS_READ ROWS_CHANGED ROWS_CHANGED_X_INDEXES
4141
DROP TABLE t2;
42-
CREATE TABLE t2 (c1 INT UNSIGNED) ENGINE=InnoDB;
42+
CREATE TABLE t2 (c1 INT UNSIGNED);
4343
ALTER TABLE t2 MODIFY c1 FLOAT;
4444
SELECT * FROM INFORMATION_SCHEMA.TABLE_STATISTICS WHERE TABLE_NAME='t2';
4545
TABLE_SCHEMA TABLE_NAME ROWS_READ ROWS_CHANGED ROWS_CHANGED_X_INDEXES

storage/tokudb/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
SET(TOKUDB_VERSION 5.6.33-79.0)
1+
SET(TOKUDB_VERSION 5.6.34-79.1)
22
# PerconaFT only supports x86-64 and cmake-2.8.9+
33
IF(CMAKE_VERSION VERSION_LESS "2.8.9")
44
MESSAGE(STATUS "CMake 2.8.9 or higher is required by TokuDB")

storage/tokudb/ha_tokudb.cc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3696,6 +3696,8 @@ int ha_tokudb::do_uniqueness_checks(uchar* record, DB_TXN* txn, THD* thd) {
36963696
// first do uniqueness checks
36973697
//
36983698
if (share->has_unique_keys && do_unique_checks(thd, in_rpl_write_rows)) {
3699+
DBUG_EXECUTE_IF("tokudb_crash_if_rpl_does_uniqueness_check",
3700+
DBUG_ASSERT(0););
36993701
for (uint keynr = 0; keynr < table_share->keys; keynr++) {
37003702
bool is_unique_key = (table->key_info[keynr].flags & HA_NOSAME) || (keynr == primary_key);
37013703
bool is_unique = false;
@@ -5916,6 +5918,7 @@ int ha_tokudb::rnd_pos(uchar * buf, uchar * pos) {
59165918
// test rpl slave by inducing a delay before the point query
59175919
THD *thd = ha_thd();
59185920
if (thd->slave_thread && (in_rpl_delete_rows || in_rpl_update_rows)) {
5921+
DBUG_EXECUTE_IF("tokudb_crash_if_rpl_looks_up_row", DBUG_ASSERT(0););
59195922
uint64_t delay_ms = tokudb::sysvars::rpl_lookup_rows_delay(thd);
59205923
if (delay_ms)
59215924
usleep(delay_ms * 1000);
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
SET @default_storage_engine_old = @@session.default_storage_engine;
2+
SET SESSION default_storage_engine = TOKUDB;
3+
FLUSH INDEX_STATISTICS;
4+
FLUSH TABLE_STATISTICS;
5+
SET @userstat_old= @@userstat;
6+
SET GLOBAL userstat=ON;
7+
CREATE TABLE t1 (id int(10), PRIMARY KEY (id));
8+
INSERT INTO t1 VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9),(10);
9+
SELECT COUNT(*) FROM t1;
10+
COUNT(*)
11+
10
12+
SELECT ROWS_READ FROM INFORMATION_SCHEMA.TABLE_STATISTICS WHERE TABLE_NAME='t1';
13+
ROWS_READ
14+
10
15+
SELECT ROWS_READ FROM INFORMATION_SCHEMA.INDEX_STATISTICS WHERE TABLE_NAME='t1';
16+
ROWS_READ
17+
10
18+
FLUSH TABLE_STATISTICS;
19+
SELECT ROWS_READ FROM INFORMATION_SCHEMA.TABLE_STATISTICS WHERE TABLE_NAME='t1';
20+
ROWS_READ
21+
SELECT ROWS_READ FROM INFORMATION_SCHEMA.INDEX_STATISTICS WHERE TABLE_NAME='t1';
22+
ROWS_READ
23+
10
24+
FLUSH INDEX_STATISTICS;
25+
SELECT ROWS_READ FROM INFORMATION_SCHEMA.INDEX_STATISTICS WHERE TABLE_NAME='t1';
26+
ROWS_READ
27+
SELECT COUNT(*) FROM t1;
28+
COUNT(*)
29+
10
30+
SELECT ROWS_READ FROM INFORMATION_SCHEMA.TABLE_STATISTICS WHERE TABLE_NAME='t1';
31+
ROWS_READ
32+
10
33+
SELECT ROWS_READ FROM INFORMATION_SCHEMA.INDEX_STATISTICS WHERE TABLE_NAME='t1';
34+
ROWS_READ
35+
10
36+
DROP TABLE t1;
37+
CREATE TABLE t2 (c1 INT UNSIGNED);
38+
ALTER TABLE t2 MODIFY c1 FLOAT;
39+
SELECT * FROM INFORMATION_SCHEMA.TABLE_STATISTICS WHERE TABLE_NAME='t2';
40+
TABLE_SCHEMA TABLE_NAME ROWS_READ ROWS_CHANGED ROWS_CHANGED_X_INDEXES
41+
DROP TABLE t2;
42+
CREATE TABLE t2 (c1 INT UNSIGNED);
43+
ALTER TABLE t2 MODIFY c1 FLOAT;
44+
SELECT * FROM INFORMATION_SCHEMA.TABLE_STATISTICS WHERE TABLE_NAME='t2';
45+
TABLE_SCHEMA TABLE_NAME ROWS_READ ROWS_CHANGED ROWS_CHANGED_X_INDEXES
46+
DROP TABLE t2;
47+
SET GLOBAL userstat= @userstat_old;
48+
SET SESSION default_storage_engine = @default_storage_engine_old;
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
--source include/have_tokudb.inc
2+
3+
SET @default_storage_engine_old = @@session.default_storage_engine;
4+
SET SESSION default_storage_engine = TOKUDB;
5+
6+
--source extra/table_index_statistics.inc
7+
8+
SET SESSION default_storage_engine = @default_storage_engine_old;
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
include/master-slave.inc
2+
Warnings:
3+
Note #### Sending passwords in plain text without SSL/TLS is extremely insecure.
4+
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.
5+
[connection master]
6+
call mtr.add_suppression(".*read free replication is disabled for TokuDB table.*continue with rows lookup");
7+
CREATE TABLE t1 (id int(11) NOT NULL, pid int(11), PRIMARY KEY (id)) ENGINE=TokuDB
8+
PARTITION BY RANGE (id)
9+
(PARTITION p_1 VALUES LESS THAN (10) ENGINE = TokuDB,
10+
PARTITION p_2 VALUES LESS THAN (20) ENGINE = TokuDB,
11+
PARTITION p_all VALUES LESS THAN MAXVALUE ENGINE = TokuDB);
12+
insert into t1 values (1, 1), (2, 2), (3, 3), (11, 11), (12, 12), (13, 13);
13+
CREATE TABLE t2 (id int(11) NOT NULL, pid int(11), key idx_1(id)) ENGINE=TokuDB
14+
PARTITION BY RANGE (id)
15+
(PARTITION p_1 VALUES LESS THAN (10) ENGINE = TokuDB,
16+
PARTITION p_2 VALUES LESS THAN (20) ENGINE = TokuDB,
17+
PARTITION p_all VALUES LESS THAN MAXVALUE ENGINE = TokuDB);
18+
insert into t2 values (1, 1), (2, 2), (3, 3), (11, 11), (12, 12), (13, 13);
19+
include/stop_slave.inc
20+
set global debug= "+d,tokudb_crash_if_rpl_looks_up_row,tokudb_crash_if_rpl_does_uniqueness_check";
21+
include/start_slave.inc
22+
insert into t1 values(21, 21);
23+
delete from t1 where id = 11;
24+
update t1 set pid = 2 where id = 1;
25+
include/diff_tables.inc [master:test.t1, slave:test.t1]
26+
insert into t2 values(21, 21);
27+
delete from t2 where id = 11;
28+
update t2 set pid = 2 where id = 1;
29+
include/diff_tables.inc [master:test.t2, slave:test.t2]
30+
drop table t1;
31+
drop table t2;
32+
include/stop_slave.inc
33+
set global debug= "-d,tokudb_crash_if_rpl_looks_up_row,tokudb_crash_if_rpl_does_uniqueness_check";
34+
set global debug= @saved_debug;
35+
include/start_slave.inc
36+
include/rpl_end.inc
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
--read-only=ON --loose-tokudb-rpl-unique-checks=OFF --loose-tokudb-rpl-lookup-rows=OFF
Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
# test tokudb read free replication feature with partition table
2+
3+
--source include/have_debug.inc
4+
--source include/have_tokudb.inc
5+
--source include/have_binlog_format_row.inc
6+
--source include/master-slave.inc
7+
8+
call mtr.add_suppression(".*read free replication is disabled for TokuDB table.*continue with rows lookup");
9+
10+
connection master;
11+
12+
# partition table with explicit PK
13+
CREATE TABLE t1 (id int(11) NOT NULL, pid int(11), PRIMARY KEY (id)) ENGINE=TokuDB
14+
PARTITION BY RANGE (id)
15+
(PARTITION p_1 VALUES LESS THAN (10) ENGINE = TokuDB,
16+
PARTITION p_2 VALUES LESS THAN (20) ENGINE = TokuDB,
17+
PARTITION p_all VALUES LESS THAN MAXVALUE ENGINE = TokuDB);
18+
19+
insert into t1 values (1, 1), (2, 2), (3, 3), (11, 11), (12, 12), (13, 13);
20+
21+
# partition table without explicit PK
22+
CREATE TABLE t2 (id int(11) NOT NULL, pid int(11), key idx_1(id)) ENGINE=TokuDB
23+
PARTITION BY RANGE (id)
24+
(PARTITION p_1 VALUES LESS THAN (10) ENGINE = TokuDB,
25+
PARTITION p_2 VALUES LESS THAN (20) ENGINE = TokuDB,
26+
PARTITION p_all VALUES LESS THAN MAXVALUE ENGINE = TokuDB);
27+
28+
insert into t2 values (1, 1), (2, 2), (3, 3), (11, 11), (12, 12), (13, 13);
29+
30+
--sync_slave_with_master
31+
32+
# set tokudb rfr crash/assert conditions if we enter lookup code
33+
# to make sure no unique checks or row lookups is invoked
34+
connection slave;
35+
--source include/stop_slave.inc
36+
let $saved_debug = `select @@debug`;
37+
set global debug= "+d,tokudb_crash_if_rpl_looks_up_row,tokudb_crash_if_rpl_does_uniqueness_check";
38+
--source include/start_slave.inc
39+
40+
connection master;
41+
insert into t1 values(21, 21);
42+
delete from t1 where id = 11;
43+
update t1 set pid = 2 where id = 1;
44+
45+
sync_slave_with_master;
46+
47+
connection master;
48+
49+
--let $diff_tables= master:test.t1, slave:test.t1
50+
--source include/diff_tables.inc
51+
52+
# print rfr disabled warning in errlog
53+
connection master;
54+
insert into t2 values(21, 21);
55+
delete from t2 where id = 11;
56+
update t2 set pid = 2 where id = 1;
57+
58+
sync_slave_with_master;
59+
60+
--let $diff_tables= master:test.t2, slave:test.t2
61+
--source include/diff_tables.inc
62+
63+
connection master;
64+
drop table t1;
65+
drop table t2;
66+
sync_slave_with_master;
67+
68+
connection slave;
69+
--source include/stop_slave.inc
70+
set global debug= "-d,tokudb_crash_if_rpl_looks_up_row,tokudb_crash_if_rpl_does_uniqueness_check";
71+
set global debug= @saved_debug;
72+
--source include/start_slave.inc
73+
74+
--source include/rpl_end.inc

0 commit comments

Comments
 (0)