List:Commits« Previous MessageNext Message »
From:Mayank Prasad Date:June 13 2011 11:57am
Subject:[Resend] bzr commit into mysql-trunk-wl5767 branch (mayank.prasad:3371)
WL#5767
View as plain text  
[This commit e-mail is a repeat.]

#At file:///home/mayank/mysql-tree/my_WL/5767/ based on
revid:mayank.prasad@stripped

 3371 Mayank Prasad	2011-06-13
      WL#5767 : PERFORMANCE SCHEMA, statement digest
      
      Description:
      Fixed failing test case issues.

    added:
      mysql-test/suite/perfschema/r/dml_esms_by_digest.result
      mysql-test/suite/sys_vars/r/pfs_digests_size.result
      mysql-test/suite/sys_vars/t/pfs_digests_size-master_basic.opt
      mysql-test/suite/sys_vars/t/pfs_digests_size_basic.test
    modified:
      mysql-test/r/mysqld--help-notwin.result
      mysql-test/r/mysqld--help-win.result
      mysql-test/suite/perfschema/t/dml_esms_by_digest.test
      mysql-test/suite/sys_vars/r/all_vars.result
      sql/sys_vars.cc
      storage/perfschema/table_esms_by_digest.cc
=== modified file 'mysql-test/r/mysqld--help-notwin.result'
--- a/mysql-test/r/mysqld--help-notwin.result	2011-05-26 05:50:01 +0000
+++ b/mysql-test/r/mysqld--help-notwin.result	2011-06-13 11:54:30 +0000
@@ -426,6 +426,8 @@ The following options may be given as th
  mrr_cost_based} and val is one of {on, off, default}
  --performance-schema 
  Enable the performance schema.
+ --performance-schema-digests-size=# 
+ Size of the statement digest.
  --performance-schema-events-stages-history-long-size=# 
  Number of rows in EVENTS_STAGES_HISTORY_LONG.
  --performance-schema-events-stages-history-size=# 
@@ -896,6 +898,7 @@ optimizer-prune-level 1
 optimizer-search-depth 62
 optimizer-switch
index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,engine_condition_pushdown=on,index_condition_pushdown=on,mrr=on,mrr_cost_based=on
 performance-schema FALSE
+performance-schema-digests-size 200
 performance-schema-events-stages-history-long-size 10000
 performance-schema-events-stages-history-size 10
 performance-schema-events-statements-history-long-size 10000

=== modified file 'mysql-test/r/mysqld--help-win.result'
--- a/mysql-test/r/mysqld--help-win.result	2011-05-26 05:50:01 +0000
+++ b/mysql-test/r/mysqld--help-win.result	2011-06-13 11:54:30 +0000
@@ -426,6 +426,8 @@ The following options may be given as th
  mrr_cost_based} and val is one of {on, off, default}
  --performance-schema 
  Enable the performance schema.
+ --performance-schema-digests-size=#
+ Size of the statement digest.
  --performance-schema-events-stages-history-long-size=# 
  Number of rows in EVENTS_STAGES_HISTORY_LONG.
  --performance-schema-events-stages-history-size=# 

