|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #31979 msql_fetch_field() not reporting unique keys
Submitted: 2005-02-15 05:26 UTC Modified: 2008-10-24 16:07 UTC
Avg. Score:5.0 ± 0.0
Reproduced:0 of 0 (0.0%)
From: danielc at analysisandsolutions dot com Assigned: zeev (profile)
Status: Wont fix Package: mSQL related
PHP Version: 5CVS-2005-02-15 OS: NetBSD 2.0
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.
Block user comment
Status: Assign to:
Bug Type:
From: danielc at analysisandsolutions dot com
New email:
PHP Version: OS:


 [2005-02-15 05:26 UTC] danielc at analysisandsolutions dot com
One of the properties returned by msql_fetch_field() is "unique".  It is supposed to contain 1 if the column in question is part of a unique key and 0 if it's not.  But it always returns 0.

Reproduce code:
$con = msql_connect();
$db  = msql_select_db('ptdb', $con);
msql_query('CREATE TABLE blah (i INT)', $con);
msql_query('CREATE UNIQUE INDEX bi ON blah (i)', $con);
$result = msql_query('SELECT * FROM blah', $con);
$info = msql_fetch_field($result);
msql_query('DROP TABLE blah', $con);

Expected result:
stdClass Object
    [name] => i
    [table] => blah
    [not_null] => 0
    [unique] => 1
    [type] => int

Actual result:
stdClass Object
    [name] => i
    [table] => blah
    [not_null] => 0
    [unique] => 0
    [type] => int


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2005-09-12 19:27 UTC]
Assigned to the maintainer of ext/msql. (although I doubt Zeev uses msql anymore..or really is the maintainer, but his name is in CREDITS :)

 [2008-10-24 16:07 UTC]
msql support has ended.
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Feb 27 03:01:28 2024 UTC