Skip to content

Commit 6e89964

Browse files
committed
move rocksdb specific changes into rocksdb
1 parent 9ce639a commit 6e89964

File tree

6 files changed

+27
-26
lines changed

6 files changed

+27
-26
lines changed

include/mysql/plugin.h

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -393,23 +393,6 @@ DECLARE_MYSQL_SYSVAR_SIMPLE(name, unsigned long long) = { \
393393
PLUGIN_VAR_LONGLONG | PLUGIN_VAR_UNSIGNED | ((opt) & PLUGIN_VAR_MASK), \
394394
#name, comment, check, update, &varname, def, min, max, blk }
395395

396-
#define MYSQL_SYSVAR_UINT64_T(name, varname, opt, comment, check, update, def, min, max, blk) \
397-
DECLARE_MYSQL_SYSVAR_SIMPLE(name, uint64_t) = { \
398-
PLUGIN_VAR_LONGLONG | PLUGIN_VAR_UNSIGNED | ((opt) & PLUGIN_VAR_MASK), \
399-
#name, comment, check, update, &varname, def, min, max, blk }
400-
401-
#ifdef _WIN64
402-
#define MYSQL_SYSVAR_SIZE_T(name, varname, opt, comment, check, update, def, min, max, blk) \
403-
DECLARE_MYSQL_SYSVAR_SIMPLE(name, size_t) = { \
404-
PLUGIN_VAR_LONGLONG | PLUGIN_VAR_UNSIGNED | ((opt) & PLUGIN_VAR_MASK), \
405-
#name, comment, check, update, &varname, def, min, max, blk }
406-
#else
407-
#define MYSQL_SYSVAR_SIZE_T(name, varname, opt, comment, check, update, def, min, max, blk) \
408-
DECLARE_MYSQL_SYSVAR_SIMPLE(name, size_t) = { \
409-
PLUGIN_VAR_LONG | PLUGIN_VAR_UNSIGNED | ((opt) & PLUGIN_VAR_MASK), \
410-
#name, comment, check, update, &varname, def, min, max, blk }
411-
#endif
412-
413396
#define MYSQL_SYSVAR_ENUM(name, varname, opt, comment, check, update, def, typelib) \
414397
DECLARE_MYSQL_SYSVAR_TYPELIB(name, unsigned long) = { \
415398
PLUGIN_VAR_ENUM | ((opt) & PLUGIN_VAR_MASK), \

sql/handler.cc

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2728,14 +2728,6 @@ int handler::ha_index_first(uchar * buf)
27282728
return result;
27292729
}
27302730

2731-
bool handler::is_using_full_key(key_part_map keypart_map,
2732-
uint actual_key_parts)
2733-
{
2734-
return (keypart_map == HA_WHOLE_KEY) ||
2735-
(keypart_map == ((key_part_map(1) << actual_key_parts)
2736-
- 1));
2737-
}
2738-
27392731
int handler::ha_index_last(uchar * buf)
27402732
{
27412733
int result;

sql/handler.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3193,7 +3193,6 @@ class handler :public Sql_alloc
31933193
size_t size)
31943194
{ return 0; }
31953195

3196-
bool is_using_full_key(key_part_map keypart_map, uint actual_key_parts);
31973196
virtual int read_range_first(const key_range *start_key,
31983197
const key_range *end_key,
31993198
bool eq_range, bool sorted);

storage/rocksdb/build_rocksdb.cmake

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,12 @@ else()
2929
endif()
3030
endif()
3131

32+
include (CheckTypeSize)
33+
check_type_size(size_t SIZEOF_SIZE_T)
34+
check_type_size(uint64_t SIZEOF_UINT64_T)
35+
set_property(SOURCE ha_rocksdb.cc APPEND PROPERTY COMPILE_DEFINITIONS
36+
SIZEOF_SIZE_T=${SIZEOF_SIZE_T} SIZEOF_UINT64_T=${SIZEOF_UINT64_T})
37+
3238
# Optional compression libraries.
3339

3440
foreach(compression_lib LZ4 BZIP2 ZSTD snappy)

storage/rocksdb/ha_rocksdb.cc

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -454,6 +454,18 @@ const int64 RDB_DEFAULT_BLOCK_CACHE_SIZE = 512 * 1024 * 1024;
454454
const int64 RDB_MIN_BLOCK_CACHE_SIZE = 1024;
455455
const int RDB_MAX_CHECKSUMS_PCT = 100;
456456

457+
#if SIZEOF_ULONG == SIZEOF_SIZE_T
458+
#define MYSQL_SYSVAR_SIZE_T MYSQL_SYSVAR_ULONG
459+
#else
460+
#define MYSQL_SYSVAR_SIZE_T MYSQL_SYSVAR_ULONGLONG
461+
#endif
462+
463+
#if SIZEOF_ULONG == SIZEOF_UINT64_T
464+
#define MYSQL_SYSVAR_UINT64_T MYSQL_SYSVAR_ULONG
465+
#else
466+
#define MYSQL_SYSVAR_UINT64_T MYSQL_SYSVAR_ULONGLONG
467+
#endif
468+
457469
// TODO: 0 means don't wait at all, and we don't support it yet?
458470
static MYSQL_THDVAR_ULONG(lock_wait_timeout, PLUGIN_VAR_RQCMDARG,
459471
"Number of seconds to wait for lock", nullptr,
@@ -5922,6 +5934,14 @@ int ha_rocksdb::secondary_index_read(const int keyno, uchar *const buf) {
59225934
return HA_ERR_END_OF_FILE;
59235935
}
59245936

5937+
bool ha_rocksdb::is_using_full_key(key_part_map keypart_map,
5938+
uint actual_key_parts)
5939+
{
5940+
return (keypart_map == HA_WHOLE_KEY) ||
5941+
(keypart_map == ((key_part_map(1) << actual_key_parts)
5942+
- 1));
5943+
}
5944+
59255945
/*
59265946
ha_rocksdb::read_range_first overrides handler::read_range_first.
59275947
The only difference from handler::read_range_first is that

storage/rocksdb/ha_rocksdb.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -866,6 +866,7 @@ class ha_rocksdb : public my_core::handler {
866866
const key_range *end_key)
867867
MY_ATTRIBUTE((__warn_unused_result__));
868868

869+
bool is_using_full_key(key_part_map keypart_map, uint actual_key_parts);
869870
int read_range_first(const key_range *const start_key,
870871
const key_range *const end_key, bool eq_range,
871872
bool sorted) override

0 commit comments

Comments
 (0)