Skip to content

Commit

Permalink
MariaRocks port: temporarily disable gap lock checking
Browse files Browse the repository at this point in the history
Also provide handler::is_using_full_key
  • Loading branch information
spetrunia committed Oct 19, 2016
1 parent fe0b57d commit 8c5912e
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 0 deletions.
8 changes: 8 additions & 0 deletions sql/handler.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
1 change: 1 addition & 0 deletions sql/handler.h
Original file line number Diff line number Diff line change
Expand Up @@ -3159,6 +3159,7 @@ class handler :public Sql_alloc
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);
Expand Down
6 changes: 6 additions & 0 deletions storage/rocksdb/ha_rocksdb.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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],
Expand Down Expand Up @@ -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 &&
Expand Down

0 comments on commit 8c5912e

Please sign in to comment.