mirror of
https://github.com/MariaDB/server.git
synced 2025-01-27 17:33:44 +01:00
Cassandra: Define ha_cassandra::records_in_range()
The definition of the member function ha_cassandra::records_in_range()
was inadvertently removed (renamed to a non-member function) in
commit ff64152bc7
.
Let us define the overridden member function inline, and add C++11
override qualifiers.
This commit is contained in:
parent
37c14690fc
commit
b2bc837ebe
2 changed files with 47 additions and 48 deletions
storage/cassandra
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
Copyright (c) 2012, Monty Program Ab
|
||||
Copyright (c) 2012, 2020, MariaDB Corporation.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
@ -2527,15 +2527,6 @@ THR_LOCK_DATA **ha_cassandra::store_lock(THD *thd,
|
|||
}
|
||||
|
||||
|
||||
ha_rows records_in_range(uint inx, const key_range *min_key,
|
||||
const key_range *max_key,
|
||||
page_range *res)
|
||||
{
|
||||
DBUG_ENTER("ha_cassandra::records_in_range");
|
||||
DBUG_RETURN(HA_POS_ERROR); /* Range scans are not supported */
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
check_if_incompatible_data() called if ALTER TABLE can't detect otherwise
|
||||
if new and old definition are compatible
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
Copyright (c) 2012, Monty Program Ab
|
||||
Copyright (c) 2012, 2020, MariaDB Corporation.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
@ -129,13 +129,13 @@ public:
|
|||
The name of the index type that will be used for display.
|
||||
Don't implement this method unless you really have indexes.
|
||||
*/
|
||||
const char *index_type(uint inx) { return "HASH"; }
|
||||
const char *index_type(uint) override { return "HASH"; }
|
||||
|
||||
/** @brief
|
||||
This is a list of flags that indicate what functionality the storage engine
|
||||
implements. The current table flags are documented in handler.h
|
||||
*/
|
||||
ulonglong table_flags() const
|
||||
ulonglong table_flags() const override
|
||||
{
|
||||
return HA_BINLOG_STMT_CAPABLE |
|
||||
HA_REC_NOT_IN_SEQ |
|
||||
|
@ -157,7 +157,7 @@ public:
|
|||
If all_parts is set, MySQL wants to know the flags for the combined
|
||||
index, up to and including 'part'.
|
||||
*/
|
||||
ulong index_flags(uint inx, uint part, bool all_parts) const
|
||||
ulong index_flags(uint, uint, bool) const override
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
@ -169,11 +169,11 @@ public:
|
|||
send. Return *real* limits of your storage engine here; MySQL will do
|
||||
min(your_limits, MySQL_limits) automatically.
|
||||
*/
|
||||
uint max_supported_record_length() const { return HA_MAX_REC_LENGTH; }
|
||||
uint max_supported_record_length() const override {return HA_MAX_REC_LENGTH;}
|
||||
|
||||
/* Support only one Primary Key, for now */
|
||||
uint max_supported_keys() const { return 1; }
|
||||
uint max_supported_key_parts() const { return 1; }
|
||||
uint max_supported_keys() const override { return 1; }
|
||||
uint max_supported_key_parts() const override { return 1; }
|
||||
|
||||
/** @brief
|
||||
unireg.cc will call this to make sure that the storage engine can handle
|
||||
|
@ -184,42 +184,48 @@ public:
|
|||
There is no need to implement ..._key_... methods if your engine doesn't
|
||||
support indexes.
|
||||
*/
|
||||
uint max_supported_key_length() const { return 16*1024; /* just to return something*/ }
|
||||
uint max_supported_key_length() const override
|
||||
{ return 16*1024; /* just to return something*/ }
|
||||
|
||||
int index_init(uint idx, bool sorted);
|
||||
int index_init(uint idx, bool sorted) override;
|
||||
|
||||
int index_read_map(uchar * buf, const uchar * key,
|
||||
key_part_map keypart_map,
|
||||
enum ha_rkey_function find_flag);
|
||||
enum ha_rkey_function find_flag) override;
|
||||
|
||||
/** @brief
|
||||
Called in test_quick_select to determine if indexes should be used.
|
||||
*/
|
||||
virtual double scan_time() { return (double) (stats.records+stats.deleted) / 20.0+10; }
|
||||
double scan_time() override
|
||||
{ return (double) (stats.records+stats.deleted) / 20.0+10; }
|
||||
|
||||
/** @brief
|
||||
This method will never be called if you do not implement indexes.
|
||||
*/
|
||||
virtual double read_time(uint, uint, ha_rows rows)
|
||||
double read_time(uint, uint, ha_rows rows) override
|
||||
{ return (double) rows / 20.0+1; }
|
||||
|
||||
virtual void start_bulk_insert(ha_rows rows, uint flags);
|
||||
virtual int end_bulk_insert();
|
||||
void start_bulk_insert(ha_rows rows, uint flags) override;
|
||||
int end_bulk_insert() override;
|
||||
|
||||
virtual int reset();
|
||||
int reset() override;
|
||||
|
||||
|
||||
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);
|
||||
uint n_ranges, uint mode, HANDLER_BUFFER *buf)
|
||||
override;
|
||||
int multi_range_read_next(range_id_t *range_info) override;
|
||||
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);
|
||||
uint *flags, Cost_estimate *cost)
|
||||
override;
|
||||
ha_rows multi_range_read_info(uint keyno, uint n_ranges, uint keys,
|
||||
uint key_parts, uint *bufsz,
|
||||
uint *flags, Cost_estimate *cost);
|
||||
int multi_range_read_explain_info(uint mrr_mode, char *str, size_t size);
|
||||
uint *flags, Cost_estimate *cost)
|
||||
override;
|
||||
int multi_range_read_explain_info(uint mrr_mode, char *str, size_t size)
|
||||
override;
|
||||
|
||||
private:
|
||||
bool source_exhausted;
|
||||
|
@ -236,12 +242,12 @@ private:
|
|||
CASSANDRA_TYPE_DEF * get_cassandra_field_def(char *cass_name,
|
||||
int cass_name_length);
|
||||
public:
|
||||
int open(const char *name, int mode, uint test_if_locked);
|
||||
int close(void);
|
||||
int open(const char *name, int mode, uint test_if_locked) override;
|
||||
int close() override;
|
||||
|
||||
int write_row(const uchar *buf);
|
||||
int update_row(const uchar *old_data, const uchar *new_data);
|
||||
int delete_row(const uchar *buf);
|
||||
int write_row(const uchar *buf) override;
|
||||
int update_row(const uchar *old_data, const uchar *new_data) override;
|
||||
int delete_row(const uchar *buf) override;
|
||||
|
||||
/** @brief
|
||||
Unlike index_init(), rnd_init() can be called two consecutive times
|
||||
|
@ -251,29 +257,31 @@ public:
|
|||
cursor to the start of the table; no need to deallocate and allocate
|
||||
it again. This is a required method.
|
||||
*/
|
||||
int rnd_init(bool scan); //required
|
||||
int rnd_end();
|
||||
int rnd_next(uchar *buf); ///< required
|
||||
int rnd_pos(uchar *buf, uchar *pos); ///< required
|
||||
void position(const uchar *record); ///< required
|
||||
int info(uint); ///< required
|
||||
int delete_all_rows(void);
|
||||
ha_rows records_in_range(uint inx, const key_range *min_key,
|
||||
int rnd_init(bool scan) override;
|
||||
int rnd_end() override;
|
||||
int rnd_next(uchar *buf) override;
|
||||
int rnd_pos(uchar *buf, uchar *pos) override;
|
||||
void position(const uchar *record) override;
|
||||
int info(uint) override;
|
||||
int delete_all_rows() override;
|
||||
ha_rows records_in_range(uint, const key_range *min_key,
|
||||
const key_range *max_key,
|
||||
page_range *res);
|
||||
page_range *res) override
|
||||
{ return HA_POS_ERROR; /* Range scans are not supported */ }
|
||||
|
||||
int create(const char *name, TABLE *form,
|
||||
HA_CREATE_INFO *create_info); ///< required
|
||||
HA_CREATE_INFO *create_info) override;
|
||||
bool check_if_incompatible_data(HA_CREATE_INFO *info,
|
||||
uint table_changes);
|
||||
uint table_changes) override;
|
||||
|
||||
THR_LOCK_DATA **store_lock(THD *thd, THR_LOCK_DATA **to,
|
||||
enum thr_lock_type lock_type); ///< required
|
||||
enum thr_lock_type lock_type) override;
|
||||
|
||||
my_bool register_query_cache_table(THD *thd, const char *table_key,
|
||||
uint key_length,
|
||||
qc_engine_callback
|
||||
*engine_callback,
|
||||
ulonglong *engine_data)
|
||||
ulonglong *engine_data) override
|
||||
{
|
||||
/*
|
||||
Do not put data from Cassandra tables into query cache (because there
|
||||
|
|
Loading…
Add table
Reference in a new issue