| 1 |
--disable_query_log |
| 2 |
--disable_result_log |
| 3 |
|
| 4 |
select @curr_server_epoch:=Variable_value |
| 5 |
from performance_schema.global_status |
| 6 |
where Variable_name ="ndb_last_commit_epoch_server"; |
| 7 |
|
| 8 |
select @curr_session_epoch:=Variable_value |
| 9 |
from performance_schema.global_status |
| 10 |
where Variable_name ="ndb_last_commit_epoch_session"; |
| 11 |
|
| 12 |
# Wait for latest committed transaction to reach binlog |
| 13 |
show binlog events; |
| 14 |
|
| 15 |
--source include/get_ndb_epochs.inc |
| 16 |
|
| 17 |
select max(epoch) |
| 18 |
from mysql.ndb_binlog_index into @binlog_max_epoch; |
| 19 |
|
| 20 |
select @binlog_max_epoch; |
| 21 |
|
| 22 |
set @a:= (@init_server_epoch + 0) >= (@init_session_epoch + 0); |
| 23 |
set @b:= (@curr_server_epoch + 0) >= (@curr_session_epoch + 0); |
| 24 |
set @c:= (@curr_server_epoch + 0) >= (@init_server_epoch + 0); |
| 25 |
set @d:= (@curr_session_epoch + 0) >= (@init_session_epoch + 0); |
| 26 |
|
| 27 |
--enable_result_log |
| 28 |
|
| 29 |
select @a as init_server_epoch_includes_session_epoch, |
| 30 |
@b as curr_server_epoch_includes_session_epoch, |
| 31 |
@c as server_epoch_does_not_regress, |
| 32 |
@d as session_epoch_does_not_regress; |
| 33 |
|
| 34 |
select (@binlog_max_epoch+0) = (@curr_session_epoch+0) as |
| 35 |
binlog_contains_last_session_epoch; |
| 36 |
|
| 37 |
--disable_result_log |
| 38 |
|
| 39 |
eval select @e:= (($ndb_latest_applied_binlog_epoch + 0) = @binlog_max_epoch); |
| 40 |
|
| 41 |
--let $problem=query_get_value("SELECT 5 - (@a+@b+@c+@d+@e) AS p", p, 1) |
| 42 |
|
| 43 |
--enable_result_log |
| 44 |
if ($problem) |
| 45 |
{ |
| 46 |
--echo Unexpected result. Details : |
| 47 |
|
| 48 |
SELECT @init_server_epoch, @init_session_epoch, |
| 49 |
@curr_server_epoch, @curr_session_epoch; |
| 50 |
|
| 51 |
eval select $ndb_latest_applied_binlog_epoch as ndb_latest_applied_binlog_epoch, @binlog_max_epoch; |
| 52 |
|
| 53 |
SELECT * FROM mysql.ndb_binlog_index; |
| 54 |
} |
| 55 |
|
| 56 |
--enable_query_log |