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

CLIENT_FOUND_ROWS option in connect() #82

Open
hdamala opened this issue Nov 8, 2018 · 0 comments
Open

CLIENT_FOUND_ROWS option in connect() #82

hdamala opened this issue Nov 8, 2018 · 0 comments

Comments

@hdamala
Copy link

hdamala commented Nov 8, 2018

Can an option be exposed in connect() to set the connection capability flag for CLIENT_FOUND_ROWS? Currently, lua-resty-mysql sets the flag by default.

My use case is when I use INSERT INTO... ON DUPLICATE KEY UPDATE... form. Not setting CLIENT_ROWS_FOUND lets me know whether the row was upserted into the DB or no change has happened.

From mysql documentation:

With ON DUPLICATE KEY UPDATE, the affected-rows value per row is 1 if the row is inserted as a new row, 2 if an existing row is updated, and 0 if an existing row is set to its current values. If you specify the CLIENT_FOUND_ROWS flag to the mysql_real_connect() C API function when connecting to mysqld, the affected-rows value is 1 (not 0) if an existing row is set to its current values.

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

No branches or pull requests

1 participant