List:Commits« Previous MessageNext Message »
From:Mayank Prasad Date:February 16 2012 2:59pm
Subject:bzr push into mysql-trunk-wl5767 branch (mayank.prasad:3439 to 3440) WL#5767
View as plain text  
 3440 Mayank Prasad	2012-02-16
      WL#5767 : Performanc Schema, Statements Digest.
      
      Details:
       - Modifed code to show stats stored at index 0.
       - added a new test case for displaying index 0 stat when 
      digest table is full.

    added:
      mysql-test/suite/perfschema/r/digest_table_full.result
      mysql-test/suite/perfschema/t/digest_table_full-master.opt
      mysql-test/suite/perfschema/t/digest_table_full.test
    modified:
      mysql-test/suite/perfschema/include/digest_execution.inc
      storage/perfschema/table_esms_by_digest.cc
 3439 Mayank Prasad	2012-02-16
      WL#5767 : Performance_schema, Statements Digest.
      
      Details:
       - Added code to distinguish between IDENT and IDENT_QUOTED tokens.
       - Modified test case and result files accordingly.

    modified:
      mysql-test/suite/perfschema/include/digest_execution.inc
      mysql-test/suite/perfschema/r/start_server_no_digests.result
      mysql-test/suite/perfschema/r/statement_digest.result
      mysql-test/suite/perfschema/r/statement_digest_consumers.result
      mysql-test/suite/perfschema/r/statement_digest_consumers2.result
      storage/perfschema/pfs_digest.cc
      storage/perfschema/pfs_digest.h
=== modified file 'mysql-test/suite/perfschema/include/digest_execution.inc'
--- a/mysql-test/suite/perfschema/include/digest_execution.inc	2012-02-16 12:57:06 +0000
+++ b/mysql-test/suite/perfschema/include/digest_execution.inc	2012-02-16 14:58:41 +0000
@@ -73,9 +73,3 @@ CREATE DATABASE statements_digest_temp;
 DROP DATABASE statements_digest_temp;
 # TODO : add more
 --enable_warnings
-
-# -----------------------------------------------------------------------
-# Tests to show how the digest tables behaves when it is full (special NULL
-# entry)
-# -----------------------------------------------------------------------
-# TODO:

=== added file 'mysql-test/suite/perfschema/r/digest_table_full.result'
--- a/mysql-test/suite/perfschema/r/digest_table_full.result	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/perfschema/r/digest_table_full.result	2012-02-16 14:58:41 +0000
@@ -0,0 +1,85 @@
+####################################
+# SETUP
+####################################
+CREATE DATABASE statements_digest;
+USE statements_digest;
+CREATE TABLE t1(a int);
+CREATE TABLE t2(a int);
+CREATE TABLE t3(a int, b int);
+CREATE TABLE t4(a int, b int);
+CREATE TABLE t5(a int, b int, c int);
+TRUNCATE TABLE performance_schema.events_statements_summary_by_digest;
+####################################
+# EXECUTION
+####################################
+SELECT 1 FROM t1;
+1
+SELECT 1 FROM `t1`;
+1
+SELECT 1,2 FROM t1;
+1	2
+SELECT 1, 2, 3, 4 FROM t1;
+1	2	3	4
+SELECT 1 FROM t2;
+1
+SELECT 1,2 FROM t2;
+1	2
+SELECT 1, 2, 3, 4 FROM t2;
+1	2	3	4
+INSERT INTO t1 VALUES (1);
+INSERT INTO t2 VALUES (1);
+INSERT INTO t3 VALUES (1, 2);
+INSERT INTO t4 VALUES (1, 2);
+INSERT INTO t5 VALUES (1, 2, 3);
+INSERT INTO t1 VALUES (1), (2), (3);
+INSERT INTO t1 VALUES (1), (2), (3), (4);
+INSERT INTO t3 VALUES (1, 2), (3, 4), (5, 6);
+INSERT INTO t5 VALUES (1, 2, 3), (4, 5, 6), (7, 8, 9);
+SELECT                                          1           +        1;
+1           +        1
+2
+SELECT 1;
+1
+1
+SELECT 1 /* This is an inline comment */ + 1;
+1 /* This is an inline comment */ + 1
+2
+SELECT 1+
+/*
+this is a
+multiple-line comment
+*/
+1;
+1+
+/*
+this is a
+multiple-line comment
+*/
+1
+2
+CREATE SCHEMA statements_digest_temp;
+DROP SCHEMA statements_digest_temp;
+CREATE DATABASE statements_digest_temp;
+DROP DATABASE statements_digest_temp;
+####################################
+# QUERYING PS STATEMENT DIGEST
+####################################
+SELECT digest, digest_text, count_star FROM performance_schema.events_statements_summary_by_digest;
+digest	digest_text	count_star
+NULL	NULL	24
+29570e463ee5c23d	TRUNCATE TABLE performance_schema . events_statements_summary_by_digest  	1
+SHOW VARIABLES LIKE "performance_schema_digests_size";
+Variable_name	Value
+performance_schema_digests_size	2
+SELECT COUNT(*) FROM performance_schema.events_statements_summary_by_digest;
+COUNT(*)
+2
+####################################
+# CLEANUP
+####################################
+DROP TABLE IF EXISTS t1;
+DROP TABLE IF EXISTS t2;
+DROP TABLE IF EXISTS t3;
+DROP TABLE IF EXISTS t4;
+DROP TABLE IF EXISTS t5;
+DROP DATABASE IF EXISTS statements_digest;

