From 18d14b3a85dfcadacb5a8e33ead4bc8d5bf29d95 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 6 Dec 2007 15:05:24 -0700 Subject: [PATCH 1/3] ctype-simple.c: Backport quick fix to remove Windows compiler warnings strings/ctype-simple.c: Backport quick fix to remove Windows compiler warnings. --- strings/ctype-simple.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/strings/ctype-simple.c b/strings/ctype-simple.c index 0355803daa8..d497eec4550 100644 --- a/strings/ctype-simple.c +++ b/strings/ctype-simple.c @@ -802,7 +802,7 @@ int my_long10_to_str_8bit(CHARSET_INFO *cs __attribute__((unused)), { if (val < 0) { - val= -(unsigned long int)val; + val= ULL(0) - (unsigned long int)val; *dst++= '-'; len--; sign= 1; @@ -838,7 +838,7 @@ int my_longlong10_to_str_8bit(CHARSET_INFO *cs __attribute__((unused)), { if (val < 0) { - val = -(ulonglong)val; + val = ULL(0) - (ulonglong)val; *dst++= '-'; len--; sign= 1; From 2632dbf6ebdf70748483e1d3bc0a4c0e0285ec61 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 6 Dec 2007 16:11:26 -0700 Subject: [PATCH 2/3] Fix compiler warning about wrong integer size (probably harmless) sql/sql_select.cc: Fix compiler warning (probably harmless, wrong integer size) --- sql/sql_select.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sql/sql_select.cc b/sql/sql_select.cc index 2ca4b73a115..5699f1d1868 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -8991,7 +8991,7 @@ static Field *create_tmp_field_from_item(THD *thd, Item *item, TABLE *table, { uint8 dec= item->decimals; uint8 intg= ((Item_decimal *) item)->decimal_precision() - dec; - uint8 len= item->max_length; + uint32 len= item->max_length; /* Trying to put too many digits overall in a DECIMAL(prec,dec) From 7d3a61e1f02ce2e890ab9825a791a1f075f31997 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 7 Dec 2007 03:39:37 -0700 Subject: [PATCH 3/3] Make tests more robust (clean up better after grant.test) mysql-test/r/grant.result: Update test results to .test changes mysql-test/t/grant.test: Drop users when done with them, to avoid skewing results of later tests. For example, running some test which examines the cardinality of the mysql.user table would fail if run right after this test, due to the extra users. --- mysql-test/r/grant.result | 2 ++ mysql-test/t/grant.test | 2 ++ 2 files changed, 4 insertions(+) diff --git a/mysql-test/r/grant.result b/mysql-test/r/grant.result index 855352a2195..e27ef64af43 100644 --- a/mysql-test/r/grant.result +++ b/mysql-test/r/grant.result @@ -1105,6 +1105,7 @@ ERROR 42000: SELECT command denied to user 'mysqltest_2'@'localhost' for table ' DROP DATABASE mysqltest1; DROP DATABASE mysqltest2; DROP USER mysqltest_1@localhost; +DROP USER mysqltest_2@localhost; use test; CREATE TABLE t1 (f1 int, f2 int); INSERT INTO t1 VALUES(1,1), (2,2); @@ -1124,6 +1125,7 @@ f1 f2 REVOKE UPDATE (f1) ON `test`.`t1` FROM 'mysqltest_1'@'localhost'; REVOKE SELECT ON `test`.* FROM 'mysqltest_1'@'localhost'; REVOKE ALL ON db27878.* FROM 'mysqltest_1'@'localhost'; +DROP USER mysqltest_1@localhost; DROP DATABASE db27878; use test; DROP TABLE t1; diff --git a/mysql-test/t/grant.test b/mysql-test/t/grant.test index 1d11a669811..ed95d90c8f8 100644 --- a/mysql-test/t/grant.test +++ b/mysql-test/t/grant.test @@ -1122,6 +1122,7 @@ DROP DATABASE mysqltest1; DROP DATABASE mysqltest2; DROP USER mysqltest_1@localhost; +DROP USER mysqltest_2@localhost; # # Bug#27878: Unchecked privileges on a view referring to a table from another @@ -1147,6 +1148,7 @@ connection default; REVOKE UPDATE (f1) ON `test`.`t1` FROM 'mysqltest_1'@'localhost'; REVOKE SELECT ON `test`.* FROM 'mysqltest_1'@'localhost'; REVOKE ALL ON db27878.* FROM 'mysqltest_1'@'localhost'; +DROP USER mysqltest_1@localhost; DROP DATABASE db27878; use test; DROP TABLE t1;