mirror of
https://github.com/MariaDB/server.git
synced 2025-08-08 11:22:35 +03:00
MDEV-35021 Behavior for RTREE indexes changed, assertion fails
disallow USING RTREE for not SPATIAL index
This commit is contained in:
@@ -42,3 +42,11 @@ t1 CREATE TABLE `t1` (
|
|||||||
DROP TABLE t1;
|
DROP TABLE t1;
|
||||||
CREATE OR REPLACE INDEX IF NOT EXISTS i1 ON t1(b,a);
|
CREATE OR REPLACE INDEX IF NOT EXISTS i1 ON t1(b,a);
|
||||||
ERROR HY000: Incorrect usage of OR REPLACE and IF NOT EXISTS
|
ERROR HY000: Incorrect usage of OR REPLACE and IF NOT EXISTS
|
||||||
|
#
|
||||||
|
# MDEV-35021 Behavior for RTREE indexes changed, assertion fails
|
||||||
|
#
|
||||||
|
create table t (f int not null);
|
||||||
|
create index ind using rtree on t (f);
|
||||||
|
ERROR HY000: Incorrect arguments to RTREE INDEX
|
||||||
|
drop table t;
|
||||||
|
# End of 11.7 tests
|
||||||
|
@@ -14,3 +14,13 @@ DROP TABLE t1;
|
|||||||
|
|
||||||
--error ER_WRONG_USAGE
|
--error ER_WRONG_USAGE
|
||||||
CREATE OR REPLACE INDEX IF NOT EXISTS i1 ON t1(b,a);
|
CREATE OR REPLACE INDEX IF NOT EXISTS i1 ON t1(b,a);
|
||||||
|
|
||||||
|
--echo #
|
||||||
|
--echo # MDEV-35021 Behavior for RTREE indexes changed, assertion fails
|
||||||
|
--echo #
|
||||||
|
create table t (f int not null);
|
||||||
|
--error ER_WRONG_ARGUMENTS
|
||||||
|
create index ind using rtree on t (f);
|
||||||
|
drop table t;
|
||||||
|
|
||||||
|
--echo # End of 11.7 tests
|
||||||
|
@@ -3347,7 +3347,7 @@ mysql_prepare_create_table_finalize(THD *thd, HA_CREATE_INFO *create_info,
|
|||||||
my_error(ER_TABLE_CANT_HANDLE_SPKEYS, MYF(0), file->table_type());
|
my_error(ER_TABLE_CANT_HANDLE_SPKEYS, MYF(0), file->table_type());
|
||||||
DBUG_RETURN(TRUE);
|
DBUG_RETURN(TRUE);
|
||||||
}
|
}
|
||||||
if (key_info->user_defined_key_parts != 1)
|
if (key->type != Key::SPATIAL || key_info->user_defined_key_parts != 1)
|
||||||
{
|
{
|
||||||
my_error(ER_WRONG_ARGUMENTS, MYF(0), "RTREE INDEX");
|
my_error(ER_WRONG_ARGUMENTS, MYF(0), "RTREE INDEX");
|
||||||
DBUG_RETURN(TRUE);
|
DBUG_RETURN(TRUE);
|
||||||
|
Reference in New Issue
Block a user