mirror of
https://github.com/phpbb/phpbb.git
synced 2025-08-05 16:27:38 +02:00
[ticket/10942] Fix sql_conditional for mssql, postgre and oracle
PHPBB3-10942
This commit is contained in:
@@ -91,6 +91,18 @@ class dbal_mssql extends dbal
|
||||
return ($this->sql_server_version) ? 'MSSQL<br />' . $this->sql_server_version : 'MSSQL';
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
function sql_conditional($condition, $action_true, $action_false = false)
|
||||
{
|
||||
$sql_condition = 'CASE WHEN ' . $condition;
|
||||
$sql_condition .= ' THEN CAST(' . $action_true . ' AS VARCHAR)';
|
||||
$sql_condition .= ($action_false !== false) ? ' ELSE CAST(' . $action_false . ' AS VARCHAR)' : '';
|
||||
$sql_condition .= ' END';
|
||||
return $sql_condition;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
|
Reference in New Issue
Block a user