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

CActiveRecord::findByPk Does Not Handle Binary Keys Correctly #3517

Closed
BourgeoisBear opened this issue Aug 31, 2014 · 1 comment
Closed

CActiveRecord::findByPk Does Not Handle Binary Keys Correctly #3517

BourgeoisBear opened this issue Aug 31, 2014 · 1 comment

Comments

@BourgeoisBear
Copy link

If you have a mysql table with a primary key on a column of type BINARY(16) (for a UUID in my case), insert value of 0x92044ce93698443d88a947967462dd61 as one of the keys, then try to look it up using model()->findByPk(hex2bin('92044ce93698443d88a947967462dd61')), it will not find the record. From studying the underlying call to createPkCriteria() on line 1485, it seems as though there is an escaping issue with the aforementioned UUID in the query criteria. I do not know if this is a problem with Yii or PDO, but it should probably be addressed in the framework either way.

@cebe cebe added this to the 1.1.17 milestone Sep 1, 2014
@samdark samdark modified the milestones: 1.1.17, 1.1.18 Dec 29, 2015
@samdark
Copy link
Member

samdark commented Mar 13, 2017

Won't be fixed in 1.1.

@samdark samdark closed this as completed Mar 13, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants