original_string: protected function query_start($sql, array $params=null, $type, $extrainfo=null) {
          if ($this->loggingquery) {
              return;
          }
          $this->last_sql       = $sql;
          $this->last_params    = $params;
          $this->last_type      = $type;
          $this->last_extrainfo = $extrainfo;
          $this->last_time      = microtime(true);
  
          switch ($type) {
              case SQL_QUERY_SELECT:
              case SQL_QUERY_AUX:
                  $this->reads++;
                  break;
              case SQL_QUERY_INSERT:
              case SQL_QUERY_UPDATE:
              case SQL_QUERY_STRUCTURE:
                  $this->writes++;
              default:
                  if ((PHPUNIT_TEST) || (defined('BEHAT_TEST') && BEHAT_TEST) ||
                      defined('BEHAT_SITE_RUNNING')) {
  
                      // Set list of tables that are updated.
                      require_once(__DIR__.'/../testing/classes/util.php');
                      testing_util::set_table_modified_by_sql($sql);
                  }
          }
  
          $this->print_debug($sql, $params);
      }
code: protected function query_start($sql, array $params=null, $type, $extrainfo=null) {
          if ($this->loggingquery) {
              return;
          }
          $this->last_sql       = $sql;
          $this->last_params    = $params;
          $this->last_type      = $type;
          $this->last_extrainfo = $extrainfo;
          $this->last_time      = microtime(true);
  
          switch ($type) {
              case SQL_QUERY_SELECT:
              case SQL_QUERY_AUX:
                  $this->reads++;
                  break;
              case SQL_QUERY_INSERT:
              case SQL_QUERY_UPDATE:
              case SQL_QUERY_STRUCTURE:
                  $this->writes++;
              default:
                  if ((PHPUNIT_TEST) || (defined('BEHAT_TEST') && BEHAT_TEST) ||
                      defined('BEHAT_SITE_RUNNING')) {
  
                      // Set list of tables that are updated.
                      require_once(__DIR__.'/../testing/classes/util.php');
                      testing_util::set_table_modified_by_sql($sql);
                  }
          }
  
          $this->print_debug($sql, $params);
      }
code_tokens: protected function query_start ( $ sql , array $ params = null , $ type , $ extrainfo = null ) { if ( $ this -> loggingquery ) { return ; } $ this -> last_sql = $ sql ; $ this -> last_params = $ params ; $ this -> last_type = $ type ; $ this -> last_extrainfo = $ extrainfo ; $ this -> last_time = microtime ( true ) ; switch ( $ type ) { case SQL_QUERY_SELECT : case SQL_QUERY_AUX : $ this -> reads ++ ; break ; case SQL_QUERY_INSERT : case SQL_QUERY_UPDATE : case SQL_QUERY_STRUCTURE : $ this -> writes ++ ; default : if ( ( PHPUNIT_TEST ) || ( defined ( 'BEHAT_TEST' ) && BEHAT_TEST ) || defined ( 'BEHAT_SITE_RUNNING' ) ) { // Set list of tables that are updated. require_once ( __DIR__ . '/../testing/classes/util.php' ) ; testing_util :: set_table_modified_by_sql ( $ sql ) ; } } $ this -> print_debug ( $ sql , $ params ) ; }
docstring: This should be called before each db query.
  @param string $sql The query string.
  @param array $params An array of parameters.
  @param int $type The type of query. ( SQL_QUERY_SELECT | SQL_QUERY_AUX | SQL_QUERY_INSERT | SQL_QUERY_UPDATE | SQL_QUERY_STRUCTURE )
  @param mixed $extrainfo This is here for any driver specific extra information.
  @return void
docstring_tokens: This should be called before each db query .