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

MySQL/MariaDB perform a floating point division for operands of any type #1957

Open
lauxjpn opened this issue Dec 11, 2024 · 0 comments
Open

Comments

@lauxjpn
Copy link
Collaborator

lauxjpn commented Dec 11, 2024

MySQL/MariaDB perform a floating point division for operands of any type (which is not the .NET behavior), while different DBMS' (SQL Server, Sqlite, PostgreSQL) perform an integer division if both operands are integer based types (which is the .NET behavior).

To make the behavior work in the same way as .NET (and other DBMS') does, we need to make use of the integer division operator DIV when translating queries.

Exposing the integer division operator as an explicit EF.Function extension method is tracked by #1932.

Investigative work has been done in dotnet/efcore#35295.

@lauxjpn lauxjpn added this to the 9.0.0-preview.3.efcore.9.0.0 milestone Dec 11, 2024
@lauxjpn lauxjpn self-assigned this Dec 11, 2024
@lauxjpn lauxjpn changed the title MySQL/MariaDB perform a floating point division for numbers of any type MySQL/MariaDB perform a floating point division for operands of any type Dec 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant