List:Commits« Previous MessageNext Message »
From:Mayank Prasad Date:December 28 2011 12:43pm
Subject:bzr push into mysql-trunk-wl5767 branch (mayank.prasad:3407 to 3408) WL#5767
View as plain text  
 3408 Mayank Prasad	2011-12-28
      WL#5767 : Statement Digest, Performance Schema
      
      Details:
       - Added code to REDUCE tokens (i.e. normalization).

    modified:
      storage/perfschema/gen_pfs_lex_token.cc
      storage/perfschema/pfs_digest.cc
 3407 Mayank Prasad	2011-12-26 [merge]
      WL#5767 : 
      
      Details:
       - Merge from latest mysql-trunk.

    added:
      mysql-test/extra/binlog_tests/mysqlbinlog_start_stop_1.inc
      mysql-test/extra/binlog_tests/mysqlbinlog_start_stop_2.inc
      mysql-test/t/mysql_embedded-master.opt
      storage/innobase/buf/buf0dblwr.cc
      storage/innobase/include/buf0dblwr.h
    renamed:
      mysql-test/r/mysqlbinlog2.result => mysql-test/r/mysqlbinlog_start_stop.result
      mysql-test/suite/rpl/r/rpl_mts_check_concurrency.result => mysql-test/suite/rpl/r/rpl_mts_debug.result
      mysql-test/suite/rpl/t/rpl_mts_check_concurrency-slave.opt => mysql-test/suite/rpl/t/rpl_mts_debug-slave.opt
      mysql-test/suite/rpl/t/rpl_mts_check_concurrency.test => mysql-test/suite/rpl/t/rpl_mts_debug.test
      mysql-test/t/mysqlbinlog2.test => mysql-test/t/mysqlbinlog_start_stop.test
    modified:
      client/mysql_upgrade.c
      client/mysqldump.c
      libmysqld/lib_sql.cc
      mysql-test/include/order_by.inc
      mysql-test/mysql-test-run.pl
      mysql-test/r/func_group.result
      mysql-test/r/mysqldump.result
      mysql-test/r/order_by_all.result
      mysql-test/r/order_by_icp_mrr.result
      mysql-test/r/order_by_none.result
      mysql-test/r/partition_list.result
      mysql-test/r/partition_mgm.result
      mysql-test/r/ps_ddl.result
      mysql-test/r/sp.result
      mysql-test/r/type_temporal_fractional.result
      mysql-test/r/xa.result
      mysql-test/suite/innodb/r/innodb_buffer_pool_load.result
      mysql-test/suite/innodb/t/innodb_buffer_pool_load.test
      mysql-test/suite/rpl/r/rpl_circular_for_4_hosts.result
      mysql-test/suite/rpl/t/rpl_circular_for_4_hosts.test
      mysql-test/suite/sys_vars/r/innodb_buffer_pool_filename_basic.result
      mysql-test/suite/sys_vars/r/innodb_buffer_pool_load_now_basic.result
      mysql-test/suite/sys_vars/r/slave_checkpoint_group_basic.result
      mysql-test/suite/sys_vars/r/slave_checkpoint_period_basic.result
      mysql-test/suite/sys_vars/r/slave_parallel_workers_basic.result
      mysql-test/suite/sys_vars/r/slave_pending_jobs_size_max_basic.result
      mysql-test/suite/sys_vars/t/innodb_adaptive_max_sleep_delay_basic.test
      mysql-test/suite/sys_vars/t/innodb_buffer_pool_dump_now_basic.test
      mysql-test/suite/sys_vars/t/innodb_buffer_pool_filename_basic.test
      mysql-test/suite/sys_vars/t/innodb_buffer_pool_load_now_basic.test
      mysql-test/suite/sys_vars/t/slave_checkpoint_group_basic.test
      mysql-test/suite/sys_vars/t/slave_checkpoint_period_basic.test
      mysql-test/suite/sys_vars/t/slave_parallel_workers_basic.test
      mysql-test/suite/sys_vars/t/slave_pending_jobs_size_max_basic.test
      mysql-test/t/func_group.test
      mysql-test/t/mysqldump.test
      mysql-test/t/partition_list.test
      mysql-test/t/partition_mgm.test
      mysql-test/t/ps_ddl.test
      mysql-test/t/sp.test
      mysql-test/t/type_temporal_fractional.test
      mysql-test/t/xa.test
      sql/field.h
      sql/ha_partition.cc
      sql/item.h
      sql/item_func.cc
      sql/item_sum.cc
      sql/item_sum.h
      sql/item_timefunc.h
      sql/mysqld.cc
      sql/mysqld.h
      sql/opt_sum.cc
      sql/partition_element.h
      sql/partition_info.cc
      sql/partition_info.h
      sql/rpl_info_factory.cc
      sql/rpl_rli.cc
      sql/rpl_rli.h
      sql/rpl_rli_pdb.cc
      sql/rpl_slave.cc
      sql/rpl_slave.h
      sql/sql_admin.cc
      sql/sql_base.cc
      sql/sql_executor.cc
      sql/sql_partition.cc
      sql/sql_partition.h
      sql/sql_select.cc
      sql/sql_view.cc
      sql/sql_yacc.yy
      sql/sys_vars.cc
      sql/table.h
      sql/unireg.h
      storage/federated/ha_federated.cc
      storage/innobase/CMakeLists.txt
      storage/innobase/buf/buf0buf.cc
      storage/innobase/buf/buf0flu.cc
      storage/innobase/buf/buf0lru.cc
      storage/innobase/buf/buf0rea.cc
      storage/innobase/handler/ha_innodb.cc
      storage/innobase/ibuf/ibuf0ibuf.cc
      storage/innobase/include/buf0types.h
      storage/innobase/include/mtr0log.ic
      storage/innobase/include/os0file.h
      storage/innobase/include/sync0sync.h
      storage/innobase/include/trx0sys.h
      storage/innobase/include/trx0types.h
      storage/innobase/include/ut0rnd.ic
      storage/innobase/log/log0recv.cc
      storage/innobase/os/os0file.cc
      storage/innobase/row/row0sel.cc
      storage/innobase/srv/srv0start.cc
      storage/innobase/trx/trx0sys.cc
      mysql-test/r/mysqlbinlog_start_stop.result
      mysql-test/suite/rpl/r/rpl_mts_debug.result
      mysql-test/suite/rpl/t/rpl_mts_debug.test
      mysql-test/t/mysqlbinlog_start_stop.test
