Skip to content

Commit

Permalink
Modify sql_concat() to support all elements being numeric. MDL-13823
Browse files Browse the repository at this point in the history
  • Loading branch information
stronk7 committed Apr 20, 2008
1 parent 1a19384 commit 5d75612
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/dmllib.php
Original file line number Diff line number Diff line change
Expand Up @@ -1807,9 +1807,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);
}

Expand Down

0 comments on commit 5d75612

Please sign in to comment.