|
Currently MERGE and underlying MyISAM tables are allowed to have different ASC/DESC attributes on corresponding indexes. It can cause wrong results, at least for ORDER BY:
create or replace table t (a int, key(a desc)) engine=MyISAM;
|
create or replace table tm (a int, key(a)) engine=Merge union(t);
|
insert into t values (1),(5),(3);
|
|
# From the underlying table -- OK
|
select * from t force index for order by (a) order by a;
|
# From the MERGE table -- not OK
|
select * from tm force index for order by (a) order by a;
|
|
# Cleanup
|
drop table tm, t;
|
|
preview-10.8-MDEV-13756-desc-indexes 49b38c82a
|
select * from tm force index for order by (a) order by a;
|
a
|
5
|
3
|
1
|
|