xref: /PHP-8.2/ext/pdo_mysql/tests/bug71145.phpt (revision b5a14e6c)
1--TEST--
2Bug #71145: Multiple statements in init command triggers unbuffered query error
3--EXTENSIONS--
4pdo_mysql
5--SKIPIF--
6<?php
7require_once(__DIR__ . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
8MySQLPDOTest::skip();
9?>
10--FILE--
11<?php
12
13require_once(__DIR__ . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
14
15$attr = array(
16    PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
17    PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES utf8mb4 COLLATE utf8mb4_unicode_ci; SET SESSION sql_mode=traditional',
18    PDO::ATTR_STRINGIFY_FETCHES => true,
19);
20putenv('PDOTEST_ATTR=' . serialize($attr));
21
22$pdo = MySQLPDOTest::factory();
23var_dump($pdo->query('SELECT 42')->fetchColumn(0));
24
25?>
26--EXPECT--
27string(2) "42"
28