Skip to content

Instantly share code, notes, and snippets.

@spetrunia
Created April 22, 2021 15:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save spetrunia/fefdca5327ca08c5599b6396a68bd926 to your computer and use it in GitHub Desktop.
Save spetrunia/fefdca5327ca08c5599b6396a68bd926 to your computer and use it in GitHub Desktop.
diff --git a/storage/rocksdb/ha_rocksdb.cc b/storage/rocksdb/ha_rocksdb.cc
index 496b920208b..e431c8c0995 100644
--- a/storage/rocksdb/ha_rocksdb.cc
+++ b/storage/rocksdb/ha_rocksdb.cc
@@ -14607,6 +14607,9 @@ void ha_rocksdb::print_error(int error, myf errflag) {
std::string make_table_version_lookup_key(const char *path) {
std::string res;
+ char buf[Rdb_key_def::INDEX_NUMBER_SIZE];
+ rdb_netbuf_store_index((uchar*)buf, Rdb_key_def::TABLE_VERSION);
+ res.append(buf, Rdb_key_def::INDEX_NUMBER_SIZE);
res.append("MariaDB:table-version:");
res.append(path);
return res;
diff --git a/storage/rocksdb/rdb_datadic.h b/storage/rocksdb/rdb_datadic.h
index 903cecdc379..fb368a17fba 100644
--- a/storage/rocksdb/rdb_datadic.h
+++ b/storage/rocksdb/rdb_datadic.h
@@ -505,6 +505,8 @@ class Rdb_key_def {
MAX_INDEX_ID = 7,
DDL_CREATE_INDEX_ONGOING = 8,
AUTO_INC = 9,
+ // MariaDB: 10 through 12 are already taken in upstream
+ TABLE_VERSION = 20, // MariaDB: table version record
END_DICT_INDEX_ID = 255
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment