xref: /PHP-8.0/ext/pdo_mysql/tests/bug70066.phpt (revision f3d58778)
1--TEST--
2Bug #70066: Unexpected "Cannot execute queries while other unbuffered queries"
3--SKIPIF--
4<?php
5if (!extension_loaded('pdo') || !extension_loaded('pdo_mysql')) die('skip not loaded');
6require_once(__DIR__ . DIRECTORY_SEPARATOR . 'skipif.inc');
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$pdo = MySQLPDOTest::factory();
16$pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
17$pdo->setAttribute(PDO::ATTR_EMULATE_PREPARES, 0);
18
19$db = $pdo->query('SELECT DATABASE()')->fetchColumn(0);
20// USE is not supported in the prepared statement protocol,
21// so this will fall back to emulation.
22$pdo->query('USE ' . $db);
23
24?>
25===DONE===
26--EXPECT--
27===DONE===
28