Bug #76703 [NEW]: MYSQLI_OPT_READ_TIMEOUT cannot be changed after connection established
| From: | php at darkain dot com | Date: | Fri, 03 Aug 2018 23:02:14 +0000 |
| Subject: | Bug #76703 [NEW]: MYSQLI_OPT_READ_TIMEOUT cannot be changed after connection established | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-216572@lists.php.net to get a copy of this message | ||
From: php at darkain dot com
Operating system: Debian 9
PHP version: 7.2.8
Package: MySQLi related
Bug Type: Bug
Bug description:MYSQLI_OPT_READ_TIMEOUT cannot be changed after connection established
Description:
------------
The MYSQLI_OPT_READ_TIMEOUT option cannot be changed after a connection
is established. This means if it is set to a low value to ensure a
stable initial connection to the MySQL server, it cannot be raised back
up again before executing long running queries.
Test script:
---------------
<?php
$connection = mysqli_init();
//ensure we receive a reply from mysql in under 1 second
$connection->options(MYSQLI_OPT_READ_TIMEOUT, 1);
//connect to the mysql server
$connection->real_connect($server, $username, $password, $database);
//change timeout to 1 hour so we can run a long query
$connection->options(MYSQLI_OPT_READ_TIMEOUT, 60*60);
//attempt to pull results from a very large table, something that would
exceed the initial 1 second timeout value, but not the 1 hour timeout
value
$connection->query('SELECT * FROM
huge_table');
--
Edit bug report at https://bugs.php.net/bug.php?id=76703&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=76703&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=76703&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=76703&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=76703&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=76703&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=76703&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=76703&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=76703&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=76703&r=support
Expected behavior: https://bugs.php.net/fix.php?id=76703&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=76703&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=76703&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=76703&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=76703&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=76703&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=76703&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=76703&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=76703&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=76703&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=76703&r=mysqlcfg