mirror of
https://github.com/MariaDB/server.git
synced 2025-01-15 19:42:28 +01:00
MDEV-35849: index records in a wrong order
page_cur_dtuple_cmp(): Take DESC index fields into account also when comparing a NULL value in a ROW_FORMAT≠REDUNDANT record. Thanks to Elena Stepanova for finding this bug.
This commit is contained in:
parent
3761a7fec8
commit
18dbeae1b8
3 changed files with 22 additions and 1 deletions
|
@ -1996,4 +1996,14 @@ a
|
|||
c
|
||||
DROP TABLE t1;
|
||||
# End of 10.8 tests
|
||||
#
|
||||
# MDEV-35849: index records in a wrong order
|
||||
#
|
||||
CREATE TABLE t (pk INT PRIMARY KEY, a VARCHAR(1), KEY (a DESC)) ENGINE=InnoDB;
|
||||
INSERT INTO t VALUES (1,NULL),(2,'x');
|
||||
CHECK TABLE t;
|
||||
Table Op Msg_type Msg_text
|
||||
test.t check status OK
|
||||
DROP TABLE t;
|
||||
# End of 11.8 tests
|
||||
ALTER DATABASE test CHARACTER SET utf8mb4 COLLATE utf8mb4_uca1400_ai_ci;
|
||||
|
|
|
@ -1229,6 +1229,17 @@ DROP TABLE t1;
|
|||
|
||||
--echo # End of 10.8 tests
|
||||
|
||||
--echo #
|
||||
--echo # MDEV-35849: index records in a wrong order
|
||||
--echo #
|
||||
|
||||
CREATE TABLE t (pk INT PRIMARY KEY, a VARCHAR(1), KEY (a DESC)) ENGINE=InnoDB;
|
||||
INSERT INTO t VALUES (1,NULL),(2,'x');
|
||||
CHECK TABLE t;
|
||||
DROP TABLE t;
|
||||
|
||||
--echo # End of 11.8 tests
|
||||
|
||||
--disable_query_log
|
||||
|
||||
call mtr.add_suppression("InnoDB: Tablespace .* was not found at .*t[12].ibd.");
|
||||
|
|
|
@ -606,7 +606,7 @@ static int page_cur_dtuple_cmp(const dtuple_t &dtuple, const rec_t *rec,
|
|||
{
|
||||
if (i < cur_field || dtuple.fields[i].len == UNIV_SQL_NULL)
|
||||
continue;
|
||||
ret= 1;
|
||||
ret= field->descending ? -1 : 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue