diff options
Diffstat (limited to 'storage/rocksdb/ha_rocksdb.h')
-rw-r--r-- | storage/rocksdb/ha_rocksdb.h | 83 |
1 files changed, 59 insertions, 24 deletions
diff --git a/storage/rocksdb/ha_rocksdb.h b/storage/rocksdb/ha_rocksdb.h index 3b72173f94c..d064988d0f3 100644 --- a/storage/rocksdb/ha_rocksdb.h +++ b/storage/rocksdb/ha_rocksdb.h @@ -30,7 +30,14 @@ #include "./handler.h" /* handler */ #include "./my_global.h" /* ulonglong */ #include "./sql_string.h" -#include "./ut0counter.h" + +#ifdef _WIN32 +#undef pthread_key_create +#undef pthread_key_delete +#undef pthread_setspecific +#undef pthread_getspecific +#endif + /* RocksDB header files */ #include "rocksdb/cache.h" @@ -48,14 +55,10 @@ #include "./rdb_perf_context.h" #include "./rdb_sst_info.h" #include "./rdb_utils.h" +#include "./ut0counter.h" -/** - @note MyRocks Coding Conventions: - MyRocks code follows the baseline MySQL coding conventions, available at - http://dev.mysql.com/doc/internals/en/coding-guidelines.html, with several - refinements (@see /storage/rocksdb/README file). -*/ - +class Field_blob; +class Field_varstring; /** @note MyRocks Coding Conventions: MyRocks code follows the baseline MySQL coding conventions, available at @@ -215,6 +218,17 @@ const char *const RDB_TTL_COL_QUALIFIER = "ttl_col"; #define RDB_BQUAL_SZ 1 #define RDB_XIDHDR_LEN (RDB_FORMATID_SZ + RDB_GTRID_SZ + RDB_BQUAL_SZ) +/* collations, used in MariaRocks */ +enum collations_used { + COLLATION_UTF8MB4_BIN = 46, + COLLATION_LATIN1_BIN = 47, + COLLATION_UTF16LE_BIN = 55, + COLLATION_UTF32_BIN = 61, + COLLATION_UTF16_BIN = 62, + COLLATION_BINARY = 63, + COLLATION_UTF8_BIN = 83 +}; + /* To fix an unhandled exception we specify the upper bound as LONGLONGMAX instead of ULONGLONGMAX because the latter is -1 and causes an exception when @@ -645,7 +659,9 @@ class ha_rocksdb : public my_core::handler { MY_ATTRIBUTE((__warn_unused_result__)); bool is_blind_delete_enabled(); bool skip_unique_check() const MY_ATTRIBUTE((__warn_unused_result__)); +#ifdef MARIAROCKS_NOT_YET // MDEV-10975 void set_force_skip_unique_check(bool skip) override; +#endif bool commit_in_the_middle() MY_ATTRIBUTE((__warn_unused_result__)); bool do_bulk_commit(Rdb_transaction *const tx) MY_ATTRIBUTE((__nonnull__, __warn_unused_result__)); @@ -688,7 +704,7 @@ class ha_rocksdb : public my_core::handler { current lookup to be covered. If the bitmap field is null, that means this index does not cover the current lookup for any record. */ - MY_BITMAP m_lookup_bitmap = {nullptr, 0, 0, nullptr, nullptr}; + MY_BITMAP m_lookup_bitmap = {nullptr, nullptr, nullptr, 0, 0}; /* Number of bytes in on-disk (storage) record format that are used for @@ -725,6 +741,17 @@ class ha_rocksdb : public my_core::handler { public: /* + The following two are currently only used for getting the range bounds + from QUICK_SELECT_DESC. + We don't need to implement prepare_index_key_scan[_map] because it is + only used with HA_READ_KEY_EXACT and HA_READ_PREFIX_LAST where one + can infer the bounds of the range being scanned, anyway. + */ + int prepare_index_scan() override; + int prepare_range_scan(const key_range *start_key, + const key_range *end_key) override; + + /* Controls whether writes include checksums. This is updated from the session variable at the start of each query. @@ -747,9 +774,10 @@ public: /** @brief The name that will be used for display purposes. */ - const char *table_type() const override { + const char *table_type() const /*override*/ { DBUG_ENTER_FUNC(); - + // MariaDB: this function is not virtual, however ha_innodb + // declares it (and then never uses!) psergey-merge-todo:. DBUG_RETURN(rocksdb_hton_name); } @@ -760,10 +788,10 @@ public: DBUG_RETURN("LSMTREE"); } - /** @brief - The file extensions. - */ - const char **bas_ext() const override; + /* + Not present in MariaDB: + const char **bas_ext() const override; + */ /* See if this is the same base table - this should only be true for different @@ -786,16 +814,23 @@ public: HA_REC_NOT_IN_SEQ If we don't set it, filesort crashes, because it assumes rowids are 1..8 byte numbers + HA_PRIMARY_KEY_IN_READ_INDEX + This flag is always set, even for tables that: + - have no PK + - have some (or all) of PK that can't be decoded from the secondary + index. */ DBUG_RETURN(HA_BINLOG_ROW_CAPABLE | HA_BINLOG_STMT_CAPABLE | HA_REC_NOT_IN_SEQ | HA_CAN_INDEX_BLOBS | - (m_pk_can_be_decoded ? HA_PRIMARY_KEY_IN_READ_INDEX : 0) | + HA_PRIMARY_KEY_IN_READ_INDEX | HA_PRIMARY_KEY_REQUIRED_FOR_POSITION | HA_NULL_IN_KEY | - HA_PARTIAL_COLUMN_READ); + HA_PARTIAL_COLUMN_READ | + HA_TABLE_SCAN_ON_INDEX); } - bool init_with_fields() override; - +private: + bool init_with_fields(); /* no 'override' in MariaDB */ +public: /** @brief This is a bitmap of flags that indicates how the storage engine implements indexes. The current index flags are documented in @@ -949,10 +984,7 @@ public: const key_range *end_key) MY_ATTRIBUTE((__warn_unused_result__)); - int index_read_last_map(uchar *const buf, const uchar *const key, - key_part_map keypart_map) override - MY_ATTRIBUTE((__warn_unused_result__)); - + bool is_using_full_key(key_part_map keypart_map, uint actual_key_parts); int read_range_first(const key_range *const start_key, const key_range *const end_key, bool eq_range, bool sorted) override @@ -1103,7 +1135,6 @@ private: int index_last_intern(uchar *buf) MY_ATTRIBUTE((__nonnull__, __warn_unused_result__)); - enum icp_result check_index_cond() const; int find_icp_matching_index_rec(const bool &move_forward, uchar *const buf) MY_ATTRIBUTE((__nonnull__, __warn_unused_result__)); @@ -1306,15 +1337,19 @@ public: int finalize_bulk_load() MY_ATTRIBUTE((__warn_unused_result__)); +#ifdef MARIAROCKS_NOT_YET // MDEV-10976 void set_use_read_free_rpl(const char *const whitelist); +#endif void set_skip_unique_check_tables(const char *const whitelist); +#ifdef MARIAROCKS_NOT_YET // MDEV-10976 public: virtual void rpl_before_delete_rows() override; virtual void rpl_after_delete_rows() override; virtual void rpl_before_update_rows() override; virtual void rpl_after_update_rows() override; virtual bool use_read_free_rpl(); +#endif // MARIAROCKS_NOT_YET private: /* Flags tracking if we are inside different replication operation */ |