From a80a51c86287dfce7d5d850e3aad5e7f69c04254 Mon Sep 17 00:00:00 2001 From: Dominique Fournier Date: Thu, 30 Nov 2017 10:57:29 +0000 Subject: [PATCH] dblayeroo: the post execute select must not convert a NULL to INT if a column definition is INTEGER git-svn-id: https://svn.fournier38.fr/svn/ProgSVN/trunk@4004 bf3deb0d-5f1a-0410-827f-c0cc1f45334c --- Tests/dblayerooComplet.php | 2 +- dblayeroo.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Tests/dblayerooComplet.php b/Tests/dblayerooComplet.php index 38639bd..716fd44 100644 --- a/Tests/dblayerooComplet.php +++ b/Tests/dblayerooComplet.php @@ -532,7 +532,7 @@ class test_dblayeroo_{ENGINE} extends PHPUnit_Framework_TestCase 'groupedoo.object' => 'object', 'groupedoo.where' => 'where', 'groupedoo.with space' => NULL, - 'usersoo.uid' => 0, + 'usersoo.uid' => NULL, 'usersoo.gecos' => NULL, 'usersoo.password' => NULL, 'usersoo.group' => NULL, diff --git a/dblayeroo.php b/dblayeroo.php index 5129133..84beb69 100644 --- a/dblayeroo.php +++ b/dblayeroo.php @@ -2882,8 +2882,8 @@ class dblayeroo if ($pos) $name = substr ($columns[$colNb], 0, $pos); $name = str_replace ("DISTINCT ", "", $name); - if (strtolower ($fieldsAll[$name][0]) === - "integer") + if (strtolower ($fieldsAll[$name][0]) === "integer" && + $val !== null) $val = intval ($val); } if (($pos = strpos ($columns[$colNb], " AS ".$this->sep)) !== false)