00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #include "heap_priv.h"
00020
00021 #include <drizzled/common.h>
00022
00023 #include <string.h>
00024 #include <algorithm>
00025
00026 using namespace std;
00027 using namespace drizzled;
00028
00042 uint32_t hp_get_encoded_data_length(HP_SHARE *info, const unsigned char *, uint32_t *chunk_count)
00043 {
00044 uint32_t dst_offset= info->fixed_data_length;
00045
00046
00047 *chunk_count= 1;
00048 return dst_offset;
00049 }
00050
00051 bool hp_compare_record_data_to_chunkset(HP_SHARE *info, const unsigned char *record, unsigned char *pos)
00052 {
00053 unsigned char* curr_chunk= pos;
00054
00055 if (memcmp(curr_chunk, record, (size_t) info->fixed_data_length))
00056 {
00057 return 1;
00058 }
00059
00060 return 0;
00061 }
00062
00073 void hp_copy_record_data_to_chunkset(HP_SHARE *info, const unsigned char *record, unsigned char *pos)
00074 {
00075 unsigned char* curr_chunk= pos;
00076
00077 memcpy(curr_chunk, record, (size_t) info->fixed_data_length);
00078 }
00079
00090 void hp_extract_record(HP_SHARE *info, unsigned char *record, const unsigned char *pos)
00091 {
00092 const unsigned char* curr_chunk= pos;
00093
00094 memcpy(record, curr_chunk, (size_t) info->fixed_data_length);
00095 }