MDL-38091 fixed bug with SQL query on Oracle