From e5b9dc15368c7597a70569048eebfc5e05e98ef4 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= <marko.makela@mariadb.com>
Date: Tue, 15 Jun 2021 22:14:51 +0300
Subject: [PATCH] MDEV-25910: Make ALTER TABLE...ALGORITHM=COPY durable again

ha_innobase::extra(HA_EXTRA_END_ALTER_COPY): Flush the redo log
because the main transaction will not have written any log and
thus will not initiate any log write either. But the DDL recovery
layer expects that the operation will have been committed.
---
 storage/innobase/handler/ha_innodb.cc | 1 +
 1 file changed, 1 insertion(+)

diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc
index 2c0a5f8f114..5dabab139b1 100644
--- a/storage/innobase/handler/ha_innodb.cc
+++ b/storage/innobase/handler/ha_innodb.cc
@@ -15308,6 +15308,7 @@ ha_innobase::extra(
 		break;
 	case HA_EXTRA_END_ALTER_COPY:
 		m_prebuilt->table->skip_alter_undo = 0;
+		log_write_up_to(LSN_MAX, true);
 		break;
 	default:/* Do nothing */
 		;
-- 
2.30.9