1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00

MDEV-27303 Table corruption after insert into a non-InnoDB table with DESC index

optimized prefix search didn't take into account descending indexes

also fixes MDEV-27330
This commit is contained in:
Sergei Golubchik
2021-12-20 19:10:20 +01:00
parent d6ab34b3da
commit 775e7ce6d6
6 changed files with 177 additions and 28 deletions

View File

@ -2706,3 +2706,43 @@ DROP TABLE t1;
#
# End of 5.5 tests
#
#
# MDEV-27303 Table corruption after insert into a non-InnoDB table with DESC index
#
create table t1 (
a bigint default 0,
b bigint default 0,
c binary(128) not null,
d datetime default '0000-00-00 00:00:00',
key (c desc,b,d,a)
) engine=aria;
insert into t1 (c) values
('xx'),('bb'),('tt'),('pp'),('mm'),('yy'),('rr'),('bb'),('yy'),('gg'),
('dd'),('fx'),('wi'),('ix'),('ox'),('mu'),('ux'),('pm'),('mx'),('xu'),
('ul'),('lp'),('px'),('lp'),('xx'),('pq'),('qs'),('se'),('ee'),('xx'),
('rv'),('ff'),('vj'),('jy'),('yn'),('nc'),('nx'),('hj'),('ji'),('ik'),
('kk'),('ww'),('xx'),('yd'),('dw'),('wk'),('kr'),('dd'),('rj'),('jf'),
('bx'),('fc'),('cp'),('pm'),('mw'),('wy'),('yl'),('li'),('ic'),('he'),
('ci'),('il'),('lz'),('zd'),('gz'),('xd'),('ze'),('dm'),('ms'),('xd'),
('sw'),('we'),('nb'),('tx'),('vr'),('xw'),('aa'),('ah'),('hd'),('jl'),
('lf'),('fw'),('wx'),('xh'),('hr'),('zx'),('vw'),('rm'),('mx'),('xt'),
('tp'),('ps'),('sh'),('ga'),('df'),('as'),('gz'),('xd'),('yy'),('xr');
check table t1 extended;
Table Op Msg_type Msg_text
test.t1 check status OK
drop table t1;
#
# MDEV-27330 Wrong sorting order with DESC index and empty strings in MyISAM/Aria table
#
create table t (id int, c char(128) not null, key (c desc));
insert into t values (1,''),(2,'foo'),(3,''),(4,'bar');
select c from t order by c;
c
bar
foo
drop table t;
#
# End of 10.8 tests
#