1--TEST--
2PDO MySQL national character set parameters don't affect true prepared statements
3--SKIPIF--
4<?php
5if (!extension_loaded('pdo') || !extension_loaded('pdo_mysql')) die('skip not loaded');
6require __DIR__ . '/config.inc';
7require __DIR__ . '/../../../ext/pdo/tests/pdo_test.inc';
8PDOTest::skip();
9?>
10--FILE--
11<?php
12require __DIR__ . '/config.inc';
13require __DIR__ . '/../../../ext/pdo/tests/pdo_test.inc';
14$db = PDOTest::test_factory(__DIR__ . '/common.phpt');
15
16$db->setAttribute(PDO::ATTR_EMULATE_PREPARES, 0);
17
18$db->exec('CREATE TABLE test (bar NCHAR(4) NOT NULL)');
19
20$stmt = $db->prepare('INSERT INTO test VALUES(?)');
21$stmt->bindValue(1, 'foo', PDO::PARAM_STR | PDO::PARAM_STR_NATL);
22$stmt->execute();
23
24var_dump($db->query('SELECT * from test'));
25foreach ($db->query('SELECT * from test') as $row) {
26    print_r($row);
27}
28
29?>
30--CLEAN--
31<?php
32require __DIR__ . '/mysql_pdo_test.inc';
33MySQLPDOTest::dropTestTable();
34?>
35--EXPECTF--
36object(PDOStatement)#%d (1) {
37  ["queryString"]=>
38  string(18) "SELECT * from test"
39}
40Array
41(
42    [bar] => foo
43    [0] => foo
44)
45