Skip to content

Commit

Permalink
Explicitly allow NULL values for dblib compatibility
Browse files Browse the repository at this point in the history
MSSQL won't necessarily default columns to NULL, see:
https://msdn.microsoft.com/en-us/library/ms174979.aspx
  • Loading branch information
adambaratz committed Sep 13, 2016
1 parent 69013f6 commit 9fb94f0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion ext/pdo/tests/pdo_018.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
2 changes: 1 addition & 1 deletion ext/pdo/tests/pdo_024.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 9fb94f0

Please sign in to comment.