|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #60691 ->def missing default value
Submitted: 2012-01-09 10:30 UTC Modified: 2013-02-18 00:35 UTC
From: bimal at sanjaal dot com Assigned:
Status: No Feedback Package: MySQL related
PHP Version: Irrelevant OS: Windows XP
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Bug Type:
From: bimal at sanjaal dot com
New email:
PHP Version: OS:


 [2012-01-09 10:30 UTC] bimal at sanjaal dot com
From manual page:
(Purpose: Some reference back to $meta->def)

The field - def - does not contain the default value of the mysql column - even if the default values were defined in the table.

(PS - The new/upgraded version of PHP manual simply hide this field)

I have used PHP 5.3.5 from XAMPP 1.7 version.

Test script:
type:         $meta->type
default:      $meta->def
unique_key:   $meta->unique_key

Here, the default value is always missing or returning empty variable.

Expected result:
Default value assiged to the mysql column while creating it using: DEFAULT 'XXX'.

For example,
`is_active` enum('N','Y') NOT NULL DEFAULT 'N' COMMENT 'Active record?',

Here, for the field is_active, we should have seen 'N'


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2012-05-02 10:13 UTC]
Please, provide a sample script. That is a short script using mysql_connect, mysql_query and mysql_fetch_field. Judging from the 5.3 and 5.4 source tree, def is provided since 2004. Its actual value is taken from the underlying C library which in turn gets it from the server - want to say that the actual value is server version dependent.
 [2012-05-02 10:13 UTC]
-Status: Open +Status: Feedback
 [2013-02-18 00:35 UTC] php-bugs at lists dot php dot net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Open". Thank you.
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Jul 19 12:01:29 2024 UTC