more progress on mysql-compatible queries