From f710ae7fbe7837d4401cca1a95395ae7c729929d Mon Sep 17 00:00:00 2001 From: DarkAngelBGE Date: Tue, 28 Jul 2009 20:08:24 +0000 Subject: [PATCH] Minor refactorings + fix for dbo mysqli related to previous commit git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@8261 3807eeeb-6ff5-0310-8944-8be069107fe0 --- cake/libs/model/datasources/dbo/dbo_mysqli.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/cake/libs/model/datasources/dbo/dbo_mysqli.php b/cake/libs/model/datasources/dbo/dbo_mysqli.php index 4663567ca..b0adf8d2e 100644 --- a/cake/libs/model/datasources/dbo/dbo_mysqli.php +++ b/cake/libs/model/datasources/dbo/dbo_mysqli.php @@ -204,7 +204,7 @@ class DboMysqli extends DboMysqlBase { return 'NULL'; } if ($data === '' && $column !== 'integer' && $column !== 'float' && $column !== 'boolean') { - return "''"; + return "''"; } if (empty($column)) { $column = $this->introspectType($data); @@ -212,11 +212,14 @@ class DboMysqli extends DboMysqlBase { switch ($column) { case 'boolean': - $data = $this->boolean((bool)$data); + return $this->boolean((bool)$data); break; case 'integer' : case 'float' : case null : + if ($data === '') { + return 'NULL'; + } if ((is_int($data) || is_float($data) || $data === '0') || ( is_numeric($data) && strpos($data, ',') === false && $data[0] != '0' && strpos($data, 'e') === false)) {