=== added file 'mysql-test/suite/perfschema/r/dml_esms_by_digest.result'
--- a/mysql-test/suite/perfschema/r/dml_esms_by_digest.result	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/perfschema/r/dml_esms_by_digest.result	2011-06-13 11:54:30 +0000
@@ -0,0 +1,27 @@
+select * from performance_schema.events_statements_summary_by_digest
+where digest like 'XXYYZZ%' limit 1;
+DIGEST	DIGEST_TEXT	COUNT_STAR	SUM_TIMER_WAIT	MIN_TIMER_WAIT	AVG_TIMER_WAIT	MAX_TIMER_WAIT	SUM_LOCK_TIME	SUM_ERRORS	SUM_WARNINGS	SUM_ROWS_AFFECTED	SUM_ROWS_SENT	SUM_ROWS_EXAMINED	SUM_CREATED_TMP_DISK_TABLES	SUM_CREATED_TMP_TABLES	SUM_SELECT_FULL_JOIN	SUM_SELECT_FULL_RANGE_JOIN	SUM_SELECT_RANGE	SUM_SELECT_RANGE_CHECK	SUM_SELECT_SCAN	SUM_SORT_MERGE_PASSES	SUM_SORT_RANGE	SUM_SORT_ROWS	SUM_SORT_SCAN	SUM_NO_INDEX_USED	SUM_NO_GOOD_INDEX_USED
+select * from performance_schema.events_statements_summary_by_digest
+where digest='XXYYZZ';
+DIGEST	DIGEST_TEXT	COUNT_STAR	SUM_TIMER_WAIT	MIN_TIMER_WAIT	AVG_TIMER_WAIT	MAX_TIMER_WAIT	SUM_LOCK_TIME	SUM_ERRORS	SUM_WARNINGS	SUM_ROWS_AFFECTED	SUM_ROWS_SENT	SUM_ROWS_EXAMINED	SUM_CREATED_TMP_DISK_TABLES	SUM_CREATED_TMP_TABLES	SUM_SELECT_FULL_JOIN	SUM_SELECT_FULL_RANGE_JOIN	SUM_SELECT_RANGE	SUM_SELECT_RANGE_CHECK	SUM_SELECT_SCAN	SUM_SORT_MERGE_PASSES	SUM_SORT_RANGE	SUM_SORT_ROWS	SUM_SORT_SCAN	SUM_NO_INDEX_USED	SUM_NO_GOOD_INDEX_USED
+insert into performance_schema.events_statements_summary_by_digest
+set digest='XXYYZZ', count_star=1, sum_timer_wait=2, min_timer_wait=3,
+avg_timer_wait=4, max_timer_wait=5;
+ERROR 42000: INSERT command denied to user 'root'@'localhost' for table
'events_statements_summary_by_digest'
+update performance_schema.events_statements_summary_by_digest
+set count_star=12;
+ERROR 42000: UPDATE command denied to user 'root'@'localhost' for table
'events_statements_summary_by_digest'
+update performance_schema.events_statements_summary_by_digest
+set count_star=12 where digest like "XXYYZZ";
+ERROR 42000: UPDATE command denied to user 'root'@'localhost' for table
'events_statements_summary_by_digest'
+delete from performance_schema.events_statements_summary_by_digest
+where count_star=1;
+ERROR 42000: DELETE command denied to user 'root'@'localhost' for table
'events_statements_summary_by_digest'
+delete from performance_schema.events_statements_summary_by_digest;
+ERROR 42000: DELETE command denied to user 'root'@'localhost' for table
'events_statements_summary_by_digest'
+LOCK TABLES performance_schema.events_statements_summary_by_digest READ;
+ERROR 42000: SELECT, LOCK TABLES command denied to user 'root'@'localhost' for table
'events_statements_summary_by_digest'
+UNLOCK TABLES;
+LOCK TABLES performance_schema.events_statements_summary_by_digest WRITE;
+ERROR 42000: SELECT, LOCK TABLES command denied to user 'root'@'localhost' for table
'events_statements_summary_by_digest'
+UNLOCK TABLES;

=== modified file 'mysql-test/suite/perfschema/t/dml_esms_by_digest.test'
--- a/mysql-test/suite/perfschema/t/dml_esms_by_digest.test	2011-05-16 11:20:58 +0000
+++ b/mysql-test/suite/perfschema/t/dml_esms_by_digest.test	2011-06-13 11:54:30 +0000
@@ -15,4 +15,42 @@
 
 # Tests for PERFORMANCE_SCHEMA
 
-##############################  TBD  #################################
+--source include/not_embedded.inc
+--source include/have_perfschema.inc
+
+#--disable_result_log 
+select * from performance_schema.events_statements_summary_by_digest
+  where digest like 'XXYYZZ%' limit 1;
+
+select * from performance_schema.events_statements_summary_by_digest
+  where digest='XXYYZZ';
+#--enable_result_log
+
+--error ER_TABLEACCESS_DENIED_ERROR
+insert into performance_schema.events_statements_summary_by_digest
+  set digest='XXYYZZ', count_star=1, sum_timer_wait=2, min_timer_wait=3,
+  avg_timer_wait=4, max_timer_wait=5;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+update performance_schema.events_statements_summary_by_digest
+  set count_star=12;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+update performance_schema.events_statements_summary_by_digest
+  set count_star=12 where digest like "XXYYZZ";
+
+--error ER_TABLEACCESS_DENIED_ERROR
+delete from performance_schema.events_statements_summary_by_digest
+  where count_star=1;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+delete from performance_schema.events_statements_summary_by_digest;
+
+-- error ER_TABLEACCESS_DENIED_ERROR
+LOCK TABLES performance_schema.events_statements_summary_by_digest READ;
+UNLOCK TABLES;
+
+-- error ER_TABLEACCESS_DENIED_ERROR
+LOCK TABLES performance_schema.events_statements_summary_by_digest WRITE;
+UNLOCK TABLES;
+

=== modified file 'mysql-test/suite/sys_vars/r/all_vars.result'
--- a/mysql-test/suite/sys_vars/r/all_vars.result	2011-05-31 09:30:59 +0000
+++ b/mysql-test/suite/sys_vars/r/all_vars.result	2011-06-13 11:54:30 +0000
@@ -14,6 +14,7 @@ left join t1 on variable_name=test_name 
 There should be *no* variables listed below:
 INNODB_STATS_TRANSIENT_SAMPLE_PAGES
 INNODB_ROLLBACK_SEGMENTS
+INNODB_LARGE_PREFIX
 INNODB_STATS_PERSISTENT_SAMPLE_PAGES
 RELAY_LOG_BASENAME
 LOG_BIN_BASENAME
@@ -27,9 +28,9 @@ INNODB_SYNC_ARRAY_SIZE
 INNODB_MONITOR_DISABLE
 INNODB_FILE_FORMAT_MAX
 INNODB_MONITOR_ENABLE
-INNODB_LARGE_PREFIX
 INNODB_STATS_TRANSIENT_SAMPLE_PAGES
 INNODB_ROLLBACK_SEGMENTS
+INNODB_LARGE_PREFIX
 INNODB_STATS_PERSISTENT_SAMPLE_PAGES
 RELAY_LOG_BASENAME
 LOG_BIN_BASENAME
@@ -43,6 +44,5 @@ INNODB_SYNC_ARRAY_SIZE
 INNODB_MONITOR_DISABLE
 INNODB_FILE_FORMAT_MAX
 INNODB_MONITOR_ENABLE
-INNODB_LARGE_PREFIX
 drop table t1;
 drop table t2;

=== added file 'mysql-test/suite/sys_vars/r/pfs_digests_size.result'
--- a/mysql-test/suite/sys_vars/r/pfs_digests_size.result	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/sys_vars/r/pfs_digests_size.result	2011-06-13 11:54:30 +0000
@@ -0,0 +1,23 @@
+select @@global.performance_schema_digests_size;
+@@global.performance_schema_digests_size
+200
+select @@session.performance_schema_digests_size;
+ERROR HY000: Variable 'performance_schema_digests_size' is a GLOBAL variable
+show global variables like 'performance_schema_digests_size';
+Variable_name	Value
+performance_schema_digests_size	200
+show session variables like 'performance_schema_digests_size';
+Variable_name	Value
+performance_schema_digests_size	200
+select * from information_schema.global_variables
+where variable_name='performance_schema_digests_size';
+VARIABLE_NAME	VARIABLE_VALUE
+PERFORMANCE_SCHEMA_DIGESTS_SIZE	200
+select * from information_schema.session_variables
+where variable_name='performance_schema_digests_size';
+VARIABLE_NAME	VARIABLE_VALUE
+PERFORMANCE_SCHEMA_DIGESTS_SIZE	200
+set global performance_schema_digests_size=1;
+ERROR HY000: Variable 'performance_schema_digests_size' is a read only variable
+set session performance_schema_digests_size=1;
+ERROR HY000: Variable 'performance_schema_digests_size' is a read only variable

