From 39616eb9ef974c69e73bcb80cd7e3c40228910fd Mon Sep 17 00:00:00 2001 From: Michael Widenius Date: Wed, 23 Feb 2011 02:06:58 +0200 Subject: [PATCH] Fixed compiler warnings and some test failures found by buildbot dbug/dbug.c: Fixed compiler warnings on windows mysql-test/r/index_intersect_innodb.result: Don't print number of rows as this varies mysql-test/suite/funcs_1/r/processlist_val_no_prot.result: Update to use new State mysql-test/suite/handler/heap.result: Update results mysql-test/suite/handler/heap.test: Changed key used in test as the key 'b' will not guarantee order of the two last elements (as the key value is the same) mysql-test/suite/pbxt/r/lock_multi.result: Update to use new State mysql-test/t/index_intersect.test: Don't print number of rows as this varies mysql-test/valgrind.supp: Added suppression for linux mysys/hash.c: Fixed compiler warnings on windows plugin/handler_socket/handlersocket/database.cpp: Fixed compiler warnings sql-common/client_plugin.c: Changed variable to define to avoid compiler warnings when variable is not used sql-common/my_time.c: Initialize all my_time elements to avoid compiler warnings storage/oqgraph/ha_oqgraph.cc: Use right function (to avoid compiler warning) storage/pbxt/src/table_xt.cc: Initialize variables (to avoid compiler warnings) --- dbug/dbug.c | 6 +-- mysql-test/r/index_intersect_innodb.result | 44 +++++++++---------- .../funcs_1/r/processlist_val_no_prot.result | 6 +-- mysql-test/suite/handler/heap.result | 20 ++++----- mysql-test/suite/handler/heap.test | 4 +- mysql-test/suite/pbxt/r/lock_multi.result | 2 +- mysql-test/t/index_intersect.test | 22 ++++++++++ mysql-test/valgrind.supp | 15 +++++++ mysys/hash.c | 19 ++++---- .../handler_socket/handlersocket/database.cpp | 5 +-- sql-common/client_plugin.c | 3 +- sql-common/my_time.c | 4 ++ storage/oqgraph/ha_oqgraph.cc | 2 +- storage/pbxt/src/table_xt.cc | 4 +- 14 files changed, 100 insertions(+), 56 deletions(-) diff --git a/dbug/dbug.c b/dbug/dbug.c index 490c91cbf0f..afed84a1c01 100644 --- a/dbug/dbug.c +++ b/dbug/dbug.c @@ -1481,7 +1481,7 @@ next: subdir=0; while (ctlp < end && *ctlp != ',') ctlp++; - len=ctlp-start; + len= (int) (ctlp-start); if (start[len-1] == '/') { len--; @@ -1544,7 +1544,7 @@ static struct link *ListCopy(struct link *orig) { struct link *new_malloc; struct link *head; - int len; + size_t len; head= NULL; while (orig != NULL) @@ -1999,7 +1999,7 @@ static void DBUGOpenFile(CODE_STATE *cs, { if (end) { - int len=end-name; + int len= (int) (end-name); memcpy(cs->stack->name, name, len); cs->stack->name[len]=0; } diff --git a/mysql-test/r/index_intersect_innodb.result b/mysql-test/r/index_intersect_innodb.result index 0aac6452b8f..4fbdb3b70fa 100644 --- a/mysql-test/r/index_intersect_innodb.result +++ b/mysql-test/r/index_intersect_innodb.result @@ -65,22 +65,22 @@ EXPLAIN SELECT * FROM City WHERE Name LIKE 'C%' AND Population > 1000000; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE City index_merge Population,Name Population,Name 4,35 NULL 16 Using sort_intersect(Population,Name); Using where +1 SIMPLE City index_merge Population,Name Population,Name 4,35 NULL # Using sort_intersect(Population,Name); Using where EXPLAIN SELECT * FROM City WHERE Name LIKE 'M%' AND Population > 1500000; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE City index_merge Population,Name Population,Name 4,35 NULL 9 Using sort_intersect(Population,Name); Using where +1 SIMPLE City index_merge Population,Name Population,Name 4,35 NULL # Using sort_intersect(Population,Name); Using where EXPLAIN SELECT * FROM City WHERE Name LIKE 'M%' AND Population > 300000; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE City index_merge Population,Name Name,Population 35,4 NULL 79 Using sort_intersect(Name,Population); Using where +1 SIMPLE City index_merge Population,Name Name,Population 35,4 NULL # Using sort_intersect(Name,Population); Using where EXPLAIN SELECT * FROM City WHERE Name LIKE 'M%' AND Population > 7000000; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE City index_merge Population,Name Population,Name 4,35 NULL 1 Using sort_intersect(Population,Name); Using where +1 SIMPLE City index_merge Population,Name Population,Name 4,35 NULL # Using sort_intersect(Population,Name); Using where SELECT * FROM City USE INDEX () WHERE Name LIKE 'C%' AND Population > 1000000; ID Name Country Population @@ -362,17 +362,17 @@ EXPLAIN SELECT * FROM City WHERE Name BETWEEN 'M' AND 'N' AND Population > 1000000 AND Country LIKE 'C%'; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE City index_merge Population,Country,Name Population,Name,Country 4,35,3 NULL 2 Using sort_intersect(Population,Name,Country); Using where +1 SIMPLE City index_merge Population,Country,Name Population,Name,Country 4,35,3 NULL # Using sort_intersect(Population,Name,Country); Using where EXPLAIN SELECT * FROM City WHERE Name BETWEEN 'G' AND 'J' AND Population > 1000000 AND Country LIKE 'B%'; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE City index_merge Population,Country,Name Population,Country,Name 4,3,35 NULL 2 Using sort_intersect(Population,Country,Name); Using where +1 SIMPLE City index_merge Population,Country,Name Population,Country,Name 4,3,35 NULL # Using sort_intersect(Population,Country,Name); Using where EXPLAIN SELECT * FROM City WHERE Name BETWEEN 'G' AND 'K' AND Population > 500000 AND Country LIKE 'C%'; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE City index_merge Population,Country,Name Population,Name,Country 4,35,3 NULL 26 Using sort_intersect(Population,Name,Country); Using where +1 SIMPLE City index_merge Population,Country,Name Population,Name,Country 4,35,3 NULL # Using sort_intersect(Population,Name,Country); Using where SELECT * FROM City USE INDEX () WHERE Name BETWEEN 'M' AND 'N' AND Population > 1000000 AND Country LIKE 'C%'; ID Name Country Population @@ -463,29 +463,29 @@ EXPLAIN SELECT * FROM City WHERE ID BETWEEN 501 AND 1000 AND Population > 700000 AND Country LIKE 'C%'; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE City index_merge PRIMARY,Population,Country PRIMARY,Country,Population 4,3,4 NULL 11 Using sort_intersect(PRIMARY,Country,Population); Using where +1 SIMPLE City index_merge PRIMARY,Population,Country PRIMARY,Country,Population 4,3,4 NULL # Using sort_intersect(PRIMARY,Country,Population); Using where EXPLAIN SELECT * FROM City WHERE ID BETWEEN 1 AND 500 AND Population > 1000000 AND Country LIKE 'A%'; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE City index_merge PRIMARY,Population,Country PRIMARY,Population,Country 4,4,3 NULL 1 Using sort_intersect(PRIMARY,Population,Country); Using where +1 SIMPLE City index_merge PRIMARY,Population,Country PRIMARY,Population,Country 4,4,3 NULL # Using sort_intersect(PRIMARY,Population,Country); Using where EXPLAIN SELECT * FROM City WHERE ID BETWEEN 2001 AND 2500 AND Population > 300000 AND Country LIKE 'H%'; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE City index_merge PRIMARY,Population,Country PRIMARY,Country 4,3 NULL 7 Using sort_intersect(PRIMARY,Country); Using where +1 SIMPLE City index_merge PRIMARY,Population,Country PRIMARY,Country 4,3 NULL # Using sort_intersect(PRIMARY,Country); Using where EXPLAIN SELECT * FROM City WHERE ID BETWEEN 3701 AND 4000 AND Population > 1000000 AND Country BETWEEN 'S' AND 'Z'; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE City index_merge PRIMARY,Population,Country PRIMARY,Country,Population 4,3,4 NULL 2 Using sort_intersect(PRIMARY,Country,Population); Using where +1 SIMPLE City index_merge PRIMARY,Population,Country PRIMARY,Country,Population 4,3,4 NULL # Using sort_intersect(PRIMARY,Country,Population); Using where EXPLAIN SELECT * FROM City WHERE ID BETWEEN 3001 AND 4000 AND Population > 600000 AND Country BETWEEN 'S' AND 'Z' ; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE City index_merge PRIMARY,Population,Country PRIMARY,Population,Country 4,4,3 NULL 30 Using sort_intersect(PRIMARY,Population,Country); Using where +1 SIMPLE City index_merge PRIMARY,Population,Country PRIMARY,Population,Country 4,4,3 NULL # Using sort_intersect(PRIMARY,Population,Country); Using where SELECT * FROM City USE INDEX () WHERE ID BETWEEN 501 AND 1000 AND Population > 700000 AND Country LIKE 'C%'; ID Name Country Population @@ -719,33 +719,33 @@ EXPLAIN SELECT * FROM City WHERE Name LIKE 'C%' AND Population > 1000000; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE City index_merge Population,Name Population,Name 4,35 NULL 16 Using sort_intersect(Population,Name); Using where +1 SIMPLE City index_merge Population,Name Population,Name 4,35 NULL # Using sort_intersect(Population,Name); Using where EXPLAIN SELECT * FROM City WHERE Name LIKE 'M%' AND Population > 1500000; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE City index_merge Population,Name Population,Name 4,35 NULL 9 Using sort_intersect(Population,Name); Using where +1 SIMPLE City index_merge Population,Name Population,Name 4,35 NULL # Using sort_intersect(Population,Name); Using where EXPLAIN SELECT * FROM City WHERE Name BETWEEN 'G' AND 'J' AND Population > 1000000 AND Country LIKE 'B%'; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE City index_merge Population,Country,Name Population,Country,Name 4,3,35 NULL 2 Using sort_intersect(Population,Country,Name); Using where +1 SIMPLE City index_merge Population,Country,Name Population,Country,Name 4,3,35 NULL # Using sort_intersect(Population,Country,Name); Using where EXPLAIN SELECT * FROM City WHERE Name BETWEEN 'G' AND 'J' AND Population > 500000 AND Country LIKE 'C%'; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE City index_merge Population,Country,Name Name,Population,Country 35,4,3 NULL 7 Using sort_intersect(Name,Population,Country); Using where +1 SIMPLE City index_merge Population,Country,Name Name,Population,Country 35,4,3 NULL # Using sort_intersect(Name,Population,Country); Using where EXPLAIN SELECT * FROM City WHERE ID BETWEEN 1 AND 500 AND Population > 1000000 AND Country LIKE 'A%'; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE City index_merge PRIMARY,Population,Country PRIMARY,Population,Country 4,4,3 NULL 1 Using sort_intersect(PRIMARY,Population,Country); Using where +1 SIMPLE City index_merge PRIMARY,Population,Country PRIMARY,Population,Country 4,4,3 NULL # Using sort_intersect(PRIMARY,Population,Country); Using where EXPLAIN SELECT * FROM City WHERE ID BETWEEN 3001 AND 4000 AND Population > 600000 AND Country BETWEEN 'S' AND 'Z'; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE City index_merge PRIMARY,Population,Country PRIMARY,Country,Population 4,3,4 NULL 30 Using sort_intersect(PRIMARY,Country,Population); Using where +1 SIMPLE City index_merge PRIMARY,Population,Country PRIMARY,Country,Population 4,3,4 NULL # Using sort_intersect(PRIMARY,Country,Population); Using where SELECT * FROM City WHERE Name LIKE 'C%' AND Population > 1000000; ID Name Country Population @@ -886,17 +886,17 @@ EXPLAIN SELECT * FROM City WHERE Country LIKE 'M%' AND Population > 1000000; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE City index_merge Population,CountryID,CountryName Population,CountryID 4,3 NULL 16 Using sort_intersect(Population,CountryID); Using where +1 SIMPLE City index_merge Population,CountryID,CountryName Population,CountryID 4,3 NULL # Using sort_intersect(Population,CountryID); Using where EXPLAIN SELECT * FROM City WHERE Country='CHN' AND Population > 1500000; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE City index_merge Population,CountryID,CountryName Population,CountryID 4,3 NULL 11 Using sort_intersect(Population,CountryID); Using where +1 SIMPLE City index_merge Population,CountryID,CountryName Population,CountryID 4,3 NULL # Using sort_intersect(Population,CountryID); Using where EXPLAIN SELECT * FROM City WHERE Country='CHN' AND Population > 1500000 AND Name LIKE 'C%'; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE City index_merge Population,Name,CountryID,CountryName CountryName,Population 38,4 NULL 1 Using sort_intersect(CountryName,Population); Using where +1 SIMPLE City index_merge Population,Name,CountryID,CountryName CountryName,Population 38,4 NULL # Using sort_intersect(CountryName,Population); Using where SELECT * FROM City USE INDEX () WHERE Country LIKE 'M%' AND Population > 1000000; ID Name Country Population @@ -1026,7 +1026,7 @@ EXPLAIN SELECT * FROM t1 WHERE (f1 < 535 OR f1 > 985) AND ( f4='r' OR f4 LIKE 'a%' ) ; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 index_merge PRIMARY,f4 PRIMARY,f4 4,35 NULL 1 Using sort_intersect(PRIMARY,f4); Using where +1 SIMPLE t1 index_merge PRIMARY,f4 PRIMARY,f4 4,35 NULL # Using sort_intersect(PRIMARY,f4); Using where SELECT * FROM t1 WHERE (f1 < 535 OR f1 > 985) AND ( f4='r' OR f4 LIKE 'a%' ) ; f1 f4 f5 diff --git a/mysql-test/suite/funcs_1/r/processlist_val_no_prot.result b/mysql-test/suite/funcs_1/r/processlist_val_no_prot.result index 431133cd2c8..aa554553f7f 100644 --- a/mysql-test/suite/funcs_1/r/processlist_val_no_prot.result +++ b/mysql-test/suite/funcs_1/r/processlist_val_no_prot.result @@ -194,11 +194,11 @@ LOCK TABLE test.t1 WRITE; SELECT COUNT(*) FROM test.t1; # ----- switch to connection default (user = root) ----- -# Poll till INFO is no more NULL and State = 'Locked'. +# Poll till INFO is no more NULL and State = "Table Lock". SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST; ID USER HOST DB COMMAND TIME STATE INFO TIME_MS - test_user information_schema Query