List:Commits« Previous MessageNext Message »
From:Mayank Prasad Date:February 8 2012 10:31am
Subject:bzr push into mysql-trunk-wl5767 branch (mayank.prasad:3434 to 3435) WL#5767
View as plain text  
 3435 Mayank Prasad	2012-02-08
      WL#5767 : Performance Schema, Statements Digest
      
      Details:
       - Added HAVE_PSI_STATEMENT_DIGEST_INTERFACE/DISABLE_PSI_STATEMENT_DIGEST

    modified:
      include/mysql/psi/mysql_statement.h
      include/mysql/psi/psi.h
      sql/sql_lex.cc
      sql/sql_lex.h
      sql/sql_parse.cc
 3434 Mayank Prasad	2012-02-08 [merge]
      WL#5767 : Performance Schema, Statements Digest
      
      Merge : mysql_trunk->mysql_trunk_wl5767

    added:
      unittest/gunit/filesort_compare-t.cc
    modified:
      include/my_sys.h
      mysql-test/include/subquery.inc
      mysql-test/r/ctype_many.result
      mysql-test/r/mix2_myisam.result
      mysql-test/r/myisam.result
      mysql-test/r/partition_windows.result
      mysql-test/r/subquery_all.result
      mysql-test/r/subquery_all_bka.result
      mysql-test/r/subquery_all_bka_nixbnl.result
      mysql-test/r/subquery_nomat_nosj.result
      mysql-test/r/subquery_nomat_nosj_bka.result
      mysql-test/r/subquery_nomat_nosj_bka_nixbnl.result
      mysql-test/r/subquery_none.result
      mysql-test/r/subquery_none_bka.result
      mysql-test/r/subquery_none_bka_nixbnl.result
      mysql-test/r/type_temporal_fractional.result
      mysql-test/suite/funcs_1/r/innodb_views.result
      mysql-test/suite/funcs_1/r/memory_views.result
      mysql-test/suite/funcs_1/views/views_master.inc
      mysql-test/suite/innodb/r/innodb.result
      mysql-test/valgrind.supp
      mysys/mf_radix.c
      mysys/mf_sort.c
      sql/filesort.cc
      sql/filesort_utils.cc
      sql/filesort_utils.h
      sql/item.h
      sql/log_event.cc
      sql/partition_info.cc
      sql/sql_executor.cc
      sql/sql_optimizer.cc
      sql/sql_parse.cc
      sql/sql_table.cc
      sql/table.h
      storage/archive/ha_archive.cc
      storage/myisam/ha_myisam.cc
      storage/myisam/mi_dbug.c
      unittest/gunit/CMakeLists.txt
      unittest/gunit/dynarray-t.cc
=== modified file 'include/mysql/psi/mysql_statement.h'
--- a/include/mysql/psi/mysql_statement.h	2012-02-03 16:00:30 +0000
+++ b/include/mysql/psi/mysql_statement.h	2012-02-08 10:30:58 +0000
@@ -42,12 +42,17 @@
 #endif
 
 #ifdef HAVE_PSI_STATEMENT_INTERFACE
+#ifdef HAVE_PSI_STATEMENT_DIGEST_INTERFACE
   #define MYSQL_DIGEST_START(LOCKER) \
     inline_mysql_digest_start(LOCKER)
 #else
   #define MYSQL_DIGEST_START(LOCKER) \
     NULL
 #endif
+#else
+  #define MYSQL_DIGEST_START(LOCKER) \
+    NULL
+#endif
 
 #ifdef HAVE_PSI_STATEMENT_INTERFACE
   #define MYSQL_START_STATEMENT(STATE, K, DB, DB_LEN) \
@@ -112,6 +117,7 @@ static inline void inline_mysql_statemen
   PSI_CALL(register_statement)(category, info, count);
 }
 
