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 := operator in SELECT #4489

Closed
sillydong opened this issue Dec 29, 2021 · 4 comments
Closed

support for := operator in SELECT #4489

sillydong opened this issue Dec 29, 2021 · 4 comments
Assignees
Labels
enhancement New feature or request sql Issue with SQL

Comments

@sillydong
Copy link

We have queries like select @id := id from table limit 1. This is basically query some data into a variable. It is fully supported in MySQL, but for this project, when I run the query, I got ERROR 1105 (HY000): syntax error at position 13 near ':' which means the content := is not supported.

Is there any plan to support such query?

@zachmu
Copy link
Member

zachmu commented Jan 3, 2022

We would like to support this and it's on our roadmap, but we don't have an ETA for when it will become available.

In the meantime, you can use this syntax, which does the same thing:

set @id = (select id from table limit 1);

@zachmu zachmu added the enhancement New feature or request label Jan 3, 2022
@zachmu zachmu changed the title feature requirement: support select @id := id from table limit 1 support for := operator in SELECT Jan 3, 2022
@sillydong
Copy link
Author

Is it like the two PRs I posted in vitess project which only need add some rules in sql.y or there is more work to do in this project? Could you share some instructions to me for achieving this and we can see if I can make it happen.

@zachmu
Copy link
Member

zachmu commented Jan 11, 2022

It's harder. It's not just syntax, it's got query planner logic too.

@fulghum fulghum reopened this May 16, 2022
@zachmu zachmu transferred this issue from dolthub/go-mysql-server Oct 6, 2022
@timsehn timsehn added the sql Issue with SQL label Oct 6, 2022
@jennifersp jennifersp self-assigned this Nov 7, 2023
@jennifersp
Copy link
Contributor

Support for := for variable assignment is added here. This PR does not include := operator usage in SELECT as it is deprecated in MySQL.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request sql Issue with SQL
Projects
None yet
Development

No branches or pull requests

5 participants