#36922 [NEW]: missing Constant
| From: | traufeisen@php.net | Date: | Thu, 30 Mar 2006 11:07:33 +0000 |
| Subject: | #36922 [NEW]: missing Constant | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-95113@lists.php.net to get a copy of this message | ||
From: traufeisen@php.net
Operating system: CentOS 4
PHP version: 5.1.2
PHP Bug Type: MySQLi related
Bug description: missing Constant
Description:
------------
Mysqli provides the possibility to throw an exception if an error occurs.
This can be done with "mysqli_report(3)"
1 = MYSQLI_REPORT_ERROR
2 = MYSQLI_REPORT_STRICT
However, the MYSQLI_REPORT_STRICT constant doesn´t exists in PHP-userland
(defined in php_mysqli.h).
A small patch which is adding this constant is available at
http://www.phpschlampe.de/mysqli.patch
Reproduce code:
---------------
<?php
error_reporting(E_ALL);
mysqli_report(MYSQLI_REPORT_ERROR | MYSQLI_REPORT_STRICT);
$sql = new mysqli("localhost","root","wrongpass","test");
?>
Expected result:
----------------
PHP Fatal error: Uncaught exception 'mysqli_sql_exception' with message
'Access denied for user 'root'@'localhost' ....
Actual result:
--------------
PHP Notice: Use of undefined constant MYSQLI_REPORT_STRICT - assumed
'MYSQLI_REPORT_STRICT' in /home/traufeisen/mysqlitest.php on line 4
PHP Warning: mysqli::mysqli(): (28000/1045): Access denied for user
'root'@'localhost' (using password: YES) in
/home/traufeisen/mysqlitest.php on line 5
--
Edit bug report at http://bugs.php.net/?id=36922&edit=1
--
Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=36922&r=trysnapshot44
Try a CVS snapshot (PHP 5.1): http://bugs.php.net/fix.php?id=36922&r=trysnapshot51
Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=36922&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=36922&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=36922&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=36922&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=36922&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=36922&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=36922&r=support
Expected behavior: http://bugs.php.net/fix.php?id=36922&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=36922&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=36922&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=36922&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=36922&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=36922&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=36922&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=36922&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=36922&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=36922&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=36922&r=mysqlcfg