From 8c5912e9ee721c32349a778531b8fd7836b8bd40 Mon Sep 17 00:00:00 2001 From: Sergei Petrunia Date: Wed, 19 Oct 2016 14:27:43 +0000 Subject: [PATCH] MariaRocks port: temporarily disable gap lock checking Also provide handler::is_using_full_key --- sql/handler.cc | 8 ++++++++ sql/handler.h | 1 + storage/rocksdb/ha_rocksdb.cc | 6 ++++++ 3 files changed, 15 insertions(+) diff --git a/sql/handler.cc b/sql/handler.cc index d7481f8e8ea..e21b7a94fa1 100644 --- a/sql/handler.cc +++ b/sql/handler.cc @@ -2704,6 +2704,14 @@ int handler::ha_index_first(uchar * buf) return result; } +bool handler::is_using_full_key(key_part_map keypart_map, + uint actual_key_parts) +{ + return (keypart_map == HA_WHOLE_KEY) || + (keypart_map == ((key_part_map(1) << actual_key_parts) + - 1)); +} + int handler::ha_index_last(uchar * buf) { int result; diff --git a/sql/handler.h b/sql/handler.h index 401d6ad9440..775d21ed3ff 100644 --- a/sql/handler.h +++ b/sql/handler.h @@ -3159,6 +3159,7 @@ public: size_t size) { return 0; } + bool is_using_full_key(key_part_map keypart_map, uint actual_key_parts); virtual int read_range_first(const key_range *start_key, const key_range *end_key, bool eq_range, bool sorted); diff --git a/storage/rocksdb/ha_rocksdb.cc b/storage/rocksdb/ha_rocksdb.cc index 1e672cad542..7f377073bd4 100644 --- a/storage/rocksdb/ha_rocksdb.cc +++ b/storage/rocksdb/ha_rocksdb.cc @@ -6229,6 +6229,7 @@ int ha_rocksdb::read_range_first(const key_range *start_key, result= ha_index_first(table->record[0]); else { +#ifdef MARIAROCKS_NOT_YET if (is_using_prohibited_gap_locks(table, is_using_full_unique_key( active_index, @@ -6237,6 +6238,7 @@ int ha_rocksdb::read_range_first(const key_range *start_key, { DBUG_RETURN(HA_ERR_LOCK_DEADLOCK); } +#endif MYSQL_TABLE_IO_WAIT(m_psi, PSI_TABLE_FETCH_ROW, active_index, 0, { result= index_read_map_impl(table->record[0], @@ -8613,7 +8615,11 @@ THR_LOCK_DATA **ha_rocksdb::store_lock(THD *thd, uint sql_command = my_core::thd_sql_command(thd); if ((lock_type == TL_READ && in_lock_tables) || (lock_type == TL_READ_HIGH_PRIORITY && in_lock_tables) || +#ifdef MARIAROCKS_NOT_YET can_hold_read_locks_on_select(thd, lock_type)) +#else + false) +#endif { ulong tx_isolation = my_core::thd_tx_isolation(thd); if (sql_command != SQLCOM_CHECKSUM &&