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

Support for VALUES in INSERT ... ON DUPLICATE KEY UPDATE #191

Closed
Harrison-Miller opened this issue Sep 9, 2020 · 4 comments
Closed

Support for VALUES in INSERT ... ON DUPLICATE KEY UPDATE #191

Harrison-Miller opened this issue Sep 9, 2020 · 4 comments

Comments

@Harrison-Miller
Copy link
Contributor

Harrison-Miller commented Sep 9, 2020

In mysql there is a specific version of the VALUES function that goes after the ON DUPLICATE KEY UPDATE statement that references a named column in the INSERT portion of the statement: https://dev.mysql.com/doc/refman/8.0/en/insert-on-duplicate.html

Currently running a command that uses this feature will result in: unknown error: unsupported syntax: values(column_name)

My guess is this is happening somewhere in vitess which may not support this feature. I may look into it myself but modifying vitess sounds like quite the deep dive.

Example test case:

INSERT INTO mytable (i,s) VALUES (1, "foo"), (2, "bar"), (3, "qux")
ON DUPLICATE KEY UPDATE s= CONCAT(VALUES(i), VALUES(s));
@zachmu
Copy link
Member

zachmu commented Sep 10, 2020

This is now in master. Thanks for the contribution!

@zachmu zachmu closed this as completed Sep 10, 2020
@Harrison-Miller
Copy link
Contributor Author

Harrison-Miller commented Sep 10, 2020

@zachmu this is a separate issue from my previous PR.

@zachmu zachmu reopened this Sep 10, 2020
@zachmu
Copy link
Member

zachmu commented Sep 10, 2020

My mistake!

I can probably get the vitess changes in the near future, stay tuned.

@zachmu
Copy link
Member

zachmu commented Feb 24, 2022

This was fixed some time ago, let us know if you find any issues with it.

@zachmu zachmu closed this as completed Feb 24, 2022
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

2 participants