The fix of MDEV-17556 (commit e25623e78a and commit 61a362c949) has been omitted due to conflicts and will have to be applied separately later.
e25623e78a
61a362c949