Kristian,
Thank you for your analysis. I suggest that we remove the unused declarations and code as soon as possible. Would you do that already under MDEV-11937?
I think that future code merges from MySQL should be based on individual commits rather than snapshots. For merging the changes from 5.7.14 to 5.7.18, I already did this, and I rewrote or omitted some commits; see MDEV-11751.
One particular problem with snapshots is that changes or additions to test files were often omitted. When merging changes commit by commit ("git format-patch" followed by "git am"), some manual work is needed to import the affected test files. The Oracle policy should be to only withhold test files for security bugs; we should take full advantage of the public tests.