[Commits] bb4206a5ac2: Code cleanup and post-merge fixes

Sergei Petrunia psergey at askmonty.org
Sat Nov 30 18:06:30 EET 2019


revision-id: bb4206a5ac2faa912b91c1da0ed69876ca1ab22d (fb-prod201903-264-gbb4206a5ac2)
parent(s): 398dfcdbfc0ba803f1da9b936deff2c893fe29ed
author: Sergei Petrunia
committer: Sergei Petrunia
timestamp: 2019-11-30 19:06:30 +0300
message:

Code cleanup and post-merge fixes

- rocksdb.varbinary_format prints different output for range vs point
  locking.

- Update to latest RocksDB: WriteUnprepared should call correct Cleanup().

---
 mysql-test/suite/rocksdb/r/varbinary_format.result | 17 ++++++++---------
 mysql-test/suite/rocksdb/t/varbinary_format.test   | 16 +++++++---------
 rocksdb                                            |  2 +-
 3 files changed, 16 insertions(+), 19 deletions(-)

diff --git a/mysql-test/suite/rocksdb/r/varbinary_format.result b/mysql-test/suite/rocksdb/r/varbinary_format.result
index e3dde737f9f..9362d42515c 100644
--- a/mysql-test/suite/rocksdb/r/varbinary_format.result
+++ b/mysql-test/suite/rocksdb/r/varbinary_format.result
@@ -1,4 +1,3 @@
-set @skip_head=9 + if(@@rocksdb_use_range_locking, 2, 0);
 CREATE TABLE t1(
 vb VARBINARY(64) primary key
 ) ENGINE=rocksdb;
@@ -46,8 +45,8 @@ hex(vb)
 00000000000000000000000000000000000000000000000000000000000000
 0000000000000000000000000000000000000000000000000000000000000000
 000000000000000000000000000000000000000000000000000000000000000000
-SELECT SUBSTRING(a.key, at skip_head) FROM information_schema.rocksdb_locks AS a ORDER BY a.key;
-SUBSTRING(a.key, at skip_head)
+SELECT SUBSTRING(a.key,9) FROM information_schema.rocksdb_locks AS a ORDER BY a.key;
+SUBSTRING(a.key,9)
 000000000000000001
 000000000000000002
 000000000000000003
@@ -112,8 +111,8 @@ hex(vb)
 00000000000000000000000000000000000000000000000000000000000000
 0000000000000000000000000000000000000000000000000000000000000000
 000000000000000000000000000000000000000000000000000000000000000000
-SELECT SUBSTRING(a.key, at skip_head) FROM information_schema.rocksdb_locks AS a ORDER BY a.key;
-SUBSTRING(a.key, at skip_head)
+SELECT SUBSTRING(a.key,9) FROM information_schema.rocksdb_locks AS a ORDER BY a.key;
+SUBSTRING(a.key,9)
 0000000000000000f8
 0000000000000000f9
 0000000000000000fa
@@ -176,8 +175,8 @@ aaaaaaaaaa
 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
-SELECT SUBSTRING(a.key, at skip_head) FROM information_schema.rocksdb_locks AS a ORDER BY a.key;
-SUBSTRING(a.key, at skip_head)
+SELECT SUBSTRING(a.key,9) FROM information_schema.rocksdb_locks AS a ORDER BY a.key;
+SUBSTRING(a.key,9)
 610000000000000001
 616100000000000002
 616161000000000003
@@ -242,8 +241,8 @@ aaaaaaaaaa
 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
-SELECT SUBSTRING(a.key, at skip_head) FROM information_schema.rocksdb_locks AS a ORDER BY a.key;
-SUBSTRING(a.key, at skip_head)
+SELECT SUBSTRING(a.key,9) FROM information_schema.rocksdb_locks AS a ORDER BY a.key;
+SUBSTRING(a.key,9)
 6100000000000000f8
 6161000000000000f9
 6161610000000000fa
diff --git a/mysql-test/suite/rocksdb/t/varbinary_format.test b/mysql-test/suite/rocksdb/t/varbinary_format.test
index cca230614fd..fd9ca2b35da 100644
--- a/mysql-test/suite/rocksdb/t/varbinary_format.test
+++ b/mysql-test/suite/rocksdb/t/varbinary_format.test
@@ -1,11 +1,9 @@
 --source include/have_debug.inc
 --source include/have_rocksdb.inc
 
-#
-# In point-locking mode, skip first 4 bytes, as they indexnr.
-# In range-locking mode, there is one more range control byte at the front
-#
-set @skip_head=9 + if(@@rocksdb_use_range_locking, 2, 0);
+# The test uses SELECT .. FOR UPDATE and examines which locks it acquires
+#  Range Locking will use different locks from point locking
+--source suite/rocksdb/include/not_range_locking.inc
 
 # Create a table with a varbinary key with the current format and validate
 # that it sorts correctly
@@ -33,7 +31,7 @@ SELECT hex(vb) FROM t1;
 # validate that the keys were encoded as expected
 BEGIN;
 SELECT hex(vb) FROM t1 FOR UPDATE;
-SELECT SUBSTRING(a.key, at skip_head) FROM information_schema.rocksdb_locks AS a ORDER BY a.key;
+SELECT SUBSTRING(a.key,9) FROM information_schema.rocksdb_locks AS a ORDER BY a.key;
 ROLLBACK;
 
 DROP TABLE t1;
@@ -66,7 +64,7 @@ SELECT hex(vb) FROM t1;
 # validate that the keys were encoded as expected
 BEGIN;
 SELECT hex(vb) FROM t1 FOR UPDATE;
-SELECT SUBSTRING(a.key, at skip_head) FROM information_schema.rocksdb_locks AS a ORDER BY a.key;
+SELECT SUBSTRING(a.key,9) FROM information_schema.rocksdb_locks AS a ORDER BY a.key;
 ROLLBACK;
 
 DROP TABLE t1;
@@ -97,7 +95,7 @@ SELECT * FROM t1;
 # validate that the keys were encoded as expected
 BEGIN;
 SELECT * FROM t1 FOR UPDATE;
-SELECT SUBSTRING(a.key, at skip_head) FROM information_schema.rocksdb_locks AS a ORDER BY a.key;
+SELECT SUBSTRING(a.key,9) FROM information_schema.rocksdb_locks AS a ORDER BY a.key;
 ROLLBACK;
 
 DROP TABLE t1;
@@ -130,7 +128,7 @@ SELECT * FROM t1;
 # validate that the keys were encoded as expected
 BEGIN;
 SELECT * FROM t1 FOR UPDATE;
-SELECT SUBSTRING(a.key, at skip_head) FROM information_schema.rocksdb_locks AS a ORDER BY a.key;
+SELECT SUBSTRING(a.key,9) FROM information_schema.rocksdb_locks AS a ORDER BY a.key;
 ROLLBACK;
 
 DROP TABLE t1;
diff --git a/rocksdb b/rocksdb
index d09b88fb9ee..73ff40dcbf0 160000
--- a/rocksdb
+++ b/rocksdb
@@ -1 +1 @@
-Subproject commit d09b88fb9ee1ebdb13cedf5f6b49bea268188366
+Subproject commit 73ff40dcbf0a46228ea02d5103d1331335622794


More information about the commits mailing list