summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergei Golubchik <sergii@pisem.net>2013-07-12 13:32:37 +0200
committerSergei Golubchik <sergii@pisem.net>2013-07-12 13:32:37 +0200
commitee8195a73198a23d8ed77736951f1d83f72689b5 (patch)
tree50f39ca379ff8814b0002a696818aa7861497766
parentf672d6b7d8b2a2f4570d5407481b3cdaaaa44e43 (diff)
downloadmariadb-git-ee8195a73198a23d8ed77736951f1d83f72689b5.tar.gz
fix lost vcol checks in sql_table.cc,
remove unused FIELD_IS_xxx flags change vcol tests to use innodb, not xtradb.
-rw-r--r--mysql-test/suite/vcol/t/rpl_vcol.test2
-rw-r--r--mysql-test/suite/vcol/t/vcol_blocked_sql_funcs_innodb.test2
-rw-r--r--mysql-test/suite/vcol/t/vcol_column_def_options_innodb.test2
-rw-r--r--mysql-test/suite/vcol/t/vcol_handler_innodb.test2
-rw-r--r--mysql-test/suite/vcol/t/vcol_ins_upd_innodb.test2
-rw-r--r--mysql-test/suite/vcol/t/vcol_keys_innodb.test2
-rw-r--r--mysql-test/suite/vcol/t/vcol_non_stored_columns_innodb.test2
-rw-r--r--mysql-test/suite/vcol/t/vcol_partition_innodb.test2
-rw-r--r--mysql-test/suite/vcol/t/vcol_select_innodb.test2
-rw-r--r--mysql-test/suite/vcol/t/vcol_supported_sql_funcs_innodb.test2
-rw-r--r--mysql-test/suite/vcol/t/vcol_trigger_sp_innodb.test2
-rw-r--r--mysql-test/suite/vcol/t/vcol_view_innodb.test2
-rw-r--r--sql/handler.h3
-rw-r--r--sql/sql_table.cc28
14 files changed, 35 insertions, 20 deletions
diff --git a/mysql-test/suite/vcol/t/rpl_vcol.test b/mysql-test/suite/vcol/t/rpl_vcol.test
index 43003f80ee9..03837df1b99 100644
--- a/mysql-test/suite/vcol/t/rpl_vcol.test
+++ b/mysql-test/suite/vcol/t/rpl_vcol.test
@@ -27,7 +27,7 @@
##### Storage engine to be tested
# Set the session storage engine
---source include/have_xtradb.inc
+--source include/have_innodb.inc
SET @@session.storage_engine = 'InnoDB';
#------------------------------------------------------------------------------#
diff --git a/mysql-test/suite/vcol/t/vcol_blocked_sql_funcs_innodb.test b/mysql-test/suite/vcol/t/vcol_blocked_sql_funcs_innodb.test
index baefddc0fd1..516e121a2aa 100644
--- a/mysql-test/suite/vcol/t/vcol_blocked_sql_funcs_innodb.test
+++ b/mysql-test/suite/vcol/t/vcol_blocked_sql_funcs_innodb.test
@@ -32,7 +32,7 @@
##### Storage engine to be tested
# Set the session storage engine
---source include/have_xtradb.inc
+--source include/have_innodb.inc
eval SET @@session.storage_engine = 'InnoDB';
let $skip_full_text_checks = 1;
diff --git a/mysql-test/suite/vcol/t/vcol_column_def_options_innodb.test b/mysql-test/suite/vcol/t/vcol_column_def_options_innodb.test
index e11618163cc..38baa2b3024 100644
--- a/mysql-test/suite/vcol/t/vcol_column_def_options_innodb.test
+++ b/mysql-test/suite/vcol/t/vcol_column_def_options_innodb.test
@@ -33,7 +33,7 @@
##### Storage engine to be tested
# Set the session storage engine
---source include/have_xtradb.inc
+--source include/have_innodb.inc
eval SET @@session.storage_engine = 'InnoDB';
##### Workarounds for known open engine specific bugs
diff --git a/mysql-test/suite/vcol/t/vcol_handler_innodb.test b/mysql-test/suite/vcol/t/vcol_handler_innodb.test
index 1a50aeaaa86..bf443c6bbd3 100644
--- a/mysql-test/suite/vcol/t/vcol_handler_innodb.test
+++ b/mysql-test/suite/vcol/t/vcol_handler_innodb.test
@@ -33,7 +33,7 @@
##### Storage engine to be tested
# Set the session storage engine
---source include/have_xtradb.inc
+--source include/have_innodb.inc
eval SET @@session.storage_engine = 'InnoDB';
##### Workarounds for known open engine specific bugs
diff --git a/mysql-test/suite/vcol/t/vcol_ins_upd_innodb.test b/mysql-test/suite/vcol/t/vcol_ins_upd_innodb.test
index 3b83c7f4565..5d9ac12e930 100644
--- a/mysql-test/suite/vcol/t/vcol_ins_upd_innodb.test
+++ b/mysql-test/suite/vcol/t/vcol_ins_upd_innodb.test
@@ -33,7 +33,7 @@
##### Storage engine to be tested
# Set the session storage engine
---source include/have_xtradb.inc
+--source include/have_innodb.inc
eval SET @@session.storage_engine = 'InnoDB';
##### Workarounds for known open engine specific bugs
diff --git a/mysql-test/suite/vcol/t/vcol_keys_innodb.test b/mysql-test/suite/vcol/t/vcol_keys_innodb.test
index d44d2f701cf..e408672ac07 100644
--- a/mysql-test/suite/vcol/t/vcol_keys_innodb.test
+++ b/mysql-test/suite/vcol/t/vcol_keys_innodb.test
@@ -33,7 +33,7 @@
##### Storage engine to be tested
# Set the session storage engine
---source include/have_xtradb.inc
+--source include/have_innodb.inc
eval SET @@session.storage_engine = 'InnoDB';
##### Workarounds for known open engine specific bugs
diff --git a/mysql-test/suite/vcol/t/vcol_non_stored_columns_innodb.test b/mysql-test/suite/vcol/t/vcol_non_stored_columns_innodb.test
index 42834d5c0bb..88ed6157294 100644
--- a/mysql-test/suite/vcol/t/vcol_non_stored_columns_innodb.test
+++ b/mysql-test/suite/vcol/t/vcol_non_stored_columns_innodb.test
@@ -35,7 +35,7 @@
##### Storage engine to be tested
# Set the session storage engine
---source include/have_xtradb.inc
+--source include/have_innodb.inc
eval SET @@session.storage_engine = 'InnoDB';
##### Workarounds for known open engine specific bugs
diff --git a/mysql-test/suite/vcol/t/vcol_partition_innodb.test b/mysql-test/suite/vcol/t/vcol_partition_innodb.test
index ab90bbf303a..7790a82800c 100644
--- a/mysql-test/suite/vcol/t/vcol_partition_innodb.test
+++ b/mysql-test/suite/vcol/t/vcol_partition_innodb.test
@@ -33,7 +33,7 @@
##### Storage engine to be tested
# Set the session storage engine
---source include/have_xtradb.inc
+--source include/have_innodb.inc
eval SET @@session.storage_engine = 'InnoDB';
##### Workarounds for known open engine specific bugs
diff --git a/mysql-test/suite/vcol/t/vcol_select_innodb.test b/mysql-test/suite/vcol/t/vcol_select_innodb.test
index 787f5fe77a7..314aecb75b9 100644
--- a/mysql-test/suite/vcol/t/vcol_select_innodb.test
+++ b/mysql-test/suite/vcol/t/vcol_select_innodb.test
@@ -33,7 +33,7 @@
##### Storage engine to be tested
# Set the session storage engine
---source include/have_xtradb.inc
+--source include/have_innodb.inc
eval SET @@session.storage_engine = 'InnoDB';
##### Workarounds for known open engine specific bugs
diff --git a/mysql-test/suite/vcol/t/vcol_supported_sql_funcs_innodb.test b/mysql-test/suite/vcol/t/vcol_supported_sql_funcs_innodb.test
index 32e2600c2fc..53826a460a7 100644
--- a/mysql-test/suite/vcol/t/vcol_supported_sql_funcs_innodb.test
+++ b/mysql-test/suite/vcol/t/vcol_supported_sql_funcs_innodb.test
@@ -32,7 +32,7 @@
##### Storage engine to be tested
# Set the session storage engine
---source include/have_xtradb.inc
+--source include/have_innodb.inc
SET @@session.storage_engine = 'InnoDB';
##### Workarounds for known open engine specific bugs
diff --git a/mysql-test/suite/vcol/t/vcol_trigger_sp_innodb.test b/mysql-test/suite/vcol/t/vcol_trigger_sp_innodb.test
index 57655d6d3fe..5a36fb1c06d 100644
--- a/mysql-test/suite/vcol/t/vcol_trigger_sp_innodb.test
+++ b/mysql-test/suite/vcol/t/vcol_trigger_sp_innodb.test
@@ -34,7 +34,7 @@
##### Storage engine to be tested
# Set the session storage engine
---source include/have_xtradb.inc
+--source include/have_innodb.inc
eval SET @@session.storage_engine = 'InnoDB';
##### Workarounds for known open engine specific bugs
diff --git a/mysql-test/suite/vcol/t/vcol_view_innodb.test b/mysql-test/suite/vcol/t/vcol_view_innodb.test
index 322fb122436..01fced8e4c3 100644
--- a/mysql-test/suite/vcol/t/vcol_view_innodb.test
+++ b/mysql-test/suite/vcol/t/vcol_view_innodb.test
@@ -33,7 +33,7 @@
##### Storage engine to be tested
# Set the session storage engine
---source include/have_xtradb.inc
+--source include/have_innodb.inc
eval SET @@session.storage_engine = 'InnoDB';
##### Workarounds for known open engine specific bugs
diff --git a/sql/handler.h b/sql/handler.h
index 0351df610a4..dc202ad9525 100644
--- a/sql/handler.h
+++ b/sql/handler.h
@@ -1652,6 +1652,9 @@ public:
// Partition operation with ALL keyword
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.
diff --git a/sql/sql_table.cc b/sql/sql_table.cc
index 4b0e0205eb7..9a3db12dc4b 100644
--- a/sql/sql_table.cc
+++ b/sql/sql_table.cc
@@ -3460,6 +3460,8 @@ mysql_prepare_create_table(THD *thd, HA_CREATE_INFO *create_info,
if (key->type == Key::FOREIGN_KEY)
{
fk_key_count++;
+ if (((Foreign_key *)key)->validate(alter_info->create_list))
+ DBUG_RETURN(TRUE);
Foreign_key *fk_key= (Foreign_key*) key;
if (fk_key->ref_columns.elements &&
fk_key->ref_columns.elements != fk_key->columns.elements)
@@ -5406,10 +5408,6 @@ static bool fill_alter_inplace_info(THD *thd,
*/
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. */
uint new_field_index= 0;
new_field_it.init(alter_info->create_list);
@@ -5482,11 +5480,22 @@ static bool fill_alter_inplace_info(THD *thd,
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 */
if (my_strcasecmp(system_charset_info, field->field_name,
new_field->field_name))
{
- field->flags|= FIELD_IS_RENAMED;
ha_alter_info->handler_flags|= Alter_inplace_info::ALTER_COLUMN_NAME;
rename_column_in_stat_tables(thd, table, field,
new_field->field_name);
@@ -5532,11 +5541,9 @@ static bool fill_alter_inplace_info(THD *thd,
Corresponding storage engine flag should be already set.
*/
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);
while ((new_field= new_field_it++))
{
@@ -5547,10 +5554,15 @@ static bool fill_alter_inplace_info(THD *thd,
Again corresponding storage engine flag should be already set.
*/
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;
}
}
-#endif /* DBUG_OFF */
/*
Go through keys and check if the original ones are compatible