From: Adam Baratz Date: Tue, 13 Sep 2016 17:15:06 +0000 (-0400) Subject: Explicitly allow NULL values for dblib compatibility X-Git-Tag: php-7.1.0RC2~6^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=9fb94f03e7b5a3655ae87c819638e3137b729004;p=php Explicitly allow NULL values for dblib compatibility MSSQL won't necessarily default columns to NULL, see: https://msdn.microsoft.com/en-us/library/ms174979.aspx --- diff --git a/ext/pdo/tests/pdo_018.phpt b/ext/pdo/tests/pdo_018.phpt index 7f27ce36e5..d931a2c1c0 100644 --- a/ext/pdo/tests/pdo_018.phpt +++ b/ext/pdo/tests/pdo_018.phpt @@ -71,7 +71,7 @@ $db->exec('CREATE TABLE classtypes(id int NOT NULL PRIMARY KEY, name VARCHAR(20) $db->exec('INSERT INTO classtypes VALUES(0, \'stdClass\')'); $db->exec('INSERT INTO classtypes VALUES(1, \'TestBase\')'); $db->exec('INSERT INTO classtypes VALUES(2, \'TestDerived\')'); -$db->exec('CREATE TABLE test(id int NOT NULL PRIMARY KEY, classtype int, val VARCHAR(255))'); +$db->exec('CREATE TABLE test(id int NOT NULL PRIMARY KEY, classtype int NULL, val VARCHAR(255) NULL)'); $db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); diff --git a/ext/pdo/tests/pdo_024.phpt b/ext/pdo/tests/pdo_024.phpt index 1b4f841f36..571ea73286 100644 --- a/ext/pdo/tests/pdo_024.phpt +++ b/ext/pdo/tests/pdo_024.phpt @@ -14,7 +14,7 @@ if (getenv('REDIR_TEST_DIR') === false) putenv('REDIR_TEST_DIR='.dirname(__FILE_ require_once getenv('REDIR_TEST_DIR') . 'pdo_test.inc'; $db = PDOTest::factory(); -$db->exec('create table test (id int, name varchar(10))'); +$db->exec('create table test (id int, name varchar(10) null)'); $stmt = $db->prepare('insert into test (id, name) values(0, :name)'); $name = NULL;