=== added file 'mysql-test/suite/sys_vars/t/pfs_digests_size-master_basic.opt'
--- a/mysql-test/suite/sys_vars/t/pfs_digests_size-master_basic.opt	1970-01-01 00:00:00
+0000
+++ b/mysql-test/suite/sys_vars/t/pfs_digests_size-master_basic.opt	2011-06-13 11:54:30
+0000
@@ -0,0 +1,2 @@
+--loose-enable-performance-schema
+--loose-performance-schema-digests-size=200

=== added file 'mysql-test/suite/sys_vars/t/pfs_digests_size_basic.test'
--- a/mysql-test/suite/sys_vars/t/pfs_digests_size_basic.test	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/sys_vars/t/pfs_digests_size_basic.test	2011-06-13 11:54:30 +0000
@@ -0,0 +1,47 @@
+# Copyright (C) 2010 Sun Microsystems, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+--source include/not_embedded.inc
+--source include/have_perfschema.inc
+
+#
+# Only global
+#
+
+select @@global.performance_schema_digests_size;
+
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+select @@session.performance_schema_digests_size;
+
+show global variables like 'performance_schema_digests_size';
+
+show session variables like 'performance_schema_digests_size';
+
+select * from information_schema.global_variables
+  where variable_name='performance_schema_digests_size';
+
+select * from information_schema.session_variables
+  where variable_name='performance_schema_digests_size';
+
+#
+# Read-only
+#
+
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+set global performance_schema_digests_size=1;
+
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+set session performance_schema_digests_size=1;
+

=== modified file 'sql/sys_vars.cc'
--- a/sql/sys_vars.cc	2011-06-07 12:08:35 +0000
+++ b/sql/sys_vars.cc	2011-06-13 11:54:30 +0000
@@ -274,7 +274,7 @@ static Sys_var_ulong Sys_pfs_events_stat
 
 static Sys_var_ulong Sys_pfs_digest_size(
        "performance_schema_digests_size",
-       "TBD.",
+       "Size of the statement digest.",
        READ_ONLY GLOBAL_VAR(pfs_param.m_digest_sizing),
        CMD_LINE(REQUIRED_ARG), VALID_RANGE(0, 200),
        DEFAULT(PFS_DIGEST_SIZE),

=== modified file 'storage/perfschema/table_esms_by_digest.cc'
--- a/storage/perfschema/table_esms_by_digest.cc	2011-05-16 11:20:58 +0000
+++ b/storage/perfschema/table_esms_by_digest.cc	2011-06-13 11:54:30 +0000
@@ -267,8 +267,11 @@ int table_esms_by_digest
   if (unlikely(! m_row_exists))
     return HA_ERR_RECORD_DELETED;
 
-  /* Set the null bits */
-  DBUG_ASSERT(table->s->null_bytes == 0);
+  /* 
+     Set the null bits. It indicates how many fields could be null
+     in the table.
+  */
+  DBUG_ASSERT(table->s->null_bytes == 1);
 
   for (; (f= *fields) ; fields++)
   {


Attachment: [text/bzr-bundle] bzr/mayank.prasad@oracle.com-20110613115430-u59wkavvbe5u43so.bundle
Thread
[Resend] bzr commit into mysql-trunk-wl5767 branch (mayank.prasad:3371)WL#5767Mayank Prasad13 Jun