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

Bug with pgsql query #177

Open
chekalsky opened this issue Sep 6, 2018 · 5 comments
Open

Bug with pgsql query #177

chekalsky opened this issue Sep 6, 2018 · 5 comments

Comments

@chekalsky
Copy link

chekalsky commented Sep 6, 2018

If you will try to do this:

$pdo->fetchCol("SELECT id FROM table WHERE removed = false AND data @> '{\"is_hidden\":false}'::jsonb AND type in (:types)", ['types' => [1, 2]]);

you will get an error from DB: SQLSTATE[08P01]: <<Unknown error>>: 7 ERROR: bind message supplies 0 parameters, but prepared statement "pdo_stmt_00000001" requires 1

And this is because :types will be skipped here.

@chekalsky
Copy link
Author

Anybody?

@chekalsky
Copy link
Author

@pmjones is Aura.SQL abandoned?

@pmjones
Copy link
Member

pmjones commented Feb 19, 2019

Which version are you trying this with: v2, or v3?

@chekalsky
Copy link
Author

chekalsky commented Mar 4, 2019

v3

@harikt harikt mentioned this issue Feb 28, 2022
@harikt
Copy link
Member

harikt commented Feb 28, 2022

@chekalsky sorry for being late here. I actually added a failing test.

The fun fact is if you change the order

SELECT * FROM table WHERE type in (:types) AND removed = false AND data @> '{\"is_hidden\":false}'::jsonb

this will work.

I don't have a fix right now. But can look into it at some point of time.

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

3 participants