Null precedence handling for MySQL in subqueries is broken for custom functions

Description

When a custom function wraps a subquery that uses order by, the sql for the order by is messed up.

This is the HQL:

The custom function LIMIT as can be found in the attached testcase in class MyMySQLDialect applies a limit(second argument) to the subquery(first argument) and returns the result. The problem is, that the function gets a messed up subquery for MySQL. The same function works for other databases in the sense that the order by is not messed up.

By messed up I mean that the following is produced:

instead of the expected:

Environment

MySQL

Assignee

Unassigned

Reporter

Christian Beikov

Fix versions

None

backPortable

None

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

Components

Affects versions

Priority

Major
Configure