Home » Database » MDB2 » Bug #2056
typo which results in all indexes being unique
Details
| Submitted | 2004-08-04 17:34 UTC |
|---|---|
| From | worker at mompopmedia dot com |
| Assigned | lsmith |
| Status | Closed |
| Package | MDB2 |
| PHP Version | 5.0.0 |
| OS | Mandrake 10 |
| Roadmaps | (Not assigned) |
Comments
[2004-08-04 17:34 UTC] worker at mompopmedia dot com
Description:
------------
line 503 in CVS of MDB2/ Driver/ Manager/ Common.php reads:
if (isset($definition['unique'])) {
$query .= ' UNIQUE';
}
which results in an index being created regardless if $definition['unique'] == 0
code should read:
if (isset($definition['unique']) && $definition['unique'] !== 0) {
$query .= ' UNIQUE';
}
Thanks,
Michael
[2004-08-05 12:21 UTC] smith at backendmedia dot com
This bug has been fixed in CVS.
In case this was a documentation problem, the fix will show up at the
end of next Sunday (CET) on pear.php.net.
In case this was a pear.php.net website problem, the change will show
up on the website in short time.
Thank you for the report, and for helping us make PEAR better.
I made the fix a little simpler .. instead of checking for !== 0, I am just checking if the value evaluates to true. Therefore an empty value would also not create a unique index.