From 1d1b10e93cff9d2db796ceac2d6be25ee8a8309c Mon Sep 17 00:00:00 2001 From: Sergei Petrunia Date: Mon, 24 Oct 2016 20:51:44 +0000 Subject: [PATCH] MariaRocks: rocksdb.rocksdb fails with a duplicate key error In MariaDB, Field::make_sort_key stores NULL-indicator byte for the field. In MySQL, it doesn't, so MyRocks stores the NULL-indicator itself. Switch to using Field::sort_string, which is the same as Field::make_sort_key in MySQL. --- storage/rocksdb/rdb_datadic.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/storage/rocksdb/rdb_datadic.cc b/storage/rocksdb/rdb_datadic.cc index 847343180ee..472af8141a7 100644 --- a/storage/rocksdb/rdb_datadic.cc +++ b/storage/rocksdb/rdb_datadic.cc @@ -741,7 +741,7 @@ void rdb_pack_with_make_sort_key(Rdb_field_packing *fpi, Field *field, DBUG_ASSERT(*dst != nullptr); const int max_len= fpi->m_max_image_len; - field->make_sort_key(*dst, max_len); + field->sort_string(*dst, max_len); *dst += max_len; }