Commit b2bc837e authored by Marko Mäkelä's avatar Marko Mäkelä

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 ff64152b.

Let us define the overridden member function inline, and add C++11
override qualifiers.
parent 37c14690
/* /*
Copyright (c) 2012, Monty Program Ab Copyright (c) 2012, 2020, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify 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 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, ...@@ -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 check_if_incompatible_data() called if ALTER TABLE can't detect otherwise
if new and old definition are compatible if new and old definition are compatible
......
/* /*
Copyright (c) 2012, Monty Program Ab Copyright (c) 2012, 2020, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify 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 it under the terms of the GNU General Public License as published by
...@@ -129,13 +129,13 @@ class ha_cassandra: public handler ...@@ -129,13 +129,13 @@ class ha_cassandra: public handler
The name of the index type that will be used for display. The name of the index type that will be used for display.
Don't implement this method unless you really have indexes. 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 /** @brief
This is a list of flags that indicate what functionality the storage engine This is a list of flags that indicate what functionality the storage engine
implements. The current table flags are documented in handler.h implements. The current table flags are documented in handler.h
*/ */
ulonglong table_flags() const ulonglong table_flags() const override
{ {
return HA_BINLOG_STMT_CAPABLE | return HA_BINLOG_STMT_CAPABLE |
HA_REC_NOT_IN_SEQ | HA_REC_NOT_IN_SEQ |
...@@ -157,7 +157,7 @@ class ha_cassandra: public handler ...@@ -157,7 +157,7 @@ class ha_cassandra: public handler
If all_parts is set, MySQL wants to know the flags for the combined If all_parts is set, MySQL wants to know the flags for the combined
index, up to and including 'part'. 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; return 0;
} }
...@@ -169,11 +169,11 @@ class ha_cassandra: public handler ...@@ -169,11 +169,11 @@ class ha_cassandra: public handler
send. Return *real* limits of your storage engine here; MySQL will do send. Return *real* limits of your storage engine here; MySQL will do
min(your_limits, MySQL_limits) automatically. 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 */ /* Support only one Primary Key, for now */
uint max_supported_keys() const { return 1; } uint max_supported_keys() const override { return 1; }
uint max_supported_key_parts() const { return 1; } uint max_supported_key_parts() const override { return 1; }
/** @brief /** @brief
unireg.cc will call this to make sure that the storage engine can handle unireg.cc will call this to make sure that the storage engine can handle
...@@ -184,42 +184,48 @@ class ha_cassandra: public handler ...@@ -184,42 +184,48 @@ class ha_cassandra: public handler
There is no need to implement ..._key_... methods if your engine doesn't There is no need to implement ..._key_... methods if your engine doesn't
support indexes. 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, int index_read_map(uchar * buf, const uchar * key,
key_part_map keypart_map, key_part_map keypart_map,
enum ha_rkey_function find_flag); enum ha_rkey_function find_flag) override;
/** @brief /** @brief
Called in test_quick_select to determine if indexes should be used. 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 /** @brief
This method will never be called if you do not implement indexes. 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; } { return (double) rows / 20.0+1; }
virtual void start_bulk_insert(ha_rows rows, uint flags); void start_bulk_insert(ha_rows rows, uint flags) override;
virtual int end_bulk_insert(); int end_bulk_insert() override;
virtual int reset(); int reset() override;
int multi_range_read_init(RANGE_SEQ_IF *seq, void *seq_init_param, int multi_range_read_init(RANGE_SEQ_IF *seq, void *seq_init_param,
uint n_ranges, uint mode, HANDLER_BUFFER *buf); uint n_ranges, uint mode, HANDLER_BUFFER *buf)
int multi_range_read_next(range_id_t *range_info); 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, ha_rows multi_range_read_info_const(uint keyno, RANGE_SEQ_IF *seq,
void *seq_init_param, void *seq_init_param,
uint n_ranges, uint *bufsz, 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, ha_rows multi_range_read_info(uint keyno, uint n_ranges, uint keys,
uint key_parts, uint *bufsz, uint key_parts, uint *bufsz,
uint *flags, Cost_estimate *cost); uint *flags, Cost_estimate *cost)
int multi_range_read_explain_info(uint mrr_mode, char *str, size_t size); override;
int multi_range_read_explain_info(uint mrr_mode, char *str, size_t size)
override;
private: private:
bool source_exhausted; bool source_exhausted;
...@@ -236,12 +242,12 @@ class ha_cassandra: public handler ...@@ -236,12 +242,12 @@ class ha_cassandra: public handler
CASSANDRA_TYPE_DEF * get_cassandra_field_def(char *cass_name, CASSANDRA_TYPE_DEF * get_cassandra_field_def(char *cass_name,
int cass_name_length); int cass_name_length);
public: public:
int open(const char *name, int mode, uint test_if_locked); int open(const char *name, int mode, uint test_if_locked) override;
int close(void); int close() override;
int write_row(const uchar *buf); int write_row(const uchar *buf) override;
int update_row(const uchar *old_data, const uchar *new_data); int update_row(const uchar *old_data, const uchar *new_data) override;
int delete_row(const uchar *buf); int delete_row(const uchar *buf) override;
/** @brief /** @brief
Unlike index_init(), rnd_init() can be called two consecutive times Unlike index_init(), rnd_init() can be called two consecutive times
...@@ -251,29 +257,31 @@ class ha_cassandra: public handler ...@@ -251,29 +257,31 @@ class ha_cassandra: public handler
cursor to the start of the table; no need to deallocate and allocate cursor to the start of the table; no need to deallocate and allocate
it again. This is a required method. it again. This is a required method.
*/ */
int rnd_init(bool scan); //required int rnd_init(bool scan) override;
int rnd_end(); int rnd_end() override;
int rnd_next(uchar *buf); ///< required int rnd_next(uchar *buf) override;
int rnd_pos(uchar *buf, uchar *pos); ///< required int rnd_pos(uchar *buf, uchar *pos) override;
void position(const uchar *record); ///< required void position(const uchar *record) override;
int info(uint); ///< required int info(uint) override;
int delete_all_rows(void); int delete_all_rows() override;
ha_rows records_in_range(uint inx, const key_range *min_key, ha_rows records_in_range(uint, const key_range *min_key,
const key_range *max_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, 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, 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, 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, my_bool register_query_cache_table(THD *thd, const char *table_key,
uint key_length, uint key_length,
qc_engine_callback qc_engine_callback
*engine_callback, *engine_callback,
ulonglong *engine_data) ulonglong *engine_data) override
{ {
/* /*
Do not put data from Cassandra tables into query cache (because there Do not put data from Cassandra tables into query cache (because there
......
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