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

Wrong query when using setUseLiterals #741

Closed
ahilmer opened this Issue May 6, 2014 · 2 comments

Comments

Projects
None yet
3 participants
@ahilmer

ahilmer commented May 6, 2014

Hi,

i get wrong results when using setUseLiterals(true) and numerial operators. Here is a simple example:

final QTimeTracking timeTracking = QTimeTracking.timeTracking;

final SQLTemplates templates = new HSQLDBTemplates();
final Configuration configuration = new Configuration(templates);
configuration.setUseLiterals(true);
Connection connection = DriverManager
        .getConnection("jdbc:hsqldb:hsql://localhost/");
SQLQuery query = new SQLQuery(connection, configuration);
query.from(timeTracking).list(
        timeTracking.hours.sum().multiply(2).add(3));

It is calculating hours_(2+3) instead (hours_2)+3.

If i switch to setUseLiterals(false) then the correct result wil be calculated.

@timowest timowest added fixed labels May 6, 2014

@timowest timowest added this to the 3.3.4 milestone May 10, 2014

@beloglazov

This comment has been minimized.

Show comment
Hide comment
@beloglazov

beloglazov May 19, 2014

I've also had issues with setUseLiterals(true) and geometry fields in the spatial branch.

I've also had issues with setUseLiterals(true) and geometry fields in the spatial branch.

@timowest

This comment has been minimized.

Show comment
Hide comment
@timowest

timowest May 20, 2014

Member

Released in 3.3.4

Member

timowest commented May 20, 2014

Released in 3.3.4

@timowest timowest closed this May 20, 2014

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