From: danielc at analysisandsolutions dot com
Operating system: Windows 2000
PHP version: 5CVS-2004-06-25 (dev)
PHP Bug Type: MySQL related
Bug description: MYSQLI_UNIQUE_KEY_FLAG not found on UNIQUE indexes
Description:
------------
MYSQLI_UNIQUE_KEY_FLAG aren't being indicated for columns that have UNIQUE
indexes.
Reproduce code:
---------------
mysqli_query($db->connection,
'CREATE TABLE phptest_fk (a VARCHAR(5),' .
' UNIQUE (a))');
$r = mysqli_query($db->connection,
'SELECT a FROM phptest_fk');
$tmp = mysqli_fetch_field($r);
echo 'MYSQLI_UNIQUE_KEY_FLAG? ';
if ($tmp->flags & MYSQLI_UNIQUE_KEY_FLAG) {
echo "yes\n";
} else {
echo "no\n";
}
mysqli_query($db->connection,
'DROP TABLE phptest_fk');
Expected result:
----------------
MYSQLI_UNIQUE_KEY_FLAG? yes
Actual result:
--------------
MYSQLI_UNIQUE_KEY_FLAG? no
--
Edit bug report at http://bugs.php.net/?id=28925&edit=1
--
Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=28925&r=trysnapshot4
Try a CVS snapshot (php5): http://bugs.php.net/fix.php?id=28925&r=trysnapshot5
Fixed in CVS: http://bugs.php.net/fix.php?id=28925&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=28925&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=28925&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=28925&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=28925&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=28925&r=support
Expected behavior: http://bugs.php.net/fix.php?id=28925&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=28925&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=28925&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=28925&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=28925&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=28925&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=28925&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=28925&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=28925&r=float