diff --git a/phpBB/includes/db/dbal.php b/phpBB/includes/db/dbal.php
index 9eb74ab617..8dbcd73b58 100644
--- a/phpBB/includes/db/dbal.php
+++ b/phpBB/includes/db/dbal.php
@@ -286,6 +286,8 @@ class dbal
/**
* Build a case expression
*
+ * Note: The two statements action_true and action_false must have the same data type (int, vchar, ...) in the database!
+ *
* @param string $condition The condition which must be true, to use action_true rather then action_else
* @param string $action_true SQL expression that is used, if the condition is true
* @param string $action_else SQL expression that is used, if the condition is false, optional
diff --git a/phpBB/includes/db/mssql.php b/phpBB/includes/db/mssql.php
index 8888bb3939..d24cbf329f 100644
--- a/phpBB/includes/db/mssql.php
+++ b/phpBB/includes/db/mssql.php
@@ -91,19 +91,6 @@ class dbal_mssql extends dbal
return ($this->sql_server_version) ? 'MSSQL
' . $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}
*/
diff --git a/phpBB/includes/db/mssql_odbc.php b/phpBB/includes/db/mssql_odbc.php
index a14d6adb14..d64264470e 100644
--- a/phpBB/includes/db/mssql_odbc.php
+++ b/phpBB/includes/db/mssql_odbc.php
@@ -109,19 +109,6 @@ class dbal_mssql_odbc extends dbal
return ($this->sql_server_version) ? 'MSSQL (ODBC)
' . $this->sql_server_version : 'MSSQL (ODBC)';
}
- /**
- * {@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}
*/
diff --git a/phpBB/includes/db/mssqlnative.php b/phpBB/includes/db/mssqlnative.php
index 0001bc4ba7..31c3a3721a 100644
--- a/phpBB/includes/db/mssqlnative.php
+++ b/phpBB/includes/db/mssqlnative.php
@@ -257,19 +257,6 @@ class dbal_mssqlnative extends dbal
return ($this->sql_server_version) ? 'MSSQL
' . $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}
*/
diff --git a/phpBB/includes/db/oracle.php b/phpBB/includes/db/oracle.php
index dc405ab08a..2e801532f0 100644
--- a/phpBB/includes/db/oracle.php
+++ b/phpBB/includes/db/oracle.php
@@ -89,19 +89,6 @@ class dbal_oracle extends dbal
return $this->sql_server_version;
}
- /**
- * {@inheritDoc}
- */
- function sql_case($condition, $action_true, $action_false = false)
- {
- // To ensure, that both expressions have the same type, we cast them to clob manually
- $sql_case = 'CASE WHEN ' . $condition;
- $sql_case .= ' THEN CAST(' . $action_true . ' AS clob)';
- $sql_case .= ($action_false !== false) ? ' ELSE CAST(' . $action_false . ' AS clob)' : '';
- $sql_case .= ' END';
- return $sql_case;
- }
-
/**
* SQL Transaction
* @access private
diff --git a/phpBB/includes/db/postgres.php b/phpBB/includes/db/postgres.php
index c3116601ae..a31181b4d4 100644
--- a/phpBB/includes/db/postgres.php
+++ b/phpBB/includes/db/postgres.php
@@ -154,19 +154,6 @@ class dbal_postgres extends dbal
return ($raw) ? $this->sql_server_version : 'PostgreSQL ' . $this->sql_server_version;
}
- /**
- * {@inheritDoc}
- */
- 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)' : '';
- $sql_case .= ' END';
- return $sql_case;
- }
-
/**
* {@inheritDoc}
*/