com php-src: Explicitly allow NULL values for dblib compatibility: ext/pdo/tests/pdo_018.phpt ext/pdo/tests/pdo_0 24.phpt
| From: | Adam Baratz | Date: | Tue, 13 Sep 2016 20:36:23 +0000 |
| Subject: | com php-src: Explicitly allow NULL values for dblib compatibility: ext/pdo/tests/pdo_018.phpt ext/pdo/tests/pdo_0 24.phpt | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-94501@lists.php.net to get a copy of this message | ||
Commit: 9fb94f03e7b5a3655ae87c819638e3137b729004
Author: Adam Baratz <adambaratz@php.net> Tue, 13 Sep 2016 13:15:06 -0400
Parents: 69013f6b2620d2ed9f143373e88124d4a74e4bf7
Branches: PHP-7.0
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=9fb94f03e7b5a3655ae87c819638e3137b729004
Log:
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
Changed paths:
M ext/pdo/tests/pdo_018.phpt
M ext/pdo/tests/pdo_024.phpt
Diff:
diff --git a/ext/pdo/tests/pdo_018.phpt b/ext/pdo/tests/pdo_018.phpt
index 7f27ce3..d931a2c 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 1b4f841..571ea73 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;