php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #50651 Native type cast returns wrong result
Submitted: 2010-01-04 12:11 UTC Modified: 2010-04-08 16:33 UTC
From: robert_xp at gmx dot net Assigned: mysql (profile)
Status: Closed Package: MySQLi related
PHP Version: 5.3.1 OS: Debain Etch
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: robert_xp at gmx dot net
New email:
PHP Version: OS:

 

 [2010-01-04 12:11 UTC] robert_xp at gmx dot net
Description:
------------
mysqlnd implements native type casting but returns string for some integer values that seem too big. A fix is also in my mysqlnd patch on http://www.xarg.org/2009/12/php-hacking/

Reproduce code:
---------------
-

Expected result:
----------------
any int64 value < INT_MAX should be casted to int as well


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2010-03-23 17:11 UTC] uw@php.net
-Type: Bug +Type: Feature/Change Request -Assigned To: +Assigned To: mysql
 [2010-03-23 17:13 UTC] uw@php.net
Andrey, can you have a look at the type casting related part of the suggested patch? Sounds good to me.
 [2010-04-08 15:20 UTC] andrey@php.net
Automatic comment from SVN on behalf of andrey
Revision: http://svn.php.net/viewvc/?view=revision&amp;revision=297701
Log: Fixint INT_AND_FLOAT_AS native. It was working ok on 64bit but
because on 32bit SIZEOF_LONG is 4 and INT64 from MySQL is 8 everything
was converted to string, even if it was able to put it in a long.
This closes Request #50651 Native type cast returns wrong result
 [2010-04-08 16:33 UTC] andrey@php.net
Fixed in 5.3.3, affects 5.3.0, 5.3.1 and 5.3.2 . No wrong data is returned but on 32bit platforms always numbers as strings, no 64bit everything was in order, if possible the number was a number, not a string.
Thanks!
 [2010-04-08 16:33 UTC] andrey@php.net
-Status: Assigned +Status: Closed
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Oct 31 22:01:27 2024 UTC