mirror of
				https://github.com/MariaDB/server.git
				synced 2025-11-04 04:46:15 +01:00 
			
		
		
		
	Remove alter_algorithm but keep the variable as no-op (with a warning). The reasons for removing alter_algorithm are: - alter_algorithm was introduced as a replacement for the old_alter_table that was used to force the usage of the original alter table algorithm (copy) in the cases where the new alter algorithm did not work. The new option was added as a way to force the usage of a specific algorithm when it should instead have made it possible to disable algorithms that would not work for some reason. - alter_algorithm introduced some cases where ALTER TABLE would not work without specifying the ALGORITHM=XXX option together with ALTER TABLE. - Having different values of alter_algorithm on master and slave could cause slave to stop unexpectedly. - ALTER TABLE FORCE, as used by mariadb-upgrade, would not always work if alter_algorithm was set for the server. - As part of the MDEV-33449 "improving repair of tables" it become clear that alter- algorithm made it harder to provide a better and more consistent ALTER TABLE FORCE and REPAIR TABLE and it would be better to remove it.
		
			
				
	
	
		
			64 lines
		
	
	
	
		
			2.7 KiB
		
	
	
	
		
			Text
		
	
	
	
	
	
			
		
		
	
	
			64 lines
		
	
	
	
		
			2.7 KiB
		
	
	
	
		
			Text
		
	
	
	
	
	
include/master-slave.inc
 | 
						|
[connection master]
 | 
						|
connection master;
 | 
						|
set binlog_alter_two_phase=true;
 | 
						|
CREATE OR REPLACE TABLE tab (
 | 
						|
a int PRIMARY KEY,
 | 
						|
b varchar(50),
 | 
						|
c varchar(50)
 | 
						|
) CHARACTER SET=latin1 engine=innodb;
 | 
						|
ALTER TABLE tab MODIFY COLUMN b varchar(100), algorithm=instant;
 | 
						|
ALTER TABLE tab MODIFY COLUMN c varchar(100), algorithm=nocopy;
 | 
						|
SHOW CREATE TABLE tab;
 | 
						|
Table	Create Table
 | 
						|
tab	CREATE TABLE `tab` (
 | 
						|
  `a` int(11) NOT NULL,
 | 
						|
  `b` varchar(100) DEFAULT NULL,
 | 
						|
  `c` varchar(100) DEFAULT NULL,
 | 
						|
  PRIMARY KEY (`a`)
 | 
						|
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
 | 
						|
include/show_binlog_events.inc
 | 
						|
Log_name	Pos	Event_type	Server_id	End_log_pos	Info
 | 
						|
master-bin.000001	#	Gtid	#	#	GTID #-#-#
 | 
						|
master-bin.000001	#	Query	#	#	use `test`; CREATE OR REPLACE TABLE tab (
 | 
						|
a int PRIMARY KEY,
 | 
						|
b varchar(50),
 | 
						|
c varchar(50)
 | 
						|
) CHARACTER SET=latin1 engine=innodb
 | 
						|
master-bin.000001	#	Gtid	#	#	GTID #-#-# START ALTER
 | 
						|
master-bin.000001	#	Query	#	#	use `test`; ALTER TABLE tab MODIFY COLUMN b varchar(100), algorithm=instant
 | 
						|
master-bin.000001	#	Gtid	#	#	GTID #-#-# COMMIT ALTER id=#
 | 
						|
master-bin.000001	#	Query	#	#	use `test`; ALTER TABLE tab MODIFY COLUMN b varchar(100), algorithm=instant
 | 
						|
master-bin.000001	#	Gtid	#	#	GTID #-#-# START ALTER
 | 
						|
master-bin.000001	#	Query	#	#	use `test`; ALTER TABLE tab MODIFY COLUMN c varchar(100), algorithm=nocopy
 | 
						|
master-bin.000001	#	Gtid	#	#	GTID #-#-# COMMIT ALTER id=#
 | 
						|
master-bin.000001	#	Query	#	#	use `test`; ALTER TABLE tab MODIFY COLUMN c varchar(100), algorithm=nocopy
 | 
						|
connection slave;
 | 
						|
SHOW CREATE TABLE tab;
 | 
						|
Table	Create Table
 | 
						|
tab	CREATE TABLE `tab` (
 | 
						|
  `a` int(11) NOT NULL,
 | 
						|
  `b` varchar(100) DEFAULT NULL,
 | 
						|
  `c` varchar(100) DEFAULT NULL,
 | 
						|
  PRIMARY KEY (`a`)
 | 
						|
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
 | 
						|
include/show_binlog_events.inc
 | 
						|
Log_name	Pos	Event_type	Server_id	End_log_pos	Info
 | 
						|
slave-bin.000001	#	Gtid	#	#	GTID #-#-#
 | 
						|
slave-bin.000001	#	Query	#	#	use `test`; CREATE OR REPLACE TABLE tab (
 | 
						|
a int PRIMARY KEY,
 | 
						|
b varchar(50),
 | 
						|
c varchar(50)
 | 
						|
) CHARACTER SET=latin1 engine=innodb
 | 
						|
slave-bin.000001	#	Gtid	#	#	GTID #-#-# START ALTER
 | 
						|
slave-bin.000001	#	Query	#	#	use `test`; ALTER TABLE tab MODIFY COLUMN b varchar(100), algorithm=instant
 | 
						|
slave-bin.000001	#	Gtid	#	#	GTID #-#-# COMMIT ALTER id=#
 | 
						|
slave-bin.000001	#	Query	#	#	use `test`; ALTER TABLE tab MODIFY COLUMN b varchar(100), algorithm=instant
 | 
						|
slave-bin.000001	#	Gtid	#	#	GTID #-#-# START ALTER
 | 
						|
slave-bin.000001	#	Query	#	#	use `test`; ALTER TABLE tab MODIFY COLUMN c varchar(100), algorithm=nocopy
 | 
						|
slave-bin.000001	#	Gtid	#	#	GTID #-#-# COMMIT ALTER id=#
 | 
						|
slave-bin.000001	#	Query	#	#	use `test`; ALTER TABLE tab MODIFY COLUMN c varchar(100), algorithm=nocopy
 | 
						|
connection master;
 | 
						|
DROP TABLE tab;
 | 
						|
connection slave;
 | 
						|
include/rpl_end.inc
 |