Commit 3a15cb6c authored by Tatiana A. Nurnberg's avatar Tatiana A. Nurnberg

Assorted post-merge fixes, clean-up, integration, compat with 5.6.

43233/55794.
parent 9ab7421b
...@@ -18,7 +18,7 @@ change_user ...@@ -18,7 +18,7 @@ change_user
SELECT @@session.sql_big_selects; SELECT @@session.sql_big_selects;
@@session.sql_big_selects @@session.sql_big_selects
0 0
SET @@global.max_join_size = -1; SET @@global.max_join_size = 18446744073709551615;
SET @@session.max_join_size = default; SET @@session.max_join_size = default;
change_user change_user
SELECT @@session.sql_big_selects; SELECT @@session.sql_big_selects;
......
...@@ -334,8 +334,7 @@ test.t1 check status OK ...@@ -334,8 +334,7 @@ test.t1 check status OK
DROP TABLE t1,t2; DROP TABLE t1,t2;
set global key_cache_block_size= @my_key_cache_block_size; set global key_cache_block_size= @my_key_cache_block_size;
set @@global.key_buffer_size=0; set @@global.key_buffer_size=0;
Warnings: ERROR HY000: Cannot drop default keycache
Warning 1438 Cannot drop default keycache
select @@global.key_buffer_size; select @@global.key_buffer_size;
@@global.key_buffer_size @@global.key_buffer_size
2097152 2097152
......
...@@ -1524,7 +1524,7 @@ ERROR 42000: Variable 'max_binlog_cache_size' can't be set to the value of '-1' ...@@ -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; SET @@global.max_join_size=0;
ERROR 42000: Variable 'max_join_size' can't be set to the value of '0' ERROR 42000: Variable 'max_join_size' can't be set to the value of '0'
SET @@global.key_buffer_size=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; SET @@global.key_cache_block_size=0;
ERROR 42000: Variable 'key_cache_block_size' can't be set to the value of '0' ERROR 42000: Variable 'key_cache_block_size' can't be set to the value of '0'
throw warnings in default mode throw warnings in default mode
...@@ -1536,8 +1536,7 @@ SET @@global.max_join_size=0; ...@@ -1536,8 +1536,7 @@ SET @@global.max_join_size=0;
Warnings: Warnings:
Warning 1292 Truncated incorrect max_join_size value: '0' Warning 1292 Truncated incorrect max_join_size value: '0'
SET @@global.key_buffer_size=0; SET @@global.key_buffer_size=0;
Warnings: ERROR HY000: Cannot drop default keycache
Warning 1292 Truncated incorrect key_buffer_size value: '0'
SET @@global.key_cache_block_size=0; SET @@global.key_cache_block_size=0;
Warnings: Warnings:
Warning 1292 Truncated incorrect key_cache_block_size value: '0' Warning 1292 Truncated incorrect key_cache_block_size value: '0'
......
...@@ -20,7 +20,7 @@ SET @@session.max_join_size = default; ...@@ -20,7 +20,7 @@ SET @@session.max_join_size = default;
SELECT @@session.sql_big_selects; SELECT @@session.sql_big_selects;
# On some machines the following will result into a warning # On some machines the following will result into a warning
--disable_warnings --disable_warnings
SET @@global.max_join_size = -1; SET @@global.max_join_size = 18446744073709551615;
--enable_warnings --enable_warnings
SET @@session.max_join_size = default; SET @@session.max_join_size = default;
--echo change_user --echo change_user
......
...@@ -216,6 +216,7 @@ set global key_cache_block_size= @my_key_cache_block_size; ...@@ -216,6 +216,7 @@ set global key_cache_block_size= @my_key_cache_block_size;
# Bug#10473 - Can't set 'key_buffer_size' system variable to ZERO # Bug#10473 - Can't set 'key_buffer_size' system variable to ZERO
# (One cannot drop the default key cache.) # (One cannot drop the default key cache.)
# #
--error ER_WARN_CANT_DROP_DEFAULT_KEYCACHE
set @@global.key_buffer_size=0; set @@global.key_buffer_size=0;
select @@global.key_buffer_size; select @@global.key_buffer_size;
......
...@@ -1275,7 +1275,7 @@ SET @@global.max_binlog_cache_size=-1; ...@@ -1275,7 +1275,7 @@ SET @@global.max_binlog_cache_size=-1;
SET @@global.max_join_size=0; SET @@global.max_join_size=0;
# sys_var_key_buffer_size: "key_buffer_size" # sys_var_key_buffer_size: "key_buffer_size"
--error ER_WRONG_VALUE_FOR_VAR --error ER_WARN_CANT_DROP_DEFAULT_KEYCACHE
SET @@global.key_buffer_size=0; SET @@global.key_buffer_size=0;
# sys_var_key_cache_long: "key_cache_block_size" et al. # sys_var_key_cache_long: "key_cache_block_size" et al.
...@@ -1287,6 +1287,9 @@ SET SQL_MODE=DEFAULT; ...@@ -1287,6 +1287,9 @@ SET SQL_MODE=DEFAULT;
SET @@global.max_binlog_cache_size=-1; SET @@global.max_binlog_cache_size=-1;
SET @@global.max_join_size=0; SET @@global.max_join_size=0;
# this is an exception. since this is a new error/warning, let's stay
# compatible with the upcoming 5.6.
--error ER_WARN_CANT_DROP_DEFAULT_KEYCACHE
SET @@global.key_buffer_size=0; SET @@global.key_buffer_size=0;
SET @@global.key_cache_block_size=0; SET @@global.key_cache_block_size=0;
......
...@@ -6774,7 +6774,7 @@ thread is in the relay logs.", ...@@ -6774,7 +6774,7 @@ thread is in the relay logs.",
"as much as you can afford; 1GB on a 4GB machine that mainly runs MySQL is " "as much as you can afford; 1GB on a 4GB machine that mainly runs MySQL is "
"quite common.", "quite common.",
&dflt_key_cache_var.param_buff_size, NULL, NULL, (GET_ULL | GET_ASK_ADDR), &dflt_key_cache_var.param_buff_size, NULL, NULL, (GET_ULL | GET_ASK_ADDR),
REQUIRED_ARG, KEY_CACHE_SIZE, MALLOC_OVERHEAD, SIZE_T_MAX, MALLOC_OVERHEAD, REQUIRED_ARG, KEY_CACHE_SIZE, 0, SIZE_T_MAX, MALLOC_OVERHEAD,
IO_SIZE, 0}, IO_SIZE, 0},
{"key_cache_age_threshold", OPT_KEY_CACHE_AGE_THRESHOLD, {"key_cache_age_threshold", OPT_KEY_CACHE_AGE_THRESHOLD,
"This characterizes the number of hits a hot block has to be untouched " "This characterizes the number of hits a hot block has to be untouched "
......
...@@ -1423,44 +1423,6 @@ bool throw_bounds_warning(THD *thd, bool fixed, bool unsignd, ...@@ -1423,44 +1423,6 @@ bool throw_bounds_warning(THD *thd, bool fixed, bool unsignd,
} }
/**
check an unsigned user-supplied value for a systemvariable against bounds.
TODO: This is a wrapper function to call clipping from within an update()
function. Calling bounds from within update() is fair game in theory,
but we can only send warnings from in there, not errors, and besides,
it violates our model of separating check from update phase.
To avoid breaking out of the server with an ASSERT() in strict mode,
we pretend we're not in strict mode when we go through here. Bug#43233
was opened to remind us to replace this kludge with The Right Thing,
which of course is to do the check in the actual check phase, and then
throw an error or warning accordingly.
@param thd thread handle
@param num the value to limit
@param option_limits the bounds-record, or NULL if none
*/
static void bound_unsigned(THD *thd, ulonglong *num,
const struct my_option *option_limits)
{
if (option_limits)
{
my_bool fixed = FALSE;
ulonglong unadjusted= *num;
*num= getopt_ull_limit_value(unadjusted, option_limits, &fixed);
if (fixed)
{
ulong ssm= thd->variables.sql_mode;
thd->variables.sql_mode&= ~MODE_STRICT_ALL_TABLES;
throw_bounds_warning(thd, fixed, TRUE, option_limits->name, unadjusted);
thd->variables.sql_mode= ssm;
}
}
}
/** /**
Get unsigned system-variable. Get unsigned system-variable.
Negative value does not wrap around, but becomes zero. Negative value does not wrap around, but becomes zero.
...@@ -2359,9 +2321,8 @@ bool sys_var_key_buffer_size::update(THD *thd, set_var *var) ...@@ -2359,9 +2321,8 @@ bool sys_var_key_buffer_size::update(THD *thd, set_var *var)
{ {
if (key_cache == dflt_key_cache) if (key_cache == dflt_key_cache)
{ {
push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_WARN, error= 1;
ER_WARN_CANT_DROP_DEFAULT_KEYCACHE, my_error(ER_WARN_CANT_DROP_DEFAULT_KEYCACHE, MYF(0));
ER(ER_WARN_CANT_DROP_DEFAULT_KEYCACHE));
goto end; // Ignore default key cache goto end; // Ignore default key cache
} }
......
...@@ -17125,7 +17125,7 @@ static void test_bug20023() ...@@ -17125,7 +17125,7 @@ static void test_bug20023()
/* Set MAX_JOIN_SIZE to the default value (-1). */ /* Set MAX_JOIN_SIZE to the default value (-1). */
DIE_IF(mysql_query(&con, "SET @@global.max_join_size = -1")); DIE_IF(mysql_query(&con, "SET @@global.max_join_size = 18446744073709551615"));
DIE_IF(mysql_query(&con, "SET @@session.max_join_size = default")); DIE_IF(mysql_query(&con, "SET @@session.max_join_size = default"));
/* Issue COM_CHANGE_USER. */ /* Issue COM_CHANGE_USER. */
...@@ -17156,7 +17156,7 @@ static void test_bug20023() ...@@ -17156,7 +17156,7 @@ static void test_bug20023()
DIE_IF(mysql_query(&con, query_buffer)); DIE_IF(mysql_query(&con, query_buffer));
DIE_IF(mysql_query(&con, "SET @@global.max_join_size = -1")); DIE_IF(mysql_query(&con, "SET @@global.max_join_size = 18446744073709551615"));
DIE_IF(mysql_query(&con, "SET @@session.max_join_size = default")); DIE_IF(mysql_query(&con, "SET @@session.max_join_size = default"));
/* Issue COM_CHANGE_USER. */ /* Issue COM_CHANGE_USER. */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment