Bug #77970 [NEW]: "ALTER VIEW" queries not working as prepared statements

From: Date: Sat, 04 May 2019 17:09:06 +0000
Subject: Bug #77970 [NEW]: "ALTER VIEW" queries not working as prepared statements
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-220706@lists.php.net to get a copy of this message
From:             mail at jonas-staudenmeir dot de
Operating system: Ubuntu
PHP version:      7.3.5
Package:          MySQL related
Bug Type:         Bug
Bug description:"ALTER VIEW" queries not working as prepared statements

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 bug report at https://bugs.php.net/bug.php?id=77970&edit=1
-- 
Try a snapshot (PHP 5.4):   https://bugs.php.net/fix.php?id=77970&r=trysnapshot54
Try a snapshot (PHP 5.5):   https://bugs.php.net/fix.php?id=77970&r=trysnapshot55
Try a snapshot (trunk):     https://bugs.php.net/fix.php?id=77970&r=trysnapshottrunk
Fixed in SVN:               https://bugs.php.net/fix.php?id=77970&r=fixed
Fixed in release:           https://bugs.php.net/fix.php?id=77970&r=alreadyfixed
Need backtrace:             https://bugs.php.net/fix.php?id=77970&r=needtrace
Need Reproduce Script:      https://bugs.php.net/fix.php?id=77970&r=needscript
Try newer version:          https://bugs.php.net/fix.php?id=77970&r=oldversion
Not developer issue:        https://bugs.php.net/fix.php?id=77970&r=support
Expected behavior:          https://bugs.php.net/fix.php?id=77970&r=notwrong
Not enough info:            https://bugs.php.net/fix.php?id=77970&r=notenoughinfo
Submitted twice:            https://bugs.php.net/fix.php?id=77970&r=submittedtwice
register_globals:           https://bugs.php.net/fix.php?id=77970&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=77970&r=php4
Daylight Savings:           https://bugs.php.net/fix.php?id=77970&r=dst
IIS Stability:              https://bugs.php.net/fix.php?id=77970&r=isapi
Install GNU Sed:            https://bugs.php.net/fix.php?id=77970&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=77970&r=float
No Zend Extensions:         https://bugs.php.net/fix.php?id=77970&r=nozend
MySQL Configuration Error:  https://bugs.php.net/fix.php?id=77970&r=mysqlcfg



Thread (2 messages)

« previous php.bugs (#220706) next »