PEAR is discontinued

This is a static archive preserving historical releases and metadata. No new packages or updates will be published. For updates to existing packages, or to publish new packages, please use Composer and Packagist.

Home » Database » MDB2_Schema » Bug #6053

create sequence error and a warning

Details

Submitted2005-11-24 09:23 UTC
Fromalex at cgi-central dot net
Assignedlsmith
StatusClosed
PackageMDB2_Schema
PHP Version4.3.11
OSany
Roadmaps(Not assigned)

Comments

[2005-11-24 09:23 UTC] alex at cgi-central dot net

Description:
------------
1. There was a warning if array element is not exists in $changes array. It is eliminated by first change in diff.

2. alterDatabaseSequences() function passed $sequence variable to createSequence function. But in $changes array this set to "1", of course it does not look like a valid sequence definition. Fixed.

Test script:
---------------
+++ MDB2/Schema.php 24 Nov 2005 09:18:54 -0000
@@ -1234,6 +1234,7 @@
function verifyAlterDatabase($changes)
{
if (array_key_exists('tables', $changes) && is_array($changes['tables']
)
+ && array_key_exists('tables', $changes['tables'])
&& array_key_exists('tables', $changes['tables']['change'])
) {
foreach ($changes['tables']['change'] as $table_name => $table) {
@@ -1445,7 +1446,7 @@

if (array_key_exists('add', $changes)) {
foreach ($changes['add'] as $sequence_name => $sequence) {
- $result = $this->createSequence($sequence_name, $sequence);
+ $result = $this->createSequence($sequence_name, $current_defini
tion[$sequence_name]);
if (PEAR::isError($result)) {
return $result;
}