diff options
Diffstat (limited to 'storage/connect')
-rw-r--r-- | storage/connect/ha_connect.cc | 9 | ||||
-rw-r--r-- | storage/connect/mysql-test/connect/r/index.result | 9 | ||||
-rw-r--r-- | storage/connect/mysql-test/connect/t/index.test | 10 |
3 files changed, 28 insertions, 0 deletions
diff --git a/storage/connect/ha_connect.cc b/storage/connect/ha_connect.cc index 17e50b5c56b..d175816bf67 100644 --- a/storage/connect/ha_connect.cc +++ b/storage/connect/ha_connect.cc @@ -1812,6 +1812,12 @@ PIXDEF ha_connect::GetIndexInfo(TABLE_SHARE *s) pn= (char*)kp.key_part[k].field->field_name.str; name= PlugDup(g, pn); + if (kp.key_part[k].key_part_flag & HA_REVERSE_SORT) + { + strcpy(g->Message, "Descending indexes are not supported"); + xdp->Invalid= true; + } + // Allocate the key part description block kpp= new(g) KPARTDEF(name, k + 1); kpp->SetKlen(kp.key_part[k].length); @@ -6944,6 +6950,9 @@ int ha_connect::create(const char *name, TABLE *table_arg, strcpy(g->Message, "Compressed tables are not indexable"); my_message(ER_UNKNOWN_ERROR, g->Message, MYF(0)); rc= HA_ERR_UNSUPPORTED; + } else if (xdp->Invalid) { + my_message(ER_UNKNOWN_ERROR, g->Message, MYF(0)); + rc= HA_ERR_UNSUPPORTED; } else if (GetIndexType(type) == 1) { PDBUSER dup= PlgGetUser(g); PCATLG cat= (dup) ? dup->Catalog : NULL; diff --git a/storage/connect/mysql-test/connect/r/index.result b/storage/connect/mysql-test/connect/r/index.result index bffaaecc785..c156e10749e 100644 --- a/storage/connect/mysql-test/connect/r/index.result +++ b/storage/connect/mysql-test/connect/r/index.result @@ -139,3 +139,12 @@ DELETE FROM t1; DROP TABLE t1; DROP TABLE t2; DROP TABLE t3; +# +# MDEV-27591 Connect tables (FIX/DOS) don't work with DESC keys - wrong results +# +CREATE TABLE t1 ( +id INT, +f VARCHAR(32), +PRIMARY KEY (id DESC) +) ENGINE=CONNECT TABLE_TYPE=DOS FILE_NAME='emp.txt'; +ERROR HY000: Descending indexes are not supported diff --git a/storage/connect/mysql-test/connect/t/index.test b/storage/connect/mysql-test/connect/t/index.test index 5e913582734..b631236832d 100644 --- a/storage/connect/mysql-test/connect/t/index.test +++ b/storage/connect/mysql-test/connect/t/index.test @@ -78,6 +78,16 @@ DROP TABLE t1; DROP TABLE t2; DROP TABLE t3; +--echo # +--echo # MDEV-27591 Connect tables (FIX/DOS) don't work with DESC keys - wrong results +--echo # +--error ER_UNKNOWN_ERROR +CREATE TABLE t1 ( + id INT, + f VARCHAR(32), + PRIMARY KEY (id DESC) +) ENGINE=CONNECT TABLE_TYPE=DOS FILE_NAME='emp.txt'; + # # Clean up # |