ID:               35103
 Updated by:       [EMAIL PROTECTED]
 Reported By:      php at pjberkel dot com
-Status:           Open
+Status:           Closed
 Bug Type:         MySQLi related
 Operating System: *
 PHP Version:      5.1CVS-2005-12-02 (cvs)
 Assigned To:      andrey
 New Comment:

And only one problem per report please.


Previous Comments:
------------------------------------------------------------------------

[2005-12-02 07:23:35] php at pjberkel dot com

Additionally, it appears that mysqli_stmt_bind_param() suffers from the
same unsigned integer problem as mysqli_stmt_bind_result() when there
bind type is set to "i" and the actual bind data is > MAX_UNSIGNED_INT
on a 32 bit platform.

Below is an example of the bug using php5.1-200512020130 and
mysql-5.0.16 on RHEL 4 (intel):

Reproduce code:
---------------
<?php

$mysqli = new mysqli("host", "user", "pass", "db");
$mysqli->query("CREATE TABLE temp (id INT UNSIGNED NOT NULL)");
$mysqli->query("INSERT INTO temp (id) VALUES
(3000000897),(3800001532),(3900002281),(3100059612)");

$id_val = 3900002281;

/* BEGIN EXAMPLE OF BUG */
$stmt = $mysqli->prepare("SELECT id FROM temp WHERE id = ?");
$stmt->bind_param("i", $id_val);
$stmt->execute();
$stmt->bind_result($id);
$stmt->fetch();
var_dump($id);
$stmt->close();
/* END EXAMPLE OF BUG */

$mysqli->query("DROP TABLE temp");
$mysqli->close();

?>

Expected result:
----------------
string(10) "3000000897"

Actual result:
--------------
int(0)

Interestingly, if the bind type in $stmt->bind_param() is changed to
"d" the above reproduce code works as expected.

------------------------------------------------------------------------

[2005-11-30 17:26:36] [EMAIL PROTECTED]

This bug has been fixed in CVS.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.



------------------------------------------------------------------------

[2005-11-21 21:52:34] [EMAIL PROTECTED]

I have a fix for this problem as well as speedup of the current code
that handles unsigned ints on 32bit but I will push it after 5.1.0 is
released because it's a bit too late in the release cycle.

------------------------------------------------------------------------

[2005-11-15 18:37:22] [EMAIL PROTECTED]

I am taking care of this problem.
Thanks!

------------------------------------------------------------------------

[2005-11-10 08:54:25] [EMAIL PROTECTED]

Andrey, really REALLY big ints don't work yet! :)
 

------------------------------------------------------------------------

The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
    http://bugs.php.net/35103

-- 
Edit this bug report at http://bugs.php.net/?id=35103&edit=1

Reply via email to