Commit graph

6 commits

Author SHA1 Message Date
Lena Startseva
a4234f0410 MDEV-27691: make working view-protocol
Update tests for version 10.8
2022-09-27 18:50:18 +07:00
Marko Mäkelä
c8a18589de Make main.desc_index_range more stable 2022-03-03 11:39:24 +02:00
Sergei Petrunia
fca37e49bb MDEV-27529 Wrong result upon query using index_merge with DESC key (#2)
ROR-index_merge relies on Rowid-ordered-retrieval property: a ROR scan,
e.g. a scan on equality range

  tbl.key=const

should return rows ordered by their Rowid. Also, handler->cmp_ref() should
compare rowids according to the Rowid ordering.

When the table's primary key uses DESC keyparts, ROR scans return rows
according to the PK's ordering.

But ha_innobase::cmp_ref() compared rowids as if PK used ASC keyparts.
This caused wrong query results with index_merge.

Fixed this by making ha_innobase::cmp_ref() compare according to the PK
defintion, including keypart's DESC property.
2022-01-26 18:43:06 +01:00
Sergei Petrunia
62760af4df MDEV-27426 Wrong result upon query using index_merge with DESC key
Make QUICK_RANGE_SELECT::cmp_next() aware of reverse-ordered key parts.

(QUICK_RANGE_SELECT::cmp_prev() uses key_cmp() and so it already works
correctly)
2022-01-26 18:43:06 +01:00
Sergei Petrunia
cbfe6a5e86 MDEV-26996 Support descending indexes in the range optimizer
- Code cleanup
- Disable "Using index for GROUP BY" over indexes with DESC keyparts
2022-01-26 18:43:06 +01:00
Sergei Petrunia
791146b9d2 MDEV-26996 Support descending indexes in the range optimizer
Make the Range Optimizer support descending index key parts.

We follow the approach taken in MySQL-8.

See HowRangeOptimizerHandlesDescKeyparts for the description.
2022-01-26 18:43:05 +01:00