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

Validation of bool for WHERE clause might be unnecessary #1

Open
tatulea opened this issue Sep 16, 2020 · 1 comment
Open

Validation of bool for WHERE clause might be unnecessary #1

tatulea opened this issue Sep 16, 2020 · 1 comment

Comments

@tatulea
Copy link

tatulea commented Sep 16, 2020

There are SQL queries that don't have a bool type in the where clause (e.g.: the usage of JSON_CONTAINS_PATH).

if self.value.return_type != bool:
should be the place to change this.

@tatulea tatulea changed the title Validation of boo for WHERE clause might be unnecessary Validation of bool for WHERE clause might be unnecessary Sep 18, 2020
@David-Wobrock
Copy link
Owner

Hi @tatulea, thanks for opening an issue :)
mysql/MariaDB indeed supports WHERE conditions on other column types than boolean. Good catch, thanks for reporting it.

I based myself on postgresql, where the condition is stricter:

ERROR:  argument of WHERE must be type boolean, not type integer
LINE 1: select * from sometable where id;

I'll probably make the validation a bit more permissive for now (even though the validation is only partly implemented)

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