Fix recording manager mysql queries