xref: /PHP-7.3/ext/pdo_mysql/tests/bug_39483.phpt (revision b746e698)
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--EXPECT--
20array(1) {
21  [0]=>
22  array(2) {
23    [0]=>
24    string(4) "�:D�"
25    [1]=>
26    string(1) "1"
27  }
28}
29