php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #54046 with multiple Mysql Links, data disappears/reappears
Submitted: 2011-02-18 15:58 UTC Modified: 2013-02-18 00:34 UTC
From: matze73 at hallo dot ms Assigned:
Status: No Feedback Package: MySQL related
PHP Version: 5.3.5 OS:
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: matze73 at hallo dot ms
New email:
PHP Version: OS:

 

 [2011-02-18 15:58 UTC] matze73 at hallo dot ms
Description:
------------
[please note: actually, this problem occurs with 5.3.3. I have currently no option to upgrade the php package. ]

I am working with two mysql links. 

Basically, I observed that with entering another block / STACK frame, previously retrieved data disappears , upon return it re-appears. 

It is no SCOPE problem, because the problem goes away when working with just one mysql database link.

Long story:

There is some small amount of data retrieved from the first link, which is put into an array ( instance member $this->a );

Then, *inside* an switch-block the array is missing its elements retrieved from the database. But after the switch-block the array is intact again .. !!

After years of PHP coding I never had such a case. Very curious indeed. I tried two workarounds:

1. copy the array into $_SESSION
2. convert the array via print_r ($a, true) to a string 

The truly NASTY thing is, even with option #2 the resulting string changes during the switch statement (looses data) - and is intact again afterwards.

The same effect when calling an instance method: elements retrieved from the first database link have disappeared.

The problem is only with data retrieved from the first mysql link.

Helpful workaround: when I move the table from the first database to the second database (i.e. just working with one mysql link), the problem disappears altogether.

The VERY strange thing is, that the data even disappears/reappears when converted via print_r( $x, true) ...



Actual result:
--------------



Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2011-02-18 16:44 UTC] johannes@php.net
-Status: Open +Status: Feedback
 [2011-02-18 16:44 UTC] johannes@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.
 [2013-02-18 00:34 UTC] php-bugs at lists dot php dot net
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 "Open". Thank you.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Apr 20 02:01:29 2024 UTC