=== modified file 'storage/perfschema/gen_pfs_lex_token.cc'
--- a/storage/perfschema/gen_pfs_lex_token.cc	2011-12-08 14:30:18 +0000
+++ b/storage/perfschema/gen_pfs_lex_token.cc	2011-12-28 12:40:43 +0000
@@ -49,6 +49,12 @@ char char_tokens[256];
 
 int tok_pfs_generic_value= 0;
 int tok_pfs_generic_value_list= 0;
+int tok_pfs_row_possible_single_value= 0;
+int tok_pfs_row_single_value= 0;
+int tok_pfs_row_single_value_list= 0;
+int tok_pfs_row_possible_multiple_value= 0;
+int tok_pfs_row_multiple_value= 0;
+int tok_pfs_row_multiple_value_list= 0;
 
 void set_token(int tok, const char *str)
 {
@@ -177,6 +183,30 @@ void compute_tokens()
   max_token_seen++;
   tok_pfs_generic_value_list= max_token_seen;
   set_token(tok_pfs_generic_value_list, "#,#");
+
+  max_token_seen++;
+  tok_pfs_row_possible_single_value= max_token_seen;
+  set_token(tok_pfs_row_possible_single_value, "(#");
+
+  max_token_seen++;
+  tok_pfs_row_single_value= max_token_seen;
+  set_token(tok_pfs_row_single_value, "(#)");
+
+  max_token_seen++;
+  tok_pfs_row_single_value_list= max_token_seen;
+  set_token(tok_pfs_row_single_value_list, "(#),(#)");
+
+  max_token_seen++;
+  tok_pfs_row_possible_multiple_value= max_token_seen;
+  set_token(tok_pfs_row_possible_multiple_value, "(#,#");
+
+  max_token_seen++;
+  tok_pfs_row_multiple_value= max_token_seen;
+  set_token(tok_pfs_row_multiple_value, "(#,#)");
+
+  max_token_seen++;
+  tok_pfs_row_multiple_value_list= max_token_seen;
+  set_token(tok_pfs_row_multiple_value_list, "(#,#),(#,#)");
 }
 
 void print_tokens()
@@ -208,6 +238,12 @@ void print_tokens()
   printf("/* PFS specific tokens. */\n");
   printf("#define TOK_PFS_GENERIC_VALUE %d\n", tok_pfs_generic_value);
   printf("#define TOK_PFS_GENERIC_VALUE_LIST %d\n", tok_pfs_generic_value_list);
+  printf("#define TOK_PFS_ROW_POSSIBLE_SINGLE_VALUE %d\n", tok_pfs_row_possible_single_value);
+  printf("#define TOK_PFS_ROW_SINGLE_VALUE %d\n", tok_pfs_row_single_value);
+  printf("#define TOK_PFS_ROW_SINGLE_VALUE_LIST %d\n", tok_pfs_row_single_value_list);
+  printf("#define TOK_PFS_ROW_POSSIBLE_MULTIPLE_VALUE %d\n", tok_pfs_row_possible_multiple_value);
+  printf("#define TOK_PFS_ROW_MULTIPLE_VALUE %d\n", tok_pfs_row_multiple_value);
+  printf("#define TOK_PFS_ROW_MULTIPLE_VALUE_LIST %d\n", tok_pfs_row_multiple_value_list);
 }
 
 int main(int argc,char **argv)

=== modified file 'storage/perfschema/pfs_digest.cc'
--- a/storage/perfschema/pfs_digest.cc	2011-12-19 19:08:09 +0000
+++ b/storage/perfschema/pfs_digest.cc	2011-12-28 12:40:43 +0000
@@ -416,6 +416,7 @@ void pfs_digest_add_token_v1(PSI_digest_
     return;
   }
 
