List:Commits« Previous MessageNext Message »
From:Mayank Prasad Date:April 6 2012 10:13am
Subject:bzr push into mysql-trunk branch (mayank.prasad:3847 to 3848) Bug#13919522
View as plain text  
 3848 Mayank Prasad	2012-04-06
      Bug#13919522 : BETTER DIGEST NORMALIZATION OF LIST OF VALUES WITH NULL.
      
      Details:
       - Added code to treat NULL a special case. When NULL is alone, it is 
         not normalized and treated as identifier. But when it is not, i.e.
         comes after/before a value ("NULL, 1" or "1, NULL" or "NULL, NULL")
         it is treated as other values and normlaized.

    modified:
      mysql-test/suite/perfschema/include/digest_cleanup.inc
      mysql-test/suite/perfschema/include/digest_execution.inc
      mysql-test/suite/perfschema/include/digest_setup.inc
      mysql-test/suite/perfschema/r/digest_table_full.result
      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
 3847 Jimmy Yang	2012-04-06
      Fix a simple compilation warning.

    modified:
      storage/innobase/include/ut0vec.ic
=== modified file 'mysql-test/suite/perfschema/include/digest_cleanup.inc'
--- a/mysql-test/suite/perfschema/include/digest_cleanup.inc	2012-02-12 21:48:28 +0000
+++ b/mysql-test/suite/perfschema/include/digest_cleanup.inc	2012-04-06 10:12:40 +0000
@@ -7,5 +7,6 @@ DROP TABLE IF EXISTS t2;
 DROP TABLE IF EXISTS t3;
 DROP TABLE IF EXISTS t4;
 DROP TABLE IF EXISTS t5;
+DROP TABLE IF EXISTS t6;
 DROP DATABASE IF EXISTS statements_digest;
 --enable_warnings

=== modified file 'mysql-test/suite/perfschema/include/digest_execution.inc'
--- a/mysql-test/suite/perfschema/include/digest_execution.inc	2012-02-20 13:32:56 +0000
+++ b/mysql-test/suite/perfschema/include/digest_execution.inc	2012-04-06 10:12:40 +0000
@@ -34,6 +34,19 @@ INSERT INTO t3 VALUES (1, 2), (3, 4), (5
 INSERT INTO t5 VALUES (1, 2, 3), (4, 5, 6), (7, 8, 9);
 
 # -----------------------------------------------------------------------
+# Test case to handle NULL. If alone, not normalized otherwise normalized. 
+# -----------------------------------------------------------------------
+INSERT INTO t1 VALUES (NULL);
+INSERT INTO t3 VALUES (NULL,NULL);
+INSERT INTO t3 VALUES (1,NULL);
+INSERT INTO t3 VALUES (NULL,1);
+INSERT INTO t6 VALUES (NULL, NULL, NULL, NULL);
+INSERT INTO t6 VALUES (1, NULL, NULL, NULL);
+INSERT INTO t6 VALUES (NULL, 2, NULL, NULL);
+INSERT INTO t6 VALUES (1, 2, 3, NULL);
+INSERT INTO t6 VALUES (1, 2, NULL, 4);
+
+# -----------------------------------------------------------------------
 # Test case for handling spaces in statement.
 # -----------------------------------------------------------------------
 
@@ -59,7 +72,6 @@ SELECT 1 /* This is an inline comment */
  */
  1;
 
-
 # -----------------------------------------------------------------------
 # Tests to show how the digest behaves with tokens that can have multiple
 # names (such as DATABASE = "DATABASE" or "SCHEMA", SUBSTRING, STD_SYM,
@@ -84,3 +96,5 @@ create table t11 (c char(4));
 --ERROR ER_TABLE_EXISTS_ERROR
 create table t11 (c char(4));
 insert into t11 values("MySQL");
+
+

=== modified file 'mysql-test/suite/perfschema/include/digest_setup.inc'
--- a/mysql-test/suite/perfschema/include/digest_setup.inc	2012-02-14 09:20:56 +0000
+++ b/mysql-test/suite/perfschema/include/digest_setup.inc	2012-04-06 10:12:40 +0000
@@ -17,5 +17,6 @@ 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);
+CREATE TABLE t6(a int, b int, c int, d int);
 --enable_warnings
 

=== modified file 'mysql-test/suite/perfschema/r/digest_table_full.result'
--- a/mysql-test/suite/perfschema/r/digest_table_full.result	2012-03-01 15:40:00 +0000
+++ b/mysql-test/suite/perfschema/r/digest_table_full.result	2012-04-06 10:12:40 +0000
@@ -8,6 +8,7 @@ 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);
+CREATE TABLE t6(a int, b int, c int, d int);
 TRUNCATE TABLE performance_schema.events_statements_summary_by_digest;
 ####################################
 # EXECUTION
