mirror of
https://github.com/MariaDB/server.git
synced 2025-02-02 03:51:50 +01:00
[t:2561] Bugfix in backwards compatibility code. Enums cannot be used for CPP directives, which broke windows build
git-svn-id: file:///svn/toku/tokudb@20797 c7de825b-a66e-492c-adef-691d508d4ae1
This commit is contained in:
parent
2834d9cee7
commit
383e896608
2 changed files with 2 additions and 16 deletions
|
@ -745,14 +745,8 @@ static void
|
|||
translation_deserialize_from_buffer(struct translation *t, // destination into which to deserialize
|
||||
DISKOFF location_on_disk, //Location of translation_buffer
|
||||
u_int64_t size_on_disk,
|
||||
unsigned char * translation_buffer
|
||||
#if BRT_LAYOUT_MIN_SUPPORTED_VERSION <= BRT_LAYOUT_VERSION_11
|
||||
, BOOL invert_checksum
|
||||
#else
|
||||
#error The above code block is obsolete
|
||||
#endif
|
||||
|
||||
) { // buffer with serialized translation
|
||||
unsigned char * translation_buffer,
|
||||
BOOL invert_checksum) { // buffer with serialized translation
|
||||
assert(location_on_disk!=0);
|
||||
t->type = TRANSLATION_CHECKPOINTED;
|
||||
{
|
||||
|
@ -761,13 +755,9 @@ translation_deserialize_from_buffer(struct translation *t, // destination int
|
|||
u_int64_t offset = size_on_disk - 4;
|
||||
//printf("%s:%d read from %ld (x1764 offset=%ld) size=%ld\n", __FILE__, __LINE__, block_translation_address_on_disk, offset, block_translation_size_on_disk);
|
||||
u_int32_t stored_x1764 = toku_dtoh32(*(int*)(translation_buffer + offset));
|
||||
#if BRT_LAYOUT_MIN_SUPPORTED_VERSION <= BRT_LAYOUT_VERSION_11
|
||||
if (invert_checksum) {
|
||||
x1764 = ~x1764;
|
||||
}
|
||||
#else
|
||||
#error The above code block is obsolete
|
||||
#endif
|
||||
assert(x1764 == stored_x1764);
|
||||
}
|
||||
struct rbuf rt;
|
||||
|
|
|
@ -1601,13 +1601,9 @@ deserialize_brtheader_from_fd_into_rbuf(int fd, toku_off_t offset, struct rbuf *
|
|||
//Verify checksum
|
||||
u_int32_t calculated_x1764 = x1764_memory(rb->buf, rb->size-4);
|
||||
u_int32_t stored_x1764 = toku_dtoh32(*(int*)(rb->buf+rb->size-4));
|
||||
#if BRT_LAYOUT_MIN_SUPPORTED_VERSION <= BRT_LAYOUT_VERSION_11
|
||||
if (version<=BRT_LAYOUT_VERSION_11) {
|
||||
calculated_x1764 = ~calculated_x1764;
|
||||
}
|
||||
#else
|
||||
#error The above code block is obsolete
|
||||
#endif
|
||||
if (calculated_x1764!=stored_x1764) r = TOKUDB_DICTIONARY_NO_HEADER; //Header useless
|
||||
}
|
||||
if (r==0) {
|
||||
|
|
Loading…
Add table
Reference in a new issue