From c4fa6a3862dbb8009effc89997701e01de705411 Mon Sep 17 00:00:00 2001 From: "Tatiana A. Nurnberg" Date: Thu, 11 Nov 2010 11:35:48 +0000 Subject: Bug#43233: Some server variables are clipped during "update," not "check" stage Bug#55794: ulonglong options of mysqld show wrong values. Port the few remaining system variables to the correct mechanism -- range-check in check-stage (and throw error or warning at that point as needed and depending on STRICTness), update in update stage. Fix some signedness errors when retrieving sysvar values for display. mysql-test/r/variables.result: Show that we throw warnings or errors depending on strictness even for "special" variables now. mysql-test/t/variables.test: Show that we throw warnings or errors depending on strictness even for "special" variables now. sql/item_func.cc: show sys_var_ulonglong_ptr and SHOW_LONGLONG type variables as unsigned. sql/set_var.cc: move range-checking from update stage to check stage for the remaining few sys-vars that broke the pattern sql/set_var.h: add check functions. --- mysql-test/r/variables.result | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) (limited to 'mysql-test/r/variables.result') diff --git a/mysql-test/r/variables.result b/mysql-test/r/variables.result index a297dbfa502..58f88b78bda 100644 --- a/mysql-test/r/variables.result +++ b/mysql-test/r/variables.result @@ -1511,4 +1511,38 @@ SELECT @@skip_name_resolve; SHOW VARIABLES LIKE 'skip_name_resolve'; Variable_name Value skip_name_resolve OFF +# +# Bug #43233 : Some server variables are clipped during "update," +# not "check" stage +# +SET @kbs=@@global.key_buffer_size; +SET @kcbs=@@global.key_cache_block_size; +throw errors in STRICT mode +SET SQL_MODE=STRICT_ALL_TABLES; +SET @@global.max_binlog_cache_size=-1; +ERROR 42000: Variable 'max_binlog_cache_size' can't be set to the value of '-1' +SET @@global.max_join_size=0; +ERROR 42000: Variable 'max_join_size' can't be set to the value of '0' +SET @@global.key_buffer_size=0; +ERROR 42000: Variable 'key_buffer_size' can't be set to the value of '0' +SET @@global.key_cache_block_size=0; +ERROR 42000: Variable 'key_cache_block_size' can't be set to the value of '0' +throw warnings in default mode +SET SQL_MODE=DEFAULT; +SET @@global.max_binlog_cache_size=-1; +Warnings: +Warning 1292 Truncated incorrect max_binlog_cache_size value: '-1' +SET @@global.max_join_size=0; +Warnings: +Warning 1292 Truncated incorrect max_join_size value: '0' +SET @@global.key_buffer_size=0; +Warnings: +Warning 1292 Truncated incorrect key_buffer_size value: '0' +SET @@global.key_cache_block_size=0; +Warnings: +Warning 1292 Truncated incorrect key_cache_block_size value: '0' +SET @@global.max_binlog_cache_size=DEFAULT; +SET @@global.max_join_size=DEFAULT; +SET @@global.key_buffer_size=@kbs; +SET @@global.key_cache_block_size=@kcbs; End of 5.1 tests -- cgit v1.2.1 From 7336ac45b77bb8f794de3c37d6aa4864c02c6c57 Mon Sep 17 00:00:00 2001 From: "Tatiana A. Nurnberg" Date: Thu, 25 Nov 2010 03:11:05 +0000 Subject: Assorted post-merge fixes, clean-up, integration, compat with 5.6. 43233/55794. mysql-test/r/change_user.result: Don't use -1 integer wrap around. It used to work, but now we do what's actually in the documentation. In tests, we now use DEFAULT or the numeral equivalent (as we do in the 5.6 tests). mysql-test/r/key_cache.result: Can't drop default key case is an error now, not a warning, for compatibility with 5.6. mysql-test/r/variables.result: Can't drop default key case is an error now, not a warning, for compatibility with 5.6. mysql-test/t/change_user.test: Don't use -1 integer wrap around. It used to work, but now we do what's actually in the documentation. In tests, we now use DEFAULT or the numeral equivalent (as we do in the 5.6 tests). mysql-test/t/key_cache.test: Can't drop default key case is an error now, not a warning, for compatibility with 5.6. mysql-test/t/variables.test: Can't drop default key case is an error now, not a warning, for compatibility with 5.6. sql/mysqld.cc: 0 is a legal (albeit magic) value: "drop key cache." sql/set_var.cc: bound_unsigned() can go now, it was just a kludge until things are done The Right Way, which they are now. Can't drop default key case is an error now, not a warning, for compatibility with 5.6. tests/mysql_client_test.c: Don't use -1 integer wrap around. It used to work, but now we do what's actually in the documentation. In tests, we now use DEFAULT or the numeral equivalent (as we do in the 5.6 tests). --- mysql-test/r/variables.result | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'mysql-test/r/variables.result') diff --git a/mysql-test/r/variables.result b/mysql-test/r/variables.result index 58f88b78bda..20f41c4a83c 100644 --- a/mysql-test/r/variables.result +++ b/mysql-test/r/variables.result @@ -1524,7 +1524,7 @@ ERROR 42000: Variable 'max_binlog_cache_size' can't be set to the value of '-1' SET @@global.max_join_size=0; ERROR 42000: Variable 'max_join_size' can't be set to the value of '0' SET @@global.key_buffer_size=0; -ERROR 42000: Variable 'key_buffer_size' can't be set to the value of '0' +ERROR HY000: Cannot drop default keycache SET @@global.key_cache_block_size=0; ERROR 42000: Variable 'key_cache_block_size' can't be set to the value of '0' throw warnings in default mode @@ -1536,8 +1536,7 @@ SET @@global.max_join_size=0; Warnings: Warning 1292 Truncated incorrect max_join_size value: '0' SET @@global.key_buffer_size=0; -Warnings: -Warning 1292 Truncated incorrect key_buffer_size value: '0' +ERROR HY000: Cannot drop default keycache SET @@global.key_cache_block_size=0; Warnings: Warning 1292 Truncated incorrect key_cache_block_size value: '0' -- cgit v1.2.1