MDL-25749 dml - pgsql fix for integer-exclusive concats
authorEloy Lafuente (stronk7) <stronk7@moodle.org>
Wed, 22 Dec 2010 17:50:05 +0000 (18:50 +0100)
committerEloy Lafuente (stronk7) <stronk7@moodle.org>
Wed, 22 Dec 2010 17:50:05 +0000 (18:50 +0100)
lib/dml/pgsql_native_moodle_database.php

index bd70bba..d78bf57 100644 (file)
@@ -1115,7 +1115,9 @@ class pgsql_native_moodle_database extends moodle_database {
         if ($s === '') {
             return " '' ";
         }
-        return " $s ";
+        // Add always empty string element so integer-exclusive concats
+        // will work without needing to cast each element explicity
+        return " '' || $s ";
     }
 
     public function sql_concat_join($separator="' '", $elements=array()) {