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 all MySQL logical operators #4497

Closed
fulghum opened this issue Apr 28, 2022 · 7 comments · Fixed by dolthub/go-mysql-server#986
Closed

Support all MySQL logical operators #4497

fulghum opened this issue Apr 28, 2022 · 7 comments · Fixed by dolthub/go-mysql-server#986
Assignees
Labels
enhancement New feature or request good first issue Good for newcomers sql Issue with SQL

Comments

@fulghum
Copy link
Contributor

fulghum commented Apr 28, 2022

We currently have support for some, but not all of MySQL's logical operators.

For example, select 1 OR 1; works, but not select 1 XOR 1;. We should review MySQL's logical operators and ensure we support all of them.

Found by: go-sqlsmith

@fulghum fulghum added the good first issue Good for newcomers label Apr 28, 2022
@jennifersp jennifersp self-assigned this Apr 28, 2022
@jennifersp jennifersp linked a pull request Apr 28, 2022 that will close this issue
@fulghum
Copy link
Contributor Author

fulghum commented Apr 29, 2022

Now that we've got xor support, it looks like the only other logical operator go-mysql-server doesn't support yet is !.

@fulghum fulghum reopened this Apr 29, 2022
@joel-rieke
Copy link

joel-rieke commented Jun 9, 2022

What about ABS, REGEXP and CONVERT? I think REGEXP and CONVERT are covered but I'm not sure? But ABS I'm pretty sure is not covered.

@timsehn
Copy link
Contributor

timsehn commented Jun 9, 2022

Those aren't logical operators. Those are functions. A good list of supported/unsupported functions are in Dolt, the main implementor of go-mysql-server.

https://docs.dolthub.com/sql-reference/sql-language-support/expressions-functions-operators

ABS - Supported
REGEXP - Supported
CONVERT - Not Supported.

Feel free to make a new issue for CONVERT.

@joel-rieke
Copy link

joel-rieke commented Jun 9, 2022

What's weird is that the query seems to work fine with CONVERT even... Hm.. but adding ABS it doesn't work. I am stringing together an ABS, a REGEXP, and a CONVERT in a WHERE clause of a JOIN query. Impressed with how close it gets. But agree this doesn't belong under this issue. I have opened another issue to address: dolthub/go-mysql-server#1050

@timsehn
Copy link
Contributor

timsehn commented Jun 9, 2022

Looks like CONVERT is supported but maybe only partially.

https://github.com/dolthub/go-mysql-server/blob/main/sql/expression/convert.go

Feel free to make an issue for the query you want to work. I'll update the Dolt docs.

@timsehn
Copy link
Contributor

timsehn commented Jun 9, 2022

PR to fix this in docs. I need a second set of eyes on it.

dolthub/docs#638

@zachmu zachmu transferred this issue from dolthub/go-mysql-server Oct 7, 2022
@timsehn timsehn added enhancement New feature or request sql Issue with SQL labels Oct 7, 2022
@timsehn
Copy link
Contributor

timsehn commented Oct 7, 2022

Resolving because we added a note on CONVERT()

@timsehn timsehn closed this as completed Oct 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers sql Issue with SQL
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants