Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-29199

Database query logging fails with Oracle

    XMLWordPrintable

Details

    Description

      With the 'logall' option enabled in $CFG->dboptions, during the call to oci_native_moodle_database::connect() at page startup, a call to $this->temptables->is_temptable() is made inside oci_native_moodle_database::fix_table_names() before $this->temptables is initialised. Execution fails with this stack trace (edited for brevity):

      Fatal error: Call to a member function is_temptable() on a non-object in /www/moodle2/lib/dml/oci_native_moodle_database.php on line 306
       
      Call Stack:
           1. {main}() /www/moodle2/index.php:0
           2. require_once('/www/moodle2/config.php') /www/moodle2/index.php:31
           3. require_once('/www/moodle2/lib/setup.php') /www/moodle2/config.php:56
           4. setup_DB() /www/moodle2/lib/setup.php:442
           5. oci_native_moodle_database->connect(..., ..., ..., ..., 'z_', array ('dbpersist' => 0, 'dbport' => 1521, 'logall' => TRUE)) /www/moodle2/lib/dmllib.php:279
           6. oci_native_moodle_database->query_end(TRUE, resource(41) of type (oci8 statement)) /www/moodle2/lib/dml/oci_native_moodle_database.php:207
           7. moodle_database->query_end(TRUE) /www/moodle2/lib/dml/oci_native_moodle_database.php:268
           8. moodle_database->query_log(???) /www/moodle2/lib/dml/moodle_database.php:375
           9. oci_native_moodle_database->insert_record('log_queries', ..., ???, ???) /www/moodle2/lib/dml/moodle_database.php:438
          10. oci_native_moodle_database->get_columns('log_queries', ???) /www/moodle2/lib/dml/oci_native_moodle_database.php:1205
          11. moodle_database->fix_sql_params(..., NULL) /www/moodle2/lib/dml/oci_native_moodle_database.php:473
          12. oci_native_moodle_database->fix_table_names(...) /www/moodle2/lib/dml/moodle_database.php:675

      A simple solution is to modify this line in oci_native_moodle_database::fix_table_names():

      if ($this->temptables->is_temptable($name)) {

      to be:

      if ($this->temptables && $this->temptables->is_temptable($name)) {

      Attachments

        Issue Links

          Activity

            People

              poltawski Dan Poltawski
              jonof Jonathon Fowler
              Dan Poltawski Dan Poltawski
              Eloy Lafuente (stronk7) Eloy Lafuente (stronk7)
              Aparup Banerjee Aparup Banerjee
              Andrew Lyons, Huong Nguyen, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                12/Mar/12