Commit e6afa256 authored by Sergei Petrunia's avatar Sergei Petrunia

MariaRocks port: Make ha_rocksdb::index_flags() return HA_CLUSTERED_INDEX for PK

Failure to do so caused a failure in rocksdb.rocksdb test.
When test_if_cheaper_ordering computes is_covering= ...,
- MySQL calls table->file->primary_key_is_clustered()
- MariaDB calls (table->file->index_flags(nr, 0, 1) &
                          HA_CLUSTERED_INDEX)

The first produces true, the second used to produce false.
parent 0d525721
......@@ -6160,7 +6160,7 @@ ulong ha_rocksdb::index_flags(uint inx, uint part, bool all_parts) const
we need to explicitly "allow" them, otherwise SQL layer will miss some
plans.
*/
base_flags |= HA_KEYREAD_ONLY;
base_flags |= HA_KEYREAD_ONLY | HA_CLUSTERED_INDEX;
}
else
{
......
......@@ -1288,6 +1288,8 @@ drop table t1;
#
CREATE TABLE t1 (pk INT PRIMARY KEY, a SMALLINT, b INT, KEY (a)) ENGINE=RocksDB;
INSERT IGNORE INTO t1 VALUES (1, 157, 0), (2, 1898, -504403), (1, -14659, 0);
Warnings:
Warning 1062 Duplicate entry '1' for key 'PRIMARY'
SELECT * FROM t1;
pk a b
1 157 0
......@@ -1807,7 +1809,7 @@ insert into t1 values (1,1),(2,2),(3,3);
# The following must not use 'Using filesort':
explain select * from t1 ORDER BY id;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 index NULL PRIMARY 4 NULL # NULL
1 SIMPLE t1 index NULL PRIMARY 4 NULL #
drop table t1;
#
# Issue #26: Index-only scans for DATETIME and TIMESTAMP
......
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