r23793 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r23792‎ | r23793 | r23794 >
Date:16:35, 6 July 2007
Author:river
Status:old
Tags:
Comment:
- mysql docs are wrong, ET_INTVAR has a single byte prefix for type. need to
account for that or SET INSERT_ID goes wrong.
- for initial setup, make -F -p on command line work
Modified paths:
  • /trunk/tools/trainwreck/trainwreck.c (modified) (history)

Diff [purge]

Index: trunk/tools/trainwreck/trainwreck.c
@@ -666,14 +666,20 @@
667667
668668 case ET_INTVAR:
669669 /*
 670+ * 1: id type
670671 * 8 bytes: next INSERT_ID
671672 */
672 - if (len < 8) {
 673+ if (len < 9) {
673674 logmsg("binlog is truncated");
674675 goto err;
675676 }
676677
 678+ ADVANCE(1);
677679 ent->le_insert_id = uint8korr(buf);
 680+
 681+ if (debug)
 682+ printf("got intvar: %llu (%llx)\n", (unsigned long long) ent->le_insert_id,
 683+ (unsigned long long) ent->le_insert_id);
678684 return ent;
679685
680686 default:
@@ -998,6 +1004,15 @@
9991005 if ((rstat = open(sname, O_RDONLY)) == -1) {
10001006 logmsg("cannot open state file \"%s\": %s",
10011007 sname, strerror(errno));
 1008+ /*
 1009+ * Use the binlog position specified on command line.
 1010+ */
 1011+ writer->wr_last_executed_pos = binlog_pos;
 1012+ strdup_free(&writer->wr_last_executed_file, binlog_file);
 1013+ pthread_mutex_lock(&rst_mtx);
 1014+ if (lowest_log_pos == 0 || writer->wr_last_executed_pos < lowest_log_pos)
 1015+ lowest_log_pos = writer->wr_last_executed_pos;
 1016+ pthread_mutex_unlock(&rst_mtx);
10021017 if (errno == ENOENT)
10031018 return 1;
10041019 exit(1);

Status & tagging log