Commit d68f2d6e authored by Zardosht Kasheff's avatar Zardosht Kasheff Committed by Yoni Fogel

addresses #1400

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
parent 1c326deb
......@@ -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) {
ulonglong a = uint5korr((char *) new_key->data);
ulonglong b = uint5korr((char *) saved_key->data);
ulonglong a = uint8korr((char *) new_key->data);
ulonglong b = uint8korr((char *) saved_key->data);
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
//
ulonglong a = uint5korr((char *) new_key_ptr);
ulonglong b = uint5korr((char *) saved_key_ptr);
ulonglong a = uint8korr((char *) new_key_ptr);
ulonglong b = uint8korr((char *) saved_key_ptr);
ret_val = a < b ? -1 : (a > b ? 1 : 0);
}
else {
......@@ -1738,7 +1738,7 @@ void ha_tokudb::init_hidden_prim_key_info() {
int error = read_last();
(void) extra(HA_EXTRA_NO_KEYREAD);
if (error == 0) {
share->auto_ident = uint5korr(current_ident);
share->auto_ident = uint8korr(current_ident);
}
share->status |= STATUS_PRIMARY_KEY_INIT;
......
......@@ -208,7 +208,7 @@ class ha_tokudb : public handler {
char write_status_msg[200]; //buffer of 200 should be a good upper bound.
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];
ulong max_row_length(const uchar * buf);
......@@ -344,7 +344,7 @@ class ha_tokudb : public handler {
inline void get_auto_primary_key(uchar * to) {
pthread_mutex_lock(&share->mutex);
share->auto_ident++;
int5store(to, share->auto_ident);
int8store(to, share->auto_ident);
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);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment