Edit report at http://bugs.php.net/bug.php?id=50651&edit=1
ID: 50651 Updated by: and...@php.net Reported by: robert_xp at gmx dot net Summary: Native type cast returns wrong result -Status: Assigned +Status: Closed Type: Feature/Change Request Package: MySQLi related Operating System: Debain Etch PHP Version: 5.3.1 Assigned To: mysql Previous Comments: ------------------------------------------------------------------------ [2010-04-08 16:33:10] and...@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 15:20:39] and...@php.net Automatic comment from SVN on behalf of andrey Revision: http://svn.php.net/viewvc/?view=revision&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-03-23 17:13:00] u...@php.net Andrey, can you have a look at the type casting related part of the suggested patch? Sounds good to me. ------------------------------------------------------------------------ [2010-01-04 12:11:58] 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 ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/bug.php?id=50651&edit=1