From b58940e9b5580a57310eceef6181e3d7273d2752 Mon Sep 17 00:00:00 2001 From: ovidiupruteanu Date: Mon, 9 Sep 2013 16:33:54 +0300 Subject: [PATCH] Fixed handling null values in Sqlserver->value The value function quoted a null value as N'' instead of NULL. As a result is produced queries like [name] IS N'' instead of [name] IS NULL which resulted in an SQL error. --- lib/Cake/Model/Datasource/Database/Sqlserver.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Cake/Model/Datasource/Database/Sqlserver.php b/lib/Cake/Model/Datasource/Database/Sqlserver.php index 788885dbc..7fb0225ad 100644 --- a/lib/Cake/Model/Datasource/Database/Sqlserver.php +++ b/lib/Cake/Model/Datasource/Database/Sqlserver.php @@ -571,7 +571,7 @@ class Sqlserver extends DboSource { * @return string Quoted and escaped data */ public function value($data, $column = null) { - if (is_array($data) || is_object($data)) { + if ($data === null || is_array($data) || is_object($data)) { return parent::value($data, $column); } elseif (in_array($data, array('{$__cakeID__$}', '{$__cakeForeignKey__$}'), true)) { return $data;