Fixed #31550: MySQL error if profiling not available/not activated in mysql and another bug on mysql driver in debug mode (bug in unreleased 3.1.2 only)