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

[t:3073], fix bug

git-svn-id: file:///svn/mysql/tokudb-engine/tokudb-engine@25905 c7de825b-a66e-492c-adef-691d508d4ae1
parent 7f836645
......@@ -4180,12 +4180,11 @@ int ha_tokudb::index_init(uint keynr, bool sorted) {
//
int ha_tokudb::index_end() {
TOKUDB_DBUG_ENTER("ha_tokudb::index_end %p", this);
int error = 0;
range_lock_grabbed = false;
if (cursor) {
DBUG_PRINT("enter", ("table: '%s'", table_share->table_name.str));
error = cursor->c_close(cursor);
assert(error==0);
int r = cursor->c_close(cursor);
assert(r==0);
cursor = NULL;
last_cursor_error = 0;
}
......@@ -4199,7 +4198,7 @@ int ha_tokudb::index_end() {
read_key = true;
num_fixed_cols_for_query = 0;
num_var_cols_for_query = 0;
TOKUDB_DBUG_RETURN(error);
TOKUDB_DBUG_RETURN(0);
}
......@@ -4766,7 +4765,7 @@ int ha_tokudb::rnd_init(bool scan) {
error = cursor->c_pre_acquire_read_lock(cursor, db->dbt_neg_infty(), db->dbt_pos_infty());
lockretry_wait;
}
if (error) { last_cursor_error = error; goto cleanup; }
if (error) { goto cleanup; }
}
//
// only want to set range_lock_grabbed to true after index_init
......@@ -4777,6 +4776,10 @@ int ha_tokudb::rnd_init(bool scan) {
if (scan) { range_lock_grabbed = true; }
error = 0;
cleanup:
if (error) {
index_end();
last_cursor_error = error;
}
TOKUDB_DBUG_RETURN(error);
}
......
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