Skip to content
Snippets Groups Projects
Commit 7dff3439 authored by pcherenkov's avatar pcherenkov
Browse files

Merge branch 'crc32'

parents fe3cbfcb 16b92ead
No related branches found
No related tags found
No related merge requests found
......@@ -464,7 +464,7 @@ row_reader_v11(FILE *f, struct palloc_pool *pool)
m->size = offsetof(struct row_v11, data);
/* header crc32c calculated on <lsn, tm, len, data_crc32c> */
header_crc = crc32c(0, m->data + offsetof(struct row_v11, lsn),
header_crc = calc_crc32c(0, m->data + offsetof(struct row_v11, lsn),
sizeof(struct row_v11) - offsetof(struct row_v11, lsn));
if (row_v11(m)->header_crc32c != header_crc) {
......@@ -478,7 +478,7 @@ row_reader_v11(FILE *f, struct palloc_pool *pool)
m->size += row_v11(m)->len;
data_crc = crc32c(0, row_v11(m)->data, row_v11(m)->len);
data_crc = calc_crc32c(0, row_v11(m)->data, row_v11(m)->len);
if (row_v11(m)->data_crc32c != data_crc) {
say_error("data crc32c mismatch");
return NULL;
......@@ -1389,9 +1389,9 @@ write_rows(struct log_io_iter *i)
row_v11(row)->lsn = 0; /* unused */
row_v11(row)->tm = ev_now();
row_v11(row)->len = data->size;
row_v11(row)->data_crc32c = crc32c(0, data->data, data->size);
row_v11(row)->data_crc32c = calc_crc32c(0, data->data, data->size);
row_v11(row)->header_crc32c =
crc32c(0, row->data + field_sizeof(struct row_v11, header_crc32c),
calc_crc32c(0, row->data + field_sizeof(struct row_v11, header_crc32c),
sizeof(struct row_v11) - field_sizeof(struct row_v11,
header_crc32c));
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment