#1190 - MySql throwing DataIntegrityException when it should throw the more specific DuplicateKeyException

This commit is contained in:
rob bygrave
2017-11-01 21:54:48 +13:00
parent c0ec87d4cd
commit db6562df76
3 changed files with 12 additions and 5 deletions
@@ -8,6 +8,8 @@ import io.ebean.PagedList;
import io.ebean.Query;
import io.ebean.RawSql;
import io.ebean.RawSqlBuilder;
import io.ebean.annotation.IgnorePlatform;
import io.ebean.annotation.Platform;
import org.tests.model.basic.Customer;
import org.tests.model.basic.Order;
import org.tests.model.basic.ResetBasicData;
@@ -67,6 +69,7 @@ public class TestRawSqlOrmQuery extends BaseTestCase {
}
@Test
@IgnorePlatform(Platform.MYSQL)
public void test_upperCaseSql() {
ResetBasicData.reset();
@@ -185,14 +188,14 @@ public class TestRawSqlOrmQuery extends BaseTestCase {
query.setRawSql(rawSql);
query.setMaxRows(100);
if (isSqlServer()) {
query.order("coalesce(shipDate, getdate()) desc");
query.findList();
assertThat(sqlOf(query)).contains("order by coalesce(o.ship_date, getdate()) desc, o.id");
assertThat(sqlOf(query)).contains("select top 100");
} else {
query.order("coalesce(shipDate, now()) desc");
query.findList();