List:Commits« Previous MessageNext Message »
From:Mayank Prasad Date:February 8 2012 11:52am
Subject:bzr push into mysql-trunk-wl5767 branch (mayank.prasad:3435 to 3436) WL#5767
View as plain text  
 3436 Mayank Prasad	2012-02-08
      WL#5767 : Performance Schema, Statements Digest
      
      Details:
       - Modified PASS_TOKEN_TO_PS.
       - Modified test cases result files accordingly.

    modified:
      mysql-test/suite/perfschema/r/statements_digest.result
      mysql-test/suite/perfschema/r/statements_digest_long_query.result
      sql/sql_lex.cc
 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
=== modified file 'mysql-test/suite/perfschema/r/statements_digest.result'
--- a/mysql-test/suite/perfschema/r/statements_digest.result	2012-02-02 17:31:41 +0000
+++ b/mysql-test/suite/perfschema/r/statements_digest.result	2012-02-08 11:51:37 +0000
@@ -68,19 +68,19 @@ use performance_schema;
 select DIGEST, DIGEST_TEXT, COUNT_STAR from events_statements_summary_by_digest;
 DIGEST	DIGEST_TEXT	COUNT_STAR
 NULL	NULL	0
-560c2f53c356e1db	TRUNCATE TABLE performance_schema . events_statements_summa  	1
+bb399912758e2135	TRUNCATE TABLE performance_schema . events_statements_summary_by_digest  	1
 c4cdaf6f814e367d	SELECT ? FROM t1  	1
 58681943ba1f6965	SELECT ?, ... FROM t1  	2
 dd87e085c2c5a2b6	SELECT ? FROM t2  	1
 fc7ca6a130fec1a4	SELECT ?, ... FROM t2  	2
 164f41cc7a0b2f31	INSERT INTO t1 VALUES (?)  	1
 06bd734b89c6f98f	INSERT INTO t2 VALUES (?)  	1
-d45807bf8c1e5d68	INSERT INTO t3 VALUES (...)  	1
-f0ea2c0da2e91d0f	INSERT INTO t4 VALUES (...)  	1
-093d15f7db5ca81e	INSERT INTO t5 VALUES (...)  	1
-92e8773c5e94030a	INSERT INTO t1 VALUES (?) /* , ... */  	2
-6a0a84a8f519cb96	INSERT INTO t3 VALUES (...) /* , ... */  	1
-36609be6d3cf105b	INSERT INTO t5 VALUES (...) /* , ... */  	1
+3a4848d584923fd7	INSERT INTO t3 VALUES (...)  	1
+37c0599e49fd77fe	INSERT INTO t4 VALUES (...)  	1
+e63c7357e9f87f44	INSERT INTO t5 VALUES (...)  	1
+1cd783ad398f6755	INSERT INTO t1 VALUES (?) /* , ... */  	2
+f52370e9b5183696	INSERT INTO t3 VALUES (...) /* , ... */  	1
+edc61a0866ec47da	INSERT INTO t5 VALUES (...) /* , ... */  	1
 06ec53eb6a3e3d4c	SELECT ? + ?  	3
 a68272fa2b30c2e3	SELECT ?  	1
 49d23ec9aebe975b	CREATE SCHEMA statements_digest_temp  	2

=== modified file 'mysql-test/suite/perfschema/r/statements_digest_long_query.result'
--- a/mysql-test/suite/perfschema/r/statements_digest_long_query.result	2012-02-06 12:08:15 +0000
+++ b/mysql-test/suite/perfschema/r/statements_digest_long_query.result	2012-02-08 11:51:37 +0000
@@ -9,5 +9,5 @@ SELECT 1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1
 select DIGEST, DIGEST_TEXT, COUNT_STAR from events_statements_summary_by_digest;
 DIGEST	DIGEST_TEXT	COUNT_STAR
 NULL	NULL	0
-553022034e2aab0f	TRUNCATE TABLE events_statements_summa  	1
+c20b2e9f0f1b8a32	TRUNCATE TABLE events_statements_summary_by_digest  	1
 ba5a568f3d3dcc06	SELECT ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + !
 ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? +  ...	1

=== modified file 'sql/sql_lex.cc'
--- a/sql/sql_lex.cc	2012-02-08 10:30:58 +0000
+++ b/sql/sql_lex.cc	2012-02-08 11:51:37 +0000
@@ -33,29 +33,21 @@
 #include "sql_optimizer.h"             // JOIN
 
 #ifdef HAVE_PSI_STATEMENT_DIGEST_INTERFACE
-#define PASS_TOKEN_TO_PS(_token)                                             \
+#define PASS_TOKEN_TO_PS(_token, _yylval)                                   \
   /*
     Passing token to PS function to calculate statement digest
     for this statement.
-  */                                                                         \
-  if( _token != 0 && lip->m_digest_psi != NULL)                              \
-  {                                                                          \
-    uint yylen= 0;                                                           \
-    char *yychar= NULL;                                                      \
-    if( _token == IDENT_QUOTED || _token == IDENT )                          \
-    {                                                                        \
-      /*
-        If it is an identifier, get the length of processed token and
-        make sure it doesn't exceed TOCK_NAME_LENGTH. If it does,
-        truncate it to TOCK_NAME_LENGTH.
-      */                                                                    \
-      yylen= lip->yyLength() + 1;                                           \
-      yylen= yylen<TOCK_NAME_LENGTH ? yylen : TOCK_NAME_LENGTH-1;           \
-      yychar= (char*)lip->get_cpp_tok_start();                              \
-    }                                                                       \
+  */                                                                        \
+  if(lip->m_digest_psi != NULL)                                             \
+  {                                                                         \
     lip->m_digest_psi= PSI_CALL(digest_add_token)(lip->m_digest_psi,        \
-                                                  _token, yychar, yylen);   \
-  }
+                                                  _token,                   \
+                                                  _yylval->lex_str.str,     \
+                                                  _yylval->lex_str.length); \
+  }
+#else
+#define PASS_TOKEN_TO_PS(_token, _yylval)                                   \
+  do{}while(0);
 #endif
 
 static int lex_one_token(void *arg, void *yythd);
@@ -908,9 +900,7 @@ 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
+    PASS_TOKEN_TO_PS(token, yylval);
     return token;
   }
 
@@ -928,14 +918,10 @@ 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
+      PASS_TOKEN_TO_PS(WITH_CUBE_SYM, yylval);
       return WITH_CUBE_SYM;
     case ROLLUP_SYM:
-#ifdef HAVE_PSI_STATEMENT_DIGEST_INTERFACE
-      PASS_TOKEN_TO_PS(WITH_ROLLUP_SYM);
-#endif
+      PASS_TOKEN_TO_PS(WITH_ROLLUP_SYM, yylval);
       return WITH_ROLLUP_SYM;
     default:
       /*
@@ -944,9 +930,7 @@ 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
+      PASS_TOKEN_TO_PS(WITH, yylval);
       return WITH;
     }
     break;
@@ -954,9 +938,7 @@ int MYSQLlex(void *arg, void *yythd)
     break;
   }
 
-#ifdef HAVE_PSI_STATEMENT_DIGEST_INTERFACE
-  PASS_TOKEN_TO_PS(token);
-#endif
+  PASS_TOKEN_TO_PS(token, yylval);
   return token;
 }
 

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