mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
Backporting from 2.4 fix for booleans in mysql when running PHP 5.5
This commit is contained in:
parent
868dc2e519
commit
58149f2315
1 changed files with 3 additions and 3 deletions
|
@ -221,10 +221,10 @@ class Mysql extends DboSource {
|
||||||
|
|
||||||
while ($numFields-- > 0) {
|
while ($numFields-- > 0) {
|
||||||
$column = $results->getColumnMeta($index);
|
$column = $results->getColumnMeta($index);
|
||||||
if (empty($column['native_type'])) {
|
if ($column['len'] === 1 && (empty($column['native_type']) || $column['native_type'] === 'TINY')) {
|
||||||
$type = ($column['len'] == 1) ? 'boolean' : 'string';
|
$type = 'boolean';
|
||||||
} else {
|
} else {
|
||||||
$type = $column['native_type'];
|
$type = empty($column['native_type']) ? 'string' : $column['native_type'];
|
||||||
}
|
}
|
||||||
if (!empty($column['table']) && strpos($column['name'], $this->virtualFieldSeparator) === false) {
|
if (!empty($column['table']) && strpos($column['name'], $this->virtualFieldSeparator) === false) {
|
||||||
$this->map[$index++] = array($column['table'], $column['name'], $type);
|
$this->map[$index++] = array($column['table'], $column['name'], $type);
|
||||||
|
|
Loading…
Reference in a new issue