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