diff options
Diffstat (limited to 'myisam')
-rwxr-xr-x | myisam/CMakeLists.txt | 2 | ||||
-rw-r--r-- | myisam/mi_packrec.c | 26 |
2 files changed, 28 insertions, 0 deletions
diff --git a/myisam/CMakeLists.txt b/myisam/CMakeLists.txt index a557d61b87f..225c04ff457 100755 --- a/myisam/CMakeLists.txt +++ b/myisam/CMakeLists.txt @@ -41,6 +41,8 @@ TARGET_LINK_LIBRARIES(myisamlog myisam mysys debug dbug strings zlib wsock32) ADD_EXECUTABLE(myisampack myisampack.c) TARGET_LINK_LIBRARIES(myisampack myisam mysys debug dbug strings zlib wsock32) +SET_TARGET_PROPERTIES(myisamchk myisampack PROPERTIES LINK_FLAGS "setargv.obj") + IF(EMBED_MANIFESTS) MYSQL_EMBED_MANIFEST("myisam_ftdump" "asInvoker") MYSQL_EMBED_MANIFEST("myisamchk" "asInvoker") diff --git a/myisam/mi_packrec.c b/myisam/mi_packrec.c index ddcf0f33e61..df9a4d18a6c 100644 --- a/myisam/mi_packrec.c +++ b/myisam/mi_packrec.c @@ -1430,6 +1430,32 @@ static void fill_buffer(MI_BIT_BUFF *bit_buff) bit_buff->current_byte=0; return; } + else + { + uint len= 0; + uint i= 0; + /* + Check if the remaining buffer/record to read is less than the word size. + If so read byte by byte + + Note: if this branch becomes a bottleneck it can be removed, assuming + that the second memory segment allocates 7 extra bytes (see + _mi_read_pack_info()). + */ + len= bit_buff->end - bit_buff->pos; + if (len < (BITS_SAVED / 8)) + { + bit_buff->current_byte= 0; + for (i=0 ; i < len ; i++) + { + bit_buff->current_byte+= (((uint) ((uchar) bit_buff->pos[len - i - 1])) + << (8 * i)); + } + bit_buff->pos= bit_buff->end; + return; + } + } + #if BITS_SAVED == 64 bit_buff->current_byte= ((((uint) ((uchar) bit_buff->pos[7]))) + (((uint) ((uchar) bit_buff->pos[6])) << 8) + |