1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-07-30 21:40:43 +02:00

[ticket/10942] Require same data type and do not cast expressions automatically

PHPBB3-10942
This commit is contained in:
Joas Schilling
2012-07-02 11:10:02 +02:00
parent 0fd02035d8
commit a8cf926566
6 changed files with 2 additions and 65 deletions

View File

@@ -91,19 +91,6 @@ class dbal_mssql extends dbal
return ($this->sql_server_version) ? 'MSSQL<br />' . $this->sql_server_version : 'MSSQL';
}
/**
* {@inheritDoc}
*/
function sql_case($condition, $action_true, $action_false = false)
{
// To ensure, that both expressions have the same type, we cast them to varchar manually
$sql_case = 'CASE WHEN ' . $condition;
$sql_case .= ' THEN CAST(' . $action_true . ' AS VARCHAR)';
$sql_case .= ($action_false !== false) ? ' ELSE CAST(' . $action_false . ' AS VARCHAR)' : '';
$sql_case .= ' END';
return $sql_case;
}
/**
* {@inheritDoc}
*/