|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull Requests
Pull requests:
HistoryAllCommentsChangesGit/SVN commits
[2013-11-21 20:14 UTC] andrey@php.net
-Status: Open
+Status: Closed
-Assigned To:
+Assigned To: andrey
[2013-11-21 20:14 UTC] andrey@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Oct 25 04:00:01 2025 UTC |
Description: ------------ in ext/mysqlnd/mysqlnd_ps_codec.c: line 572->593, 632->648 bind_param() with 'i' is processed like 1 copy to tmp_data 2 call convert_to_double_ex but the convert_to_double_ex makes the input 64-bit-numeric string losing it's precision. This works fine with the libmysqlclient based build. I tried changing the two convert_to_double_ex to convert_to_long_ex, works for this issue but not sure if it would take any side effect. Test script: --------------- <?php /* CREATE TABLE `ndtest` ( `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 */ $host = '172.16.3.53'; $user = 'sskaje'; $pass = 'sskaje'; $name = 'test'; $port = '3306'; $id = '1311200011005001566'; $mysqli = new mysqli($host, $user, $pass, $name, $port); #delete data $query = "DELETE FROM `ndtest`"; $mysqli->query($query); $query = "INSERT INTO `ndtest` SET `id`=?"; $stmt = $mysqli->prepare($query); $stmt->bind_param('i', $id); echo "declare i\n"; $ret = $stmt->execute(); if($ret){ echo "insert id:{$id}=>{$stmt->insert_id}\n"; }else{ echo "insert failed.\n"; } $query = "SELECT * FROM `ndtest`"; $result = $mysqli->query($query); if($result){ while ($row = $result->fetch_assoc()) { echo "fetch id:{$row['id']}\n"; } } echo "\n\n"; $query = "DELETE FROM `ndtest`"; $mysqli->query($query); $query = "INSERT INTO `ndtest` SET `id`=?"; $stmt = $mysqli->prepare($query); $stmt->bind_param('s', $id); echo "declare s\n"; $ret = $stmt->execute(); if($ret){ echo "insert id:{$id}\n"; }else{ echo "insert failed.\n"; } $query = "SELECT * FROM `ndtest`"; $result = $mysqli->query($query); if($result){ while ($row = $result->fetch_assoc()) { echo "fetch id:{$row['id']}\n"; } } Expected result: ---------------- [root@zhouyu php-5.5.5]# /usr/local/php/bin/php /root/ndtest.php declare i insert id:1311200011005001566=>1311200011005001566 fetch id:1311200011005001566 declare s insert id:1311200011005001566 fetch id:1311200011005001566 Actual result: -------------- [root@QA_Server81 ~]# /usr/local/php/bin/php /root/ndtest.php declare i insert id:1311200011005001566=>1311200011005001472 fetch id:1311200011005001472 declare s insert id:1311200011005001566 fetch id:1311200011005001566