1--TEST-- 2PDO MySQL PECL Bug #5802 (bindParam/bindValue retain the is_null flag) 3--EXTENSIONS-- 4pdo_mysql 5--SKIPIF-- 6<?php 7require_once __DIR__ . '/inc/mysql_pdo_test.inc'; 8MySQLPDOTest::skip(); 9?> 10--FILE-- 11<?php 12require_once __DIR__ . '/inc/mysql_pdo_test.inc'; 13$db = MySQLPDOTest::factory(); 14 15$db->exec('create table test_pcl_bug_5802 ( bar char(3) NULL )'); 16$stmt = $db->prepare('insert into test_pcl_bug_5802 (bar) values(:bar)') or var_dump($db->errorInfo()); 17 18$bar = 'foo'; 19$stmt->bindParam(':bar', $bar); 20$stmt->execute() or var_dump($stmt->errorInfo()); 21 22$bar = null; 23$stmt->bindParam(':bar', $bar); 24$stmt->execute() or var_dump($stmt->errorInfo()); 25 26$bar = 'qaz'; 27$stmt->bindParam(':bar', $bar); 28$stmt->execute() or var_dump($stmt->errorInfo()); 29 30$stmt = $db->prepare('select * from test_pcl_bug_5802') or var_dump($db->errorInfo()); 31 32if($stmt) $stmt->execute(); 33if($stmt) var_dump($stmt->fetchAll(PDO::FETCH_ASSOC)); 34 35print "done!"; 36?> 37--CLEAN-- 38<?php 39require_once __DIR__ . '/inc/mysql_pdo_test.inc'; 40$db = MySQLPDOTest::factory(); 41$db->exec('DROP TABLE IF EXISTS test_pcl_bug_5802'); 42?> 43--EXPECT-- 44array(3) { 45 [0]=> 46 array(1) { 47 ["bar"]=> 48 string(3) "foo" 49 } 50 [1]=> 51 array(1) { 52 ["bar"]=> 53 NULL 54 } 55 [2]=> 56 array(1) { 57 ["bar"]=> 58 string(3) "qaz" 59 } 60} 61done! 62