mirror of
https://github.com/MariaDB/server.git
synced 2026-05-17 20:37:12 +02:00
MDEV-27408 DESC index on a Mroonga table causes wrong order of result set
disallow descending indexes in mroonga
This commit is contained in:
parent
918f524490
commit
ae8600d514
3 changed files with 32 additions and 0 deletions
|
|
@ -3844,6 +3844,14 @@ int ha_mroonga::storage_create_validate_index(TABLE *table)
|
|||
KEY *key_info = &(table->s->key_info[i]);
|
||||
// must be single column key
|
||||
int key_parts = KEY_N_KEY_PARTS(key_info);
|
||||
for (int j = 0; j < key_parts; j++) {
|
||||
if (key_info->key_part[j].key_part_flag & HA_REVERSE_SORT) {
|
||||
GRN_LOG(ctx, GRN_LOG_ERROR, "DESC indexes are not supported");
|
||||
error = ER_CANT_CREATE_TABLE;
|
||||
my_message(error, "DESC indexes are not supported", MYF(0));
|
||||
DBUG_RETURN(error);
|
||||
}
|
||||
}
|
||||
if (key_parts != 1) {
|
||||
continue;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,9 @@
|
|||
#
|
||||
# MDEV-27408 DESC index on a Mroonga table causes wrong order of result set
|
||||
#
|
||||
create table t1 (a int, key(a desc));
|
||||
ERROR HY000: DESC indexes are not supported
|
||||
show warnings;
|
||||
Level Code Message
|
||||
Error 1005 DESC indexes are not supported
|
||||
Warning 1030 Got error 1005 "Unknown error 1005" from storage engine Mroonga
|
||||
15
storage/mroonga/mysql-test/mroonga/storage/t/index_desc.test
Normal file
15
storage/mroonga/mysql-test/mroonga/storage/t/index_desc.test
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
--source ../../include/mroonga/have_mroonga.inc
|
||||
|
||||
--echo #
|
||||
--echo # MDEV-27408 DESC index on a Mroonga table causes wrong order of result set
|
||||
--echo #
|
||||
|
||||
--error ER_CANT_CREATE_TABLE
|
||||
create table t1 (a int, key(a desc));
|
||||
show warnings;
|
||||
#show create table t1;
|
||||
#insert into t1 values (1),(3),(2);
|
||||
#select * from t1 order by a;
|
||||
#drop table t1;
|
||||
|
||||
--source ../../include/mroonga/have_mroonga_deinit.inc
|
||||
Loading…
Add table
Add a link
Reference in a new issue