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

Object with __toString() as query parameter = PDO error, string looks OK. #7192

Closed
mcd-php opened this issue Feb 6, 2015 · 2 comments
Closed

Comments

@mcd-php
Copy link
Contributor

mcd-php commented Feb 6, 2015

Right after implementing #7181 I stumbled on a trange error:

Then I pass the boxed object as query parameter (SomeModel::find()->where(['id'=>$someId])), Cassandra PDO tells me CQLSTATE[HY000] [2] Invalid STRING constant (a11...4df) for "id" of type uuid. (The UUID is perfectly the same)

If I put (string) (typecast) before $someId, everything works.

But __toString() is being called on it anyway, from \yii\db\Command::bindPendingParams at pdoStatement->bindValue() - if I set breakpoint on __toString(), stack trace tells me so !

Adding typecast to \yii\db\Command::bindPendingParams as $this->pdoStatement->bindValue($name, (string)$value[0], $value[1]); does not help at all.

What can it be - some creepy misfeature or bug in PHP, PDO, Cassandra PDO driver ? I see where's likely not framework bug, but maybe you do know how to fight it or where to escalate ?

@cebe
Copy link
Member

cebe commented Feb 6, 2015

Please try to reproduce it with plain PDO and report it to PDO/Cassandra if it is possible.

@mcd-php
Copy link
Contributor Author

mcd-php commented Feb 9, 2015

Fixed in my private Cassandra library, it was [https://github.com/Orange-OpenSource/YACassandraPDO/issues/64]

@mcd-php mcd-php closed this as completed Feb 9, 2015
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