| 1 |
--source include/have_ndb.inc |
| 2 |
--source include/have_log_bin.inc |
| 3 |
|
| 4 |
set @is_enable_default = @@global.ndb_index_stat_enable; |
| 5 |
|
| 6 |
set @is_enable = 1; |
| 7 |
source index_stat_enable.inc; |
| 8 |
|
| 9 |
create table t1 ( |
| 10 |
a int primary key, |
| 11 |
b int, |
| 12 |
c int, |
| 13 |
key t1x1 (b), |
| 14 |
key t1x2 (c) |
| 15 |
) engine=ndb |
| 16 |
partition by key (a) partitions 1; |
| 17 |
|
| 18 |
insert into t1 values (1,1,1),(2,1,1),(3,2,1),(4,2,1); |
| 19 |
analyze table t1; |
| 20 |
|
| 21 |
# put some entries into index stats cache |
| 22 |
select count(*) from t1 where b = 1; |
| 23 |
select count(*) from t1 where c = 1; |
| 24 |
show status like 'ndb_index_stat_cache%'; |
| 25 |
|
| 26 |
--echo # restart cluster --initial |
| 27 |
--exec $NDB_MGM -e "all restart -i -n" >> $NDB_TOOLS_OUTPUT |
| 28 |
--exec $NDB_WAITER --not-started >> $NDB_TOOLS_OUTPUT |
| 29 |
--exec $NDB_MGM -e "all start" >> $NDB_TOOLS_OUTPUT |
| 30 |
--exec $NDB_WAITER >> $NDB_TOOLS_OUTPUT |
| 31 |
|
| 32 |
--echo # wait for mysqld |
| 33 |
--source include/ndb_not_readonly.inc |
| 34 |
# wait for stats thread to re-initialize |
| 35 |
--source suite/ndb/include/ndb_index_stat_wait.inc |
| 36 |
|
| 37 |
--error 0,1193 |
| 38 |
set global ndb_dbg_check_shares=1; |
| 39 |
|
| 40 |
--error 0,1051 |
| 41 |
drop table if exists t1; |
| 42 |
|
| 43 |
create table t1 ( |
| 44 |
a int primary key, |
| 45 |
b int, |
| 46 |
c int, |
| 47 |
key t1x1 (b), |
| 48 |
key t1x2 (c) |
| 49 |
) engine=ndb |
| 50 |
partition by key (a) partitions 1; |
| 51 |
|
| 52 |
insert into t1 values (1,1,1),(2,1,1),(3,2,1),(4,2,1); |
| 53 |
analyze table t1; |
| 54 |
|
| 55 |
# put some entries into index stats cache |
| 56 |
select count(*) from t1 where b = 1; |
| 57 |
select count(*) from t1 where c = 1; |
| 58 |
show status like 'ndb_index_stat_cache%'; |
| 59 |
|
| 60 |
drop table t1; |
| 61 |
|
| 62 |
set @is_enable = @is_enable_default; |
| 63 |
source index_stat_enable.inc; |
| 64 |
|
| 65 |
|
| 66 |
# Ignore the warning generated by ndbcluster's binlog thread |
| 67 |
# when cluster is restarted |
| 68 |
--disable_query_log ONCE |
| 69 |
call mtr.add_suppression("cluster disconnect An incident event has been written"); |
| 70 |
|
| 71 |
# Ignore the warning generated by ndbcluster's binlog thread |
| 72 |
# when cluster is restarted - also on the second mysqld |
| 73 |
connect(mysqld2,127.0.0.1,root,,test,$MASTER_MYPORT1); |
| 74 |
connection mysqld2; |
| 75 |
--disable_query_log ONCE |
| 76 |
call mtr.add_suppression("cluster disconnect An incident event has been written"); |
| 77 |
--remove_file $NDB_TOOLS_OUTPUT |