diff options
author | Satya B <satya.bn@sun.com> | 2009-04-02 14:30:44 +0530 |
---|---|---|
committer | Satya B <satya.bn@sun.com> | 2009-04-02 14:30:44 +0530 |
commit | b1d74c9b5c01b3ff91e4199ab9146b4baec4e163 (patch) | |
tree | a589af47af72d1dc00fa5e3cd80b4fc4b91e09f0 /myisam | |
parent | 295e876718d03d8c19fae2427421571b5c935f7f (diff) | |
parent | ccbd4c045115a30da2ce0499f1c18d528a43fd39 (diff) | |
download | mariadb-git-b1d74c9b5c01b3ff91e4199ab9146b4baec4e163.tar.gz |
merge to 5.0-bugteam
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) + |