Bug #66525 [Opn->Nab]: Mysqli::thread_id limited in 32bit int.
| From: | uw@php.net | Date: | Tue, 25 Feb 2014 12:25:44 +0000 |
| Subject: | Bug #66525 [Opn->Nab]: Mysqli::thread_id limited in 32bit int. | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-184412@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=66525&edit=1
ID: 66525
Updated by: uw@php.net
Reported by: aleiphoenix at gmail dot com
Summary: Mysqli::thread_id limited in 32bit int.
-Status: Open
+Status: Not a bug
Type: Bug
Package: MySQLi related
Operating System: Linux x86_64
PHP Version: 5.5.8
Block user comment: N
Private report: N
New Comment:
mysql::thread_id is taken from the C/S protocol. The C/S protocol is using 32bit. Hence, any
consumer, such as PHP, is limited to 32bit. If you consider this an error, report it at MySQL.
Previous Comments:
------------------------------------------------------------------------
[2014-01-21 03:08:58] aleiphoenix at gmail dot com
Description:
------------
When MySQL connection_id goes larger then 2**31, Mysqli::thread_id just return the wrong value.
tested version
PHP 5.5.7 on Gentoo Linux x86_64
PHP 5.2.14 on RHEL 5.5 x86_64
Test script:
---------------
<?php
$mysql = new Mysqli('127.0.0.1', 'batchjob', 'aN2jU3ke',
'anjuke_db');
$_id = $mysql->thread_id;
var_dump($_id);
$sql = 'select connection_id()';
$res = $mysql->query($sql);
var_dump($res->fetch_row()[0]);
sleep(30);
$mysql->close();
Expected result:
----------------
result of Mysqli::thread_id is the same as result of
select connection_id() statement.
Actual result:
--------------
Mysqli::thread_id: 2804557258
select connection_id(): 11394491850
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=66525&edit=1