ID:               34001
 Updated by:       [EMAIL PROTECTED]
 Reported By:      james at safesearching dot com
-Status:           Assigned
+Status:           Closed
 Bug Type:         PDO related
 Operating System: *
 PHP Version:      5.1.0b3
 Assigned To:      iliaa
 New Comment:

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.




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

[2005-08-31 07:28:38] [EMAIL PROTECTED]

Ilia: 1) don't use the "quick fix" all the time when you just have some
short comment to add. 2) Why PDO differs with the "normal" api? :)

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

[2005-08-30 23:08:13] james at safesearching dot com

MySQL isn't doing any truncating:


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

$c = new PDO(
   "mysql:dbname=test;host=localhost",
   '***',
   '***'
);

$c->exec('CREATE TABLE IF NOT EXISTS foo (id mediumint(4), primary key
(id));');
$c->exec("INSERT INTO foo VALUES (6234567);");

$stmt = $c->prepare("SELECT * FROM foo");

$stmt->execute();

print_r($stmt->fetchAll());

$c = mysql_connect('localhost', '***', '***');

mysql_select_db('test');

$r = mysql_query("SELECT * FROM foo");

while ($a = mysql_fetch_array($r))
        print_r($a);

?>

Actual result:
--------------
Array
(
    [0] => Array
        (
            [id] => 6234
            [0] => 6234
        )

)
Array
(
    [0] => 6234567
    [id] => 6234567
)

Comments:
---------
If MySQL was truncating the data, then the results should be the same
for both APIs.

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

[2005-08-30 01:09:09] [EMAIL PROTECTED]

Sorry, but your problem does not imply a bug in PHP itself.  For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system is not the
appropriate forum for asking support questions.  Due to the volume
of reports we can not explain in detail here why your report is not
a bug.  The support channels will be able to provide an explanation
for you.

Thank you for your interest in PHP.

The pdo_mysql driver does not truncate any data, if it does occur it is
done by myself itself.

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

[2005-08-10 10:52:10] [EMAIL PROTECTED]

Is the truncating supposed to happen?

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

[2005-08-10 04:01:33] james at safesearching dot com

Tested php5-200508100030, and the junk character issue seems to be
resolved, but values from the database are still being truncated.

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

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/34001

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

Reply via email to