Modify sql_concat() to support all elements being numeric. MDL-13823 ; backported from HEAD

This commit is contained in:
stronk7
2008-04-20 21:20:45 +00:00
parent 4f569a8a67
commit c40ff3464d
+6 -1
View File
@@ -1666,9 +1666,14 @@ function sql_fullname($firstname='firstname', $lastname='lastname') {
* @return string
*/
function sql_concat() {
global $db;
global $db, $CFG;
$args = func_get_args();
/// PostgreSQL requires at least one char element in the concat, let's add it
/// here (at the beginning of the array) until ADOdb fixes it
if ($CFG->dbfamily == 'postgres' && is_array($args)) {
array_unshift($args , "''");
}
return call_user_func_array(array($db, 'Concat'), $args);
}