summaryrefslogtreecommitdiff
path: root/sql/sql_alter.h
diff options
context:
space:
mode:
Diffstat (limited to 'sql/sql_alter.h')
-rw-r--r--sql/sql_alter.h26
1 files changed, 22 insertions, 4 deletions
diff --git a/sql/sql_alter.h b/sql/sql_alter.h
index 10aafe1ab37..53d0c8438f8 100644
--- a/sql/sql_alter.h
+++ b/sql/sql_alter.h
@@ -57,7 +57,10 @@ public:
ALTER_TABLE_ALGORITHM_NOCOPY,
// Instant should allow any operation that changes metadata only.
- ALTER_TABLE_ALGORITHM_INSTANT
+ ALTER_TABLE_ALGORITHM_INSTANT,
+
+ // When there is no specification of algorithm during alter table.
+ ALTER_TABLE_ALGORITHM_NONE
};
@@ -104,8 +107,11 @@ public:
List<const char> partition_names;
// Number of partitions.
uint num_parts;
+private:
// Type of ALTER TABLE algorithm.
enum_alter_table_algorithm requested_algorithm;
+
+public:
// Type of ALTER TABLE lock.
enum_alter_table_lock requested_lock;
@@ -114,7 +120,7 @@ public:
flags(0), partition_flags(0),
keys_onoff(LEAVE_AS_IS),
num_parts(0),
- requested_algorithm(ALTER_TABLE_ALGORITHM_DEFAULT),
+ requested_algorithm(ALTER_TABLE_ALGORITHM_NONE),
requested_lock(ALTER_TABLE_LOCK_DEFAULT)
{}
@@ -130,7 +136,7 @@ public:
keys_onoff= LEAVE_AS_IS;
num_parts= 0;
partition_names.empty();
- requested_algorithm= ALTER_TABLE_ALGORITHM_DEFAULT;
+ requested_algorithm= ALTER_TABLE_ALGORITHM_NONE;
requested_lock= ALTER_TABLE_LOCK_DEFAULT;
}
@@ -178,9 +184,15 @@ public:
bool set_requested_lock(const LEX_CSTRING *str);
/**
+ Set the requested algorithm to the given algorithm value
+ @param algo_value algorithm to be set
+ */
+ void set_requested_algorithm(enum_alter_table_algorithm algo_value);
+
+ /**
Returns the algorithm value in the format "algorithm=value"
*/
- const char* algorithm() const;
+ const char* algorithm_clause(THD *thd) const;
/**
Returns the lock value in the format "lock=value"
@@ -216,6 +228,12 @@ public:
bool supports_lock(THD *thd, enum_alter_inplace_result result,
const Alter_inplace_info *ha_alter_info);
+ /**
+ Return user requested algorithm. If user does not specify
+ algorithm then return alter_algorithm variable value.
+ */
+ enum_alter_table_algorithm algorithm(const THD *thd) const;
+
private:
Alter_info &operator=(const Alter_info &rhs); // not implemented
Alter_info(const Alter_info &rhs); // not implemented