php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #44274 Cannot extend built-in classes
Submitted: 2008-02-27 21:01 UTC Modified: 2008-03-26 01:00 UTC
From: cadastro at luciana dot pro dot br Assigned:
Status: No Feedback Package: MySQLi related
PHP Version: 5.2.5 OS: linux
Private report: No CVE-ID: None
 [2008-02-27 21:01 UTC] cadastro at luciana dot pro dot br
Description:
------------
 Fixed bug #28430 (Extending mysqli class). (Georg)

this fix is SO NOT TRUE !!

The bug is STILL THERE THE SAME AS IT WAS 4 YEARS AGO !!!



I CAN'T GET THE THREAD_ID VALUE !! AND THAT'S CAUSING A BIG ISSUE :

I OPEN CONNECTION, USE AND CLOSE IT. IT ACTUALLY CLOSES (I TESTED), BUT IT LETS AN ORPHAN >>>> THREAD <<<< IN MEMORY - WHICH IS CONSUMING RESOURCES UNTIL MAX THREAD OF MYSQL IS REACHED, MAKING MYSQL GO DOWN WHEN IT HAPPENS. 

TO FIX IT I NEED TO MANUALLY KILL THE THREAD THAT IS NOT BEEING CLOSED BY MYSQLI! BUT HOW IF THE THING IS BUGGED?! :/

I HOPE IT GETS REALLY FIXED !!

THANKS!



Reproduce code:
---------------
EXAMPLE FOR TESTING THE BUG :

--------------------------------------------------------
myclass inherits mysqli {

function connect() {
     
     parent::connect( <conection stuff> );
}


function kill() {
     
     parent::kill( parent::thread_id ); // <<<<< BUG!! 
}

}
--------------------------------------------


Expected result:
----------------
I expect the thread to be REMOVED FROM MEMORY !!!

Actual result:
--------------
MYSQLI is letting OPRHAN THREADS in memory, and if mysql limit is 100 and I reload page 100 times, it will take mysql off business :/

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2008-02-27 21:03 UTC] cadastro at luciana dot pro dot br
PHP Version 5.2.0-8+etch10

compile date: 2008-01-18
 [2008-03-18 17:17 UTC] andrey@php.net
 Hi,
I can't reproduce it with CVS of 5.3 and 5.2
I used the following test case

<?php
class myclass extends mysqli {
  function connect() {
    parent::connect( "localhost", "root", "xxx" );
  }
  function kill() {
    var_dump($this->thread_id);
    parent::kill( $this->thread_id ); // <<<<< BUG!! 
  }
}
$a = new myclass();
$a->connect();
$a->kill();
?>

Output:
int(1834)

Then I check with SHOW PROCESSLIST what are the running processes - nothing is left.

 [2008-03-26 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Oct 04 08:01:28 2024 UTC