mariadb: fix for issue #30891

Please note, that this might also require PR #30930.
Would be good to report it in both places if possible, thanks.