Skip to content
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
Closed

Wrong query when using setUseLiterals #741

ahilmer opened this issue May 6, 2014 · 2 comments
Labels
bug
Milestone

Comments

@ahilmer
Copy link

@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
Copy link

@beloglazov beloglazov commented May 19, 2014

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

@timowest
Copy link
Member

@timowest 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
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.