@@ -35,6 +36,15 @@ 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);
+INSERT INTO t1 VALUES (NULL);
+INSERT INTO t3 VALUES (NULL,NULL);
+INSERT INTO t3 VALUES (1,NULL);
+INSERT INTO t3 VALUES (NULL,1);
+INSERT INTO t6 VALUES (NULL, NULL, NULL, NULL);
+INSERT INTO t6 VALUES (1, NULL, NULL, NULL);
+INSERT INTO t6 VALUES (NULL, 2, NULL, NULL);
+INSERT INTO t6 VALUES (1, 2, 3, NULL);
+INSERT INTO t6 VALUES (1, 2, NULL, 4);
 SELECT                                          1           +        1;
 1           +        1
 2
@@ -75,7 +85,7 @@ Warning	1265	Data truncated for column '
 SELECT DIGEST, DIGEST_TEXT, COUNT_STAR, SUM_ROWS_AFFECTED, SUM_WARNINGS,
 SUM_ERRORS FROM performance_schema.events_statements_summary_by_digest;
 DIGEST	DIGEST_TEXT	COUNT_STAR	SUM_ROWS_AFFECTED	SUM_WARNINGS	SUM_ERRORS
-NULL	NULL	29	21	1	2
+NULL	NULL	38	30	1	2
 dee8f4f04e57a5e456c31892855e6835	TRUNCATE TABLE performance_schema . events_statements_summary_by_digest  	1	0	0	0
 SHOW VARIABLES LIKE "performance_schema_digests_size";
 Variable_name	Value
@@ -91,4 +101,5 @@ DROP TABLE IF EXISTS t2;
 DROP TABLE IF EXISTS t3;
 DROP TABLE IF EXISTS t4;
 DROP TABLE IF EXISTS t5;
+DROP TABLE IF EXISTS t6;
 DROP DATABASE IF EXISTS statements_digest;

=== modified file 'mysql-test/suite/perfschema/r/start_server_no_digests.result'
--- a/mysql-test/suite/perfschema/r/start_server_no_digests.result	2012-02-20 13:32:56 +0000
+++ b/mysql-test/suite/perfschema/r/start_server_no_digests.result	2012-04-06 10:12:40 +0000
@@ -8,6 +8,7 @@ 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);
+CREATE TABLE t6(a int, b int, c int, d int);
 TRUNCATE TABLE performance_schema.events_statements_summary_by_digest;
 ####################################
 # EXECUTION
@@ -35,6 +36,15 @@ 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);
+INSERT INTO t1 VALUES (NULL);
+INSERT INTO t3 VALUES (NULL,NULL);
+INSERT INTO t3 VALUES (1,NULL);
+INSERT INTO t3 VALUES (NULL,1);
+INSERT INTO t6 VALUES (NULL, NULL, NULL, NULL);
+INSERT INTO t6 VALUES (1, NULL, NULL, NULL);
+INSERT INTO t6 VALUES (NULL, 2, NULL, NULL);
+INSERT INTO t6 VALUES (1, 2, 3, NULL);
+INSERT INTO t6 VALUES (1, 2, NULL, 4);
 SELECT                                          1           +        1;
 1           +        1
 2
@@ -89,4 +99,5 @@ DROP TABLE IF EXISTS t2;
 DROP TABLE IF EXISTS t3;
 DROP TABLE IF EXISTS t4;
 DROP TABLE IF EXISTS t5;
+DROP TABLE IF EXISTS t6;
 DROP DATABASE IF EXISTS statements_digest;

=== modified file 'mysql-test/suite/perfschema/r/statement_digest.result'
--- a/mysql-test/suite/perfschema/r/statement_digest.result	2012-03-01 15:40:00 +0000
+++ b/mysql-test/suite/perfschema/r/statement_digest.result	2012-04-06 10:12:40 +0000
@@ -8,6 +8,7 @@ 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);
+CREATE TABLE t6(a int, b int, c int, d int);
 TRUNCATE TABLE performance_schema.events_statements_summary_by_digest;
 ####################################
 # EXECUTION
@@ -35,6 +36,15 @@ 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);
+INSERT INTO t1 VALUES (NULL);
+INSERT INTO t3 VALUES (NULL,NULL);
+INSERT INTO t3 VALUES (1,NULL);
+INSERT INTO t3 VALUES (NULL,1);
+INSERT INTO t6 VALUES (NULL, NULL, NULL, NULL);
+INSERT INTO t6 VALUES (1, NULL, NULL, NULL);
+INSERT INTO t6 VALUES (NULL, 2, NULL, NULL);
+INSERT INTO t6 VALUES (1, 2, 3, NULL);
+INSERT INTO t6 VALUES (1, 2, NULL, 4);
 SELECT                                          1           +        1;
 1           +        1
 2
@@ -83,12 +93,14 @@ e7f8dc15f1156f57978116e457cc7488	SELECT
 3b8d5477aa795a19c9e9183e4ad04e6b	SELECT ?, ... FROM t2  	2	0	0	0
 5737343d989b1c42464fd3632614d25e	INSERT INTO t1 VALUES (?)  	1	1	0	0
 1e7fe109d5dd49394ee079690a029452	INSERT INTO t2 VALUES (?)  	1	1	0	0
-d63092ea2fa59316f398af6283bf80a5	INSERT INTO t3 VALUES (...)  	1	1	0	0
+d63092ea2fa59316f398af6283bf80a5	INSERT INTO t3 VALUES (...)  	4	4	0	0
 7383272b3a17c661872524713abae82f	INSERT INTO t4 VALUES (...)  	1	1	0	0
 42e8c9d8a502b06ac931886d3ff1ed1e	INSERT INTO t5 VALUES (...)  	1	1	0	0
 db545539039d269501474510fbc2da56	INSERT INTO t1 VALUES (?) /* , ... */  	2	7	0	0
 446dead39135f87b4fc4168f00dff254	INSERT INTO t3 VALUES (...) /* , ... */  	1	3	0	0
 3ec23fcc5b568c4ad359703ff996e0bd	INSERT INTO t5 VALUES (...) /* , ... */  	1	3	0	0
+d6eac9eb14e3e67fcd647c754f06e87f	INSERT INTO t1 VALUES ( NULL )  	1	1	0	0
+6a1b3810f32f521701aecb1cc695048d	INSERT INTO t6 VALUES (...)  	5	5	0	0
 6b473a776aa59140774b6ee689e68c9e	SELECT ? + ?  	3	0	0	0
 b608da273ea6dffe2120354f751cc8ba	SELECT ?  	1	0	0	0
 30046d97cfdc44c95bdaa7f3987d0a20	CREATE SCHEMA statements_digest_temp  	2	2	0	0
@@ -105,4 +117,5 @@ DROP TABLE IF EXISTS t2;
 DROP TABLE IF EXISTS t3;
 DROP TABLE IF EXISTS t4;
 DROP TABLE IF EXISTS t5;
+DROP TABLE IF EXISTS t6;
 DROP DATABASE IF EXISTS statements_digest;

=== modified file 'mysql-test/suite/perfschema/r/statement_digest_consumers.result'
--- a/mysql-test/suite/perfschema/r/statement_digest_consumers.result	2012-03-01 15:40:00 +0000
+++ b/mysql-test/suite/perfschema/r/statement_digest_consumers.result	2012-04-06 10:12:40 +0000
@@ -8,6 +8,7 @@ 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);
+CREATE TABLE t6(a int, b int, c int, d int);
 SELECT * FROM performance_schema.setup_consumers;
 NAME	ENABLED
 events_stages_current	YES
@@ -49,6 +50,15 @@ 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);
+INSERT INTO t1 VALUES (NULL);
+INSERT INTO t3 VALUES (NULL,NULL);
+INSERT INTO t3 VALUES (1,NULL);
+INSERT INTO t3 VALUES (NULL,1);
+INSERT INTO t6 VALUES (NULL, NULL, NULL, NULL);
+INSERT INTO t6 VALUES (1, NULL, NULL, NULL);
+INSERT INTO t6 VALUES (NULL, 2, NULL, NULL);
+INSERT INTO t6 VALUES (1, 2, 3, NULL);
+INSERT INTO t6 VALUES (1, 2, NULL, 4);
 SELECT                                          1           +        1;
 1           +        1
 2
@@ -96,12 +106,14 @@ e7f8dc15f1156f57978116e457cc7488	SELECT
 3b8d5477aa795a19c9e9183e4ad04e6b	SELECT ?, ... FROM t2  	2
 5737343d989b1c42464fd3632614d25e	INSERT INTO t1 VALUES (?)  	1
 1e7fe109d5dd49394ee079690a029452	INSERT INTO t2 VALUES (?)  	1
-d63092ea2fa59316f398af6283bf80a5	INSERT INTO t3 VALUES (...)  	1
+d63092ea2fa59316f398af6283bf80a5	INSERT INTO t3 VALUES (...)  	4
 7383272b3a17c661872524713abae82f	INSERT INTO t4 VALUES (...)  	1
 42e8c9d8a502b06ac931886d3ff1ed1e	INSERT INTO t5 VALUES (...)  	1
 db545539039d269501474510fbc2da56	INSERT INTO t1 VALUES (?) /* , ... */  	2
 446dead39135f87b4fc4168f00dff254	INSERT INTO t3 VALUES (...) /* , ... */  	1
 3ec23fcc5b568c4ad359703ff996e0bd	INSERT INTO t5 VALUES (...) /* , ... */  	1
+d6eac9eb14e3e67fcd647c754f06e87f	INSERT INTO t1 VALUES ( NULL )  	1
+6a1b3810f32f521701aecb1cc695048d	INSERT INTO t6 VALUES (...)  	5
 6b473a776aa59140774b6ee689e68c9e	SELECT ? + ?  	3
 b608da273ea6dffe2120354f751cc8ba	SELECT ?  	1
 30046d97cfdc44c95bdaa7f3987d0a20	CREATE SCHEMA statements_digest_temp  	2
@@ -120,4 +132,5 @@ DROP TABLE IF EXISTS t2;
 DROP TABLE IF EXISTS t3;
 DROP TABLE IF EXISTS t4;
 DROP TABLE IF EXISTS t5;
+DROP TABLE IF EXISTS t6;
 DROP DATABASE IF EXISTS statements_digest;

=== modified file 'mysql-test/suite/perfschema/r/statement_digest_consumers2.result'
--- a/mysql-test/suite/perfschema/r/statement_digest_consumers2.result	2012-02-20 13:32:56 +0000
+++ b/mysql-test/suite/perfschema/r/statement_digest_consumers2.result	2012-04-06 10:12:40 +0000
@@ -8,6 +8,7 @@ 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);
+CREATE TABLE t6(a int, b int, c int, d int);
 SELECT * FROM performance_schema.setup_consumers;
 NAME	ENABLED
 events_stages_current	YES
@@ -49,6 +50,15 @@ 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);
+INSERT INTO t1 VALUES (NULL);
+INSERT INTO t3 VALUES (NULL,NULL);
+INSERT INTO t3 VALUES (1,NULL);
+INSERT INTO t3 VALUES (NULL,1);
+INSERT INTO t6 VALUES (NULL, NULL, NULL, NULL);
+INSERT INTO t6 VALUES (1, NULL, NULL, NULL);
+INSERT INTO t6 VALUES (NULL, 2, NULL, NULL);
+INSERT INTO t6 VALUES (1, 2, 3, NULL);
+INSERT INTO t6 VALUES (1, 2, NULL, 4);
 SELECT                                          1           +        1;
 1           +        1
 2
@@ -99,4 +109,5 @@ DROP TABLE IF EXISTS t2;
 DROP TABLE IF EXISTS t3;
 DROP TABLE IF EXISTS t4;
 DROP TABLE IF EXISTS t5;
+DROP TABLE IF EXISTS t6;
 DROP DATABASE IF EXISTS statements_digest;

=== modified file 'storage/perfschema/pfs_digest.cc'
--- a/storage/perfschema/pfs_digest.cc	2012-04-03 21:19:04 +0000
+++ b/storage/perfschema/pfs_digest.cc	2012-04-06 10:12:40 +0000
@@ -578,19 +578,23 @@ PSI_digest_locker* pfs_digest_add_token_
         TOK_PFS_GENERIC_VALUE := BIN_NUM | DECIMAL_NUM | ... | ULONGLONG_NUM
       */
       token= TOK_PFS_GENERIC_VALUE;
-
+    }
+    /* fall through */
+    case NULL_SYM:
+    {
       if ((last_token2 == TOK_PFS_GENERIC_VALUE ||
-           last_token2 == TOK_PFS_GENERIC_VALUE_LIST) &&
+           last_token2 == TOK_PFS_GENERIC_VALUE_LIST ||
+           last_token2 == NULL_SYM) &&
           (last_token == ','))
       {
         /*
           REDUCE:
           TOK_PFS_GENERIC_VALUE_LIST :=
-            TOK_PFS_GENERIC_VALUE ',' TOK_PFS_GENERIC_VALUE
+            (TOK_PFS_GENERIC_VALUE|NULL_SYM) ',' (TOK_PFS_GENERIC_VALUE|NULL_SYM)
           
           REDUCE:
           TOK_PFS_GENERIC_VALUE_LIST :=
-            TOK_PFS_GENERIC_VALUE_LIST ',' TOK_PFS_GENERIC_VALUE
+            TOK_PFS_GENERIC_VALUE_LIST ',' (TOK_PFS_GENERIC_VALUE|NULL_SYM)
         */
         digest_storage->m_byte_count-= 2*PFS_SIZE_OF_A_TOKEN;
         token= TOK_PFS_GENERIC_VALUE_LIST;

No bundle (reason: useless for push emails).
Thread
bzr push into mysql-trunk branch (mayank.prasad:3847 to 3848) Bug#13919522Mayank Prasad10 Apr