php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #80556 Uncaught PDOException: SQLSTATE[HY000]: General error: 2014
Submitted: 2020-12-27 17:04 UTC Modified: 2020-12-27 23:02 UTC
From: mail at awekas dot at Assigned:
Status: Duplicate Package: PDO MySQL
PHP Version: 7.4.13 OS: CentOS 7
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: mail at awekas dot at
New email:
PHP Version: OS:

 

 [2020-12-27 17:04 UTC] 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();


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2020-12-27 23:02 UTC] requinix@php.net
-Status: Open +Status: Duplicate
 [2020-12-27 23:02 UTC] requinix@php.net
Duplicate of bug #80458

Note that it doesn't make sense to try to fetch results from a query that doesn't produce results.
 
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Wed Aug 04 16:01:23 2021 UTC