mirror of
https://github.com/MariaDB/server.git
synced 2025-01-17 12:32:27 +01:00
Aria: test for ER_KEY_BASED_ON_GENERATED_VIRTUAL_COLUMN
Aria supports virtual columns, but does not support indexes on virtual columns. Let's issue an appropriate error in this case.
This commit is contained in:
parent
9d7c3cbe18
commit
a9a362d3fd
5 changed files with 13 additions and 0 deletions
2
mysql-test/suite/vcol/r/vcol_keys_aria.result
Normal file
2
mysql-test/suite/vcol/r/vcol_keys_aria.result
Normal file
|
@ -0,0 +1,2 @@
|
|||
create table t1 (a int, b int as (a+1), c int, index(b)) engine=aria;
|
||||
ERROR HY000: Key/Index cannot be defined on a virtual generated column
|
3
mysql-test/suite/vcol/t/vcol_keys_aria.test
Normal file
3
mysql-test/suite/vcol/t/vcol_keys_aria.test
Normal file
|
@ -0,0 +1,3 @@
|
|||
--source include/have_maria.inc
|
||||
--error ER_KEY_BASED_ON_GENERATED_VIRTUAL_COLUMN
|
||||
create table t1 (a int, b int as (a+1), c int, index(b)) engine=aria;
|
|
@ -522,6 +522,14 @@ static int table2maria(TABLE *table_arg, data_file_type row_type,
|
|||
for (j= 0; j < pos->user_defined_key_parts; j++)
|
||||
{
|
||||
Field *field= pos->key_part[j].field;
|
||||
|
||||
if (!table_arg->field[field->field_index]->stored_in_db())
|
||||
{
|
||||
my_free(*recinfo_out);
|
||||
my_error(ER_KEY_BASED_ON_GENERATED_VIRTUAL_COLUMN, MYF(0));
|
||||
DBUG_RETURN(HA_ERR_UNSUPPORTED);
|
||||
}
|
||||
|
||||
type= field->key_type();
|
||||
keydef[i].seg[j].flag= pos->key_part[j].key_part_flag;
|
||||
|
||||
|
|
Loading…
Reference in a new issue