Commit ee8195a7 authored by Sergei Golubchik's avatar Sergei Golubchik

fix lost vcol checks in sql_table.cc,

remove unused FIELD_IS_xxx flags
change vcol tests to use innodb, not xtradb.
parent f672d6b7
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
##### Storage engine to be tested ##### Storage engine to be tested
# Set the session storage engine # Set the session storage engine
--source include/have_xtradb.inc --source include/have_innodb.inc
SET @@session.storage_engine = 'InnoDB'; SET @@session.storage_engine = 'InnoDB';
#------------------------------------------------------------------------------# #------------------------------------------------------------------------------#
......
...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
##### Storage engine to be tested ##### Storage engine to be tested
# Set the session storage engine # Set the session storage engine
--source include/have_xtradb.inc --source include/have_innodb.inc
eval SET @@session.storage_engine = 'InnoDB'; eval SET @@session.storage_engine = 'InnoDB';
let $skip_full_text_checks = 1; let $skip_full_text_checks = 1;
......
...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
##### Storage engine to be tested ##### Storage engine to be tested
# Set the session storage engine # Set the session storage engine
--source include/have_xtradb.inc --source include/have_innodb.inc
eval SET @@session.storage_engine = 'InnoDB'; eval SET @@session.storage_engine = 'InnoDB';
##### Workarounds for known open engine specific bugs ##### Workarounds for known open engine specific bugs
......
...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
##### Storage engine to be tested ##### Storage engine to be tested
# Set the session storage engine # Set the session storage engine
--source include/have_xtradb.inc --source include/have_innodb.inc
eval SET @@session.storage_engine = 'InnoDB'; eval SET @@session.storage_engine = 'InnoDB';
##### Workarounds for known open engine specific bugs ##### Workarounds for known open engine specific bugs
......
...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
##### Storage engine to be tested ##### Storage engine to be tested
# Set the session storage engine # Set the session storage engine
--source include/have_xtradb.inc --source include/have_innodb.inc
eval SET @@session.storage_engine = 'InnoDB'; eval SET @@session.storage_engine = 'InnoDB';
##### Workarounds for known open engine specific bugs ##### Workarounds for known open engine specific bugs
......
...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
##### Storage engine to be tested ##### Storage engine to be tested
# Set the session storage engine # Set the session storage engine
--source include/have_xtradb.inc --source include/have_innodb.inc
eval SET @@session.storage_engine = 'InnoDB'; eval SET @@session.storage_engine = 'InnoDB';
##### Workarounds for known open engine specific bugs ##### Workarounds for known open engine specific bugs
......
...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
##### Storage engine to be tested ##### Storage engine to be tested
# Set the session storage engine # Set the session storage engine
--source include/have_xtradb.inc --source include/have_innodb.inc
eval SET @@session.storage_engine = 'InnoDB'; eval SET @@session.storage_engine = 'InnoDB';
##### Workarounds for known open engine specific bugs ##### Workarounds for known open engine specific bugs
......
...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
##### Storage engine to be tested ##### Storage engine to be tested
# Set the session storage engine # Set the session storage engine
--source include/have_xtradb.inc --source include/have_innodb.inc
eval SET @@session.storage_engine = 'InnoDB'; eval SET @@session.storage_engine = 'InnoDB';
##### Workarounds for known open engine specific bugs ##### Workarounds for known open engine specific bugs
......
...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
##### Storage engine to be tested ##### Storage engine to be tested
# Set the session storage engine # Set the session storage engine
--source include/have_xtradb.inc --source include/have_innodb.inc
eval SET @@session.storage_engine = 'InnoDB'; eval SET @@session.storage_engine = 'InnoDB';
##### Workarounds for known open engine specific bugs ##### Workarounds for known open engine specific bugs
......
...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
##### Storage engine to be tested ##### Storage engine to be tested
# Set the session storage engine # Set the session storage engine
--source include/have_xtradb.inc --source include/have_innodb.inc
SET @@session.storage_engine = 'InnoDB'; SET @@session.storage_engine = 'InnoDB';
##### Workarounds for known open engine specific bugs ##### Workarounds for known open engine specific bugs
......
...@@ -34,7 +34,7 @@ ...@@ -34,7 +34,7 @@
##### Storage engine to be tested ##### Storage engine to be tested
# Set the session storage engine # Set the session storage engine
--source include/have_xtradb.inc --source include/have_innodb.inc
eval SET @@session.storage_engine = 'InnoDB'; eval SET @@session.storage_engine = 'InnoDB';
##### Workarounds for known open engine specific bugs ##### Workarounds for known open engine specific bugs
......
...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
##### Storage engine to be tested ##### Storage engine to be tested
# Set the session storage engine # Set the session storage engine
--source include/have_xtradb.inc --source include/have_innodb.inc
eval SET @@session.storage_engine = 'InnoDB'; eval SET @@session.storage_engine = 'InnoDB';
##### Workarounds for known open engine specific bugs ##### Workarounds for known open engine specific bugs
......
...@@ -1652,6 +1652,9 @@ public: ...@@ -1652,6 +1652,9 @@ public:
// Partition operation with ALL keyword // Partition operation with ALL keyword
static const HA_ALTER_FLAGS ALTER_ALL_PARTITION = 1L << 28; static const HA_ALTER_FLAGS ALTER_ALL_PARTITION = 1L << 28;
// Partition operation with ALL keyword
static const HA_ALTER_FLAGS ALTER_COLUMN_VCOL = 1L << 29;
/** /**
Create options (like MAX_ROWS) for the new version of table. Create options (like MAX_ROWS) for the new version of table.
......
...@@ -3460,6 +3460,8 @@ mysql_prepare_create_table(THD *thd, HA_CREATE_INFO *create_info, ...@@ -3460,6 +3460,8 @@ mysql_prepare_create_table(THD *thd, HA_CREATE_INFO *create_info,
if (key->type == Key::FOREIGN_KEY) if (key->type == Key::FOREIGN_KEY)
{ {
fk_key_count++; fk_key_count++;
if (((Foreign_key *)key)->validate(alter_info->create_list))
DBUG_RETURN(TRUE);
Foreign_key *fk_key= (Foreign_key*) key; Foreign_key *fk_key= (Foreign_key*) key;
if (fk_key->ref_columns.elements && if (fk_key->ref_columns.elements &&
fk_key->ref_columns.elements != fk_key->columns.elements) fk_key->ref_columns.elements != fk_key->columns.elements)
...@@ -5406,10 +5408,6 @@ static bool fill_alter_inplace_info(THD *thd, ...@@ -5406,10 +5408,6 @@ static bool fill_alter_inplace_info(THD *thd,
*/ */
for (f_ptr= table->field; (field= *f_ptr); f_ptr++) for (f_ptr= table->field; (field= *f_ptr); f_ptr++)
{ {
/* Clear marker for renamed or dropped field
which we are going to set later. */
field->flags&= ~(FIELD_IS_RENAMED | FIELD_IS_DROPPED);
/* Use transformed info to evaluate flags for storage engine. */ /* Use transformed info to evaluate flags for storage engine. */
uint new_field_index= 0; uint new_field_index= 0;
new_field_it.init(alter_info->create_list); new_field_it.init(alter_info->create_list);
...@@ -5482,11 +5480,22 @@ static bool fill_alter_inplace_info(THD *thd, ...@@ -5482,11 +5480,22 @@ static bool fill_alter_inplace_info(THD *thd,
ha_alter_info->handler_flags|= Alter_inplace_info::ALTER_COLUMN_TYPE; ha_alter_info->handler_flags|= Alter_inplace_info::ALTER_COLUMN_TYPE;
} }
/*
Check if the altered column is computed and either
is stored or is used in the partitioning expression.
TODO: Mark such a column with an alter flag only if
the defining expression has changed.
*/
if (field->vcol_info &&
(field->stored_in_db || field->vcol_info->is_in_partitioning_expr()))
{
ha_alter_info->handler_flags|= Alter_inplace_info::ALTER_COLUMN_VCOL;
}
/* Check if field was renamed */ /* Check if field was renamed */
if (my_strcasecmp(system_charset_info, field->field_name, if (my_strcasecmp(system_charset_info, field->field_name,
new_field->field_name)) new_field->field_name))
{ {
field->flags|= FIELD_IS_RENAMED;
ha_alter_info->handler_flags|= Alter_inplace_info::ALTER_COLUMN_NAME; ha_alter_info->handler_flags|= Alter_inplace_info::ALTER_COLUMN_NAME;
rename_column_in_stat_tables(thd, table, field, rename_column_in_stat_tables(thd, table, field,
new_field->field_name); new_field->field_name);
...@@ -5532,11 +5541,9 @@ static bool fill_alter_inplace_info(THD *thd, ...@@ -5532,11 +5541,9 @@ static bool fill_alter_inplace_info(THD *thd,
Corresponding storage engine flag should be already set. Corresponding storage engine flag should be already set.
*/ */
DBUG_ASSERT(ha_alter_info->handler_flags & Alter_inplace_info::DROP_COLUMN); DBUG_ASSERT(ha_alter_info->handler_flags & Alter_inplace_info::DROP_COLUMN);
field->flags|= FIELD_IS_DROPPED;
} }
} }
#ifndef DBUG_OFF
new_field_it.init(alter_info->create_list); new_field_it.init(alter_info->create_list);
while ((new_field= new_field_it++)) while ((new_field= new_field_it++))
{ {
...@@ -5547,10 +5554,15 @@ static bool fill_alter_inplace_info(THD *thd, ...@@ -5547,10 +5554,15 @@ static bool fill_alter_inplace_info(THD *thd,
Again corresponding storage engine flag should be already set. Again corresponding storage engine flag should be already set.
*/ */
DBUG_ASSERT(ha_alter_info->handler_flags & Alter_inplace_info::ADD_COLUMN); DBUG_ASSERT(ha_alter_info->handler_flags & Alter_inplace_info::ADD_COLUMN);
if (new_field->vcol_info &&
(new_field->stored_in_db || new_field->vcol_info->is_in_partitioning_expr()))
{
ha_alter_info->handler_flags|= Alter_inplace_info::ALTER_COLUMN_VCOL;
}
break; break;
} }
} }
#endif /* DBUG_OFF */
/* /*
Go through keys and check if the original ones are compatible Go through keys and check if the original ones are compatible
......
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