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] Fix: mysql decimal casted to number where queried in related table #1688

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

Angelelz
Copy link
Collaborator

@Angelelz Angelelz commented Dec 23, 2023

close #1290

  • Added fix via cast(<decimal column> as char) function in mysql. This is necessary because mysql will return decimal as a number when requested in a json. Another possibility would have been to edit the json string before parsing, but this would have been a lot more complicated IMO.
  • Added tests to both mysql2 and planetscale drivers. The tests include nested relations in findFirst and findMany.

Edit: it's very likely that we'll need to apply this fix to the other dialects. I could do that in another PR.

@Angelelz Angelelz force-pushed the fix-mysql-decimal-casted-to-number branch from 2034fc4 to 7fc6e72 Compare December 27, 2023 03:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG]: Decimal type gets casted to number when queried through with (include relations)
1 participant