]> git.mjollnir.org Git - moodle.git/commitdiff
Adding new sql_null_from_clause() helper function from 19_STABLE. MDL-13861
authorstronk7 <stronk7>
Thu, 26 Jun 2008 18:27:22 +0000 (18:27 +0000)
committerstronk7 <stronk7>
Thu, 26 Jun 2008 18:27:22 +0000 (18:27 +0000)
lib/dml/moodle_database.php
lib/dml/oci8po_adodb_moodle_database.php

index ab06ee7226fd7ff8a2f828bf793476463e7458e7..b4cfe68b7091970246ca78e03b33eff7ee439c0f 100644 (file)
@@ -1199,6 +1199,15 @@ abstract class moodle_database {
         return '((' . $int1 . ') ^ (' . $int2 . '))';
     }
 
+    /**
+     * Returns the FROM clause required by some DBs in all SELECT statements
+     * To be used in queries not having FROM clause to provide cross_db
+     * Most DBs don't need it, hence the default is ''
+     */
+    public function sql_null_from_clause() {
+        return '';
+    }
+
     /**
      * Returns the SQL to be used in order to CAST one CHAR column to INTEGER.
      *
index bc756f7cc5027196140f6bc79b91a7a2611860eb..52ce5c7d41a774ef9cbe85a348be066ea43c8128 100644 (file)
@@ -166,6 +166,10 @@ class oci8po_adodb_moodle_database extends adodb_moodle_database {
         return '((' . $int1 . ') # (' . $int2 . '))';
     }
 
+    function sql_null_from_clause() {
+        return ' FROM dual';
+    }
+
     public function sql_cast_char2int($fieldname, $text=false) {
         if (!$text) {
             return ' CAST(' . $fieldname . ' AS INT) ';