PEAR is archived and read-only

This mirror preserves historical PEAR package releases and metadata so existing references remain available.

Home » Database » MDB2 » Bug #2056

typo which results in all indexes being unique

Details

Submitted2004-08-04 17:34 UTC
Fromworker at mompopmedia dot com
Assignedlsmith
StatusClosed
PackageMDB2
PHP Version5.0.0
OSMandrake 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.