Commit 6dc68e5e authored by Zardosht Kasheff's avatar Zardosht Kasheff Committed by Yoni Fogel

refs #6024, merge MRR for MySQL 5.6 to main

git-svn-id: file:///svn/mysql/tokudb-engine/tokudb-engine@53314 c7de825b-a66e-492c-adef-691d508d4ae1
parent 38468b6c
......@@ -5792,7 +5792,7 @@ int ha_tokudb::reset(void) {
TOKUDB_DBUG_ENTER("ha_tokudb::reset");
key_read = 0;
using_ignore = 0;
close_dsmrr();
reset_dsmrr();
TOKUDB_DBUG_RETURN(0);
}
......@@ -8073,6 +8073,16 @@ void ha_tokudb::set_dup_value_for_pk(DBT* key) {
void ha_tokudb::close_dsmrr() {
#ifdef MARIADB_BASE_VERSION
ds_mrr.dsmrr_close();
#elif 50600 <= MYSQL_VERSION_ID && MYSQL_VERSION_ID <= 50699
ds_mrr.dsmrr_close();
#endif
}
void ha_tokudb::reset_dsmrr() {
#ifdef MARIADB_BASE_VERSION
ds_mrr.dsmrr_close();
#elif 50600 <= MYSQL_VERSION_ID && MYSQL_VERSION_ID <= 50699
ds_mrr.reset();
#endif
}
......@@ -8095,6 +8105,14 @@ void ha_tokudb::close_dsmrr() {
#include "ha_tokudb_mrr_maria.cc"
#endif
#if !defined(MARIADB_BASE_VERSION)
#if 50600 <= MYSQL_VERSION_ID && MYSQL_VERSION_ID <= 50699
#include "ha_tokudb_mrr_mysql.cc"
#endif
#endif
// key comparisons
#include "hatoku_cmp.cc"
......
......@@ -126,11 +126,15 @@ class ha_tokudb : public handler {
THR_LOCK_DATA lock; ///< MySQL lock
TOKUDB_SHARE *share; ///< Shared lock info
// maria version of MRR
#ifdef MARIADB_BASE_VERSION
// maria version of MRR
DsMrr_impl ds_mrr;
#elif 50600 <= MYSQL_VERSION_ID && MYSQL_VERSION_ID <= 50699
// maria version of MRR
DsMrr_impl ds_mrr;
#endif
//
// last key returned by ha_tokudb's cursor
//
......@@ -549,6 +553,21 @@ class ha_tokudb : public handler {
char *str, size_t size);
#endif
// MariaDB MRR introduced in 5.6
#if !defined(MARIADB_BASE_VERSION)
#if 50600 <= MYSQL_VERSION_ID && MYSQL_VERSION_ID <= 50699
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(char **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_estimate *cost);
ha_rows multi_range_read_info(uint keyno, uint n_ranges, uint keys,
uint *bufsz, uint *flags, Cost_estimate *cost);
#endif
#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);
......@@ -696,6 +715,7 @@ class ha_tokudb : public handler {
void invalidate_bulk_fetch();
int delete_all_rows_internal();
void close_dsmrr();
void reset_dsmrr();
#if TOKU_INCLUDE_WRITE_FRM_DATA
int write_frm_data(const uchar *frm_data, size_t frm_len);
......
/****************************************************************************
* MRR implementation: use DS-MRR, essentially copied from MyISAM
***************************************************************************/
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(char **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_estimate *cost)
{
/*
This call is here because there is no location where this->table would
already be known.
TODO: consider moving it into some per-query initialization call.
*/
ds_mrr.init(this, table);
return ds_mrr.dsmrr_info_const(keyno, seq, seq_init_param, n_ranges, bufsz,
flags, cost);
}
ha_rows ha_tokudb::multi_range_read_info(uint keyno, uint n_ranges, uint keys,
uint *bufsz, uint *flags,
Cost_estimate *cost)
{
ds_mrr.init(this, table);
return ds_mrr.dsmrr_info(keyno, n_ranges, keys, bufsz, flags, cost);
}
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