Commit 38468b6c authored by Zardosht Kasheff's avatar Zardosht Kasheff Committed by Yoni Fogel

refs #5571, merge to main

git-svn-id: file:///svn/mysql/tokudb-engine/tokudb-engine@53300 c7de825b-a66e-492c-adef-691d508d4ae1
parent 691e2b71
......@@ -4459,6 +4459,7 @@ int ha_tokudb::index_end() {
invalidate_bulk_fetch();
doing_bulk_fetch = false;
close_dsmrr();
TOKUDB_DBUG_RETURN(0);
}
......@@ -5791,6 +5792,7 @@ int ha_tokudb::reset(void) {
TOKUDB_DBUG_ENTER("ha_tokudb::reset");
key_read = 0;
using_ignore = 0;
close_dsmrr();
TOKUDB_DBUG_RETURN(0);
}
......@@ -8068,6 +8070,13 @@ void ha_tokudb::set_dup_value_for_pk(DBT* key) {
last_dup_key = primary_key;
}
void ha_tokudb::close_dsmrr() {
#ifdef MARIADB_BASE_VERSION
ds_mrr.dsmrr_close();
#endif
}
// table admin
#include "ha_tokudb_admin.cc"
......@@ -8081,6 +8090,11 @@ void ha_tokudb::set_dup_value_for_pk(DBT* key) {
#include "ha_tokudb_alter_55.cc"
#include "ha_tokudb_alter_56.cc"
// maria mrr
#ifdef MARIADB_BASE_VERSION
#include "ha_tokudb_mrr_maria.cc"
#endif
// key comparisons
#include "hatoku_cmp.cc"
......
......@@ -126,6 +126,11 @@ private:
THR_LOCK_DATA lock; ///< MySQL lock
TOKUDB_SHARE *share; ///< Shared lock info
// maria version of MRR
#ifdef MARIADB_BASE_VERSION
DsMrr_impl ds_mrr;
#endif
//
// last key returned by ha_tokudb's cursor
//
......@@ -526,6 +531,24 @@ public:
int cmp_ref(const uchar * ref1, const uchar * ref2);
bool check_if_incompatible_data(HA_CREATE_INFO * info, uint table_changes);
// MariaDB MRR introduced in 5.5
#ifdef MARIADB_BASE_VERSION
int multi_range_read_init(RANGE_SEQ_IF* seq,
void* seq_init_param,
uint n_ranges, uint mode,
HANDLER_BUFFER *buf);
int multi_range_read_next(range_id_t *range_info);
ha_rows multi_range_read_info_const(uint keyno, RANGE_SEQ_IF *seq,
void *seq_init_param,
uint n_ranges, uint *bufsz,
uint *flags, COST_VECT *cost);
ha_rows multi_range_read_info(uint keyno, uint n_ranges, uint keys,
uint key_parts, uint *bufsz,
uint *flags, COST_VECT *cost);
int multi_range_read_explain_info(uint mrr_mode,
char *str, size_t size);
#endif
#if TOKU_INCLUDE_ALTER_56
public:
enum_alter_inplace_result check_if_supported_inplace_alter(TABLE *altered_table, Alter_inplace_info *ha_alter_info);
......@@ -672,6 +695,8 @@ private:
int read_data_from_range_query_buff(uchar* buf, bool need_val);
void invalidate_bulk_fetch();
int delete_all_rows_internal();
void close_dsmrr();
#if TOKU_INCLUDE_WRITE_FRM_DATA
int write_frm_data(const uchar *frm_data, size_t frm_len);
#endif
......
/****************************************************************************
* DS-MRR implementation, essentially copied from InnoDB/MyISAM/Maria
***************************************************************************/
/**
* Multi Range Read interface, DS-MRR calls
*/
int ha_tokudb::multi_range_read_init(RANGE_SEQ_IF *seq, void *seq_init_param,
uint n_ranges, uint mode,
HANDLER_BUFFER *buf)
{
return ds_mrr.dsmrr_init(this, seq, seq_init_param, n_ranges, mode, buf);
}
int ha_tokudb::multi_range_read_next(range_id_t *range_info)
{
return ds_mrr.dsmrr_next(range_info);
}
ha_rows ha_tokudb::multi_range_read_info_const(uint keyno, RANGE_SEQ_IF *seq,
void *seq_init_param,
uint n_ranges, uint *bufsz,
uint *flags,
COST_VECT *cost)
{
/* See comments in ha_myisam::multi_range_read_info_const */
ds_mrr.init(this, table);
ha_rows res= ds_mrr.dsmrr_info_const(keyno, seq, seq_init_param, n_ranges,
bufsz, flags, cost);
return res;
}
ha_rows ha_tokudb::multi_range_read_info(uint keyno, uint n_ranges, uint keys,
uint key_parts, uint *bufsz,
uint *flags, COST_VECT *cost)
{
ds_mrr.init(this, table);
ha_rows res= ds_mrr.dsmrr_info(keyno, n_ranges, keys, key_parts, bufsz,
flags, cost);
return res;
}
int ha_tokudb::multi_range_read_explain_info(uint mrr_mode, char *str, size_t size)
{
return ds_mrr.dsmrr_explain_info(mrr_mode, str, size);
}
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