aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@nxc.no>2014-06-01 19:38:04 +0200
committerSergey Poznyakoff <gray@nxc.no>2014-06-01 19:38:04 +0200
commitc16de06862f9b2106dcb7810fc20856689ef2aa6 (patch)
tree385af24e0c3a395d747fb22ab7a9f13d242e96b9
parent6054989b78b7a481770a1608c809a56e1cf5cc7d (diff)
downloadvmod-binlog-c16de06862f9b2106dcb7810fc20856689ef2aa6.tar.gz
vmod-binlog-c16de06862f9b2106dcb7810fc20856689ef2aa6.tar.bz2
Bugfixes in binlogsel
* src/binlogsel.c (selmem): Fix operation in case when all records are earlier than start_time. (read_status_fp): Set start_time 1 second later than the status file time. Set last_ts.
-rw-r--r--src/binlogsel.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/src/binlogsel.c b/src/binlogsel.c
index b3fb75b..9587c2b 100644
--- a/src/binlogsel.c
+++ b/src/binlogsel.c
@@ -337,17 +337,21 @@ selmem(const char *name, void *base)
for (; start < hdr->recnum; start++) {
if (getrec(base, hdr->recsize, start)->ts > start_time)
break;
}
break;
case 1:
- for (; start + 1 >= 0; start--) {
- if (start_time < getrec(base, hdr->recsize, start)->ts)
+ for (; start >= 0; start--) {
+ if (start_time <
+ getrec(base, hdr->recsize, start)->ts) {
+ ++start;
break;
+ }
}
- ++start;
+ if (start == 0)
+ return;
}
} else
start = 0;
for (i = 0; start < hdr->recnum; i++, start++) {
time_t ts;
@@ -914,14 +918,15 @@ read_status_fp(FILE *fp)
if (ferror(fp))
return 1;
if (fgetc(fp) != EOF)
return 1;
timemask |= START_TIME;
- start_time = ts;
-
+ start_time = ts + 1;
+ last_ts = start_time;
+
return 0;
}
int
read_status_file(char const *name)
{

Return to:

Send suggestions and report system problems to the System administrator.