Re: com php-src: This is a very very old thing dated back to year 2009. MYSQL_OPT_READ_TIMEOUT was never a macro in mysqlnd but an enum value. So this
never actually worked correctly. mysqlnd provides these so it is safe to have them when mysqlnd used.: ext/mysqli/mysqli_api.c ext/mysqlnd/mysqlnd.c
ext/mysqlnd/mysqlnd_net.c
| From: | Matteo Beccati | Date: | Thu, 20 Oct 2016 10:57:44 +0000 |
| Subject: | Re: com php-src: This is a very very old thing dated back to year 2009. MYSQL_OPT_READ_TIMEOUT was never a macro in mysqlnd but an enum value. So this never actually worked correctly. mysqlnd provides these so it is safe to have them when mysqlnd used.: ext/mysqli/mysqli_api.c ext/mysqlnd/mysqlnd.c ext/mysqlnd/mysqlnd_net.c |
||
| References: | 1 2 | Groups: | php.cvs php.internals |
| Request: | Send a blank email to php-cvs+get-95241@lists.php.net to get a copy of this message | ||
Hi,
I have fixed the test for now, but I believe a mention to the new
constant should be added to NEWS and UPGRADING in master.
Cheers
On 18/10/2016 10:59, Matteo Beccati wrote:
> Hi Andrey,
>
> you're probably aware of it by now, but in any case, this commit (or
> others related) seems to cause a test failure:
>
>
> https://revive.beccati.com/bamboo/browse/PHP-SRC-TESTS-969/test/case/19172577
>
>
> Cheers
>
> On 17/10/2016 17:58, Andrey Hristov wrote:
>> Commit: 9594e364ed49d575dc27b887a996af10d18577ce
>> Author: Andrey Hristov <andrey.hristov@dnhsoft.com> Mon, 17 Oct 2016
>> 18:58:14 +0300
>> Parents: e1f5b6d8dfe1543205d5b45d3dcf1d34f5e2e420
>> Branches: master
>>
>> Link:
>> http://git.php.net/?p=php-src.git;a=commitdiff;h=9594e364ed49d575dc27b887a996af10d18577ce
>>
>> Log:
>> This is a very very old thing dated back to year 2009.
>> MYSQL_OPT_READ_TIMEOUT was never a macro in mysqlnd but an enum value.
>> So this never actually worked correctly. mysqlnd provides these so it is
>> safe to have them when mysqlnd used.
>>
>> Changed paths:
>> M ext/mysqli/mysqli_api.c
>> M ext/mysqlnd/mysqlnd.c
>> M ext/mysqlnd/mysqlnd_net.c
>>
>>
>> Diff:
>> diff --git a/ext/mysqli/mysqli_api.c b/ext/mysqli/mysqli_api.c
>> index 4f66069..b806820 100644
>> --- a/ext/mysqli/mysqli_api.c
>> +++ b/ext/mysqli/mysqli_api.c
>> @@ -1759,14 +1759,14 @@ static int mysqli_options_get_option_zval_type(int option)
>> #ifdef MYSQL_OPT_PROTOCOL
>> case MYSQL_OPT_PROTOCOL:
>> #endif /* MySQL 4.1.0 */
>> -#ifdef MYSQL_OPT_READ_TIMEOUT
>> +#if MYSQL_VERSION_ID > 40101 || defined(MYSQLI_USE_MYSQLND)
>> case MYSQL_OPT_READ_TIMEOUT:
>> case MYSQL_OPT_WRITE_TIMEOUT:
>> case MYSQL_OPT_GUESS_CONNECTION:
>> case MYSQL_OPT_USE_EMBEDDED_CONNECTION:
>> case MYSQL_OPT_USE_REMOTE_CONNECTION:
>> case MYSQL_SECURE_AUTH:
>> -#endif /* MySQL 4.1.1 */
>> +#endif
>> #ifdef MYSQL_OPT_RECONNECT
>> case MYSQL_OPT_RECONNECT:
>> #endif /* MySQL 5.0.13 */
>> diff --git a/ext/mysqlnd/mysqlnd.c b/ext/mysqlnd/mysqlnd.c
>> index 4c8f27f..4290f9e 100644
>> --- a/ext/mysqlnd/mysqlnd.c
>> +++ b/ext/mysqlnd/mysqlnd.c
>> @@ -2333,10 +2333,8 @@ MYSQLND_METHOD(mysqlnd_conn_data,
>> set_client_option)(MYSQLND_CONN_DATA * const c
>> }
>> switch (option) {
>> case MYSQL_OPT_COMPRESS:
>> -#ifdef WHEN_SUPPORTED_BY_MYSQLI
>> case MYSQL_OPT_READ_TIMEOUT:
>> case MYSQL_OPT_WRITE_TIMEOUT:
>> -#endif
>> case MYSQLND_OPT_SSL_KEY:
>> case MYSQLND_OPT_SSL_CERT:
>> case MYSQLND_OPT_SSL_CA:
>> diff --git a/ext/mysqlnd/mysqlnd_net.c b/ext/mysqlnd/mysqlnd_net.c
>> index 0fa6710..8ede642 100644
>> --- a/ext/mysqlnd/mysqlnd_net.c
>> +++ b/ext/mysqlnd/mysqlnd_net.c
>> @@ -820,13 +820,13 @@ MYSQLND_METHOD(mysqlnd_net, set_client_option)(MYSQLND_NET * const
>> net, enum mys
>> break;
>> }
>> case MYSQL_OPT_READ_TIMEOUT:
>> + DBG_INF("MYSQL_OPT_READ_TIMEOUT");
>> net->data->options.timeout_read = *(unsigned int*) value;
>> break;
>> -#ifdef WHEN_SUPPORTED_BY_MYSQLI
>> case MYSQL_OPT_WRITE_TIMEOUT:
>> + DBG_INF("MYSQL_OPT_WRITE_TIMEOUT");
>> net->data->options.timeout_write = *(unsigned int*) value;
>> break;
>> -#endif
>> case MYSQL_OPT_COMPRESS:
>> net->data->options.flags |= MYSQLND_NET_FLAG_USE_COMPRESSION;
>> break;
>>
>>
>
>
--
Matteo Beccati
Development & Consulting - http://www.beccati.com/