Bug #75595 [NEW]: Database connect
| From: | markus at prepaid-order dot com | Date: | Thu, 30 Nov 2017 13:16:01 +0000 |
| Subject: | Bug #75595 [NEW]: Database connect | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-212831@lists.php.net to get a copy of this message | ||
From: markus at prepaid-order dot com
Operating system: ubuntu 16.04
PHP version: 7.1.12
Package: PDO MySQL
Bug Type: Bug
Bug description:Database connect
Description:
------------
simple mariadb PDO connect and give result after success...
when Database is available all worked fine.... shut down DB instance
manual and host is not available call simple php script with this
function...
if Database is down catch block will not work and php is working and
after that following Message appear.
Fatal error: Allowed memory size of 629145600 bytes exhausted (tried to
allocate 20480 bytes)
my php function shows like this.
the Code worked before,source code have never changed.
tested with arbitrary php_memory limit,but the issue is still
available...
testet with php 5.6,7.0,7.1 (default)...
it works fine with 7.1,but have no idea...
timeout array in PDO constructor have also removed...
Test script:
---------------
> function getDBConnection()
> {
> global $pdo;
> try {
> if ($pdo == null)
> $pdo = new PDO(
>
>
'mysql:host=databaseHost;dbname=someDatabase;charset=utf8mb4',
> 'removed',
> 'removed_too'
> );
> } catch (Exception $ex) {
>
> generateErrorPlistWithFailReason(ErrorCodes::DATABASE_IS_DOWN,
> exit();
> }
> return $pdo;
> }
Expected result:
----------------
resource result and or result from catch block (if databse is
down/notavailable)...
Actual result:
--------------
after timeout
Fatal error: Allowed memory size of 629145600 bytes exhausted (tried to
allocate 20480 bytes)
--
Edit bug report at https://bugs.php.net/bug.php?id=75595&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=75595&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=75595&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=75595&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=75595&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=75595&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=75595&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=75595&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=75595&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=75595&r=support
Expected behavior: https://bugs.php.net/fix.php?id=75595&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=75595&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=75595&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=75595&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=75595&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=75595&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=75595&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=75595&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=75595&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=75595&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=75595&r=mysqlcfg