MDL-29199 dml: fix query logging on Oracle
authorDan Poltawski <dan@moodle.com>
Fri, 24 Feb 2012 03:54:43 +0000 (11:54 +0800)
committerDan Poltawski <dan@moodle.com>
Fri, 24 Feb 2012 03:57:18 +0000 (11:57 +0800)
thanks to Jonathon Fowler for the fix

lib/dml/oci_native_moodle_database.php

index bc08fb9..f34e835 100644 (file)
@@ -313,7 +313,7 @@ class oci_native_moodle_database extends moodle_database {
         if (preg_match_all('/\{([a-z][a-z0-9_]*)\}/', $sql, $matches)) {
             foreach($matches[0] as $key=>$match) {
                 $name = $matches[1][$key];
-                if ($this->temptables->is_temptable($name)) {
+                if ($this->temptables && $this->temptables->is_temptable($name)) {
                     $sql = str_replace($match, $this->temptables->get_correct_name($name), $sql);
                 } else {
                     $sql = str_replace($match, $this->prefix.$name, $sql);