php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #56510 Describe table gives unexpected result mysql and type enum
Submitted: 2005-08-24 09:49 UTC Modified: 2005-09-10 15:27 UTC
From: amue63 at t-online dot de Assigned: wez (profile)
Status: Closed Package: PDO (PECL)
PHP Version: 5.0.3 OS: Linux
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.
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: amue63 at t-online dot de
New email:
PHP Version: OS:

 

 [2005-08-24 09:49 UTC] amue63 at t-online dot de
Description:
------------
I try to get meta information on a table in a mysql db.
the table contains a column named "Phase" that is of type enum. 
For columns of type "enum" the query below always returns the first 40 characters describing the columntype correctly however all following characters are random.

Reproduce code:
---------------
$select = $db->query('DESCRIBE Study Phase',PDO_FETCH_ASSOC);
foreach ($select as $row) { print_r($row); }

Expected result:
----------------
 Array ( [Field] => Phase [Type] => enum('please_select','I','II','IIa','IIb','III','IV') [Null] => Ynf [Key] => [Default] => [Extra] => ) 

Actual result:
--------------
 Array ( [Field] => Phase [Type] => enum('please_select','I','II','IIa','IIb9{some random output} 
[Null] => Ynf [Key] => [Default] => [Extra] => )

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-08-24 20:22 UTC] wez@php.net
Please try the latest PHP 5.0.x stable snapshot from http://snaps.php.net, I believe that this issue has already been fixed.
 [2005-08-25 10:02 UTC] amue63 at t-online dot de
I tried 5.1.0_rc1 and got the same result. 
(I could not compile the lastest stable 5.0.x snapshot 
because the ebuild on Gentoo Linux does not work) 
PHP 5.0.4 on Windows gives the correct result, however.
 [2005-09-10 15:27 UTC] wez@php.net
Unable to repeat with tip of the 5.1 branch; assuming that it's been fixed.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Dec 21 14:01:32 2024 UTC