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.
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.