1--TEST-- 2PDO MySQL Bug #39483 (Problem with handling of \ char in prepared statements) 3--SKIPIF-- 4<?php 5if (!extension_loaded('pdo') || !extension_loaded('pdo_mysql')) die('skip not loaded'); 6require dirname(__FILE__) . '/config.inc'; 7require dirname(__FILE__) . '/../../../ext/pdo/tests/pdo_test.inc'; 8PDOTest::skip(); 9?> 10--FILE-- 11<?php 12require dirname(__FILE__) . '/../../../ext/pdo/tests/pdo_test.inc'; 13$db = PDOTest::test_factory(dirname(__FILE__) . '/common.phpt'); 14 15$db->setAttribute(PDO::ATTR_EMULATE_PREPARES, TRUE); 16$stmt = $db->prepare('SELECT UPPER(\'\0:D\0\'),?'); 17$stmt->execute(array(1)); 18var_dump($stmt->fetchAll(PDO::FETCH_NUM)); 19 20--EXPECT-- 21array(1) { 22 [0]=> 23 array(2) { 24 [0]=> 25 string(4) ":D" 26 [1]=> 27 string(1) "1" 28 } 29} 30