+  /* Take very last token from collected till now. */
   uint *current= & digest_storage->m_token_array[digest_storage->m_token_count];
 
   switch (token)
@@ -439,38 +440,105 @@ void pfs_digest_add_token_v1(PSI_digest_
 
       if (digest_storage->m_token_count >= 2)
       {
-        if ((current[-2] == TOK_PFS_GENERIC_VALUE) &&
+        if ((current[-2] == TOK_PFS_GENERIC_VALUE ||
+             current[-2] == TOK_PFS_GENERIC_VALUE_LIST) &&
             (current[-1] == ','))
         {
           /*
             REDUCE:
             TOK_PFS_GENERIC_VALUE_LIST :=
               TOK_PFS_GENERIC_VALUE ',' TOK_PFS_GENERIC_VALUE
+            
+            REDUCE:
+            TOK_PFS_GENERIC_VALUE_LIST :=
+              TOK_PFS_GENERIC_VALUE_LIST ',' TOK_PFS_GENERIC_VALUE
           */
           digest_storage->m_token_count-= 2;
           token= TOK_PFS_GENERIC_VALUE_LIST;
         }
-        else if ((current[-2] == TOK_PFS_GENERIC_VALUE_LIST) &&
-                 (current[-1] == ','))
+
+        else if(current[-1] == '(')
         {
           /*
             REDUCE:
-            TOK_PFS_GENERIC_VALUE_LIST :=
-              TOK_PFS_GENERIC_VALUE_LIST ',' TOK_PFS_GENERIC_VALUE
+              "(" , "#" => "(#" 
+          */
+          digest_storage->m_token_count-= 1;
+          token= TOK_PFS_ROW_POSSIBLE_SINGLE_VALUE;
+        }
+        else if((current[-2] == TOK_PFS_ROW_POSSIBLE_SINGLE_VALUE) &&
+                (current[-1] == ','))
+        {
+          /*
+            REDUCE:
+              "(#" , "#" => "(#,#" 
           */
           digest_storage->m_token_count-= 2;
-          token= TOK_PFS_GENERIC_VALUE_LIST;
+          token= TOK_PFS_ROW_POSSIBLE_MULTIPLE_VALUE;
+        }
+        else if((current[-2] == TOK_PFS_ROW_POSSIBLE_MULTIPLE_VALUE) &&
+                (current[-1] == ','))
+        {
+          /*
+            REDUCE:
+              "(#,#" , "#" => "(#,#"
+          */
+          digest_storage->m_token_count-= 2;
+          token= TOK_PFS_ROW_POSSIBLE_MULTIPLE_VALUE;
         }
       }
       break;
     }
-#ifdef TODO
-    case xxx:
+    case ')':
     {
-      /* Code for reduces involving token xxx goes here. */
+      if(current[-1] == TOK_PFS_ROW_POSSIBLE_SINGLE_VALUE) 
+      { 
+        /*
+          REDUCE:
+            "(#" , ")" => "(#)"
+        */
+        digest_storage->m_token_count-= 1;
+        token= TOK_PFS_ROW_SINGLE_VALUE;
+      
+        if((current[-3] == TOK_PFS_ROW_SINGLE_VALUE ||
+            current[-3] == TOK_PFS_ROW_SINGLE_VALUE_LIST) &&
+           (current[-2] == ','))
+        {
+          /*
+            REDUCE:
+              "(#)" , "(#)" => "(#),(#)"
+            REDUCE:
+              "(#),(#)" , "(#)" => "(#),(#)"
+          */
+          digest_storage->m_token_count-= 2;
+          token= TOK_PFS_ROW_SINGLE_VALUE_LIST;
+        }
+      }
+
+      else if(current[-1] == TOK_PFS_ROW_POSSIBLE_MULTIPLE_VALUE)
+      {
+        /*
+          REDUCE:
+            "(#,#" , ")" => "(#,#)"
+        */
+        digest_storage->m_token_count-= 1;
+        token= TOK_PFS_ROW_MULTIPLE_VALUE;
+        if((current[-3] == TOK_PFS_ROW_MULTIPLE_VALUE ||
+            current[-3] == TOK_PFS_ROW_MULTIPLE_VALUE_LIST) &&
+           (current[-2] == ','))
+        {
+          /*
+            REDUCE:
+              "(#,#)" , "(#,#)" ) => "(#,#),(#,#)"
+            REDUCE:
+              "(#,#),(#,#)" , "(#,#)" ) => "(#,#),(#,#)"
+          */
+          digest_storage->m_token_count-= 2;
+          token= TOK_PFS_ROW_MULTIPLE_VALUE_LIST;
+        }
+      }
       break;
     }
-#endif
   }
 
   /*

No bundle (reason: useless for push emails).
Thread
bzr push into mysql-trunk-wl5767 branch (mayank.prasad:3407 to 3408) WL#5767Mayank Prasad29 Dec