summaryrefslogtreecommitdiff
path: root/sql/sql_alter.h
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2020-05-05 21:16:22 +0300
committerMarko Mäkelä <marko.makela@mariadb.com>2020-05-05 21:16:22 +0300
commit7bcaa541aa1f298abf8e863566a19b3e9ec2f659 (patch)
tree066d58ad89536edf0e9a3de898506735c933381f /sql/sql_alter.h
parent36b8ac2c0d763a3f96b254cb6e2cbdbc40dde22b (diff)
parent2c3c851d2cba73825f81cd06220138b15c17ae4d (diff)
downloadmariadb-git-7bcaa541aa1f298abf8e863566a19b3e9ec2f659.tar.gz
Merge 10.4 into 10.5
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 a553c31346a..88873477c7c 100644
--- a/sql/sql_alter.h
+++ b/sql/sql_alter.h
@@ -58,7 +58,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
};
@@ -107,8 +110,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;
@@ -117,7 +123,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)
{}
@@ -134,7 +140,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;
}
@@ -182,9 +188,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"
@@ -220,6 +232,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