New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

castToNum generates invalid syntax in MySQL #817

Closed
madgnome opened this Issue Jun 19, 2014 · 1 comment

Comments

Projects
None yet
2 participants
@madgnome
final String sql = 
     sqlQuery.from(BOUNTY)
                   .getSQL(Expressions.numberPath(Integer.class, TEST, "VALUE").castToNum(Long.class))
                   .getSQL();

generates this sql select cast(TEST.VALUE as integer), invalid in MySQL.

MySQL documentation says

The CONVERT() and CAST() functions take an expression of any type and produce a result value of a specified type.

The type for the result can be one of the following values:

BINARY[(N)]

CHAR[(N)]

DATE

DATETIME

DECIMAL[(M[,D])]

SIGNED [INTEGER]

TIME

UNSIGNED [INTEGER]

@timowest timowest added the bug label Jun 20, 2014

@timowest timowest referenced this issue Jun 20, 2014

Merged

Add cast tests #819

@timowest timowest added the fixed label Jun 21, 2014

@timowest timowest modified the milestone: 3.4.1 Jun 21, 2014

@timowest

This comment has been minimized.

Show comment
Hide comment
@timowest

timowest Jun 29, 2014

Member

Released in 3.4.1

Member

timowest commented Jun 29, 2014

Released in 3.4.1

@timowest timowest closed this Jun 29, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment