[hibernate-dev] Are the tests in the documentation module expected to run on MySQL only?

Vlad Mihalcea mihalcea.vlad at gmail.com
Fri Sep 8 14:23:17 EDT 2017


I test Hibernate with the following DBs mostly:

- H2
- Oracle
- SQL Server
- PostgreSQL
- MySQL and MariaDb

For other databases, it's not guaranteed that all tests will run.

Related to that function, we could other add a change, but it must work on
the DBs above too.
Or, you could just mark the test with @SkipForDialect.

Thanks,
Vlad

On Fri, Sep 8, 2017 at 7:41 PM, Mark Rotteveel <mark at lawinegevaar.nl> wrote:

> Are the tests in the documentation module expected to run on MySQL /
> MariaDB only? Or are they expected to run on all databases?
>
> The test org.hibernate.userguide.mapping.basic.SubselectTest is failing
> on Firebird, because it has the following subselect:
>
> @Subselect(
>      "select " +
>      "  a.id as id, " +
>      "  concat(concat(c.first_name, ' '), c.last_name) as clientName, " +
>      "  sum(at.cents) as balance " +
>      "from account a " +
>      "join client c on c.id = a.client_id " +
>      "join account_transaction at on a.id = at.account_id " +
>      "group by a.id, concat(concat(c.first_name, ' '), c.last_name)"
> )
>
> Firebird doesn't have a concat function. According to the version
> history, this test previously used the SQL standard concat operator
> '||', but this was changed in May with the commit comment "Fix test
> failing on MariaDB".
>
> I am surprised that this change wouldn't be failing on other databases
> either (unless most of them define a concat function next to supporting
> the || operator).
>
> To fix this database independently, it would need to be changed to use
> the JDBC concat function escape:
>
> @Subselect(
>      "select " +
>      "  a.id as id, " +
>      "  {fn concat({fn concat(c.first_name, ' ')}, c.last_name)} as
> clientName, " +
>      "  sum(atr.cents) as balance " +
>      "from account a " +
>      "join client c on c.id = a.client_id " +
>      "join account_transaction atr on a.id = atr.account_id " +
>      "group by a.id, {fn concat({fn concat(c.first_name, ' ')},
> c.last_name)}"
> )
>
> However, JDBC function escape are (almost) never used in Hibernate
> tests, so I wonder if this would need to be handled elsewhere.
>
> What to do? Do I ignore the documentation tests, add an exception for
> Firebird or create a pull request with the above change, or something else?
> --
> Mark Rotteveel
> _______________________________________________
> hibernate-dev mailing list
> hibernate-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/hibernate-dev
>


More information about the hibernate-dev mailing list