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