change size of hidden primary key from 5 bytes to 8

git-svn-id: file:///svn/mysql/tokudb-engine/src@10664 c7de825b-a66e-492c-adef-691d508d4ae1
This commit is contained in:
Zardosht Kasheff 2013-04-17 00:01:47 -04:00 committed by Yoni Fogel
parent d60e8ecef2
commit c694757d82
2 changed files with 7 additions and 7 deletions

View file

@ -224,8 +224,8 @@ ulong ha_tokudb::index_flags(uint idx, uint part, bool all_parts) const {
static int tokudb_cmp_hidden_key(DB * file, const DBT * new_key, const DBT * saved_key) { static int tokudb_cmp_hidden_key(DB * file, const DBT * new_key, const DBT * saved_key) {
ulonglong a = uint5korr((char *) new_key->data); ulonglong a = uint8korr((char *) new_key->data);
ulonglong b = uint5korr((char *) saved_key->data); ulonglong b = uint8korr((char *) saved_key->data);
return a < b ? -1 : (a > b ? 1 : 0); return a < b ? -1 : (a > b ? 1 : 0);
} }
@ -357,8 +357,8 @@ static int tokudb_compare_two_clustered_keys(KEY *key, KEY* primary_key, const D
// //
// primary key hidden // primary key hidden
// //
ulonglong a = uint5korr((char *) new_key_ptr); ulonglong a = uint8korr((char *) new_key_ptr);
ulonglong b = uint5korr((char *) saved_key_ptr); ulonglong b = uint8korr((char *) saved_key_ptr);
ret_val = a < b ? -1 : (a > b ? 1 : 0); ret_val = a < b ? -1 : (a > b ? 1 : 0);
} }
else { else {
@ -1738,7 +1738,7 @@ void ha_tokudb::init_hidden_prim_key_info() {
int error = read_last(); int error = read_last();
(void) extra(HA_EXTRA_NO_KEYREAD); (void) extra(HA_EXTRA_NO_KEYREAD);
if (error == 0) { if (error == 0) {
share->auto_ident = uint5korr(current_ident); share->auto_ident = uint8korr(current_ident);
} }
share->status |= STATUS_PRIMARY_KEY_INIT; share->status |= STATUS_PRIMARY_KEY_INIT;

View file

@ -208,7 +208,7 @@ private:
char write_status_msg[200]; //buffer of 200 should be a good upper bound. char write_status_msg[200]; //buffer of 200 should be a good upper bound.
bool fix_rec_buff_for_blob(ulong length); bool fix_rec_buff_for_blob(ulong length);
#define TOKUDB_HIDDEN_PRIMARY_KEY_LENGTH 5 // QQQ why 5? #define TOKUDB_HIDDEN_PRIMARY_KEY_LENGTH 8
uchar current_ident[TOKUDB_HIDDEN_PRIMARY_KEY_LENGTH]; uchar current_ident[TOKUDB_HIDDEN_PRIMARY_KEY_LENGTH];
ulong max_row_length(const uchar * buf); ulong max_row_length(const uchar * buf);
@ -344,7 +344,7 @@ public:
inline void get_auto_primary_key(uchar * to) { inline void get_auto_primary_key(uchar * to) {
pthread_mutex_lock(&share->mutex); pthread_mutex_lock(&share->mutex);
share->auto_ident++; share->auto_ident++;
int5store(to, share->auto_ident); int8store(to, share->auto_ident);
pthread_mutex_unlock(&share->mutex); pthread_mutex_unlock(&share->mutex);
} }
virtual void get_auto_increment(ulonglong offset, ulonglong increment, ulonglong nb_desired_values, ulonglong * first_value, ulonglong * nb_reserved_values); virtual void get_auto_increment(ulonglong offset, ulonglong increment, ulonglong nb_desired_values, ulonglong * first_value, ulonglong * nb_reserved_values);