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

fix: pass CLIENT_FOUND_ROWS #1

Merged
merged 1 commit into from
Feb 7, 2023
Merged

Conversation

Weakky
Copy link

@Weakky Weakky commented Feb 7, 2023

This changes the behaviour of the affected count returned for mutations (UPDATE/INSERT etc). It makes MySQL return the FOUND rows instead of the AFFECTED rows. Without this, MySQL returns 0 affected row when performing a noop update. This breaks the QueryEngine when performing nested connects which expect the update to have had happened.

You can read more about it here https://dev.mysql.com/doc/refman/8.0/en/information-functions.html.

image

This changes the behaviour of the affected count returned for mutations (UPDATE/INSERT etc). It makes MySQL returns the FOUND rows instead of the AFFECTED rows. Without this, MySQL returns 0 affected row when performing a noop update. This breaks the QueryEngine when performing nested connects which expect the update to have had happened.
Copy link

@tomhoule tomhoule left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's do this 👍

@Weakky Weakky merged commit b5d16fb into vendored-openssl Feb 7, 2023
@Weakky Weakky deleted the fix/client-found-rows branch February 7, 2023 15:28
Weakky added a commit to prisma/prisma-engines that referenced this pull request Feb 7, 2023
When performing a noop update on MySQL & MongoDB, the returned "affected count" by the updateMany mutation was 0. This was breaking nested connect mutations which expect the mutation to have happened. MySQL & MongoDB were affected by this.

This commit updates mysql_async (prisma/mysql_async#1) so that it passes the CLIENT_FOUND_ROWS flag. This changes the behaviour of the affected count returned for mutations (UPDATE/INSERT etc). It makes MySQL return the FOUND rows instead of the AFFECTED rows.

It also updates the logic on MongoDB to rely on the `matched_count` instead of the `modified_count`.
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.

2 participants