mirror of
https://github.com/MariaDB/server.git
synced 2025-07-20 10:24:14 +03:00
MDEV-16288 ALTER TABLE…ALGORITHM=DEFAULT does not override alter_algorithm
- ALTER_ALGORITHM should be substituted when there is no mention of algorithm in alter statement. - Introduced algorithm(thd) in Alter_info. It returns the user requested algorithm. If user doesn't specify algorithm explicitly then it returns alter_algorithm variable. - changed algorithm() to get_algorithm(thd) to return algorithm name for displaying the error. - set_requested_algorithm(algo_value) to avoid direct assignment on requested_algorithm variable. - Avoid direct access of requested_algorithm to encapsulate requested_algorithm variable
This commit is contained in:
@ -44,4 +44,16 @@ call p1();
|
||||
DROP TABLE t1;
|
||||
DROP PROCEDURE p1;
|
||||
DROP PROCEDURE p2;
|
||||
|
||||
CREATE TABLE t1(id INT PRIMARY KEY,
|
||||
col1 INT UNSIGNED NOT NULL UNIQUE)ENGINE=InnoDB;
|
||||
INSERT INTO t1 VALUES(1,1),(2,2),(3,3);
|
||||
SET ALTER_ALGORITHM=INSTANT;
|
||||
--error ER_ALTER_OPERATION_NOT_SUPPORTED
|
||||
ALTER TABLE t1 DROP COLUMN col1;
|
||||
--error ER_ALTER_OPERATION_NOT_SUPPORTED
|
||||
ALTER TABLE t1 DROP COLUMN col1, ALGORITHM=NOCOPY;
|
||||
ALTER TABLE t1 DROP COLUMN col1, ALGORITHM=DEFAULT;
|
||||
ALTER TABLE t1 DROP PRIMARY KEY, ALGORITHM=DEFAULT;
|
||||
DROP TABLE t1;
|
||||
--disable_info
|
||||
|
Reference in New Issue
Block a user