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

[t:2862], fix calls to pre_acquire_read_lock in handlerton

git-svn-id: file:///svn/mysql/tokudb-engine/tokudb-engine@23066 c7de825b-a66e-492c-adef-691d508d4ae1
parent 680e214d
...@@ -4000,8 +4000,8 @@ int ha_tokudb::prepare_index_scan() { ...@@ -4000,8 +4000,8 @@ int ha_tokudb::prepare_index_scan() {
error = db->pre_acquire_read_lock( error = db->pre_acquire_read_lock(
db, db,
transaction, transaction,
db->dbt_neg_infty(), db->dbt_neg_infty(), db->dbt_neg_infty(),
db->dbt_pos_infty(), db->dbt_pos_infty() db->dbt_pos_infty()
); );
lockretry_wait; lockretry_wait;
} }
...@@ -4032,9 +4032,7 @@ int ha_tokudb::prepare_index_key_scan( const uchar * key, uint key_len ) { ...@@ -4032,9 +4032,7 @@ int ha_tokudb::prepare_index_key_scan( const uchar * key, uint key_len ) {
share->key_file[active_index], share->key_file[active_index],
transaction, transaction,
&start_key, &start_key,
share->key_file[active_index]->dbt_neg_infty(),
&end_key, &end_key,
share->key_file[active_index]->dbt_pos_infty()
); );
lockretry_wait; lockretry_wait;
} }
...@@ -4689,7 +4687,7 @@ int ha_tokudb::rnd_init(bool scan) { ...@@ -4689,7 +4687,7 @@ int ha_tokudb::rnd_init(bool scan) {
if (scan) { if (scan) {
DB* db = share->key_file[primary_key]; DB* db = share->key_file[primary_key];
lockretryN(read_lock_wait_time){ lockretryN(read_lock_wait_time){
error = db->pre_acquire_read_lock(db, transaction, db->dbt_neg_infty(), NULL, db->dbt_pos_infty(), NULL); error = db->pre_acquire_read_lock(db, transaction, db->dbt_neg_infty(), db->dbt_pos_infty());
lockretry_wait; lockretry_wait;
} }
if (error) { last_cursor_error = error; goto cleanup; } if (error) { last_cursor_error = error; goto cleanup; }
...@@ -4862,9 +4860,7 @@ int ha_tokudb::prelock_range( const key_range *start_key, const key_range *end_k ...@@ -4862,9 +4860,7 @@ int ha_tokudb::prelock_range( const key_range *start_key, const key_range *end_k
int error = 0; int error = 0;
DBT start_dbt_key; DBT start_dbt_key;
const DBT* start_dbt_data = NULL;
DBT end_dbt_key; DBT end_dbt_key;
const DBT* end_dbt_data = NULL;
uchar* start_key_buff = key_buff2; uchar* start_key_buff = key_buff2;
uchar* end_key_buff = key_buff3; uchar* end_key_buff = key_buff3;
...@@ -4875,43 +4871,30 @@ int ha_tokudb::prelock_range( const key_range *start_key, const key_range *end_k ...@@ -4875,43 +4871,30 @@ int ha_tokudb::prelock_range( const key_range *start_key, const key_range *end_k
switch (start_key->flag) { switch (start_key->flag) {
case HA_READ_AFTER_KEY: case HA_READ_AFTER_KEY:
pack_key(&start_dbt_key, active_index, start_key_buff, start_key->key, start_key->length, COL_POS_INF); pack_key(&start_dbt_key, active_index, start_key_buff, start_key->key, start_key->length, COL_POS_INF);
start_dbt_data = share->key_file[active_index]->dbt_pos_infty();
break; break;
default: default:
pack_key(&start_dbt_key, active_index, start_key_buff, start_key->key, start_key->length, COL_NEG_INF); pack_key(&start_dbt_key, active_index, start_key_buff, start_key->key, start_key->length, COL_NEG_INF);
start_dbt_data = share->key_file[active_index]->dbt_neg_infty();
break; break;
} }
} }
else {
start_dbt_data = share->key_file[active_index]->dbt_neg_infty();
}
if (end_key) { if (end_key) {
switch (end_key->flag) { switch (end_key->flag) {
case HA_READ_BEFORE_KEY: case HA_READ_BEFORE_KEY:
pack_key(&end_dbt_key, active_index, end_key_buff, end_key->key, end_key->length, COL_NEG_INF); pack_key(&end_dbt_key, active_index, end_key_buff, end_key->key, end_key->length, COL_NEG_INF);
end_dbt_data = share->key_file[active_index]->dbt_neg_infty();
break; break;
default: default:
pack_key(&end_dbt_key, active_index, end_key_buff, end_key->key, end_key->length, COL_POS_INF); pack_key(&end_dbt_key, active_index, end_key_buff, end_key->key, end_key->length, COL_POS_INF);
end_dbt_data = share->key_file[active_index]->dbt_pos_infty();
break; break;
} }
} }
else {
end_dbt_data = share->key_file[active_index]->dbt_pos_infty();
}
lockretryN(read_lock_wait_time){ lockretryN(read_lock_wait_time){
error = share->key_file[active_index]->pre_acquire_read_lock( error = share->key_file[active_index]->pre_acquire_read_lock(
share->key_file[active_index], share->key_file[active_index],
transaction, transaction,
start_key ? &start_dbt_key : share->key_file[active_index]->dbt_neg_infty(), start_key ? &start_dbt_key : share->key_file[active_index]->dbt_neg_infty(),
start_dbt_data, end_key ? &end_dbt_key : share->key_file[active_index]->dbt_pos_infty()
end_key ? &end_dbt_key : share->key_file[active_index]->dbt_pos_infty(),
end_dbt_data
); );
lockretry_wait; lockretry_wait;
} }
...@@ -5180,8 +5163,8 @@ int ha_tokudb::acquire_table_lock (DB_TXN* trans, TABLE_LOCK_TYPE lt) { ...@@ -5180,8 +5163,8 @@ int ha_tokudb::acquire_table_lock (DB_TXN* trans, TABLE_LOCK_TYPE lt) {
error = db->pre_acquire_read_lock( error = db->pre_acquire_read_lock(
db, db,
trans, trans,
db->dbt_neg_infty(), db->dbt_neg_infty(), db->dbt_neg_infty(),
db->dbt_pos_infty(), db->dbt_pos_infty() db->dbt_pos_infty()
); );
if (error) break; if (error) break;
} }
...@@ -6459,9 +6442,7 @@ int ha_tokudb::add_index(TABLE *table_arg, KEY *key_info, uint num_of_keys) { ...@@ -6459,9 +6442,7 @@ int ha_tokudb::add_index(TABLE *table_arg, KEY *key_info, uint num_of_keys) {
share->file, share->file,
txn, txn,
share->file->dbt_neg_infty(), share->file->dbt_neg_infty(),
NULL, share->file->dbt_pos_infty()
share->file->dbt_pos_infty(),
NULL
); );
lockretry_wait; lockretry_wait;
} }
......
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