=== added file 'mysql-test/suite/perfschema/t/digest_table_full-master.opt'
--- a/mysql-test/suite/perfschema/t/digest_table_full-master.opt	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/perfschema/t/digest_table_full-master.opt	2012-02-16 14:58:41 +0000
@@ -0,0 +1 @@
+--performance-schema-digests-size=2

=== added file 'mysql-test/suite/perfschema/t/digest_table_full.test'
--- a/mysql-test/suite/perfschema/t/digest_table_full.test	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/perfschema/t/digest_table_full.test	2012-02-16 14:58:41 +0000
@@ -0,0 +1,31 @@
+# ----------------------------------------------------
+# Tests for the performance schema statement Digests.
+# ----------------------------------------------------
+
+# Test case to show behavior of statements digest when
+# statement-digest-size is 0
+
+--source include/not_embedded.inc
+--source include/have_perfschema.inc
+
+# Initial Setup for Digest
+--source ../include/digest_setup.inc
+
+TRUNCATE TABLE performance_schema.events_statements_summary_by_digest;
+
+# Executing queries
+--source ../include/digest_execution.inc
+
+--echo ####################################
+--echo # QUERYING PS STATEMENT DIGEST
+--echo ####################################
+SELECT digest, digest_text, count_star FROM performance_schema.events_statements_summary_by_digest;
+
+
+# Expect no digest
+SHOW VARIABLES LIKE "performance_schema_digests_size";
+SELECT COUNT(*) FROM performance_schema.events_statements_summary_by_digest;
+
+# Cleanup for Digest
+--source ../include/digest_cleanup.inc
+

=== modified file 'storage/perfschema/table_esms_by_digest.cc'
--- a/storage/perfschema/table_esms_by_digest.cc	2012-02-11 20:33:44 +0000
+++ b/storage/perfschema/table_esms_by_digest.cc	2012-02-16 14:58:41 +0000
@@ -233,7 +233,7 @@ int table_esms_by_digest::rnd_next(void)
        m_pos.next())
   {
     digest_stat= &statements_digest_stat_array[m_pos.m_index];
-    if(digest_stat->m_digest_storage.m_byte_count != 0)
+    if(digest_stat->m_first_seen != 0)
     {
       make_row(digest_stat);
       m_next_pos.set_after(&m_pos);
@@ -249,16 +249,13 @@ table_esms_by_digest::rnd_pos(const void
 {
   PFS_statements_digest_stat* digest_stat;
 
+  if(statements_digest_stat_array == NULL)
+    return HA_ERR_END_OF_FILE;
+
   set_position(pos);
   digest_stat= &statements_digest_stat_array[m_pos.m_index];
 
-  /* 
-    If byte_count is not 0 i.e. its a valid entry in stat array or
-    If it is a record at index 0 of statements_digest_stat_array,
-    make a new row.
-  */
-  if(digest_stat->m_digest_storage.m_byte_count != 0 ||
-     m_pos.m_index == 0)
+  if(digest_stat->m_first_seen != 0)
   {
     make_row(digest_stat);
     return 0;

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