php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #35171 mysqli integer (tinyint and others) problem on 64bit
Submitted: 2005-11-09 14:08 UTC Modified: 2005-11-09 14:10 UTC
From: andrey@php.net Assigned: andrey (profile)
Status: Closed Package: MySQLi related
PHP Version: 5.0.5 OS: irrelevant
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: andrey@php.net
New email:
PHP Version: OS:

 

 [2005-11-09 14:08 UTC] andrey@php.net
Description:
------------
In 5.0.5 (existant in 5.0.0-5.0.4) was fixed a bug appearing on 64bit architectures when using prepared statements and binding result data. In more details tinyint, year, mediumint, and int(eger) where fetched incorrectly and incorrect data was returned to the script.
Use the reproduce code to test your installation.

This bug report has been create TO KEEP TRACK of this bug which was fixed without corresponding bug report.

For more information see : http://bugs.mysql.com/bug.php?id=14343

Reproduce code:
---------------
php -r '$c= new mysqli("localhost","root","secret");$c->query("DROP TABLE IF
EXIST test.tint_test;");$c->query("CREATE TABLE test.tint_test (a
tinyint(3));");$c->query("INSERT INTO test.tint_test VALUES
(123)");$s=$c->stmt_init();$s->prepare("select a from
test.tint_test");$s->execute();$s->bind_result($v);$s->fetch();var_dump($v);$c->
query("DROP TABLE EXIST test.tint_test;");'

Expected result:
----------------
int(123)

Actual result:
--------------
int(4357062704804921467)

Patches

Add a Patch

Pull Requests

Add a Pull Request

 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Apr 23 13:01:29 2024 UTC