Commit ebbe59fa authored by Sergei Petrunia's avatar Sergei Petrunia

MariaRocks port: fix rocksdb.bloomfilter3 test

In MySQL 5.6, QUICK_SELECT_DESC calls handler->set_end_range() to
inform the storage engine about the bounds of the range being scanned.

MariaDB doesn't have that (handler::set_end_range call was back-ported
but it is not called from QUICK_SELECT_DESC).
Instead, it got prepare_*scan() methods from TokuDB.

Implement these methods so that MyRocks has information about the range
end.
parent 69d5ee58
......@@ -6528,6 +6528,23 @@ int ha_rocksdb::read_range_first(const key_range* const start_key,
}
int ha_rocksdb::prepare_index_scan()
{
range_key_part= table->key_info[active_index].key_part;
set_end_range(NULL);
return 0;
}
int ha_rocksdb::prepare_range_scan(const key_range *start_key,
const key_range *end_key)
{
range_key_part= table->key_info[active_index].key_part;
set_end_range(end_key);
return 0;
}
int ha_rocksdb::index_read_map(uchar* const buf, const uchar* const key,
key_part_map keypart_map,
enum ha_rkey_function find_flag)
......
......@@ -576,6 +576,17 @@ class ha_rocksdb: public my_core::handler
void update_stats(void);
public:
/*
The following two are currently only used for getting the range bounds
from QUICK_SELECT_DESC.
We don't need to implement prepare_index_key_scan[_map] because it is
only used with HA_READ_KEY_EXACT and HA_READ_PREFIX_LAST where one
can infer the bounds of the range being scanned, anyway.
*/
int prepare_index_scan() override;
int prepare_range_scan(const key_range *start_key,
const key_range *end_key) override;
/*
Controls whether writes include checksums. This is updated from the session variable
at the start of each query.
......
......@@ -101,11 +101,11 @@ insert into t1 values (21,2,2,0x12FFFFFFFFFF,1);
explain
select * from t1 where kp0=1 and kp1=1 and kp2=0x12FFFFFFFFFF order by kp3 desc;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 index kp12 kp12 28 NULL # Using where; Using index
1 SIMPLE t1 ref kp12 kp12 20 const,const,const # Using where; Using index
show status like '%rocksdb_bloom_filter_prefix%';
Variable_name Value
rocksdb_bloom_filter_prefix_checked 0
rocksdb_bloom_filter_prefix_useful 0
Rocksdb_bloom_filter_prefix_checked 0
Rocksdb_bloom_filter_prefix_useful 0
select variable_value into @c from information_schema.global_status where variable_name='rocksdb_bloom_filter_prefix_checked';
select * from t1 where kp0=1 and kp1=1 and kp2=0x12FFFFFFFFFF order by kp3 desc;
pk kp0 kp1 kp2 kp3
......@@ -113,8 +113,8 @@ pk kp0 kp1 kp2 kp3
10 1 1 20890720927743 1
show status like '%rocksdb_bloom_filter_prefix%';
Variable_name Value
rocksdb_bloom_filter_prefix_checked 0
rocksdb_bloom_filter_prefix_useful 0
Rocksdb_bloom_filter_prefix_checked 0
Rocksdb_bloom_filter_prefix_useful 0
# The following MUST show TRUE:
select case when variable_value-@c = 0 then 'true' else 'false' end from information_schema.global_status where variable_name='rocksdb_bloom_filter_prefix_checked';
case when variable_value-@c = 0 then 'true' else 'false' end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment