List:Commits« Previous MessageNext Message »
From:Matthias Leich Date:August 23 2011 10:38am
Subject:bzr push into mysql-trunk branch (matthias.leich:3396 to 3397)
View as plain text  
 3397 Matthias Leich	2011-08-23
      socket_summary_by_instance failed sporadic in PB
      1. Avoid that some calculation hits the upper limit of the value range.
         This might fix the issues seen in PB.
      2. In case of unexpected results, this already means that the test failed,
         print the complete content of important tables. This might accelarate
         the bug analysis.
      
           

    modified:
      mysql-test/suite/perfschema/include/socket_check1.inc
      mysql-test/suite/perfschema/include/socket_summary_check.inc
      mysql-test/suite/perfschema/r/socket_summary_by_instance_func.result
      mysql-test/suite/perfschema/t/socket_summary_by_instance_func.test
 3396 Evgeny Potemkin	2011-08-23 [merge]
      Auto-merged fix for the bug#12896124.

    added:
      mysql-test/suite/sys_vars/r/innodb_checksum_algorithm_basic.result
      mysql-test/suite/sys_vars/t/innodb_checksum_algorithm_basic.test
      storage/innobase/buf/buf0checksum.c
      storage/innobase/include/buf0checksum.h
      storage/innobase/include/ut0crc32.h
      storage/innobase/ut/ut0crc32.c
    modified:
      extra/CMakeLists.txt
      extra/innochecksum.c
      mysql-test/collections/default.experimental
      mysql-test/suite/rpl/r/rpl_mixed_mts_crash_safe.result
      mysql-test/suite/rpl/r/rpl_mixed_mts_rec_crash_safe.result
      mysql-test/suite/rpl/r/rpl_mixed_mts_rec_crash_safe_checksum.result
      mysql-test/suite/rpl/r/rpl_row_mts_crash_safe.result
      mysql-test/suite/rpl/r/rpl_row_mts_rec_crash_safe.result
      mysql-test/suite/rpl/r/rpl_stm_mts_crash_safe.result
      mysql-test/suite/rpl/r/rpl_stm_mts_rec_crash_safe.result
      mysql-test/suite/sys_vars/t/disabled.def
      sql/CMakeLists.txt
      sql/log_event.cc
      sql/sql_class.cc
      storage/innobase/CMakeLists.txt
      storage/innobase/buf/buf0buf.c
      storage/innobase/buf/buf0flu.c
      storage/innobase/buf/buf0lru.c
      storage/innobase/handler/ha_innodb.cc
      storage/innobase/include/buf0buf.h
      storage/innobase/include/page0zip.h
      storage/innobase/include/srv0srv.h
      storage/innobase/include/univ.i
      storage/innobase/page/page0zip.c
      storage/innobase/srv/srv0srv.c
=== modified file 'mysql-test/suite/perfschema/include/socket_check1.inc'
--- a/mysql-test/suite/perfschema/include/socket_check1.inc	2011-08-19 06:59:27 +0000
+++ b/mysql-test/suite/perfschema/include/socket_check1.inc	2011-08-23 10:12:13 +0000
@@ -134,6 +134,7 @@ if(`SELECT NOT ( $my_rules )
      AND EVENT_NAME LIKE ('%client_connection')
      AND run = 1
      AND statement IN('$stmt2','$stmt1');
+   let $print_details= 1;
 }
 # Initialize all variables which depend on the statements to be checked.
 # This prevents that we run with wrong data.

=== modified file 'mysql-test/suite/perfschema/include/socket_summary_check.inc'
--- a/mysql-test/suite/perfschema/include/socket_summary_check.inc	2011-08-19 06:59:27 +0000
+++ b/mysql-test/suite/perfschema/include/socket_summary_check.inc	2011-08-23 10:12:13 +0000
@@ -113,6 +113,7 @@ if(`SELECT SUM($my_rules) <> COUNT(*) FR
       $part
    FROM performance_schema.socket_summary_by_instance
    ORDER BY EVENT_NAME, OBJECT_INSTANCE_BEGIN;
+   let $print_details= 1;
 }
 
 
@@ -151,6 +152,7 @@ if(`SELECT SUM($my_rules) <> COUNT(*) FR
    FROM mysqltest.my_socket_summary_by_instance
    WHERE pk = 'After' AND NOT ($my_rules)
    ORDER BY EVENT_NAME, OBJECT_INSTANCE_BEGIN;
+   let $print_details= 1;
 }
 
 
@@ -184,6 +186,7 @@ if(`SELECT SUM($my_rules) <> COUNT(*) FR
    FROM mysqltest.my_socket_summary_by_instance
    WHERE pk = 'After'
    ORDER BY EVENT_NAME, OBJECT_INSTANCE_BEGIN;
+   let $print_details= 1;
 }
 
 
@@ -213,6 +216,7 @@ if(`SELECT SUM($my_rules) <> COUNT(*) FR
    FROM mysqltest.my_socket_summary_by_instance
    WHERE pk = 'After'
    ORDER BY EVENT_NAME, OBJECT_INSTANCE_BEGIN;
+   let $print_details= 1;
 }
 
 
@@ -242,6 +246,7 @@ if(`SELECT SUM($my_rules) <> COUNT(*) FR
    FROM mysqltest.my_socket_summary_by_instance
    WHERE pk = 'After'
    ORDER BY EVENT_NAME, OBJECT_INSTANCE_BEGIN;
+   let $print_details= 1;
 }
 
 --horizontal_results

=== modified file 'mysql-test/suite/perfschema/r/socket_summary_by_instance_func.result'
--- a/mysql-test/suite/perfschema/r/socket_summary_by_instance_func.result	2011-08-20 00:36:03 +0000
+++ b/mysql-test/suite/perfschema/r/socket_summary_by_instance_func.result	2011-08-23 10:12:13 +0000
@@ -16,6 +16,7 @@ SET INSTRUMENTED='NO' WHERE PROCESSLIST_
 #     It must reset all counters.
 TRUNCATE TABLE performance_schema.socket_summary_by_instance;
 # 1.3 Check the base line
+TRUNCATE TABLE mysqltest.my_socket_summary_by_instance;
 # 2. Variations on Connect
 # 2.1 Connect fails because the user is unknown
 #     length of user name = 4 character

=== modified file 'mysql-test/suite/perfschema/t/socket_summary_by_instance_func.test'
--- a/mysql-test/suite/perfschema/t/socket_summary_by_instance_func.test	2011-08-20 00:36:03 +0000
+++ b/mysql-test/suite/perfschema/t/socket_summary_by_instance_func.test	2011-08-23 10:12:13 +0000
@@ -110,6 +110,8 @@ if($my_socket_debug)
 #    cause that the test needs maintenance.
 # Advantage:
 #    More thorough checks.
+# If any of the checks detects some suspicious/unexpected state than
+# $print_details will be automatically switched to 1.
 #
 let $print_details= 0;
 
@@ -214,43 +216,73 @@ SET INSTRUMENTED='NO' WHERE PROCESSLIST_
 # - to have initial values from before some action
 # - to minimize the impact of statements used for the checks on results.
 # CREATE TEMPORARY TABLE my_socket_summary_by_instance AS
-# would be nice but the optimizer does not support important statements.
+# would be nice but some statements are not supported for temporary tables.
 #
-CREATE TABLE mysqltest.my_socket_summary_by_instance AS
-SELECT *, 'Pseudo_Before' AS pk FROM performance_schema.socket_summary_by_instance
-WHERE 1 = 0;
+# DECIMAL(60,0) is used instead of BIGINT UNSIGNED. The goal is to prevent
+# errors during calculations
+#   Example:
+#   -    A and B UNSIGNED BIGINT
+#   -    A < B
+#   -    A - B ---> Error
+# though the columns in all queries are orderd to avoid this too.
+#
+CREATE TABLE mysqltest.my_socket_summary_by_instance (
+  EVENT_NAME varchar(128) NOT NULL,
+  OBJECT_INSTANCE_BEGIN bigint(20) unsigned NOT NULL,
+  COUNT_STAR                DECIMAL(60,0) NOT NULL,
+  SUM_TIMER_WAIT            DECIMAL(60,0) NOT NULL,
+  MIN_TIMER_WAIT            DECIMAL(60,0) NOT NULL,
+  AVG_TIMER_WAIT            DECIMAL(60,0) NOT NULL,
+  MAX_TIMER_WAIT            DECIMAL(60,0) NOT NULL,
+  COUNT_READ                DECIMAL(60,0) NOT NULL,
+  SUM_TIMER_READ            DECIMAL(60,0) NOT NULL,
+  MIN_TIMER_READ            DECIMAL(60,0) NOT NULL,
+  AVG_TIMER_READ            DECIMAL(60,0) NOT NULL,
+  MAX_TIMER_READ            DECIMAL(60,0) NOT NULL,
+  SUM_NUMBER_OF_BYTES_READ  DECIMAL(60,0) NOT NULL,
+  COUNT_WRITE               DECIMAL(60,0) NOT NULL,
+  SUM_TIMER_WRITE           DECIMAL(60,0) NOT NULL,
+  MIN_TIMER_WRITE           DECIMAL(60,0) NOT NULL,
+  AVG_TIMER_WRITE           DECIMAL(60,0) NOT NULL,
+  MAX_TIMER_WRITE           DECIMAL(60,0) NOT NULL,
+  SUM_NUMBER_OF_BYTES_WRITE DECIMAL(60,0) NOT NULL,
+  COUNT_MISC                DECIMAL(60,0) NOT NULL,
+  SUM_TIMER_MISC            DECIMAL(60,0) NOT NULL,
+  MIN_TIMER_MISC            DECIMAL(60,0) NOT NULL,
+  AVG_TIMER_MISC            DECIMAL(60,0) NOT NULL,
+  MAX_TIMER_MISC            DECIMAL(60,0) NOT NULL,
+  pk VARCHAR(20),
+  PRIMARY KEY(pk, EVENT_NAME, OBJECT_INSTANCE_BEGIN)
+) DEFAULT CHARSET=utf8;
 
-# The CAST(... AS DECIMAL) prevents errors which might show up in case
+
+# The CAST(... AS DECIMAL(60,0)) prevents errors which might show up in case
 # we run with the original data type UNSIGNED BIGINT.
-# Example:
-# -    A and B UNSIGNED BIGINT
-# -    A < B
-# -    A - B ---> Error
-CREATE TABLE mysqltest.socket_summary_by_instance_detail AS
-SELECT EVENT_NAME,OBJECT_INSTANCE_BEGIN,
-       CAST(COUNT_READ AS DECIMAL) AS COUNT_READ,
-       CAST(SUM_TIMER_READ AS DECIMAL) AS SUM_TIMER_READ,
-       CAST(SUM_NUMBER_OF_BYTES_READ AS DECIMAL) SUM_NUMBER_OF_BYTES_READ,
-       CAST(COUNT_WRITE AS DECIMAL) AS COUNT_WRITE,
-       CAST(SUM_TIMER_WRITE AS DECIMAL) AS SUM_TIMER_WRITE,
-       CAST(SUM_NUMBER_OF_BYTES_WRITE AS DECIMAL) AS SUM_NUMBER_OF_BYTES_WRITE,
-       CAST(COUNT_MISC AS DECIMAL) AS COUNT_MISC,
-       CAST(SUM_TIMER_MISC AS DECIMAL) AS SUM_TIMER_MISC
-FROM performance_schema.socket_summary_by_instance
-WHERE 1 = 2;
-ALTER TABLE mysqltest.socket_summary_by_instance_detail
-ADD statement VARCHAR(500), ADD run INTEGER;
+CREATE TABLE mysqltest.socket_summary_by_instance_detail (
+  EVENT_NAME varchar(128) NOT NULL,
+  OBJECT_INSTANCE_BEGIN bigint(20) unsigned NOT NULL,
+  COUNT_READ                DECIMAL(60,0) NOT NULL,
+  SUM_TIMER_READ            DECIMAL(60,0) NOT NULL,
+  SUM_NUMBER_OF_BYTES_READ  DECIMAL(60,0) NOT NULL,
+  COUNT_WRITE               DECIMAL(60,0) NOT NULL,
+  SUM_TIMER_WRITE           DECIMAL(60,0) NOT NULL,
+  SUM_NUMBER_OF_BYTES_WRITE DECIMAL(60,0) NOT NULL,
+  COUNT_MISC                DECIMAL(60,0) NOT NULL,
+  SUM_TIMER_MISC            DECIMAL(60,0) NOT NULL,
+  statement VARCHAR(500),
+  run INTEGER
+) DEFAULT CHARSET=utf8;
 
 #
 # Auxiliary SQL functions used to shorten some commands.
 #
 CREATE FUNCTION mysqltest.min_of_triple
-   (f1 BIGINT UNSIGNED, f2 BIGINT UNSIGNED, f3 BIGINT UNSIGNED)
-   RETURNS BIGINT UNSIGNED
+   (f1 DECIMAL(60,0), f2 DECIMAL(60,0), f3 DECIMAL(60,0))
+   RETURNS DECIMAL(60,0)
    RETURN IF(IF(f1 < f2,f1,f2) < f3,IF(f1 < f2,f1,f2), f3);
 CREATE FUNCTION mysqltest.max_of_triple
-   (f1 BIGINT UNSIGNED, f2 BIGINT UNSIGNED, f3 BIGINT UNSIGNED)
-   RETURNS BIGINT UNSIGNED
+   (f1 DECIMAL(60,0), f2 DECIMAL(60,0), f3 DECIMAL(60,0))
+   RETURNS DECIMAL(60,0)
    RETURN IF(IF(f1 > f2,f1,f2) > f3,IF(f1 > f2,f1,f2), f3);
 
 #
@@ -470,6 +502,7 @@ if(`SELECT COUNT(*) FROM performance_sch
 
 --echo # 1.3 Check the base line
 #===============================
+eval $truncate;
 --source ../include/socket_summary_check.inc
 
 # --disable_query_log
@@ -731,6 +764,7 @@ if(`SELECT COUNT(*) FROM mysqltest.socke
    FROM mysqltest.socket_summary_by_instance_detail
    WHERE NOT ( $my_rules )
    ORDER BY EVENT_NAME, OBJECT_INSTANCE, STATEMENT, RUN;
+   let $print_details= 1;
 }
 
 --echo # 4.2 Results must be stable
@@ -798,6 +832,7 @@ if(`SELECT COUNT(statement) $part`)
          IN (SELECT EVENT_NAME, statement
              $part)
    ORDER BY EVENT_NAME, statement, run, OBJECT_INSTANCE_BEGIN;
+   let $print_details= 1;
 }
 
 --echo # 4.3 Counters must be 0 in client_connection for the default session
@@ -833,6 +868,7 @@ if(`SELECT COUNT(*) FROM performance_sch
       COUNT_MISC,SUM_TIMER_MISC
    FROM performance_schema.socket_summary_by_instance
    WHERE OBJECT_INSTANCE_BEGIN = @default_object_instance_begin;
+   let $print_details= 1;
 }
 
 #---------------------------------------------------------------------------
@@ -879,6 +915,7 @@ if(`SELECT COUNT(*) $part`)
       $column_list
    $part
    ORDER BY EVENT_NAME, OBJECT_INSTANCE_BEGIN, statement, run;
+   let $print_details= 1;
 }
 
 --echo # 4.4.2 In case of SELECT and our scenarios even COUNT_READ and COUNT_MISC
@@ -921,6 +958,7 @@ if(`SELECT COUNT(statement) $part`)
          IN (SELECT EVENT_NAME, statement
              $part)
    ORDER BY EVENT_NAME, statement, run, OBJECT_INSTANCE_BEGIN;
+   let $print_details= 1;
 }
 
 --echo # 4.4.3 In our testing scenarios we get for the client_connection entry
@@ -963,6 +1001,7 @@ if(`SELECT COUNT(*) $part`)
       $column_list
    $part
    ORDER BY EVENT_NAME, OBJECT_INSTANCE_BEGIN, statement, run;
+   let $print_details= 1;
 }
 
 # Initialize variables
@@ -1190,6 +1229,7 @@ if(`SELECT COUNT(*) $part `)
    SELECT
    $column_list
    $part;
+   let $print_details= 1;
 }
 
 --echo # 4.5.2 Connects using for host the value 'localhost'
@@ -1231,6 +1271,7 @@ if(`SELECT COUNT(*) $part `)
    SELECT
    $column_list
    $part;
+   let $print_details= 1;
 }
 
 --echo # 4.5.2.2 For the instance with EVENT_NAME LIKE '%server_unix_socket'
@@ -1270,6 +1311,7 @@ if(`SELECT COUNT(*) $part `)
    SELECT
    $column_list
    $part;
+   let $print_details= 1;
 }
 
 --echo # 4.5.3 Connects using for host a value <> 'localhost'
@@ -1312,6 +1354,7 @@ if(`SELECT COUNT(*) $part `)
    SELECT
    $column_list
    $part;
+   let $print_details= 1;
 }
 
 --echo # 4.5.3.2 For the instance with EVENT_NAME LIKE '%server_tcpip_socket'
@@ -1352,6 +1395,7 @@ if(`SELECT COUNT(*) $part `)
    SELECT
    $column_list
    $part;
+   let $print_details= 1;
 }
 
 --echo # 4.5.4 Failing Connects do not cause any row with EVENT_NAME
@@ -1389,6 +1433,7 @@ if(`SELECT COUNT(*) $part`)
    SELECT
    $column_list
    $part;
+   let $print_details= 1;
 }
 
 --echo # 4.5.5 Successful Connects cause a new instance with EVENT_NAME
@@ -1447,6 +1492,7 @@ if(`SELECT COUNT(*) $part`)
      AND statement IN
          (SELECT statement
           $part);
+   let $print_details= 1;
 }
 
 --echo # 4.6 Check the differences caused by Connects
@@ -1494,6 +1540,7 @@ if(`SELECT NOT ( $my_rules) $part`)
    SELECT
    statement, SUM_NUMBER_OF_BYTES_WRITE
    $part;
+   let $print_details= 1;
 }
 
 --echo # 4.6.2 The SUM_OF_BYTES_WRITE value hast to be > 100.
@@ -1519,6 +1566,7 @@ if(`SELECT COUNT(*) $part`)
    SELECT
    statement, SUM_NUMBER_OF_BYTES_WRITE
    $part;
+   let $print_details= 1;
 }
 
 --echo # 4.6.3 COUNT_READ, COUNT_WRITE and COUNT_MISC have to be to be > 0
@@ -1545,6 +1593,7 @@ if(`SELECT COUNT(*) $part`)
    SELECT
    statement, COUNT_READ, COUNT_WRITE, COUNT_MISC
    $part;
+   let $print_details= 1;
 }
 
 --echo # 4.6.4 Checks based on comparison of results for connects
@@ -1588,6 +1637,7 @@ if(`SELECT NOT ($my_rules)
    eval
    $part1
    AND statement IN('$stmt2','$stmt1');
+   let $print_details= 1;
 }
 
 --echo # 4.6.5 The database name length affects the SUM_OF_BYTES_READ value
@@ -1613,6 +1663,7 @@ if(`SELECT NOT ($my_rules)
    eval
    $part1
    AND statement IN('$stmt2','$stmt1');
+   let $print_details= 1;
 }
 
 if($print_details)

No bundle (reason: useless for push emails).
Thread
bzr push into mysql-trunk branch (matthias.leich:3396 to 3397) Matthias Leich23 Aug