|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #77970 "ALTER VIEW" queries not working as prepared statements
Submitted: 2019-05-04 17:09 UTC Modified: 2020-12-09 16:57 UTC
From: mail at jonas-staudenmeir dot de Assigned:
Status: Duplicate Package: PDO MySQL
PHP Version: 7.3.5 OS: Ubuntu
Private report: No CVE-ID: None
 [2019-05-04 17:09 UTC] mail at jonas-staudenmeir dot de
Ubuntu 18.04.2
MySQL 8.0.15

"ALTER VIEW" queries don't work as prepared statements if emulation is disabled.

Test script:
$pdo = new PDO('mysql:host=;port=3306;dbname=database', 'user', 'password', [

$pdo->prepare('create view `test` as select 1')->execute();
$pdo->prepare('alter view `test` as select 1')->execute();

Expected result:
Successful query execution.

Actual result:
The last line throws an exception:

"PDOException: SQLSTATE[HY000]: General error: 2014 Cannot execute queries while other unbuffered queries are active.  Consider using PDOStatement::fetchAll().  Alternatively, if your code is only ever going to run against mysql, you may enable query buffering by setting the PDO::MYSQL_ATTR_USE_BUFFERED_QUERY attribute."


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2019-05-05 10:11 UTC]
-Package: MySQL related +Package: PDO MySQL
 [2020-12-09 16:57 UTC]
-Status: Open +Status: Duplicate
 [2020-12-09 16:57 UTC]
This is another instance of bug #70066.
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed Apr 24 07:01:29 2024 UTC