Fix IGNORE option for sqlite update
this fixes the issue of the normalized sqlite IGNORE option being discarded and ignored in DatabaseBase::makeUpdateOptions. Change-Id: I01579dee0f939a56c086d13683a60f4400014f62
This commit is contained in:
parent
ffc115f05b
commit
e611604d10
2 changed files with 20 additions and 6 deletions
|
|
@ -1,4 +1,5 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* @defgroup Database Database
|
||||
*
|
||||
|
|
@ -1921,12 +1922,12 @@ abstract class DatabaseBase implements IDatabase, DatabaseType {
|
|||
}
|
||||
|
||||
/**
|
||||
* Make UPDATE options for the DatabaseBase::update function
|
||||
* Make UPDATE options array for DatabaseBase::makeUpdateOptions
|
||||
*
|
||||
* @param array $options The options passed to DatabaseBase::update
|
||||
* @return string
|
||||
* @param array $options
|
||||
* @return array
|
||||
*/
|
||||
protected function makeUpdateOptions( $options ) {
|
||||
protected function makeUpdateOptionsArray( $options ) {
|
||||
if ( !is_array( $options ) ) {
|
||||
$options = array( $options );
|
||||
}
|
||||
|
|
@ -1941,6 +1942,18 @@ abstract class DatabaseBase implements IDatabase, DatabaseType {
|
|||
$opts[] = 'IGNORE';
|
||||
}
|
||||
|
||||
return $opts;
|
||||
}
|
||||
|
||||
/**
|
||||
* Make UPDATE options for the DatabaseBase::update function
|
||||
*
|
||||
* @param array $options The options passed to DatabaseBase::update
|
||||
* @return string
|
||||
*/
|
||||
protected function makeUpdateOptions( $options ) {
|
||||
$opts = $this->makeUpdateOptionsArray( $options );
|
||||
|
||||
return implode( ' ', $opts );
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -522,10 +522,11 @@ class DatabaseSqlite extends DatabaseBase {
|
|||
* @param array $options
|
||||
* @return string
|
||||
*/
|
||||
protected function makeUpdateOptions( $options ) {
|
||||
protected function makeUpdateOptionsArray( $options ) {
|
||||
$options = parent::makeUpdateOptionsArray( $options );
|
||||
$options = self::fixIgnore( $options );
|
||||
|
||||
return parent::makeUpdateOptions( $options );
|
||||
return $options;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Reference in a new issue