Commit 5a6023cf authored by Sachin Setiya's avatar Sachin Setiya Committed by Sachin

MDEV-18791 Wrong error upon creating Aria table with long index on BLOB

If we have long unique key for aria engine return too long key error, because
Aria does not support key on virtual generated column.
parent 1b414c03
......@@ -265,3 +265,5 @@ ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
disconnect con1;
connection default;
DROP TABLE t1, t2;
CREATE TABLE t1 (a TEXT, UNIQUE(a)) ENGINE=Aria;
ERROR 42000: Specified key was too long; max key length is 1000 bytes
......@@ -317,3 +317,9 @@ INSERT IGNORE INTO t1 VALUES (4, 1)/*4*/;
--disconnect con1
--connection default
DROP TABLE t1, t2;
#
# MDEV-18791 Wrong error upon creating Aria table with long index on BLOB
#
--error ER_TOO_LONG_KEY
CREATE TABLE t1 (a TEXT, UNIQUE(a)) ENGINE=Aria;
......@@ -554,6 +554,11 @@ static int table2maria(TABLE *table_arg, data_file_type row_type,
if (!table_arg->field[field->field_index]->stored_in_db())
{
my_free(*recinfo_out);
if (table_arg->s->long_unique_table)
{
my_error(ER_TOO_LONG_KEY, MYF(0), table_arg->file->max_key_length());
DBUG_RETURN(HA_ERR_INDEX_COL_TOO_LONG);
}
my_error(ER_KEY_BASED_ON_GENERATED_VIRTUAL_COLUMN, MYF(0));
DBUG_RETURN(HA_ERR_UNSUPPORTED);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment