diff options
author | Sergei Petrunia <psergey@askmonty.org> | 2018-05-15 12:34:10 +0300 |
---|---|---|
committer | Sergei Petrunia <psergey@askmonty.org> | 2018-05-15 12:34:10 +0300 |
commit | 21bcfeb9961ca52a06c995cc5d6a76bd7f3fec09 (patch) | |
tree | d41f8576c6e6b6ebc20f2b8aa4ec57957e788fd4 /storage/rocksdb/ha_rocksdb.h | |
parent | 681e8ca35e3439a39d2069d8f3ebc61d5e18515b (diff) | |
download | mariadb-git-21bcfeb9961ca52a06c995cc5d6a76bd7f3fec09.tar.gz |
MDEV-16155: UPDATE on RocksDB table with unique constraint does not work
RocksDB now supports "iterator bounds" which are min and max keys
that an iterator is interested in.
Iterator initialization function doesn't copy the keys, though, it keeps
pointers to them.
So if the buffer space for the keys is used for another iterator (the one
for checking for UNIUQE constraint violation in ha_rocksdb::ha_update_row)
then one can get incorrect query result.
Fixed by using a separate buffer for iterator bounds in the unique constraint
violation check.
Diffstat (limited to 'storage/rocksdb/ha_rocksdb.h')
-rw-r--r-- | storage/rocksdb/ha_rocksdb.h | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/storage/rocksdb/ha_rocksdb.h b/storage/rocksdb/ha_rocksdb.h index 6083dd73020..5f3d97918fe 100644 --- a/storage/rocksdb/ha_rocksdb.h +++ b/storage/rocksdb/ha_rocksdb.h @@ -653,13 +653,21 @@ class ha_rocksdb : public my_core::handler { enum ha_rkey_function find_flag) const MY_ATTRIBUTE((__nonnull__, __warn_unused_result__)); void setup_iterator_bounds(const Rdb_key_def &kd, - const rocksdb::Slice &eq_cond); + const rocksdb::Slice &eq_cond, + uchar *lower_bound_buf, + uchar *upper_bound_buf, + rocksdb::Slice *out_lower_bound, + rocksdb::Slice *out_upper_bound); bool can_use_bloom_filter(THD *thd, const Rdb_key_def &kd, const rocksdb::Slice &eq_cond, const bool use_all_keys); bool check_bloom_and_set_bounds(THD *thd, const Rdb_key_def &kd, const rocksdb::Slice &eq_cond, - const bool use_all_keys); + const bool use_all_keys, + uchar *lower_bound_buf, + uchar *upper_bound_buf, + rocksdb::Slice *out_lower_bound, + rocksdb::Slice *out_upper_bound); void setup_scan_iterator(const Rdb_key_def &kd, rocksdb::Slice *slice, const bool use_all_keys, const uint eq_cond_len) MY_ATTRIBUTE((__nonnull__)); |