diff options
author | unknown <mskold/marty@mysql.com/linux.site> | 2006-09-19 11:31:55 +0200 |
---|---|---|
committer | unknown <mskold/marty@mysql.com/linux.site> | 2006-09-19 11:31:55 +0200 |
commit | 8a68821f83a80026045aaab83843ca010a172bd1 (patch) | |
tree | 1e2609bc281f1e7d5deac6fb7e306a25a196b1d9 /client | |
parent | 34edcac86c26ebd0ebdc22ae286845ef664ed043 (diff) | |
download | mariadb-git-8a68821f83a80026045aaab83843ca010a172bd1.tar.gz |
Bug #18679 rpl_ndb_dd_advance.test fails randomly
Diffstat (limited to 'client')
-rw-r--r-- | client/mysqltest.c | 129 |
1 files changed, 90 insertions, 39 deletions
diff --git a/client/mysqltest.c b/client/mysqltest.c index edcce59e136..9c3301c7b66 100644 --- a/client/mysqltest.c +++ b/client/mysqltest.c @@ -1625,16 +1625,25 @@ int do_save_master_pos() if (have_ndbcluster) { - ulonglong epoch=0, tmp_epoch= 0; + ulonglong start_epoch= 0, applied_epoch= 0, + latest_epoch=0, latest_trans_epoch=0, + latest_handled_binlog_epoch= 0, latest_received_binlog_epoch= 0, + latest_applied_binlog_epoch= 0; int count= 0; int do_continue= 1; while (do_continue) { const char binlog[]= "binlog"; - const char latest_trans_epoch[]= + const char latest_epoch_str[]= + "latest_epoch="; + const char latest_trans_epoch_str[]= "latest_trans_epoch="; - const char latest_handled_binlog_epoch[]= + const char latest_received_binlog_epoch_str[]= + "latest_received_binlog_epoch"; + const char latest_handled_binlog_epoch_str[]= "latest_handled_binlog_epoch="; + const char latest_applied_binlog_epoch_str[]= + "latest_applied_binlog_epoch="; if (count) sleep(1); if (mysql_query(mysql, query= "show engine ndb status")) @@ -1648,45 +1657,87 @@ int do_save_master_pos() if (strcmp(row[1], binlog) == 0) { const char *status= row[2]; - /* latest_trans_epoch */ - if (count == 0) - { - while (*status && strncmp(status, latest_trans_epoch, - sizeof(latest_trans_epoch)-1)) - status++; - if (*status) - { - status+= sizeof(latest_trans_epoch)-1; - epoch= strtoull(status, (char**) 0, 10); - } - else - die("line %u: result does not contain '%s' in '%s'", - start_lineno, latest_trans_epoch, query); - } - /* latest_applied_binlog_epoch */ - while (*status && strncmp(status, latest_handled_binlog_epoch, - sizeof(latest_handled_binlog_epoch)-1)) - status++; - if (*status) + + // latest_epoch + while (*status && strncmp(status, latest_epoch_str, + sizeof(latest_epoch_str)-1)) + status++; + if (*status) { - status+= sizeof(latest_handled_binlog_epoch)-1; - tmp_epoch= strtoull(status, (char**) 0, 10); - } - else - die("line %u: result does not contain '%s' in '%s'", - start_lineno, latest_handled_binlog_epoch, query); - break; - } - } - if (!row) - die("line %u: result does not contain '%s' in '%s'", - start_lineno, binlog, query); - count++; - if (tmp_epoch >= epoch) + status+= sizeof(latest_epoch_str)-1; + latest_epoch= strtoull(status, (char**) 0, 10); + } + else + die("line %u: result does not contain '%s' in '%s'", + start_lineno, latest_epoch_str, query); + // latest_trans_epoch + while (*status && strncmp(status, latest_trans_epoch_str, + sizeof(latest_trans_epoch_str)-1)) + status++; + if (*status) + { + status+= sizeof(latest_trans_epoch_str)-1; + latest_trans_epoch= strtoull(status, (char**) 0, 10); + } + else + die("line %u: result does not contain '%s' in '%s'", + start_lineno, latest_trans_epoch_str, query); + /* latest_received_binlog_epoch */ + while (*status && + strncmp(status, latest_received_binlog_epoch_str, + sizeof(latest_received_binlog_epoch_str)-1)) + status++; + if (*status) + { + status+= sizeof(latest_received_binlog_epoch_str)-1; + latest_received_binlog_epoch= strtoull(status, (char**) 0, 10); + } + else + die("line %u: result does not contain '%s' in '%s'", + start_lineno, latest_received_binlog_epoch_str, query); + /* latest_handled_binlog */ + while (*status && + strncmp(status, latest_handled_binlog_epoch_str, + sizeof(latest_handled_binlog_epoch_str)-1)) + status++; + if (*status) + { + status+= sizeof(latest_handled_binlog_epoch_str)-1; + latest_handled_binlog_epoch= strtoull(status, (char**) 0, 10); + } + else + die("line %u: result does not contain '%s' in '%s'", + start_lineno, latest_handled_binlog_epoch_str, query); + /* latest_applied_binlog_epoch */ + while (*status && + strncmp(status, latest_applied_binlog_epoch_str, + sizeof(latest_applied_binlog_epoch_str)-1)) + status++; + if (*status) + { + status+= sizeof(latest_applied_binlog_epoch_str)-1; + latest_applied_binlog_epoch= strtoull(status, (char**) 0, 10); + } + else + die("line %u: result does not contain '%s' in '%s'", + start_lineno, latest_applied_binlog_epoch_str, query); + if (count == 0) + start_epoch= latest_trans_epoch; + break; + } + } + if (!row) + die("line %u: result does not contain '%s' in '%s'", + start_lineno, binlog, query); + if (latest_applied_binlog_epoch > applied_epoch) + count= 0; + applied_epoch= latest_applied_binlog_epoch; + count++; + if (latest_handled_binlog_epoch >= start_epoch) do_continue= 0; else if (count > 30) - { - break; + { + break; } mysql_free_result(res); } |