~ubuntu-branches/ubuntu/lucid/mysql-dfsg-5.1/lucid-security

« back to all changes in this revision

Viewing changes to sql/sql_profile.cc

  • Committer: Package Import Robot
  • Author(s): Marc Deslauriers
  • Date: 2012-02-22 22:33:55 UTC
  • mto: (1.2.1) (37.1.1 lucid-security)
  • mto: This revision was merged to the branch mainline in revision 36.
  • Revision ID: package-import@ubuntu.com-20120222223355-ku1tb4r70osci6v2
Tags: upstream-5.1.61
ImportĀ upstreamĀ versionĀ 5.1.61

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* Copyright (C) 2007 MySQL AB
 
1
/*
 
2
   Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
2
3
 
3
4
   This program is free software; you can redistribute it and/or modify
4
5
   it under the terms of the GNU General Public License as published by
11
12
 
12
13
   You should have received a copy of the GNU General Public License
13
14
   along with this program; if not, write to the Free Software
14
 
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA */
 
15
   Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301  USA
 
16
*/
15
17
 
16
18
 
17
19
/**
485
487
  There are two ways to get to this function:  Selecting from the information
486
488
  schema, and a SHOW command.
487
489
*/
488
 
int PROFILING::fill_statistics_info(THD *thd, TABLE_LIST *tables, Item *cond)
 
490
int PROFILING::fill_statistics_info(THD *thd_arg, TABLE_LIST *tables, Item *cond)
489
491
{
490
492
  DBUG_ENTER("PROFILING::fill_statistics_info");
491
493
  TABLE *table= tables->table;
520
522
      /* Skip the first.  We count spans of fence, not fence-posts. */
521
523
      if (previous == NULL) continue;
522
524
 
523
 
      if (thd->lex->sql_command == SQLCOM_SHOW_PROFILE)
 
525
      if (thd_arg->lex->sql_command == SQLCOM_SHOW_PROFILE)
524
526
      {
525
527
        /*
526
528
          We got here via a SHOW command.  That means that we stored
533
535
          struct where and having conditions at the SQL layer, then this
534
536
          condition should be ripped out.
535
537
        */
536
 
        if (thd->lex->profile_query_id == 0) /* 0 == show final query */
 
538
        if (thd_arg->lex->profile_query_id == 0) /* 0 == show final query */
537
539
        {
538
540
          if (query != last)
539
541
            continue;
540
542
        }
541
543
        else
542
544
        {
543
 
          if (thd->lex->profile_query_id != query->profiling_query_id)
 
545
          if (thd_arg->lex->profile_query_id != query->profiling_query_id)
544
546
            continue;
545
547
        }
546
548
      }
661
663
        table->field[17]->set_notnull();
662
664
      }
663
665
 
664
 
      if (schema_table_store_record(thd, table))
 
666
      if (schema_table_store_record(thd_arg, table))
665
667
        DBUG_RETURN(1);
666
668
 
667
669
    }