From 14976fbe8a5d9e88cba6474808b8b59790e84c3e Mon Sep 17 00:00:00 2001 From: Nisha Gopalakrishnan Date: Thu, 5 Sep 2013 13:40:27 +0530 Subject: BUG#16032946 - PLEASE GIVE A MESSAGE FOR "THREAD_CONCURRENCY DOESN'T DO WHAT YOU EXPECT" Fix info: -------- Backport of the deprecation bug fix (WL#5265) for global variable 'THREAD_CONCURRENCY' from mysql-5.6 to mysql-5.5 Note: With this backport, certain additional deprecation warnings would be reported under error conditions while setting the global/session variables. --- sql/sys_vars.cc | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'sql/sys_vars.cc') diff --git a/sql/sys_vars.cc b/sql/sys_vars.cc index 1d0f9691629..63f478be5f0 100644 --- a/sql/sys_vars.cc +++ b/sql/sys_vars.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2002, 2012, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -1797,9 +1797,13 @@ static Sys_var_charptr Sys_socket( static Sys_var_ulong Sys_thread_concurrency( "thread_concurrency", "Permits the application to give the threads system a hint for " - "the desired number of threads that should be run at the same time", + "the desired number of threads that should be run at the same time." + "This variable has no effect, and is deprecated. " + "It will be removed in a future release.", READ_ONLY GLOBAL_VAR(concurrency), CMD_LINE(REQUIRED_ARG), - VALID_RANGE(1, 512), DEFAULT(DEFAULT_CONCURRENCY), BLOCK_SIZE(1)); + VALID_RANGE(1, 512), DEFAULT(DEFAULT_CONCURRENCY), BLOCK_SIZE(1), + NO_MUTEX_GUARD, NOT_IN_BINLOG, ON_CHECK(0), ON_UPDATE(0), + DEPRECATED("")); static Sys_var_ulong Sys_thread_stack( "thread_stack", "The stack size for each thread", -- cgit v1.2.1 From 680288873c4dd0418657fbc718687b1f91e2afbd Mon Sep 17 00:00:00 2001 From: Michael Widenius Date: Sun, 26 Jan 2014 21:48:42 +0100 Subject: Fix for MDEV-5168: MariaDB returns warnings for INSERT IGNORE Added variable "OLD_MODE" that can be used to turn off the new behavior mysql-test/r/insert.result: Added test case mysql-test/r/mysqld--help.result: Added old_mode mysql-test/suite/sys_vars/r/old_mode_basic.result: Added testing of new variable mysql-test/suite/sys_vars/t/old_mode_basic.test: Added testing of new variable mysql-test/t/insert.test: Added test case sql/sql_class.h: Added bit flags for OLD_MODE sql/sql_insert.cc: Disable duplicate key warnings for INSERT IGNORE of OLD_MODE NO_DUP_KEY_WARNINGS_WITH_IGNORE is used sql/sql_show.cc: Don't show progress reporting on SHOW PROCESSLIST if OLD_MODE NO_PROGRESS_INFO is used sql/sys_vars.cc: Added OLD_MODE --- sql/sys_vars.cc | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) (limited to 'sql/sys_vars.cc') diff --git a/sql/sys_vars.cc b/sql/sys_vars.cc index 5b4d4fdb4eb..49b90006000 100644 --- a/sql/sys_vars.cc +++ b/sql/sys_vars.cc @@ -1390,7 +1390,7 @@ static Sys_var_ulong Sys_net_retry_count( ON_UPDATE(fix_net_retry_count)); static Sys_var_mybool Sys_old_mode( - "old", "Use compatible behavior", + "old", "Use compatible behavior from previous MariaDB version. See also --old-mode", SESSION_VAR(old_mode), CMD_LINE(OPT_ARG), DEFAULT(FALSE)); static Sys_var_mybool Sys_old_alter_table( @@ -2211,6 +2211,30 @@ static Sys_var_set Sys_sql_mode( sql_mode_names, DEFAULT(0), NO_MUTEX_GUARD, NOT_IN_BINLOG, ON_CHECK(check_sql_mode), ON_UPDATE(fix_sql_mode)); +static const char *old_mode_names[]= +{ + "NO_DUP_KEY_WARNINGS_WITH_IGNORE", "NO_PROGRESS_INFO", + 0 +}; + +export bool old_mode_string_representation(THD *thd, ulonglong sql_mode, + LEX_STRING *ls) +{ + set_to_string(thd, ls, sql_mode, old_mode_names); + return ls->str == 0; +} +/* + sql_mode should *not* be IN_BINLOG as the slave can't remember this + anyway on restart. +*/ +static Sys_var_set Sys_old_behavior( + "old_mode", + "Used to emulate old behavior from earlier MariaDB or MySQL versions. " + "Syntax: old_mode=mode[,mode[,mode...]]. " + "See the manual for the complete list of valid old modes", + SESSION_VAR(old_behavior), CMD_LINE(REQUIRED_ARG), + old_mode_names, DEFAULT(0), NO_MUTEX_GUARD, NOT_IN_BINLOG); + #if defined(HAVE_OPENSSL) && !defined(EMBEDDED_LIBRARY) #define SSL_OPT(X) CMD_LINE(REQUIRED_ARG,X) #else -- cgit v1.2.1