Bug #74967 [Com]: mysqli.reconnect = 1: MYSQLI_OPT_INT_AND_FLOAT_NATIVE lost
| From: | egegega at sgegeg dot com | Date: | Thu, 05 Nov 2020 16:29:25 +0000 |
| Subject: | Bug #74967 [Com]: mysqli.reconnect = 1: MYSQLI_OPT_INT_AND_FLOAT_NATIVE lost | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-230145@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=74967&edit=1
ID: 74967
Comment by: egegega at sgegeg dot com
Reported by: spam2 at rhsoft dot net
Summary: mysqli.reconnect = 1:
MYSQLI_OPT_INT_AND_FLOAT_NATIVE lost
Status: Feedback
Type: Bug
Package: MySQLi related
Operating System: Linux
PHP Version: 7.0.21
Block user comment: N
Private report: N
New Comment:
the point is that the php code is always the same just with the difference using persistent
connections you randomly lose strict types of results
anyways, I stopped using persistent connections at all because they do more harm than anything else
and even disallowed them on the servers
Previous Comments:
------------------------------------------------------------------------
[2020-11-05 15:58:32] nikic@php.net
From a cursory look, mysqli.reconnect is a libmysqlclient only option, while
MYSQLI_OPT_INT_AND_FLOAT_NATIVE is a mysqlnd only option, so both of those cannot be in use at the
same time.
I'm assuming that this is rather referring to the reconnect that happens when mysqli_connect()
reuses an existing persistent connection.
But I believe that reconnect loses all options -- and more generally, it is expected that
mysqli_connect() is followed by setting all the necessary options, as you do not know whether you
get back a new connection or a reused existing one.
As such, I'm not really sure what the reported bug is.
------------------------------------------------------------------------
[2020-11-04 16:21:12] noname at withgod dot jp
still existing same bug in php 7.4.12.
------------------------------------------------------------------------
[2017-07-22 02:57:28] spam2 at rhsoft dot net
Description:
------------
if you are using persistent connections (p:hostname) and after some idle time mysqld has closed the
connection you lose the MYSQLI_OPT_INT_AND_FLOAT_NATIVE setting due the automatic reconnect
when the application is written with declare(strict_types=1); and used mysqli_options($conn,
MYSQLI_OPT_INT_AND_FLOAT_NATIVE, true) any typesafe comparison based on database rows then fails
this is really serious and make persistent connections dangerous to useless
noticed this recently after a benchmark worked fine with 9000 requests/second and later random
requests depending if the application chosed the readonly-slave or the master things started to
break
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=74967&edit=1