Continuing the detailed refactoring to native MySQL code.
Authored by: fourshades 2023-01-07
Parent: [r683]
Child: [r685]