aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/db/mssqlnative.php
diff options
context:
space:
mode:
authorJoas Schilling <nickvergessen@gmx.de>2012-06-20 23:30:31 +0200
committerJoas Schilling <nickvergessen@gmx.de>2012-06-20 23:30:31 +0200
commitc71f604327653bde3eea1b5d7150f5cc9c58a712 (patch)
tree7cc60934591baa1718e8672133c63233347d66d2 /phpBB/includes/db/mssqlnative.php
parent089e5f5c79965058a5288590a3a34d94f3bcb833 (diff)
downloadforums-c71f604327653bde3eea1b5d7150f5cc9c58a712.tar
forums-c71f604327653bde3eea1b5d7150f5cc9c58a712.tar.gz
forums-c71f604327653bde3eea1b5d7150f5cc9c58a712.tar.bz2
forums-c71f604327653bde3eea1b5d7150f5cc9c58a712.tar.xz
forums-c71f604327653bde3eea1b5d7150f5cc9c58a712.zip
[ticket/10942] Add a comment why we cast to sql_case()
PHPBB3-10942
Diffstat (limited to 'phpBB/includes/db/mssqlnative.php')
-rw-r--r--phpBB/includes/db/mssqlnative.php1
1 files changed, 1 insertions, 0 deletions
diff --git a/phpBB/includes/db/mssqlnative.php b/phpBB/includes/db/mssqlnative.php
index 835b86f8c3..0001bc4ba7 100644
--- a/phpBB/includes/db/mssqlnative.php
+++ b/phpBB/includes/db/mssqlnative.php
@@ -262,6 +262,7 @@ class dbal_mssqlnative extends dbal
*/
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)' : '';