original_string: protected function query_end($result) {
          if ($this->loggingquery) {
              return;
          }
          if ($result !== false) {
              $this->query_log();
              // free memory
              $this->last_sql    = null;
              $this->last_params = null;
              $this->print_debug_time();
              return;
          }
  
          // remember current info, log queries may alter it
          $type   = $this->last_type;
          $sql    = $this->last_sql;
          $params = $this->last_params;
          $error  = $this->get_last_error();
  
          $this->query_log($error);
  
          switch ($type) {
              case SQL_QUERY_SELECT:
              case SQL_QUERY_AUX:
                  throw new dml_read_exception($error, $sql, $params);
              case SQL_QUERY_INSERT:
              case SQL_QUERY_UPDATE:
                  throw new dml_write_exception($error, $sql, $params);
              case SQL_QUERY_STRUCTURE:
                  $this->get_manager(); // includes ddl exceptions classes ;-)
                  throw new ddl_change_structure_exception($error, $sql);
          }
      }
code: protected function query_end($result) {
          if ($this->loggingquery) {
              return;
          }
          if ($result !== false) {
              $this->query_log();
              // free memory
              $this->last_sql    = null;
              $this->last_params = null;
              $this->print_debug_time();
              return;
          }
  
          // remember current info, log queries may alter it
          $type   = $this->last_type;
          $sql    = $this->last_sql;
          $params = $this->last_params;
          $error  = $this->get_last_error();
  
          $this->query_log($error);
  
          switch ($type) {
              case SQL_QUERY_SELECT:
              case SQL_QUERY_AUX:
                  throw new dml_read_exception($error, $sql, $params);
              case SQL_QUERY_INSERT:
              case SQL_QUERY_UPDATE:
                  throw new dml_write_exception($error, $sql, $params);
              case SQL_QUERY_STRUCTURE:
                  $this->get_manager(); // includes ddl exceptions classes ;-)
                  throw new ddl_change_structure_exception($error, $sql);
          }
      }
code_tokens: protected function query_end ( $ result ) { if ( $ this -> loggingquery ) { return ; } if ( $ result !== false ) { $ this -> query_log ( ) ; // free memory $ this -> last_sql = null ; $ this -> last_params = null ; $ this -> print_debug_time ( ) ; return ; } // remember current info, log queries may alter it $ type = $ this -> last_type ; $ sql = $ this -> last_sql ; $ params = $ this -> last_params ; $ error = $ this -> get_last_error ( ) ; $ this -> query_log ( $ error ) ; switch ( $ type ) { case SQL_QUERY_SELECT : case SQL_QUERY_AUX : throw new dml_read_exception ( $ error , $ sql , $ params ) ; case SQL_QUERY_INSERT : case SQL_QUERY_UPDATE : throw new dml_write_exception ( $ error , $ sql , $ params ) ; case SQL_QUERY_STRUCTURE : $ this -> get_manager ( ) ; // includes ddl exceptions classes ;-) throw new ddl_change_structure_exception ( $ error , $ sql ) ; } }
docstring: This should be called immediately after each db query. It does a clean up of resources.
  It also throws exceptions if the sql that ran produced errors.
  @param mixed $result The db specific result obtained from running a query.
  @throws dml_read_exception | dml_write_exception | ddl_change_structure_exception
  @return void
docstring_tokens: This should be called immediately after each db query . It does a clean up of resources . It also throws exceptions if the sql that ran produced errors .