mirror of
https://github.com/phpbb/phpbb.git
synced 2025-08-07 01:06:48 +02:00
[ticket/10942] Fix sql_conditional for mssql, postgre and oracle
PHPBB3-10942
This commit is contained in:
@@ -89,6 +89,18 @@ class dbal_oracle extends dbal
|
||||
return $this->sql_server_version;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
function sql_conditional($condition, $action_true, $action_false = false)
|
||||
{
|
||||
$sql_condition = 'CASE WHEN ' . $condition;
|
||||
$sql_condition .= ' THEN CAST(' . $action_true . ' AS clob)';
|
||||
$sql_condition .= ($action_false !== false) ? ' ELSE CAST(' . $action_false . ' AS clob)' : '';
|
||||
$sql_condition .= ' END';
|
||||
return $sql_condition;
|
||||
}
|
||||
|
||||
/**
|
||||
* SQL Transaction
|
||||
* @access private
|
||||
|
Reference in New Issue
Block a user