From: Jure Kajzer Date: Wed, 4 Nov 2009 19:27:22 +0000 (+0000) Subject: Fixed replace function behaviour when required ID not specified X-Git-Tag: 1.31.0-rc.0~38971 X-Git-Url: http://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/pie.php?a=commitdiff_plain;h=bf16a1ccff7da2f5cd10f5a131b9e9ae3d269050;p=lhc%2Fweb%2Fwiklou.git Fixed replace function behaviour when required ID not specified --- diff --git a/includes/db/DatabaseOracle.php b/includes/db/DatabaseOracle.php index f1d90ac547..55c9c05089 100644 --- a/includes/db/DatabaseOracle.php +++ b/includes/db/DatabaseOracle.php @@ -419,7 +419,7 @@ class DatabaseOracle extends DatabaseBase { if (!is_array($options)) $options = array($options); - if (in_array('IGNORE', $options)) + if (in_array('IGNORE', $options)) $this->ignore_DUP_VAL_ON_INDEX = true; if (!is_array(reset($a))) { @@ -648,6 +648,8 @@ class DatabaseOracle extends DatabaseBase { $rows = array($rows); } + $sequenceData = $this->getSequenceData($table); + foreach( $rows as $row ) { # Delete rows which collide if ( $uniqueIndexes ) { @@ -678,6 +680,9 @@ class DatabaseOracle extends DatabaseBase { $this->query( $sql, $fname ); } + if ($sequenceData !== false && !isset($row[$sequenceData['column']])) + $row[$sequenceData['column']] = $this->nextSequenceValue($sequenceData['sequence']); + # Now insert the row $this->insert( $table, $row, $fname ); }