nette/nette — pull request #806 by juzna (2012-10-08 22:17:57+00:00)
Title: Database - normalize values

Bug: database values are not properly normalized to valid php types.

When column in a mysql db is of type `bit(1)`, it's then fetched as binary, i.e. `\0` or `\1`, instead of booleans (`false` or `true`) - tested on PHP 5.3.16.
On PHP 5.4.7 numeric strings are returned (`"0"` or `"1"`).

The biggest problem in 5.3 is that these binary strings evaluate to true in conditions! Thus `if ($row->flag)` always matches.

I don't know how to fix this atm, so at least attaching a simple test case. Suggestions or comments welcomed.