This is likely related to libmysqlclient changes for ubuntu, like reported by #2394. On Debian stable I was not able to reproduce on a couple of heavy duty deployments, so might be something different.
I am closing this one, if you get it on Debian stable again, open a new issue and attach the the backtrace, ideally for a kamailio 5.3 or 5.3