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

Firebird different number datatype between constant or variable usage #4469

Open
the-blazing-dev opened this issue Apr 3, 2024 · 2 comments

Comments

@the-blazing-dev
Copy link

Hello together and thank you for providing this great LinqPad driver!

I have an issue with querying the Firebird database. To verify if the data in my table is correct I did some calculation where I calculate minutes / 60.0 * hourlyRate.
Depending on whether I hardcode the value 60.0 or use a variable defined earlier I get different SQL queries and different result data.

Here is the wrong behavior using the hardcoded / const value:
image

Here is the right behavior using a SQL variable:
image

What I would expect:
If the hardcoded value is of type double/float, it should be used with the sql-related floating point datatype in the query.

Or is this somehow expected behavior?

Thanks in advance!

Used LinqPad version: v8.2.4 (X64)
Used Driver version: v5.2.2

@MaceWindu
Copy link
Contributor

Thanks, I will transfer this issue to linq2db as it is provider issue

@MaceWindu MaceWindu transferred this issue from linq2db/linq2db.LINQPad Apr 3, 2024
@MaceWindu MaceWindu added this to the Backlog milestone Apr 3, 2024
@MaceWindu
Copy link
Contributor

We should always generate double literals for double/float values. E.g. for case above it should be 60e0 or CAST(60 AS DOUBLE PRECISION)

https://firebirdsql.org/file/documentation/chunk/en/refdocs/fblangref40/fblangref40-commons.html#fblangref40-commons-number-constant

@MaceWindu MaceWindu self-assigned this Apr 6, 2024
@MaceWindu MaceWindu modified the milestones: Backlog, In-progress Apr 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

2 participants