From 6877425f2f41717a329d757a5f98c57b4e0c1eb5 Mon Sep 17 00:00:00 2001 From: Patrick Crews Date: Thu, 26 Feb 2009 10:57:33 +0200 Subject: [PATCH 1/5] Bug#41893: main.variables mysql-test fails if new variable like '%alloc%' is added. Started fix in 5.0 as the same issue is here. Revising queries used given what appears to be the scope of this test to only select the manipulated variables. Added tests for values that are / are not multiples of 1024 to test rounding / constraints. This behavior is not currently documented (docs bug has been opened) --- mysql-test/r/variables.result | 46 ++++++++++++++++++++++++++++++----- mysql-test/t/variables.test | 38 +++++++++++++++++++++++++---- 2 files changed, 73 insertions(+), 11 deletions(-) diff --git a/mysql-test/r/variables.result b/mysql-test/r/variables.result index 376a8ffa38e..04ccf3d688c 100644 --- a/mysql-test/r/variables.result +++ b/mysql-test/r/variables.result @@ -236,32 +236,66 @@ set @@rand_seed1=10000000,@@rand_seed2=1000000; select ROUND(RAND(),5); ROUND(RAND(),5) 0.02887 -show variables like '%alloc%'; + +==+ Testing %alloc% system variables +== +==+ NOTE: These values *must* be a multiple of 1024 +== +==+ Other values will be rounded down to nearest multiple +== + +==+ Show initial values +== +SHOW VARIABLES WHERE variable_name IN ('range_alloc_block_size', +'query_alloc_block_size', 'query_prealloc_size', +'transaction_alloc_block_size', 'transaction_prealloc_size'); Variable_name Value query_alloc_block_size 8192 query_prealloc_size 8192 range_alloc_block_size 4096 transaction_alloc_block_size 8192 transaction_prealloc_size 4096 -set @@range_alloc_block_size=1024*16; +==+ Manipulate variable values += +Testing values that are multiples of 1024 +set @@range_alloc_block_size=1024*15+1024; +set @@query_alloc_block_size=1024*15+1024*2; +set @@query_prealloc_size=1024*18-1024; +set @@transaction_alloc_block_size=1024*21-1024*1; +set @@transaction_prealloc_size=1024*21-2048; +==+ Check manipulated values ==+ +SHOW VARIABLES WHERE variable_name IN ('range_alloc_block_size', +'query_alloc_block_size', 'query_prealloc_size', +'transaction_alloc_block_size', 'transaction_prealloc_size'); +Variable_name Value +query_alloc_block_size 17408 +query_prealloc_size 17408 +range_alloc_block_size 16384 +transaction_alloc_block_size 20480 +transaction_prealloc_size 19456 +==+ Manipulate variable values +== +Testing values that are not 1024 multiples +set @@range_alloc_block_size=1024*16+1023; set @@query_alloc_block_size=1024*17+2; -set @@query_prealloc_size=1024*18; +set @@query_prealloc_size=1024*18-1023; set @@transaction_alloc_block_size=1024*20-1; set @@transaction_prealloc_size=1024*21-1; select @@query_alloc_block_size; @@query_alloc_block_size 17408 -show variables like '%alloc%'; +==+ Check manipulated values ==+ +SHOW VARIABLES WHERE variable_name IN ('range_alloc_block_size', +'query_alloc_block_size', 'query_prealloc_size', +'transaction_alloc_block_size', 'transaction_prealloc_size'); Variable_name Value query_alloc_block_size 17408 -query_prealloc_size 18432 +query_prealloc_size 17408 range_alloc_block_size 16384 transaction_alloc_block_size 19456 transaction_prealloc_size 20480 +==+ Set values back to the default values +== set @@range_alloc_block_size=default; set @@query_alloc_block_size=default, @@query_prealloc_size=default; set transaction_alloc_block_size=default, @@transaction_prealloc_size=default; -show variables like '%alloc%'; +==+ Check the values not that they are reset +== +SHOW VARIABLES WHERE variable_name IN ('range_alloc_block_size', +'query_alloc_block_size', 'query_prealloc_size', +'transaction_alloc_block_size', 'transaction_prealloc_size'); Variable_name Value query_alloc_block_size 8192 query_prealloc_size 8192 diff --git a/mysql-test/t/variables.test b/mysql-test/t/variables.test index 60254ad9a1d..173be9d87c6 100644 --- a/mysql-test/t/variables.test +++ b/mysql-test/t/variables.test @@ -150,18 +150,46 @@ select @@timestamp>0; set @@rand_seed1=10000000,@@rand_seed2=1000000; select ROUND(RAND(),5); -show variables like '%alloc%'; -set @@range_alloc_block_size=1024*16; +--echo +--echo ==+ Testing %alloc% system variables +== +--echo ==+ NOTE: These values *must* be a multiple of 1024 +== +--echo ==+ Other values will be rounded down to nearest multiple +== +--echo +--echo ==+ Show initial values +== +SHOW VARIABLES WHERE variable_name IN ('range_alloc_block_size', +'query_alloc_block_size', 'query_prealloc_size', +'transaction_alloc_block_size', 'transaction_prealloc_size'); +--echo ==+ Manipulate variable values += +--echo Testing values that are multiples of 1024 +set @@range_alloc_block_size=1024*15+1024; +set @@query_alloc_block_size=1024*15+1024*2; +set @@query_prealloc_size=1024*18-1024; +set @@transaction_alloc_block_size=1024*21-1024*1; +set @@transaction_prealloc_size=1024*21-2048; +--echo ==+ Check manipulated values ==+ +SHOW VARIABLES WHERE variable_name IN ('range_alloc_block_size', +'query_alloc_block_size', 'query_prealloc_size', +'transaction_alloc_block_size', 'transaction_prealloc_size'); +--echo ==+ Manipulate variable values +== +--echo Testing values that are not 1024 multiples +set @@range_alloc_block_size=1024*16+1023; set @@query_alloc_block_size=1024*17+2; -set @@query_prealloc_size=1024*18; +set @@query_prealloc_size=1024*18-1023; set @@transaction_alloc_block_size=1024*20-1; set @@transaction_prealloc_size=1024*21-1; select @@query_alloc_block_size; -show variables like '%alloc%'; +--echo ==+ Check manipulated values ==+ +SHOW VARIABLES WHERE variable_name IN ('range_alloc_block_size', +'query_alloc_block_size', 'query_prealloc_size', +'transaction_alloc_block_size', 'transaction_prealloc_size'); +--echo ==+ Set values back to the default values +== set @@range_alloc_block_size=default; set @@query_alloc_block_size=default, @@query_prealloc_size=default; set transaction_alloc_block_size=default, @@transaction_prealloc_size=default; -show variables like '%alloc%'; +--echo ==+ Check the values not that they are reset +== +SHOW VARIABLES WHERE variable_name IN ('range_alloc_block_size', +'query_alloc_block_size', 'query_prealloc_size', +'transaction_alloc_block_size', 'transaction_prealloc_size'); # # Bug #10904 Illegal mix of collations between From a7fe00afb5442800f54e50636c7ee829c8194d60 Mon Sep 17 00:00:00 2001 From: Magnus Svensson Date: Thu, 26 Feb 2009 15:01:57 +0100 Subject: [PATCH 2/5] Bug#43215 6 error codes changed from 5.1 to 6.0 sql/share/errmsg.txt: - Reserve released error codes in 5.1 --- sql/share/errmsg.txt | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/sql/share/errmsg.txt b/sql/share/errmsg.txt index 5dc75c340ea..23231eefcc2 100644 --- a/sql/share/errmsg.txt +++ b/sql/share/errmsg.txt @@ -6154,3 +6154,18 @@ WARN_PLUGIN_BUSY ER_VARIABLE_IS_READONLY eng "%s variable '%s' is read-only. Use SET %s to assign the value" + +ER_WARN_ENGINE_TRANSACTION_ROLLBACK + eng "Storage engine %s does not support rollback for this statement. Transaction rolled back and must be restarted" + +ER_SLAVE_HEARTBEAT_FAILURE + eng "Unexpected master's heartbeat data: %s" +ER_SLAVE_HEARTBEAT_VALUE_OUT_OF_RANGE + eng "The requested value for the heartbeat period %s %s" + +ER_NDB_REPLICATION_SCHEMA_ERROR + eng "Bad schema for mysql.ndb_replication table. Message: %-.64s" +ER_CONFLICT_FN_PARSE_ERROR + eng "Error in parsing conflict function. Message: %-.64s" +ER_EXCEPTIONS_WRITE_ERROR + eng "Write to exceptions table failed. Message: %-.128s"" From afdf8a447f538a20f61fc4d7cea26975da53e973 Mon Sep 17 00:00:00 2001 From: Patrick Crews Date: Thu, 26 Feb 2009 18:00:47 +0200 Subject: [PATCH 3/5] Bug#41893 - main.variables mysql-test fails if new variable like '%alloc%' is added. Fixed a typo in the bug fix patch. --- mysql-test/t/variables.test | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mysql-test/t/variables.test b/mysql-test/t/variables.test index 173be9d87c6..424776dfda4 100644 --- a/mysql-test/t/variables.test +++ b/mysql-test/t/variables.test @@ -186,7 +186,7 @@ SHOW VARIABLES WHERE variable_name IN ('range_alloc_block_size', set @@range_alloc_block_size=default; set @@query_alloc_block_size=default, @@query_prealloc_size=default; set transaction_alloc_block_size=default, @@transaction_prealloc_size=default; ---echo ==+ Check the values not that they are reset +== +--echo ==+ Check the values now that they are reset +== SHOW VARIABLES WHERE variable_name IN ('range_alloc_block_size', 'query_alloc_block_size', 'query_prealloc_size', 'transaction_alloc_block_size', 'transaction_prealloc_size'); From ee772168032cde8f6dc7abf8155f573ccd96afeb Mon Sep 17 00:00:00 2001 From: Georgi Kodinov Date: Fri, 27 Feb 2009 09:41:39 +0200 Subject: [PATCH 4/5] addendum to the fix for bug #41354: fixed the error returned by SELECT * --- mysql-test/r/grant2.result | 2 +- mysql-test/t/grant2.test | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/mysql-test/r/grant2.result b/mysql-test/r/grant2.result index 95748c89103..698e602e2e6 100644 --- a/mysql-test/r/grant2.result +++ b/mysql-test/r/grant2.result @@ -433,7 +433,7 @@ USE db1; SELECT c FROM t2; ERROR 42000: SELECT command denied to user 'mysqltest1'@'localhost' for column 'c' in table 't2' SELECT * FROM t2; -ERROR 42000: SELECT command denied to user 'mysqltest1'@'localhost' for column 'c' in table 't2' +ERROR 42000: SELECT command denied to user 'mysqltest1'@'localhost' for table 't2' SELECT * FROM t1 JOIN t2 USING (b); ERROR 42000: SELECT command denied to user 'mysqltest1'@'localhost' for column 'c' in table 't2' USE test; diff --git a/mysql-test/t/grant2.test b/mysql-test/t/grant2.test index 8f83c365170..2393bb1c6d8 100644 --- a/mysql-test/t/grant2.test +++ b/mysql-test/t/grant2.test @@ -615,7 +615,7 @@ connection conn1; USE db1; --error ER_COLUMNACCESS_DENIED_ERROR SELECT c FROM t2; ---error ER_COLUMNACCESS_DENIED_ERROR +--error ER_TABLEACCESS_DENIED_ERROR SELECT * FROM t2; --error ER_COLUMNACCESS_DENIED_ERROR SELECT * FROM t1 JOIN t2 USING (b); From 1f847d1604b9430356133aa379fe242cfc687cc5 Mon Sep 17 00:00:00 2001 From: Patrick Crews Date: Fri, 27 Feb 2009 10:24:57 +0200 Subject: [PATCH 5/5] Bug#41893: main.variables mysql-test fails in new variable like '%alloc%' is added. Added ORDER BY clause to I_S query to ensure consistent order. There were differences between 5.1 and 6.0 output. Correcting it 5.1. --- mysql-test/r/variables.result | 6 +++--- mysql-test/t/variables.test | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/mysql-test/r/variables.result b/mysql-test/r/variables.result index c99d3f314c5..0b56e3c1d52 100644 --- a/mysql-test/r/variables.result +++ b/mysql-test/r/variables.result @@ -318,13 +318,13 @@ transaction_prealloc_size 4096 SELECT * FROM information_schema.session_variables WHERE variable_name IN ('range_alloc_block_size', 'query_alloc_block_size', 'query_prealloc_size', -'transaction_alloc_block_size', 'transaction_prealloc_size'); +'transaction_alloc_block_size', 'transaction_prealloc_size') ORDER BY 1; VARIABLE_NAME VARIABLE_VALUE +QUERY_ALLOC_BLOCK_SIZE 8192 +QUERY_PREALLOC_SIZE 8192 RANGE_ALLOC_BLOCK_SIZE 4096 TRANSACTION_ALLOC_BLOCK_SIZE 8192 TRANSACTION_PREALLOC_SIZE 4096 -QUERY_PREALLOC_SIZE 8192 -QUERY_ALLOC_BLOCK_SIZE 8192 Testing values that are multiples of 1024 set @@range_alloc_block_size=1024*15+1024; set @@query_alloc_block_size=1024*15+1024*2; diff --git a/mysql-test/t/variables.test b/mysql-test/t/variables.test index 5cfa614f94a..6cd5abc3ea2 100644 --- a/mysql-test/t/variables.test +++ b/mysql-test/t/variables.test @@ -188,7 +188,7 @@ SHOW VARIABLES WHERE variable_name IN ('range_alloc_block_size', SELECT * FROM information_schema.session_variables WHERE variable_name IN ('range_alloc_block_size', 'query_alloc_block_size', 'query_prealloc_size', -'transaction_alloc_block_size', 'transaction_prealloc_size'); +'transaction_alloc_block_size', 'transaction_prealloc_size') ORDER BY 1; --echo Testing values that are multiples of 1024 set @@range_alloc_block_size=1024*15+1024; set @@query_alloc_block_size=1024*15+1024*2;