diff --git a/mysql-test/suite/rocksdb/r/compression_zstd.result b/mysql-test/suite/rocksdb/r/compression_zstd.result new file mode 100644 index 000000000000..62a6dbbdaca7 --- /dev/null +++ b/mysql-test/suite/rocksdb/r/compression_zstd.result @@ -0,0 +1,2 @@ +create table t (id int primary key) engine=rocksdb; +drop table t; diff --git a/mysql-test/suite/rocksdb/t/compression_zstd-master.opt b/mysql-test/suite/rocksdb/t/compression_zstd-master.opt new file mode 100644 index 000000000000..81b5acc4e56b --- /dev/null +++ b/mysql-test/suite/rocksdb/t/compression_zstd-master.opt @@ -0,0 +1 @@ +--rocksdb_default_cf_options=compression_per_level=kZSTDNotFinalCompression;compression_opts=-14:4:0 diff --git a/mysql-test/suite/rocksdb/t/compression_zstd.test b/mysql-test/suite/rocksdb/t/compression_zstd.test new file mode 100644 index 000000000000..c146d43474ce --- /dev/null +++ b/mysql-test/suite/rocksdb/t/compression_zstd.test @@ -0,0 +1,4 @@ +--source include/have_rocksdb.inc + +create table t (id int primary key) engine=rocksdb; +drop table t; diff --git a/storage/rocksdb/CMakeLists.txt b/storage/rocksdb/CMakeLists.txt index 451d2f6b4e14..7bd9360e1c1d 100644 --- a/storage/rocksdb/CMakeLists.txt +++ b/storage/rocksdb/CMakeLists.txt @@ -62,6 +62,12 @@ ELSE() SET(rocksdb_static_libs ${rocksdb_static_libs} bz2) ENDIF() +# link ZSTD only if instructed +IF (NOT "$ENV{WITH_ZSTD}" STREQUAL "") + SET(rocksdb_static_libs ${rocksdb_static_libs} $ENV{WITH_ZSTD}/lib/libzstd.a) + ADD_DEFINITIONS(-DZSTD) +ENDIF() + SET(rocksdb_static_libs ${rocksdb_static_libs} ${ZLIB_LIBRARY}) MYSQL_ADD_PLUGIN(rocksdb_se ${ROCKSDB_SOURCES} STORAGE_ENGINE DEFAULT STATIC_ONLY