+#ifdef HAVE_PSI_STATEMENT_DIGEST_INTERFACE
 static inline struct PSI_digest_locker *
 inline_mysql_digest_start(PSI_statement_locker *locker)
 {
@@ -121,6 +127,7 @@ inline_mysql_digest_start(PSI_statement_
     digest_locker= PSI_CALL(digest_start)(locker);
   return digest_locker;
 }
+#endif
 
 static inline struct PSI_statement_locker *
 inline_mysql_start_statement(PSI_statement_locker_state *state,

=== modified file 'include/mysql/psi/psi.h'
--- a/include/mysql/psi/psi.h	2012-02-06 09:30:53 +0000
+++ b/include/mysql/psi/psi.h	2012-02-08 10:30:58 +0000
@@ -26,6 +26,7 @@
 #define DISABLE_PSI_STAGE
 #define DISABLE_PSI_STATEMENT
 #define DISABLE_PSI_IDLE
+#define DISABLE_PSI_STATEMENT_DIGEST
 #endif /* EMBEDDED_LIBRARY */
 
 #ifndef MY_GLOBAL_INCLUDED
@@ -244,6 +245,15 @@ typedef struct PSI_bootstrap PSI_bootstr
 #endif
 
 /**
+  @def DISABLE_PSI_STATEMENT_DIGEST
+  Compiling option to disable the statement digest instrumentation.
+*/
+
+#ifndef DISABLE_PSI_STATEMENT_DIGEST
+#define HAVE_PSI_STATEMENT_DIGEST_INTERFACE
+#endif
+
+/**
   @def DISABLE_PSI_SOCKET
   Compiling option to disable the statement instrumentation.
   @sa DISABLE_PSI_MUTEX
@@ -922,7 +932,6 @@ struct PSI_table_locker_state_v1
   */
   uint m_index;
 };
-
 struct PSI_digest_locker_state_v1
 {
   int m_last_id_index;

=== modified file 'sql/sql_lex.cc'
--- a/sql/sql_lex.cc	2012-02-08 09:44:47 +0000
+++ b/sql/sql_lex.cc	2012-02-08 10:30:58 +0000
@@ -32,6 +32,7 @@
 #include "sql_select.h"                // JOIN
 #include "sql_optimizer.h"             // JOIN
 
+#ifdef HAVE_PSI_STATEMENT_DIGEST_INTERFACE
 #define PASS_TOKEN_TO_PS(_token)                                             \
   /*
     Passing token to PS function to calculate statement digest
@@ -55,6 +56,7 @@
     lip->m_digest_psi= PSI_CALL(digest_add_token)(lip->m_digest_psi,        \
                                                   _token, yychar, yylen);   \
   }
+#endif
 
 static int lex_one_token(void *arg, void *yythd);
 
@@ -906,7 +908,9 @@ int MYSQLlex(void *arg, void *yythd)
     lip->lookahead_token= -1;
     *yylval= *(lip->lookahead_yylval);
     lip->lookahead_yylval= NULL;
+#ifdef HAVE_PSI_STATEMENT_DIGEST_INTERFACE
     PASS_TOKEN_TO_PS(token);
+#endif
     return token;
   }
 
@@ -924,10 +928,14 @@ int MYSQLlex(void *arg, void *yythd)
     token= lex_one_token(arg, yythd);
     switch(token) {
     case CUBE_SYM:
+#ifdef HAVE_PSI_STATEMENT_DIGEST_INTERFACE
       PASS_TOKEN_TO_PS(WITH_CUBE_SYM);
+#endif
       return WITH_CUBE_SYM;
     case ROLLUP_SYM:
+#ifdef HAVE_PSI_STATEMENT_DIGEST_INTERFACE
       PASS_TOKEN_TO_PS(WITH_ROLLUP_SYM);
+#endif
       return WITH_ROLLUP_SYM;
     default:
       /*
@@ -936,7 +944,9 @@ int MYSQLlex(void *arg, void *yythd)
       lip->lookahead_yylval= lip->yylval;
       lip->yylval= NULL;
       lip->lookahead_token= token;
+#ifdef HAVE_PSI_STATEMENT_DIGEST_INTERFACE
       PASS_TOKEN_TO_PS(WITH);
+#endif
       return WITH;
     }
     break;
@@ -944,7 +954,9 @@ int MYSQLlex(void *arg, void *yythd)
     break;
   }
 
+#ifdef HAVE_PSI_STATEMENT_DIGEST_INTERFACE
   PASS_TOKEN_TO_PS(token);
+#endif
   return token;
 }
 

=== modified file 'sql/sql_lex.h'
--- a/sql/sql_lex.h	2012-02-08 09:44:47 +0000
+++ b/sql/sql_lex.h	2012-02-08 10:30:58 +0000
@@ -2110,11 +2110,13 @@ public:
     NOTE: this member must be used within MYSQLlex() function only.
   */
   CHARSET_INFO *m_underscore_cs;
-  
+
+#ifdef HAVE_PSI_STATEMENT_DIGEST_INTERFACE
   /**
     attribute for statement digest. 
   */
   PSI_digest_locker* m_digest_psi;
+#endif
 };
 
 /* The state of the lex parsing. This is saved in the THD struct */

=== modified file 'sql/sql_parse.cc'
--- a/sql/sql_parse.cc	2012-02-08 09:44:47 +0000
+++ b/sql/sql_parse.cc	2012-02-08 10:30:58 +0000
@@ -7766,8 +7766,10 @@ bool parse_sql(THD *thd,
 
   thd->m_parser_state= parser_state;
 
+#ifdef HAVE_PSI_STATEMENT_DIGEST_INTERFACE
   /* Start Digest */
   thd->m_parser_state->m_lip.m_digest_psi= MYSQL_DIGEST_START(thd->m_statement_psi);
+#endif
 
   /* Parse the query. */
 

No bundle (reason: useless for push emails).
Thread
bzr push into mysql-trunk-wl5767 branch (mayank.prasad:3434 to 3435) WL#5767Mayank Prasad8 Feb