Bug #74401 [Opn->Fbk]: PDO trigger warning already set throw exception

From: Date: Mon, 10 Apr 2017 09:56:50 +0000
Subject: Bug #74401 [Opn->Fbk]: PDO trigger warning already set throw exception
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-208422@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=74401&edit=1

 ID:                 74401
 Updated by:         danack@php.net
 Reported by:        lusc at jiedaibao dot com
 Summary:            PDO trigger warning already set throw exception
-Status:             Open
+Status:             Feedback
 Type:               Bug
 Package:            PDO MySQL
 Operating System:   Centos6.x
 PHP Version:        7.0.17
 Block user comment: N
 Private report:     N

 New Comment:

Forgot to update the status to feedback. Also, the reason I'm asking for an example is that the
code for generating warning or exceptions looks really quite unlikely to do both.

https://github.com/php/php-src/blob/528468579b002ff17e3c38d9330da67749fd85ec/ext/pdo/pdo_dbh.c#L149-L165


Previous Comments:
------------------------------------------------------------------------
[2017-04-10 09:52:57] danack@php.net

Please can you provide a simple test script that shows this.

------------------------------------------------------------------------
[2017-04-10 09:39:24] lusc at jiedaibao dot com

Description:
------------
PDOStatement::execute trigger an error when lost connection. I have already set 
$this->pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);


bug an Warning error is trigger , like:
Warning: PDOStatement::execute: MySQL server has gone away in ...

Expected result:
----------------
just throw exception

Actual result:
--------------
warning and exception all trigger


------------------------------------------------------------------------



--
Edit this bug report at https://bugs.php.net/bug.php?id=74401&edit=1


Thread (8 messages)

« previous php.bugs (#208422) next »