Skip to content

Commit

Permalink
Backporting from 2.4 fix for booleans in mysql when running PHP 5.5
Browse files Browse the repository at this point in the history
  • Loading branch information
lorenzo committed Jul 2, 2013
1 parent 868dc2e commit 58149f2
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/Cake/Model/Datasource/Database/Mysql.php
Expand Up @@ -221,10 +221,10 @@ public function resultSet($results) {

while ($numFields-- > 0) {
$column = $results->getColumnMeta($index);
if (empty($column['native_type'])) {
$type = ($column['len'] == 1) ? 'boolean' : 'string';
if ($column['len'] === 1 && (empty($column['native_type']) || $column['native_type'] === 'TINY')) {
$type = 'boolean';
} else {
$type = $column['native_type'];
$type = empty($column['native_type']) ? 'string' : $column['native_type'];
}
if (!empty($column['table']) && strpos($column['name'], $this->virtualFieldSeparator) === false) {
$this->map[$index++] = array($column['table'], $column['name'], $type);
Expand Down

0 comments on commit 58149f2

Please sign in to comment.