php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #58507 PDO: 'query' in $errcontext (set_handler_error) not filled
Submitted: 2009-01-14 08:42 UTC Modified: 2014-01-01 12:42 UTC
Votes:1
Avg. Score:3.0 ± 0.0
Reproduced:0 of 1 (0.0%)
From: eromero at sitrack dot com Assigned:
Status: Open Package: PDO_INFORMIX (PECL)
PHP Version: 5.2.5 OS: Linux Gentoo
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2009-01-14 08:42 UTC] eromero at sitrack dot com
Description:
------------
Verions: PDO-1.0.3
         PDO-INFORMIX-1.2.6
         PHP-5.2.8-r1

I dont know why or when, but now PDO dont report errors in queries to the function set with set_error_handler().

I have to force the attribute
$pdo->setAttribute( PDO::ATTR_ERRMODE, PDO::ERRMODE_WARNING );

With this It reports errors but dont complete the node 'query' in the var errcontext (Param of my error handler function)



Reproduce code:
---------------
...
function my_err_hand ($errno, $errmsg, $filename, $linenum, $errcontext) {
  if(isset($errcontext['query'])) {
    echo "query: " . $errcontext['query'];
  } else {
    echo "query was not set";
  }
}

set_error_handler('my_err_hand');
...

$pdo->setAttribute( PDO::ATTR_ERRMODE, PDO::ERRMODE_WARNING );

$pdo->query("SELECT false_column from some_table");





Expected result:
----------------
query: SELECT false_column from some_table

Actual result:
--------------
query was not set

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2013-06-12 03:44 UTC] ssufficool@php.net
-Summary: 'query' in $errcontext (set_handler_error) not filled +Summary: PDO: 'query' in $errcontext (set_handler_error) not filled -Package: PDO +Package: PDO related
 [2014-01-01 12:42 UTC] felipe@php.net
-Package: PDO related +Package: PDO_INFORMIX
 
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Fri Apr 19 21:01:26 2019 UTC