yiisoft/yii — pull request #1834 by tom-- (2012-12-09 15:39:18+00:00)
Title: CHAR(64) replaced with VARCHAR(128) on tbl_user.password

In the original PR for moving to use crypt() in the blog, the `tbl_user.password` column type was changed from `VARCHAR(128)` to `CHAR(64)`, which fits the hash strings nicely.

This works fine with MySQL and SQLite, and possibly other DBMSs because:

> When CHAR values are stored, they are right-padded with spaces to the specified length. When CHAR values are retrieved, trailing spaces are removed.

But this is not ANSI standard behavior, [it is a bug](http://bugs.mysql.com/bug.php?id=24424). (I was not aware of this until today when I tested the new blog tutorial with CUBRID 9.0.0.)

But when the blog tutorial is used with an ANSI-compliant DBMS, auth fails.

Reverting to `VARCHAR(128)` solves this problem with only a small performance hit.