From c71f604327653bde3eea1b5d7150f5cc9c58a712 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Wed, 20 Jun 2012 23:30:31 +0200 Subject: [ticket/10942] Add a comment why we cast to sql_case() PHPBB3-10942 --- phpBB/includes/db/postgres.php | 1 + 1 file changed, 1 insertion(+) (limited to 'phpBB/includes/db/postgres.php') diff --git a/phpBB/includes/db/postgres.php b/phpBB/includes/db/postgres.php index 1ceb0ed0a2..c3116601ae 100644 --- a/phpBB/includes/db/postgres.php +++ b/phpBB/includes/db/postgres.php @@ -159,6 +159,7 @@ class dbal_postgres extends dbal */ function sql_case($condition, $action_true, $action_false = false) { + // To ensure, that both expressions have the same type, we cast them to text manually $sql_case = 'CASE WHEN ' . $condition; $sql_case .= ' THEN CAST(' . $action_true . ' AS TEXT)'; $sql_case .= ($action_false !== false) ? ' ELSE CAST(' . $action_false . ' AS TEXT)' : ''; -- cgit v1.2.1