Bug #77970 [Opn->Dup]: "ALTER VIEW" queries not working as prepared statements

From: Date: Wed, 09 Dec 2020 16:57:44 +0000
Subject: Bug #77970 [Opn->Dup]: "ALTER VIEW" queries not working as prepared statements
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-230973@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=77970&edit=1 ID: 77970 Updated by: nikic@php.net Reported by: mail at jonas-staudenmeir dot de Summary: "ALTER VIEW" queries not working as prepared statements -Status: Open +Status: Duplicate Type: Bug Package: PDO MySQL Operating System: Ubuntu PHP Version: 7.3.5 Block user comment: N Private report: N New Comment: This is another instance of bug #70066. Previous Comments: ------------------------------------------------------------------------ [2019-05-04 17:09:06] mail at jonas-staudenmeir dot de Description: ------------ 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=127.0.0.1;port=3306;dbname=database', 'user', 'password', [ PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION, PDO::ATTR_EMULATE_PREPARES => false, ]); $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." ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=77970&edit=1

« previous php.bugs (#230973) next »