fixed a wrong argument for sql-func on mysql and added a test.