Bug #80556 [Opn->Dup]: Uncaught PDOException: SQLSTATE[HY000]: General error: 2014

From: Date: Sun, 27 Dec 2020 23:02:59 +0000
Subject: Bug #80556 [Opn->Dup]: Uncaught PDOException: SQLSTATE[HY000]: General error: 2014
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-231270@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=80556&edit=1 ID: 80556 Updated by: requinix@php.net Reported by: mail at awekas dot at Summary: Uncaught PDOException: SQLSTATE[HY000]: General error: 2014 -Status: Open +Status: Duplicate Type: Bug Package: PDO MySQL Operating System: CentOS 7 PHP Version: 7.4.13 Block user comment: N Private report: N New Comment: Duplicate of bug #80458 Note that it doesn't make sense to try to fetch results from a query that doesn't produce results. Previous Comments: ------------------------------------------------------------------------ [2020-12-27 17:04:43] mail at awekas dot at Description: ------------ After update my Centos 7 server to PHP lsphp74-pdo 7.4.13-1.el7 i get many PDO errors like: Fatal error: Uncaught 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. in /var/www/xxxx.php:901 Stack trace: #0 /var/www/xxxx.php(901): PDOStatement->fetch() #1 {main} thrown in /var/www/xxxx.php on line 901 Code is working fine with lsphp73-pdo 7.3.25-1.el8 (and lower) and lsphp74-pdo 7.4.11-1.el7 Have checked the code but no improvement. Test script: --------------- include ("../pdoconnect.php"); $user = "user"; $passwd = "password"; $stmt = $pdo->prepare("SELECT timestamp, UNIX_TIMESTAMP(),id, name FROM firsttable WHERE user = :user AND password = :password "); $stmt->execute(array(':user' => $user, ':password' => $passwd)); $db_erg = $stmt->fetch(); $time = "2020-01-01 00:00:00"; $dump = "test0123"; $sqlstring = "TEST"; $stmt = $pdo->prepare("UPDATE secondtable SET sqlstring= :sqlstring, dump= :dump WHERE time = :time "); $stmt->execute(array(':sqlstring' => $sqlstring, ':dump' => $dump, ':time' => $time )); $stmt->fetch(); ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=80556&edit=1

« previous php.bugs (#231270) next »