ID:               49511
 User updated by:  casper at procurios dot nl
 Reported By:      casper at procurios dot nl
 Status:           Assigned
 Bug Type:         MySQL related
 Operating System: *
 PHP Version:      5.3, 6 (2009-09-09)
 Assigned To:      mysql
 New Comment:

Hi Ulf,

Your solution seems spot on.

Also, I don't understand what you are saying here:
"To get the same behaviour in mysql as with libmysql, we would need to
set the streams timeout to 1 year upon connect and 
wait. We may wait longer than max_execution_time. However, it seems
that by default default_socket_timeout >  
max_execution_time and thus it may be irrelevant to take care of it."

In the manual on set_time_limit() it says:
"Note: The set_time_limit() function and the configuration directive
max_execution_time only affect the execution time of 
the script itself. Any time spent on activity that happens outside the
execution of the script such as system calls using 
system(), stream operations, database queries, etc. is not included
when determining the maximum time that the script has 
been running. This is not true on Windows where the measured time is
real." (http://www.php.net/manual/en/function.set-time-
limit.php)

Regarding default_socket_timeout = -1 -> endless:
It could be that it's just overflowing an int, resulting in 2^64-1 or
2^32-1 seconds.


Previous Comments:
------------------------------------------------------------------------

[2009-09-15 20:59:16] paj...@php.net

Sorry, I was not clear. Bugs have been reported and nothing has been
done so far. It is not a PHP bug and no, the libmysql libraries (5.0 or
5.1) does not build with VC6 either. As I said, we rather have to fix
mysqlnd instead of forking libmysql for our usages (as we will have to
do to support VC6).

I really don't want to do that for the next 3-4 years (expected
lifetime for 5.3) :)

And yes, your comment about this bug is right, Ulf agrees too afaics :)

------------------------------------------------------------------------

[2009-09-15 17:23:06] u...@php.net

On the bug itself:

The MySQL Client Library (libmysql) sets a limit of 365 * 24 * 3600
seconds as a default timeout for select() etc. One will hardly ever get
into that timeout but see a TCP/IP timeout happening before (e.g. after
10 minutes). 

mysqlnd does currently set no PHP streams timeout and therefore the
default PHP setting applies. 

To get the same behaviour in mysql as with libmysql, we would need to
set the streams timeout to 1 year upon connect and wait. We may wait
longer than max_execution_time. However, it seems that by default
default_socket_timeout > max_execution_time and thus it may be
irrelevant to take care of it.

Only ext/mysqli is more or less prepared to allow users to set the
timeout via an API call - one would need to introduce
MYSQLI_READ_TIMEOUT. While it may be easy to add that option also to
PDO_MYSQL there is easy way to make the read timeout configurable via
API in ext/mysql.

My current thinking is to introduce mysqlnd.read_timeout with a default
value equal to libmysql (= huuuuuugggggeeee) and make it SYSTEM_INI
only: no API changes required and admins can set it to
max_execution_time if they want.

Regarding default_socket_timeout = -1 -> endless:
I could not find it in the documentation either. It may need
documentation.

------------------------------------------------------------------------

[2009-09-15 16:45:05] u...@php.net

Pierre,

1) is an aside discussion. 

I assume 2) is about binaries offered for download from mysql.com? CRT
is a runtime dependency specific to the Windows platform. Windows
binaries can have those dependencies. Educate me about the details but
if any Windows binary has such a dependency there can be trouble using
it with other Windows binaries that use other CRTs.

In the worst case users needs to compile the library from source. 

Now, if you compile the MySQL Client Library from source to ensure that
it uses the CRT you want and that self-compiled library cannot be used
together with ext/mysql, ext/mysqli or PDO_MYSQL, it is a bug and should
be reported - at bugs.php.net or at bugs.mysql.com.

------------------------------------------------------------------------

[2009-09-15 15:32:59] paj...@php.net

It canont be compiled against libmysql. Their libraries are not
compatible. I don't choose to do it but they did. I also reported the
issue upstream but they don't care much about this problem, for two
reasons:

1. they gave php a new driver so they won't worry anymore about such
troubles (or licensing issues)
2. libmysql latest version CRT (5.0 or 5.1) can only be built only for
vc8+

There is even BC breaks as latest libmysql.dll makes php 5.2 crashes.

But that's not the problem here, there is a bug in mysqlnd and it has
to be addressed. It is not even a windows only issue.

------------------------------------------------------------------------

[2009-09-15 15:18:27] u...@php.net

On the available options on Windows:

ext/mysql, ext/mysqli and PDO_MYSQL can either be compiled against the
MySQL Client Library or mysqlnd. That is also true for Windows in
general. If not, it is a bug. Windows users do have a choice.

Pierre, php.net restricts itself on Windows to mysqlnd for a reason.
The reason is that you cannot compile current versions of the MySQL
Client Library using Visual Studio 6, just like you cannot compile
current versions of the MySQL Server using Visual Studio 6. Visual
Studio 6 is old - it is from 1998. As far as I know, Microsoft has
stopped to support this compiler. Consequently, MySQL has dropped
support for it.

To my understanding VC 6 is still of relevance for php.net because
other projects have or still do use VC 6. I would not want to use an
unsupported compiler for my project but they do although there are
superior and free offering from Microsoft. Using their products together
with a PHP binary that is not compiled with VC 6 can lead to crashes. 

Therefore, you are looking to support VC 6, which is not possible when
using the MySQL Client Library.

If one fails to use a recent version of the MySQL Client Library
together with ext/mysql, ext/mysqli or PDO_MYSQL on Windows using a
recent Visual Studio it should be reported as a bug.

------------------------------------------------------------------------

The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
    http://bugs.php.net/49511

-- 
Edit this bug report at http://bugs.php.net/?id=49511&edit=1

Reply via email to