Bug #75595 [Fbk->NoF]: Database connect
| From: | php-bugs at lists dot php dot net | Date: | Sun, 18 Apr 2021 04:22:10 +0000 |
| Subject: | Bug #75595 [Fbk->NoF]: Database connect | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-233484@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=75595&edit=1
ID: 75595
Updated by: php-bugs@lists.php.net
Reported by: markus at prepaid-order dot com
Summary: Database connect
-Status: Feedback
+Status: No Feedback
Type: Bug
Package: PDO MySQL
Operating System: ubuntu 16.04
PHP Version: 7.1.12
Assigned To: dharman
Private report: N
New Comment:
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Re-Opened". Thank you.
Previous Comments:
------------------------------------------------------------------------
[2021-04-09 13:00:11] dharman@php.net
I am closing this bug report as it is not clear what the actual issue reported is. If you are still
encountering the same problem with modern PHP versions, please create minimal reproducible script
which we can copy and paste. The code provided so far has syntax errors and calls an unknown
function. You claim that the catch block is never called, but the actual output is a memory
overflow. Please explain the problem more clearly.
------------------------------------------------------------------------
[2017-11-30 15:39:24] markus at prepaid-order dot com
hi,
this simple function is inside of any php class.
remember (it works) fine !!!! but the catch block never called when pdo resource is null or timed
out.
this is only the connection to connect the database.You can call any small sql statement no matter.
this works fine (only database is online an available). You can stop the mysql instance via
/etcInit.d/mysql stop
you can make any connection see my PDO DSN string select any table or sql statement,
hope you can see the error too... please shut down the database instance and call the php script /
connection again,aou will see the error appear.
------------------------------------------------------------------------
[2017-11-30 14:48:30] requinix@php.net
Thank you for this bug report. To properly diagnose the problem, we
need a short but complete example script to be able to reproduce
this bug ourselves.
A proper reproducing script starts with <?php and ends with ?>,
is max. 10-20 lines long and does not require any external
resources such as databases, etc. If the script requires a
database to demonstrate the issue, please make sure it creates
all necessary tables, stored procedures etc.
Please avoid embedding huge scripts into the report.
According to your description the problem would be somewhere within
generateErrorPlistWithFailReason...
------------------------------------------------------------------------
[2017-11-30 13:15:59] markus at prepaid-order dot com
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 this bug report at https://bugs.php.net/bug.php?id=75595&edit=1