From da0089a11da921fe1acec2de97c64f2ac6bda288 Mon Sep 17 00:00:00 2001 From: Murthy Narkedimilli Date: Tue, 23 Jun 2015 06:06:07 +0200 Subject: [PATCH 01/85] Raise version number after cloning 5.5.45 --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 904aeda33ab..45f770d8f07 100644 --- a/VERSION +++ b/VERSION @@ -1,4 +1,4 @@ MYSQL_VERSION_MAJOR=5 MYSQL_VERSION_MINOR=5 -MYSQL_VERSION_PATCH=45 +MYSQL_VERSION_PATCH=46 MYSQL_VERSION_EXTRA= From 8f87d6cd41042fe931305a60718d6aa1015a9ccc Mon Sep 17 00:00:00 2001 From: Balasubramanian Kandasamy Date: Tue, 23 Jun 2015 13:56:39 +0200 Subject: [PATCH 02/85] Raise version number after tagging 5.1.76 --- configure.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.in b/configure.in index 84ffbb7ac74..be169e073bd 100644 --- a/configure.in +++ b/configure.in @@ -29,7 +29,7 @@ dnl dnl When changing the major version number please also check the switch dnl statement in mysqlbinlog::check_master_version(). You may also need dnl to update version.c in ndb. -AC_INIT([MySQL Server], [5.1.76], [], [mysql]) +AC_INIT([MySQL Server], [5.1.77], [], [mysql]) AC_CONFIG_SRCDIR([sql/mysqld.cc]) AC_CANONICAL_SYSTEM From 0eadadad25d9e44232e1567897cf9dcb957ccdcd Mon Sep 17 00:00:00 2001 From: Debarun Banerjee Date: Wed, 24 Jun 2015 10:27:12 +0530 Subject: [PATCH 03/85] BUG#20310212 PARTITION DDL- CRASH AFTER THD::NOCHECK_REGISTER_ITEM_ Problem : --------- Issue-1: The root cause for the issues is that (col1 > 1) is not a valid partition function and we should have thrown error at much early stage [partition_info::check_partition_info]. We are not checking sub-partition expression when partition expression is NULL. Issue-2: Potential issue for future if any partition function needs to change item tree during open/fix_fields. We should release changed items, if any, before doing closefrm when we open the partitioned table during creation in create_table_impl. Solution : ---------- 1.check_partition_info() - Check for sub-partition expression even if no partition expression. [partition by ... columns(...) subpartition by hash()] 2.create_table_impl() - Assert that the change list is empty before doing closefrm for partitioned table. Currently no supported partition function seems to be changing item tree during open. Reviewed-by: Mattias Jonsson RB: 9345 --- mysql-test/r/partition_error.result | 2 +- mysql-test/t/partition_error.test | 2 +- sql/partition_info.cc | 15 +++++++++++---- sql/sql_table.cc | 6 ++++++ 4 files changed, 19 insertions(+), 6 deletions(-) diff --git a/mysql-test/r/partition_error.result b/mysql-test/r/partition_error.result index 0e4f89b70db..1e0f2cbea10 100644 --- a/mysql-test/r/partition_error.result +++ b/mysql-test/r/partition_error.result @@ -1089,7 +1089,7 @@ partition by key (a) subpartition by hash (sin(a+b)) (partition x1 (subpartition x11, subpartition x12), partition x2 (subpartition x21, subpartition x22)); -ERROR HY000: It is only possible to mix RANGE/LIST partitioning with HASH/KEY partitioning for subpartitioning +ERROR HY000: This partition function is not allowed select load_file('$MYSQLD_DATADIR/test/t1.par'); load_file('$MYSQLD_DATADIR/test/t1.par') NULL diff --git a/mysql-test/t/partition_error.test b/mysql-test/t/partition_error.test index c0f49a4d414..9a6939032a3 100644 --- a/mysql-test/t/partition_error.test +++ b/mysql-test/t/partition_error.test @@ -1145,7 +1145,7 @@ subpartition by hash (rand(a+b)); # # Subpartition by hash, wrong subpartition function # ---error ER_SUBPARTITION_ERROR +--error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED CREATE TABLE t1 ( a int not null, b int not null, diff --git a/sql/partition_info.cc b/sql/partition_info.cc index 958f77f5bd0..336010cc7dd 100644 --- a/sql/partition_info.cc +++ b/sql/partition_info.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2006, 2013, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2006, 2015, 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 @@ -1109,15 +1109,22 @@ bool partition_info::check_partition_info(THD *thd, handlerton **eng_type, { int err= 0; + /* Check for partition expression. */ if (!list_of_part_fields) { DBUG_ASSERT(part_expr); err= part_expr->walk(&Item::check_partition_func_processor, 0, NULL); - if (!err && is_sub_partitioned() && !list_of_subpart_fields) - err= subpart_expr->walk(&Item::check_partition_func_processor, 0, - NULL); } + + /* Check for sub partition expression. */ + if (!err && is_sub_partitioned() && !list_of_subpart_fields) + { + DBUG_ASSERT(subpart_expr); + err= subpart_expr->walk(&Item::check_partition_func_processor, 0, + NULL); + } + if (err) { my_error(ER_PARTITION_FUNCTION_IS_NOT_ALLOWED, MYF(0)); diff --git a/sql/sql_table.cc b/sql/sql_table.cc index b8858cffce6..2951d921e15 100644 --- a/sql/sql_table.cc +++ b/sql/sql_table.cc @@ -3913,6 +3913,12 @@ static bool check_if_created_table_can_be_opened(THD *thd, result= (open_table_def(thd, &share, 0) || open_table_from_share(thd, &share, "", 0, (uint) READ_ALL, 0, &table, TRUE)); + /* + Assert that the change list is empty as no partition function currently + needs to modify item tree. May need call THD::rollback_item_tree_changes + later before calling closefrm if the change list is not empty. + */ + DBUG_ASSERT(thd->change_list.is_empty()); if (! result) (void) closefrm(&table, 0); From 9068238b1984100dc2251f742a994b18fafaa841 Mon Sep 17 00:00:00 2001 From: Yashwant Sahu Date: Wed, 24 Jun 2015 17:48:46 +0530 Subject: [PATCH 04/85] Bug# 20376760: STACK-BUFFER-OVERFLOW WITH LONG PATHS TO CERTAIN VARIABLES --- mysys/mf_loadpath.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mysys/mf_loadpath.c b/mysys/mf_loadpath.c index 776435e0e75..812c3895bec 100644 --- a/mysys/mf_loadpath.c +++ b/mysys/mf_loadpath.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2000, 2015, 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 @@ -47,7 +47,7 @@ char * my_load_path(char * to, const char *path, (void) strnmov(buff, path, FN_REFLEN); /* Return org file name */ } else - (void) strxnmov(buff, FN_REFLEN, own_path_prefix, path, NullS); + (void) strxnmov(buff, sizeof(buff)-1, own_path_prefix, path, NullS); strnmov(to, buff, FN_REFLEN); to[FN_REFLEN-1]= '\0'; DBUG_PRINT("exit",("to: %s",to)); From 7c5d18e2271ce4fcd9294511860841dbb4fec31a Mon Sep 17 00:00:00 2001 From: Arun Kuruvila Date: Tue, 30 Jun 2015 10:27:12 +0530 Subject: [PATCH 05/85] Bug #20772273 : MYSQLIMPORT --USE-THREADS DOESN'T USE MULTIPLE THREADS Description:- The utility "mysqlimport" does not use multiple threads for the execution with option "--use-threads". "mysqlimport" while importing multiple files and multiple tables, uses a single thread even if the number of threads are specified with "--use-threads" option. Analysis:- This utility uses ifdef HAVE_LIBPTHREAD to check for libpthread library and if defined uses libpthread library for mutlithreaing. Since HAVE_LIBPTHREAD is not defined anywhere in the source, "--use-threads" option is silently ignored. Fix:- "-DTHREADS" is set to the COMPILE_FLAGS which will enable pthreads. HAVE_LIBPTHREAD macro is removed. --- client/CMakeLists.txt | 3 ++- client/mysqlimport.c | 11 +---------- mysql-test/r/mysqldump.result | 28 ++++++++++++++++++++++++++++ mysql-test/t/mysqldump.test | 29 +++++++++++++++++++++++++++++ 4 files changed, 60 insertions(+), 11 deletions(-) diff --git a/client/CMakeLists.txt b/client/CMakeLists.txt index 0d67cf2e0d4..21b1e084409 100644 --- a/client/CMakeLists.txt +++ b/client/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (c) 2006, 2011, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2006, 2015, 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 @@ -51,6 +51,7 @@ MYSQL_ADD_EXECUTABLE(mysqldump mysqldump.c ../sql-common/my_user.c) TARGET_LINK_LIBRARIES(mysqldump mysqlclient) MYSQL_ADD_EXECUTABLE(mysqlimport mysqlimport.c) +SET_SOURCE_FILES_PROPERTIES(mysqlimport.c PROPERTIES COMPILE_FLAGS "-DTHREADS") TARGET_LINK_LIBRARIES(mysqlimport mysqlclient) MYSQL_ADD_EXECUTABLE(mysql_upgrade mysql_upgrade.c) diff --git a/client/mysqlimport.c b/client/mysqlimport.c index 2045c94619b..813c1baf793 100644 --- a/client/mysqlimport.c +++ b/client/mysqlimport.c @@ -1,5 +1,5 @@ /* - Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved. + Copyright (c) 2000, 2015, 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 @@ -24,19 +24,14 @@ #include "client_priv.h" #include "mysql_version.h" -#ifdef HAVE_LIBPTHREAD -#include -#endif #include /* ORACLE_WELCOME_COPYRIGHT_NOTICE */ /* Global Thread counter */ uint counter; -#ifdef HAVE_LIBPTHREAD pthread_mutex_t counter_mutex; pthread_cond_t count_threshhold; -#endif static void db_error_with_table(MYSQL *mysql, char *table); static void db_error(MYSQL *mysql); @@ -548,7 +543,6 @@ static char *field_escape(char *to,const char *from,uint length) int exitcode= 0; -#ifdef HAVE_LIBPTHREAD pthread_handler_t worker_thread(void *arg) { int error; @@ -588,7 +582,6 @@ error: return 0; } -#endif int main(int argc, char **argv) @@ -607,7 +600,6 @@ int main(int argc, char **argv) return(1); } -#ifdef HAVE_LIBPTHREAD if (opt_use_threads && !lock_tables) { pthread_t mainthread; /* Thread descriptor */ @@ -661,7 +653,6 @@ int main(int argc, char **argv) pthread_attr_destroy(&attr); } else -#endif { MYSQL *mysql= 0; if (!(mysql= db_connect(current_host,current_db,current_user,opt_password))) diff --git a/mysql-test/r/mysqldump.result b/mysql-test/r/mysqldump.result index a31516d10d2..c578f9e8df6 100644 --- a/mysql-test/r/mysqldump.result +++ b/mysql-test/r/mysqldump.result @@ -5255,3 +5255,31 @@ SET @@global.general_log= @old_general_log_state; # # End of 5.1 tests # +# +# Bug #20772273 : MYSQLIMPORT --USE-THREADS DOESN'T USE MULTIPLE THREADS +# +CREATE DATABASE db_20772273; +USE db_20772273; +CREATE TABLE t1(a INT); +INSERT INTO t1 VALUES (1), (2); +CREATE TABLE t2(a INT); +INSERT INTO t2 VALUES (3), (4); +SELECT * FROM t1; +a +1 +2 +SELECT * FROM t2; +a +3 +4 +SELECT * FROM t1; +a +1 +2 +SELECT * FROM t2; +a +3 +4 +DROP TABLE t1; +DROP TABLE t2; +DROP DATABASE db_20772273; diff --git a/mysql-test/t/mysqldump.test b/mysql-test/t/mysqldump.test index 478d8fb2863..54780b95627 100644 --- a/mysql-test/t/mysqldump.test +++ b/mysql-test/t/mysqldump.test @@ -2401,3 +2401,32 @@ SET @@global.general_log= @old_general_log_state; --echo # --echo # End of 5.1 tests --echo # + +--echo # +--echo # Bug #20772273 : MYSQLIMPORT --USE-THREADS DOESN'T USE MULTIPLE THREADS +--echo # + +CREATE DATABASE db_20772273; +USE db_20772273; +CREATE TABLE t1(a INT); +INSERT INTO t1 VALUES (1), (2); +CREATE TABLE t2(a INT); +INSERT INTO t2 VALUES (3), (4); + +SELECT * FROM t1; +SELECT * FROM t2; + +--exec $MYSQL_DUMP --tab=$MYSQLTEST_VARDIR/tmp/ db_20772273 +--exec $MYSQL db_20772273 < $MYSQLTEST_VARDIR/tmp/t1.sql +--exec $MYSQL db_20772273 < $MYSQLTEST_VARDIR/tmp/t2.sql + +# Test mysqlimport with multiple threads +--exec $MYSQL_IMPORT --silent --use-threads=2 db_20772273 $MYSQLTEST_VARDIR/tmp/t1.txt $MYSQLTEST_VARDIR/tmp/t2.txt + +SELECT * FROM t1; +SELECT * FROM t2; + +#Cleanup +DROP TABLE t1; +DROP TABLE t2; +DROP DATABASE db_20772273; From 7ce304dff0e268304c8c13708ff9a3f034cce50a Mon Sep 17 00:00:00 2001 From: Praveenkumar Hulakund Date: Thu, 2 Jul 2015 15:31:55 +0530 Subject: [PATCH 06/85] Bug#18487951 - QUERY_CACHE_MIN_RES_UNIT SET TO ZERO, CRASHES IN QUERY_CACHE::FIND_BIN Valid min value for query_cache_min_res_unit is 512. But attempt to set value greater than or equal to the ULONG_MAX(max value) is resulting query_cache_min_res_unit value to 0. This result in crash while searching for memory block lesser than the valid min value to store query results. Free memory blocks in query cache are stored in bins according to their size. The bins are stored in size descending order. For the memory block request the appropriate bin is searched using binary search algorithm. The minimum free memory block request expected is 512 bytes. And the appropriate bin is searched for block greater than or equals to 512 bytes. Because of the bug the query_cache_min_res_unit is set to 0. Due to which there is a chance of request for memory blocks lesser than the minimum size in free memory block bins. Search for bin for this invalid input size fails and returns garbage index. Accessing bins array element with this index is causing the issue reported. The valid value range for the query_cache_min_res_unit is 512 to ULONG_MAX(when value is greater than the max allowed value, max allowed value is used i.e ULONG_MAX). While setting result unit block size (query_cache_min_res_unit), size is memory aligned by using a macro ALIGN_SIZE. The ALIGN_SIZE logic is as below, (input_size + sizeof(double) - 1) & ~(sizeof(double) - 1) For unsigned long type variable when input_size is greater than equal to ULONG_MAX-(sizeof(double)-1), above expression is resulting in value 0. Fix: ----- Comparing value set for query_cache_min_res_unit with max aligned value which can be stored in ulong type variable. If it is greater then setting it to the max aligned value for ulong type variable. --- sql/sql_cache.cc | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/sql/sql_cache.cc b/sql/sql_cache.cc index ca3db3b48c0..e1f9e68ff83 100644 --- a/sql/sql_cache.cc +++ b/sql/sql_cache.cc @@ -1,4 +1,5 @@ -/* Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2000, 2013, 2015, 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 @@ -399,6 +400,9 @@ TODO list: #define QC_DEBUG_SYNC(name) #endif +// Max aligned size for ulong type query_cache_min_res_unit. +static const ulong max_aligned_min_res_unit_size= ((ULONG_MAX) & + (~(sizeof(double) - 1))); /** Thread state to be used when the query cache lock needs to be acquired. @@ -1158,6 +1162,9 @@ ulong Query_cache::set_min_res_unit(ulong size) { if (size < min_allocation_unit) size= min_allocation_unit; + else if (size > max_aligned_min_res_unit_size) + size= max_aligned_min_res_unit_size; + return (min_result_data_size= ALIGN_SIZE(size)); } From 2ac01ca6606a300dc7c043affccb9f850284a5e7 Mon Sep 17 00:00:00 2001 From: Praveenkumar Hulakund Date: Fri, 3 Jul 2015 16:56:13 +0530 Subject: [PATCH 07/85] Bug#18487951 - QUERY_CACHE_MIN_RES_UNIT SET TO ZERO, CRASHES IN QUERY_CACHE::FIND_BIN Follow up patch to fix sys_vars.query_cache_min_res_unit_basic_32 test failure. --- .../r/query_cache_min_res_unit_basic_32.result | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/mysql-test/suite/sys_vars/r/query_cache_min_res_unit_basic_32.result b/mysql-test/suite/sys_vars/r/query_cache_min_res_unit_basic_32.result index c408a39fdc0..9dc4a0d5062 100644 --- a/mysql-test/suite/sys_vars/r/query_cache_min_res_unit_basic_32.result +++ b/mysql-test/suite/sys_vars/r/query_cache_min_res_unit_basic_32.result @@ -50,7 +50,7 @@ Warnings: Warning 1292 Truncated incorrect query_cache_min_res_unit value: '4294967296' SELECT @@global.query_cache_min_res_unit; @@global.query_cache_min_res_unit -0 +4294967288 SET @@global.query_cache_min_res_unit = 511; SELECT @@global.query_cache_min_res_unit; @@global.query_cache_min_res_unit @@ -71,23 +71,23 @@ Warnings: Warning 1292 Truncated incorrect query_cache_min_res_unit value: '42949672950' SELECT @@global.query_cache_min_res_unit; @@global.query_cache_min_res_unit -0 +4294967288 SET @@global.query_cache_min_res_unit = ON; ERROR 42000: Incorrect argument type to variable 'query_cache_min_res_unit' SELECT @@global.query_cache_min_res_unit; @@global.query_cache_min_res_unit -0 +4294967288 SET @@global.query_cache_min_res_unit = 'test'; ERROR 42000: Incorrect argument type to variable 'query_cache_min_res_unit' SELECT @@global.query_cache_min_res_unit; @@global.query_cache_min_res_unit -0 +4294967288 '#-------------------FN_DYNVARS_132_05----------------------------#' SET @@session.query_cache_min_res_unit = 0; ERROR HY000: Variable 'query_cache_min_res_unit' is a GLOBAL variable and should be set with SET GLOBAL SELECT @@query_cache_min_res_unit; @@query_cache_min_res_unit -0 +4294967288 '#----------------------FN_DYNVARS_132_06------------------------#' SELECT @@global.query_cache_min_res_unit = VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES From 359f102ad157adaacc904a1c81f5ddcb9ce3662b Mon Sep 17 00:00:00 2001 From: Debarun Banerjee Date: Wed, 8 Jul 2015 10:00:53 +0530 Subject: [PATCH 08/85] BUG#16613004 PARTITIONING DDL, CRASH IN FIELD_VARSTRING::CMP_MAX Problem : --------- The specific issue reported in this bug is with range/list column value that is allocated and initialized by evaluating partition expression(item tree) during execution. After evaluation the range list value is marked fixed [part_column_list_val]. During next execution, we don't re-evaluate the expression and use the old value since it is marked fixed. Solution : ---------- One way to solve the issue is to mark all column values as not fixed during clone so that the expression is always re-evaluated once we attempt partition_info::fix_column_value_functions() after cloning the part_info object during execution of DDL on partitioned table. Reviewed-by: Jimmy Yang Reviewed-by: Mattias Jonsson RB: 9424 --- sql/partition_info.cc | 22 +++++++++++++++++++++- sql/partition_info.h | 4 ++-- sql/sql_parse.cc | 4 ++-- sql/sql_partition.cc | 4 ++-- 4 files changed, 27 insertions(+), 7 deletions(-) diff --git a/sql/partition_info.cc b/sql/partition_info.cc index 336010cc7dd..a0d09557b81 100644 --- a/sql/partition_info.cc +++ b/sql/partition_info.cc @@ -31,7 +31,7 @@ #include "ha_partition.h" -partition_info *partition_info::get_clone() +partition_info *partition_info::get_clone(bool reset /* = false */) { if (!this) return 0; @@ -57,6 +57,26 @@ partition_info *partition_info::get_clone() return NULL; } memcpy(part_clone, part, sizeof(partition_element)); + + /* + Mark that RANGE and LIST values needs to be fixed so that we don't + use old values. fix_column_value_functions would evaluate the values + from Item expression. + */ + if (reset) + { + clone->defined_max_value = false; + List_iterator list_it(part_clone->list_val_list); + while (part_elem_value *list_value= list_it++) + { + part_column_list_val *col_val= list_value->col_val_array; + for (uint i= 0; i < num_columns; col_val++, i++) + { + col_val->fixed= 0; + } + } + } + part_clone->subpartitions.empty(); while ((subpart= (subpart_it++))) { diff --git a/sql/partition_info.h b/sql/partition_info.h index 806b15da1ea..7bfbf8a1b1a 100644 --- a/sql/partition_info.h +++ b/sql/partition_info.h @@ -1,7 +1,7 @@ #ifndef PARTITION_INFO_INCLUDED #define PARTITION_INFO_INCLUDED -/* Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2006, 2015, 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 @@ -265,7 +265,7 @@ public: } ~partition_info() {} - partition_info *get_clone(); + partition_info *get_clone(bool reset = false); /* Answers the question if subpartitioning is used for a certain table */ bool is_sub_partitioned() { diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index f52f56447f4..e1fc26775a4 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2000, 2015, 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 @@ -2428,7 +2428,7 @@ case SQLCOM_PREPARE: #ifdef WITH_PARTITION_STORAGE_ENGINE { partition_info *part_info= thd->lex->part_info; - if (part_info && !(part_info= thd->lex->part_info->get_clone())) + if (part_info && !(part_info= thd->lex->part_info->get_clone(true))) { res= -1; goto end_with_restore_list; diff --git a/sql/sql_partition.cc b/sql/sql_partition.cc index c615ee96d03..5358535e9f9 100644 --- a/sql/sql_partition.cc +++ b/sql/sql_partition.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2005, 2015, 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 @@ -4718,7 +4718,7 @@ uint prep_alter_part_table(THD *thd, TABLE *table, Alter_info *alter_info, thd->work_part_info= thd->lex->part_info; if (thd->work_part_info && - !(thd->work_part_info= thd->lex->part_info->get_clone())) + !(thd->work_part_info= thd->lex->part_info->get_clone(true))) DBUG_RETURN(TRUE); /* ALTER_ADMIN_PARTITION is handled in mysql_admin_table */ From bf681d6bb341411a8b17abeda8e723368545d48d Mon Sep 17 00:00:00 2001 From: Shishir Jaiswal Date: Wed, 8 Jul 2015 11:53:54 +0530 Subject: [PATCH 09/85] Bug #20802751 - SEGMENTATION FAILURE WHEN RUNNING MYSQLADMIN -U ROOT -P DESCRIPTION =========== Crash occurs when no command is given while executing mysqladmin utility. ANALYSIS ======== In mask_password() the final write to array 'temp_argv' is done without checking if corresponding index 'argc' is valid (non-negative) or not. In case its negative (would happen when this function is called with 'argc'=0), it may cause a SEGFAULT. Logically in such a case, mask_password() should not have been called as it would do no valid thing. FIX === mask_password() is now called after checking 'argc'. This function is now called only when 'argc' is positive otherwise the process terminates --- client/mysqladmin.cc | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/client/mysqladmin.cc b/client/mysqladmin.cc index 2a1f8b521f0..e8bb4a1a27c 100644 --- a/client/mysqladmin.cc +++ b/client/mysqladmin.cc @@ -1,5 +1,5 @@ /* - Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. + Copyright (c) 2000, 2015, 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 @@ -319,8 +319,6 @@ int main(int argc,char *argv[]) free_defaults(save_argv); exit(ho_error); } - temp_argv= mask_password(argc, &argv); - temp_argc= argc; if (debug_info_flag) my_end_arg= MY_CHECK_ERROR | MY_GIVE_INFO; @@ -332,6 +330,10 @@ int main(int argc,char *argv[]) usage(); exit(1); } + + temp_argv= mask_password(argc, &argv); + temp_argc= argc; + commands = temp_argv; if (tty_password) opt_password = get_tty_password(NullS); From c9685a78c3960f5822e42e0dc847c72a46528af5 Mon Sep 17 00:00:00 2001 From: Robert Golebiowski Date: Fri, 20 Mar 2015 15:05:59 +0100 Subject: [PATCH 10/85] Bug #20168526 YASSL: CORRUPT SSL-KEY CRASHES CLIENT Affects at least 5.6 and 5.7. In customer case, the "client" happened to be a replication slave, therefore his server crashed. Bug-fix: The bug was in yassl. Todd Ouska has provided us with the patch. (cherry picked from commit 42ffa91aad898b02f0793b669ffd04f5c178ce39) --- extra/yassl/README | 4 ++++ extra/yassl/include/openssl/ssl.h | 2 +- extra/yassl/src/ssl.cpp | 29 +++++++++++++++++++++++++++- extra/yassl/taocrypt/src/rsa.cpp | 4 ++++ extra/yassl/testsuite/cipher-test.sh | 1 + 5 files changed, 38 insertions(+), 2 deletions(-) diff --git a/extra/yassl/README b/extra/yassl/README index da399c3d141..d245d20ce5f 100644 --- a/extra/yassl/README +++ b/extra/yassl/README @@ -12,6 +12,10 @@ before calling SSL_new(); *** end Note *** +yaSSL Patch notes, version 2.3.7b (3/18/2015) + This release of yaSSL fixes a potential crash with corrupted private keys. + Also detects bad keys earlier for user. + yaSSL Release notes, version 2.3.7 (12/10/2014) This release of yaSSL fixes the potential to process duplicate handshake messages by explicitly marking/checking received handshake messages. diff --git a/extra/yassl/include/openssl/ssl.h b/extra/yassl/include/openssl/ssl.h index 24acc7e86b9..e10fb5299f7 100644 --- a/extra/yassl/include/openssl/ssl.h +++ b/extra/yassl/include/openssl/ssl.h @@ -35,7 +35,7 @@ #include "rsa.h" -#define YASSL_VERSION "2.3.7" +#define YASSL_VERSION "2.3.7b" #if defined(__cplusplus) diff --git a/extra/yassl/src/ssl.cpp b/extra/yassl/src/ssl.cpp index a47b175e635..845b35bac8b 100644 --- a/extra/yassl/src/ssl.cpp +++ b/extra/yassl/src/ssl.cpp @@ -37,6 +37,8 @@ #include "file.hpp" // for TaoCrypt Source #include "coding.hpp" // HexDecoder #include "helpers.hpp" // for placement new hack +#include "rsa.hpp" // for TaoCrypt RSA key decode +#include "dsa.hpp" // for TaoCrypt DSA key decode #include #ifdef _WIN32 @@ -54,6 +56,8 @@ namespace yaSSL { int read_file(SSL_CTX* ctx, const char* file, int format, CertType type) { + int ret = SSL_SUCCESS; + if (format != SSL_FILETYPE_ASN1 && format != SSL_FILETYPE_PEM) return SSL_BAD_FILETYPE; @@ -141,8 +145,31 @@ int read_file(SSL_CTX* ctx, const char* file, int format, CertType type) } } } + + if (type == PrivateKey && ctx->privateKey_) { + // see if key is valid early + TaoCrypt::Source rsaSource(ctx->privateKey_->get_buffer(), + ctx->privateKey_->get_length()); + TaoCrypt::RSA_PrivateKey rsaKey; + rsaKey.Initialize(rsaSource); + + if (rsaSource.GetError().What()) { + // rsa failed see if DSA works + + TaoCrypt::Source dsaSource(ctx->privateKey_->get_buffer(), + ctx->privateKey_->get_length()); + TaoCrypt::DSA_PrivateKey dsaKey; + dsaKey.Initialize(dsaSource); + + if (rsaSource.GetError().What()) { + // neither worked + ret = SSL_FAILURE; + } + } + } + fclose(input); - return SSL_SUCCESS; + return ret; } diff --git a/extra/yassl/taocrypt/src/rsa.cpp b/extra/yassl/taocrypt/src/rsa.cpp index 79a8a8f1c4f..73f678e2674 100644 --- a/extra/yassl/taocrypt/src/rsa.cpp +++ b/extra/yassl/taocrypt/src/rsa.cpp @@ -140,6 +140,10 @@ word32 RSA_BlockType2::UnPad(const byte *pkcsBlock, unsigned int pkcsBlockLen, void RSA_BlockType1::Pad(const byte* input, word32 inputLen, byte* pkcsBlock, word32 pkcsBlockLen, RandomNumberGenerator&) const { + // sanity checks + if (input == NULL || pkcsBlock == NULL) + return; + // convert from bit length to byte length if (pkcsBlockLen % 8 != 0) { diff --git a/extra/yassl/testsuite/cipher-test.sh b/extra/yassl/testsuite/cipher-test.sh index 5ce29459d07..d3e69146097 100644 --- a/extra/yassl/testsuite/cipher-test.sh +++ b/extra/yassl/testsuite/cipher-test.sh @@ -4,6 +4,7 @@ # +no_pid=-1 server_pid=$no_pid From e7ff2040d7af2dec681bbfab5bc2a8232e53c50d Mon Sep 17 00:00:00 2001 From: Robert Golebiowski Date: Wed, 8 Jul 2015 12:21:51 +0200 Subject: [PATCH 11/85] Bug #21025377 CAN'T CONNECT TO SSL ENABLED SERVER FIRST 30 SEC AFTER INITIAL STARTUP Description: By using mysql_ssl_rsa_setup to get SSL enabled server (after running mysqld --initialize) server don't answer properly to "mysqladmin ping" first 30 secs after startup. Bug-fix: YASSL validated certificate date to the minute but should have to the second. This is why the ssl on the server side was not up right away after new certs were created with mysql_ssl_rsa_setup. The fix for that was submitted by Todd. YASSL was updated to 2.3.7c. --- extra/yassl/README | 5 +++++ extra/yassl/include/openssl/ssl.h | 2 +- extra/yassl/taocrypt/src/asn.cpp | 7 ++++++- 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/extra/yassl/README b/extra/yassl/README index d245d20ce5f..61326bc079a 100644 --- a/extra/yassl/README +++ b/extra/yassl/README @@ -12,6 +12,11 @@ before calling SSL_new(); *** end Note *** +yaSSL Patch notes, version 2.3.7c (6/12/2015) + This release of yaSSL does certificate DATE comparisons to the second + instead of to the minute, helpful when using freshly generated certs. + Though keep in mind that time sync differences could still show up. + yaSSL Patch notes, version 2.3.7b (3/18/2015) This release of yaSSL fixes a potential crash with corrupted private keys. Also detects bad keys earlier for user. diff --git a/extra/yassl/include/openssl/ssl.h b/extra/yassl/include/openssl/ssl.h index e10fb5299f7..5818a3b2cfc 100644 --- a/extra/yassl/include/openssl/ssl.h +++ b/extra/yassl/include/openssl/ssl.h @@ -35,7 +35,7 @@ #include "rsa.h" -#define YASSL_VERSION "2.3.7b" +#define YASSL_VERSION "2.3.7c" #if defined(__cplusplus) diff --git a/extra/yassl/taocrypt/src/asn.cpp b/extra/yassl/taocrypt/src/asn.cpp index d521088d74a..342255c91b8 100644 --- a/extra/yassl/taocrypt/src/asn.cpp +++ b/extra/yassl/taocrypt/src/asn.cpp @@ -39,7 +39,7 @@ namespace TaoCrypt { namespace { // locals -// to the minute +// to the second bool operator>(tm& a, tm& b) { if (a.tm_year > b.tm_year) @@ -60,6 +60,11 @@ bool operator>(tm& a, tm& b) a.tm_min > b.tm_min) return true; + if (a.tm_year == b.tm_year && a.tm_mon == b.tm_mon && + a.tm_mday == b.tm_mday && a.tm_hour == b.tm_hour && + a.tm_min == b.tm_min && a.tm_sec > b.tm_sec) + return true; + return false; } From 7255ae6ceb20c67d09fd153558d9a14372142f8b Mon Sep 17 00:00:00 2001 From: Robert Golebiowski Date: Wed, 8 Jul 2015 13:51:06 +0200 Subject: [PATCH 12/85] Bug #20774956: THREAD_POOL.THREAD_POOL_CONNECT HANGS WHEN RUN ON A YASSL-COMPILED SERVER/CLIENT Description: thread_pool.thread_pool_connect hangs when the server and client are compiled with yaSSL. Bug-fix: Test thread_pool.thread_pool_connect was temporary disabled for yaSSL. However, now that yaSSL is fixed it runs OK. The bug was introduced by one of the yaSSL updates. set_current was not working for i == 0. Now this is fixed. YASSL is updated to 2.3.7d --- extra/yassl/README | 5 +++++ extra/yassl/include/openssl/ssl.h | 2 +- extra/yassl/src/buffer.cpp | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/extra/yassl/README b/extra/yassl/README index 61326bc079a..2560c09addd 100644 --- a/extra/yassl/README +++ b/extra/yassl/README @@ -12,6 +12,11 @@ before calling SSL_new(); *** end Note *** +yaSSL Patch notes, version 2.3.7d (6/22/2015) + This release of yaSSL includes a fix for input_buffer set_current with + index 0. SSL_peek() at front of waiting data could trigger. Robert + Golebiowski of Oracle identified and suggested a fix, thanks! + yaSSL Patch notes, version 2.3.7c (6/12/2015) This release of yaSSL does certificate DATE comparisons to the second instead of to the minute, helpful when using freshly generated certs. diff --git a/extra/yassl/include/openssl/ssl.h b/extra/yassl/include/openssl/ssl.h index 5818a3b2cfc..692d8b270d2 100644 --- a/extra/yassl/include/openssl/ssl.h +++ b/extra/yassl/include/openssl/ssl.h @@ -35,7 +35,7 @@ #include "rsa.h" -#define YASSL_VERSION "2.3.7c" +#define YASSL_VERSION "2.3.7d" #if defined(__cplusplus) diff --git a/extra/yassl/src/buffer.cpp b/extra/yassl/src/buffer.cpp index aa7224bf64e..ce00a474e49 100644 --- a/extra/yassl/src/buffer.cpp +++ b/extra/yassl/src/buffer.cpp @@ -162,7 +162,7 @@ void input_buffer::set_error() void input_buffer::set_current(uint i) { - if (error_ == 0 && i && check(i - 1, size_) == 0) + if (error_ == 0 && check(i ? i - 1 : 0, size_) == 0) current_ = i; else error_ = -1; From 33a2e5abd86727155b629246445d508bb2cd02c0 Mon Sep 17 00:00:00 2001 From: Sreeharsha Ramanavarapu Date: Fri, 10 Jul 2015 07:52:00 +0530 Subject: [PATCH 13/85] Bug #20238729: ILLEGALLY CRAFTED UTF8 SELECT PROVIDES NO WARNINGS Backporting to 5.1 and 5.5 --- .../r/strings_charsets_update_delete.result | Bin 112951 -> 113476 bytes .../r/character_set_connection_func.result | 6 ++ sql/item.cc | 63 ++++++++++------ sql/item.h | 9 ++- sql/item_strfunc.cc | 10 ++- sql/sql_class.cc | 38 +++++----- sql/sql_string.cc | 68 +++++++++++++++++- sql/sql_string.h | 6 +- sql/sql_yacc.yy | 10 ++- 9 files changed, 164 insertions(+), 46 deletions(-) diff --git a/mysql-test/suite/engines/iuds/r/strings_charsets_update_delete.result b/mysql-test/suite/engines/iuds/r/strings_charsets_update_delete.result index 08eecb1c17d52648b61184c98cfc97174e7be5cb..b862e23e3d3db65ab2a2b4cf3a614cc4a7698581 100644 GIT binary patch delta 594 zcmdn~iS5WYwhf!DvcnUL@-p+%i>charset(); - int well_formed_error; - uint wlen= cs->cset->well_formed_len(cs, - str->ptr(), str->ptr() + str->length(), - str->length(), &well_formed_error); - if (wlen < str->length()) + + size_t valid_length; + bool length_error; + + if (validate_string(cs, str->ptr(), str->length(), + &valid_length, &length_error)) { + const char *str_end= str->ptr() + str->length(); + const char *print_byte= str->ptr() + valid_length; THD *thd= current_thd; char hexbuf[7]; - enum MYSQL_ERROR::enum_warning_level level; - uint diff= str->length() - wlen; + enum MYSQL_ERROR::enum_warning_level level= MYSQL_ERROR::WARN_LEVEL_WARN; + uint diff= str_end - print_byte; set_if_smaller(diff, 3); - octet2hex(hexbuf, str->ptr() + wlen, diff); - if (send_error) + octet2hex(hexbuf, print_byte, diff); + if (send_error && length_error) { my_error(ER_INVALID_CHARACTER_STRING, MYF(0), cs->csname, hexbuf); return 0; } - if ((thd->variables.sql_mode & - (MODE_STRICT_TRANS_TABLES | MODE_STRICT_ALL_TABLES))) + if (truncate && length_error) { - level= MYSQL_ERROR::WARN_LEVEL_ERROR; - null_value= 1; - str= 0; - } - else - { - level= MYSQL_ERROR::WARN_LEVEL_WARN; - str->length(wlen); + if ((thd->variables.sql_mode & + (MODE_STRICT_TRANS_TABLES | MODE_STRICT_ALL_TABLES))) + { + level= MYSQL_ERROR::WARN_LEVEL_ERROR; + null_value= 1; + str= 0; + } + else + { + str->length(valid_length); + } } push_warning_printf(thd, level, ER_INVALID_CHARACTER_STRING, ER(ER_INVALID_CHARACTER_STRING), cs->csname, hexbuf); diff --git a/sql/item.h b/sql/item.h index c82d23b6d5a..15fe7ce5afa 100644 --- a/sql/item.h +++ b/sql/item.h @@ -1052,7 +1052,9 @@ public: bool is_datetime(); virtual Field::geometry_type get_geometry_type() const { return Field::GEOM_GEOMETRY; }; - String *check_well_formed_result(String *str, bool send_error= 0); + String *check_well_formed_result(String *str, + bool send_error, + bool truncate); bool eq_by_collation(Item *item, bool binary_cmp, CHARSET_INFO *cs); /** @@ -1929,6 +1931,11 @@ public: decimals=NOT_FIXED_DEC; // it is constant => can be used without fix_fields (and frequently used) fixed= 1; + /* + Check if the string has any character that can't be + interpreted using the relevant charset. + */ + check_well_formed_result(&str_value, false, false); } /* Just create an item and do not fill string representation */ Item_string(CHARSET_INFO *cs, Derivation dv= DERIVATION_COERCIBLE) diff --git a/sql/item_strfunc.cc b/sql/item_strfunc.cc index 25473815b9c..5e6da3b1300 100644 --- a/sql/item_strfunc.cc +++ b/sql/item_strfunc.cc @@ -1,5 +1,5 @@ /* - Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved. + Copyright (c) 2000, 2015, 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 @@ -2373,7 +2373,9 @@ String *Item_func_char::val_str(String *str) } } str->realloc(str->length()); // Add end 0 (for Purify) - return check_well_formed_result(str); + return check_well_formed_result(str, + false, // send warning + true); // truncate } @@ -2773,7 +2775,9 @@ String *Item_func_conv_charset::val_str(String *str) } null_value= tmp_value.copy(arg->ptr(), arg->length(), arg->charset(), conv_charset, &dummy_errors); - return null_value ? 0 : check_well_formed_result(&tmp_value); + return null_value ? 0 : check_well_formed_result(&tmp_value, + false, // send warning + true); // truncate } void Item_func_conv_charset::fix_length_and_dec() diff --git a/sql/sql_class.cc b/sql/sql_class.cc index d71da6403ae..39d6316a512 100644 --- a/sql/sql_class.cc +++ b/sql/sql_class.cc @@ -1,5 +1,5 @@ /* - Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved. + Copyright (c) 2000, 2015, 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 @@ -1313,21 +1313,17 @@ LEX_STRING *THD::make_lex_string(LEX_STRING *lex_str, /* Convert a string to another character set - SYNOPSIS - convert_string() - to Store new allocated string here - to_cs New character set for allocated string - from String to convert - from_length Length of string to convert - from_cs Original character set + @param to Store new allocated string here + @param to_cs New character set for allocated string + @param from String to convert + @param from_length Length of string to convert + @param from_cs Original character set - NOTES - to will be 0-terminated to make it easy to pass to system funcs + @note to will be 0-terminated to make it easy to pass to system funcs - RETURN - 0 ok - 1 End of memory. - In this case to->str will point to 0 and to->length will be 0. + @retval false ok + @retval true End of memory. + In this case to->str will point to 0 and to->length will be 0. */ bool THD::convert_string(LEX_STRING *to, CHARSET_INFO *to_cs, @@ -1336,15 +1332,25 @@ bool THD::convert_string(LEX_STRING *to, CHARSET_INFO *to_cs, { DBUG_ENTER("convert_string"); size_t new_length= to_cs->mbmaxlen * from_length; - uint dummy_errors; + uint errors= 0; if (!(to->str= (char*) alloc(new_length+1))) { to->length= 0; // Safety fix DBUG_RETURN(1); // EOM } to->length= copy_and_convert((char*) to->str, new_length, to_cs, - from, from_length, from_cs, &dummy_errors); + from, from_length, from_cs, &errors); to->str[to->length]=0; // Safety + if (errors != 0) + { + char printable_buff[32]; + convert_to_printable(printable_buff, sizeof(printable_buff), + from, from_length, from_cs, 6); + push_warning_printf(this, MYSQL_ERROR::WARN_LEVEL_WARN, ER_UNKNOWN_ERROR, + "Can't convert the character string from %s to %s: '%.64s'", + from_cs->csname, to_cs->csname, printable_buff); + } + DBUG_RETURN(0); } diff --git a/sql/sql_string.cc b/sql/sql_string.cc index f692014011c..511bf3c9547 100644 --- a/sql/sql_string.cc +++ b/sql/sql_string.cc @@ -1,5 +1,5 @@ /* - Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. + Copyright (c) 2000, 2015, 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 @@ -1231,3 +1231,69 @@ uint convert_to_printable(char *to, size_t to_len, *t= '\0'; return t - to; } + +/** + Check if an input byte sequence is a valid character string of a given charset + + @param cs The input character set. + @param str The input byte sequence to validate. + @param length A byte length of the str. + @param [out] valid_length A byte length of a valid prefix of the str. + @param [out] length_error True in the case of a character length error: + some byte[s] in the input is not a valid + prefix for a character, i.e. the byte length + of that invalid character is undefined. + + @retval true if the whole input byte sequence is a valid character string. + The length_error output parameter is undefined. + + @return + if the whole input byte sequence is a valid character string + then + return false + else + if the length of some character in the input is undefined (MY_CS_ILSEQ) + or the last character is truncated (MY_CS_TOOSMALL) + then + *length_error= true; // fatal error! + else + *length_error= false; // non-fatal error: there is no wide character + // encoding for some input character + return true +*/ +bool validate_string(CHARSET_INFO *cs, const char *str, uint32 length, + size_t *valid_length, bool *length_error) +{ + if (cs->mbmaxlen > 1) + { + int well_formed_error; + *valid_length= cs->cset->well_formed_len(cs, str, str + length, + length, &well_formed_error); + *length_error= well_formed_error; + return well_formed_error; + } + + /* + well_formed_len() is not functional on single-byte character sets, + so use mb_wc() instead: + */ + *length_error= false; + + const uchar *from= reinterpret_cast(str); + const uchar *from_end= from + length; + my_charset_conv_mb_wc mb_wc= cs->cset->mb_wc; + + while (from < from_end) + { + my_wc_t wc; + int cnvres= (*mb_wc)(cs, &wc, (uchar*) from, from_end); + if (cnvres <= 0) + { + *valid_length= from - reinterpret_cast(str); + return true; + } + from+= cnvres; + } + *valid_length= length; + return false; +} diff --git a/sql/sql_string.h b/sql/sql_string.h index c65560dd1d1..e06180b108f 100644 --- a/sql/sql_string.h +++ b/sql/sql_string.h @@ -1,5 +1,5 @@ /* - Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. + Copyright (c) 2000, 2015, 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 @@ -413,3 +413,7 @@ static inline bool check_if_only_end_space(CHARSET_INFO *cs, char *str, { return str+ cs->cset->scan(cs, str, end, MY_SEQ_SPACES) == end; } + +bool +validate_string(CHARSET_INFO *cs, const char *str, uint32 length, + size_t *valid_length, bool *length_error); diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy index 29516d34855..d9a32f2dd35 100644 --- a/sql/sql_yacc.yy +++ b/sql/sql_yacc.yy @@ -1,5 +1,5 @@ /* - Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. + Copyright (c) 2000, 2015, 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 @@ -11070,7 +11070,9 @@ literal: str ? str->length() : 0, $1); if (!item_str || - !item_str->check_well_formed_result(&item_str->str_value, TRUE)) + !item_str->check_well_formed_result(&item_str->str_value, + true, //send error + true)) //truncate { MYSQL_YYABORT; } @@ -11099,7 +11101,9 @@ literal: str ? str->length() : 0, $1); if (!item_str || - !item_str->check_well_formed_result(&item_str->str_value, TRUE)) + !item_str->check_well_formed_result(&item_str->str_value, + true, //send error + true)) //truncate { MYSQL_YYABORT; } From 49667f044197cefdb7c90b8beab3e78ec23deecd Mon Sep 17 00:00:00 2001 From: Christopher Powers Date: Fri, 10 Jul 2015 20:42:33 +0200 Subject: [PATCH 14/85] Bug#21374104 SETUP_TIMERS INITIALIZATION ASSUMES CYCLE TIMER IS ALWAYS AVAILABLE For WAIT events, fall back to other timers if CYCLE is not available. --- .../suite/perfschema/r/query_cache.result | 4 +- .../suite/perfschema/t/query_cache.test | 2 + storage/perfschema/pfs_timer.cc | 43 ++++++++++++++++++- 3 files changed, 45 insertions(+), 4 deletions(-) diff --git a/mysql-test/suite/perfschema/r/query_cache.result b/mysql-test/suite/perfschema/r/query_cache.result index 8786cd055ca..837c2573a72 100644 --- a/mysql-test/suite/perfschema/r/query_cache.result +++ b/mysql-test/suite/perfschema/r/query_cache.result @@ -38,7 +38,7 @@ spins NULL select * from performance_schema.setup_timers where name='wait'; NAME TIMER_NAME -wait CYCLE +wait {CYCLE_OR_NANOSECOND} show status like "Qcache_queries_in_cache"; Variable_name Value Qcache_queries_in_cache 1 @@ -53,7 +53,7 @@ spins NULL select * from performance_schema.setup_timers where name='wait'; NAME TIMER_NAME -wait CYCLE +wait {CYCLE_OR_NANOSECOND} show status like "Qcache_queries_in_cache"; Variable_name Value Qcache_queries_in_cache 1 diff --git a/mysql-test/suite/perfschema/t/query_cache.test b/mysql-test/suite/perfschema/t/query_cache.test index 60d4a648222..802e574f89b 100644 --- a/mysql-test/suite/perfschema/t/query_cache.test +++ b/mysql-test/suite/perfschema/t/query_cache.test @@ -34,6 +34,7 @@ show status like "Qcache_hits"; select spins from performance_schema.events_waits_current order by event_name limit 1; +--replace_result CYCLE {CYCLE_OR_NANOSECOND} NANOSECOND {CYCLE_OR_NANOSECOND} select * from performance_schema.setup_timers where name='wait'; show status like "Qcache_queries_in_cache"; @@ -42,6 +43,7 @@ show status like "Qcache_hits"; select spins from performance_schema.events_waits_current order by event_name limit 1; +--replace_result CYCLE {CYCLE_OR_NANOSECOND} NANOSECOND {CYCLE_OR_NANOSECOND} select * from performance_schema.setup_timers where name='wait'; show status like "Qcache_queries_in_cache"; diff --git a/storage/perfschema/pfs_timer.cc b/storage/perfschema/pfs_timer.cc index 302548c97c2..3191a0514e7 100644 --- a/storage/perfschema/pfs_timer.cc +++ b/storage/perfschema/pfs_timer.cc @@ -1,5 +1,4 @@ -/* Copyright (c) 2008 MySQL AB, 2010 Sun Microsystems, Inc. - Use is subject to license terms. +/* Copyright (c) 2008, 2015, 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 @@ -89,6 +88,46 @@ void init_timers(void) (double)pfs_timer_info.ticks.frequency); else tick_to_pico= 0; + + /* + Depending on the platform and build options, some timers may not be + available. Pick best replacements. + */ + + /* + For WAIT, the cycle timer is used by default. However, it is not available + on all architectures. Fall back to the nanosecond timer in this case. It is + unlikely that neither cycle nor nanosecond are available, but we continue + probing less resolution timers anyway for consistency with other events. + */ + if (cycle_to_pico != 0) + { + /* Normal case. */ + wait_timer= TIMER_NAME_CYCLE; + } + else if (nanosec_to_pico != 0) + { + /* Robustness, no known cases. */ + wait_timer= TIMER_NAME_NANOSEC; + } + else if (microsec_to_pico != 0) + { + /* Robustness, no known cases. */ + wait_timer= TIMER_NAME_MICROSEC; + } + else if (millisec_to_pico != 0) + { + /* Robustness, no known cases. */ + wait_timer= TIMER_NAME_MILLISEC; + } + else + { + /* + Will never be reached on any architecture, but must provide a default if + no other timers are available. + */ + wait_timer= TIMER_NAME_TICK; + } } ulonglong get_timer_value(enum_timer_name timer_name) From 6fb2cdbc74c85f266d5d60a8e6194dec1f9c36a3 Mon Sep 17 00:00:00 2001 From: Sreeharsha Ramanavarapu Date: Mon, 13 Jul 2015 07:51:23 +0530 Subject: [PATCH 15/85] Bug #20777016: DELETE CHECKS PRIVILEGES ON THE WRONG DATABASE WHEN USING TABLE ALIASES Issue: ----- When using table aliases for deleting, MySQL checks privileges against the current database and not the privileges on the actual table or database the table resides. SOLUTION: --------- While checking privileges for multi-deletes, correspondent_table should be used since it points to the correct table and database. --- sql/sql_acl.cc | 43 +++++++++++++++++++++++-------------------- sql/sql_parse.cc | 29 ++++++++++++++++------------- 2 files changed, 39 insertions(+), 33 deletions(-) diff --git a/sql/sql_acl.cc b/sql/sql_acl.cc index e8edd790f39..fea1a209c20 100644 --- a/sql/sql_acl.cc +++ b/sql/sql_acl.cc @@ -4612,16 +4612,19 @@ bool check_grant(THD *thd, ulong want_access, TABLE_LIST *tables, tl && number-- && tl != first_not_own_table; tl= tl->next_global) { - sctx = test(tl->security_ctx) ? tl->security_ctx : thd->security_ctx; + TABLE_LIST *const t_ref= + tl->correspondent_table ? tl->correspondent_table : tl; + sctx = test(t_ref->security_ctx) ? t_ref->security_ctx : + thd->security_ctx; const ACL_internal_table_access *access= - get_cached_table_access(&tl->grant.m_internal, - tl->get_db_name(), - tl->get_table_name()); + get_cached_table_access(&t_ref->grant.m_internal, + t_ref->get_db_name(), + t_ref->get_table_name()); if (access) { - switch(access->check(orig_want_access, &tl->grant.privilege)) + switch(access->check(orig_want_access, &t_ref->grant.privilege)) { case ACL_INTERNAL_ACCESS_GRANTED: /* @@ -4645,34 +4648,34 @@ bool check_grant(THD *thd, ulong want_access, TABLE_LIST *tables, if (!want_access) continue; // ok - if (!(~tl->grant.privilege & want_access) || - tl->is_anonymous_derived_table() || tl->schema_table) + if (!(~t_ref->grant.privilege & want_access) || + t_ref->is_anonymous_derived_table() || t_ref->schema_table) { /* - It is subquery in the FROM clause. VIEW set tl->derived after + It is subquery in the FROM clause. VIEW set t_ref->derived after table opening, but this function always called before table opening. */ - if (!tl->referencing_view) + if (!t_ref->referencing_view) { /* If it's a temporary table created for a subquery in the FROM clause, or an INFORMATION_SCHEMA table, drop the request for a privilege. */ - tl->grant.want_privilege= 0; + t_ref->grant.want_privilege= 0; } continue; } GRANT_TABLE *grant_table= table_hash_search(sctx->get_host()->ptr(), sctx->get_ip()->ptr(), - tl->get_db_name(), + t_ref->get_db_name(), sctx->priv_user, - tl->get_table_name(), + t_ref->get_table_name(), FALSE); if (!grant_table) { - want_access &= ~tl->grant.privilege; + want_access &= ~t_ref->grant.privilege; goto err; // No grants } @@ -4683,17 +4686,17 @@ bool check_grant(THD *thd, ulong want_access, TABLE_LIST *tables, if (any_combination_will_do) continue; - tl->grant.grant_table= grant_table; // Remember for column test - tl->grant.version= grant_version; - tl->grant.privilege|= grant_table->privs; - tl->grant.want_privilege= ((want_access & COL_ACLS) & ~tl->grant.privilege); + t_ref->grant.grant_table= grant_table; // Remember for column test + t_ref->grant.version= grant_version; + t_ref->grant.privilege|= grant_table->privs; + t_ref->grant.want_privilege= ((want_access & COL_ACLS) & ~t_ref->grant.privilege); - if (!(~tl->grant.privilege & want_access)) + if (!(~t_ref->grant.privilege & want_access)) continue; - if (want_access & ~(grant_table->cols | tl->grant.privilege)) + if (want_access & ~(grant_table->cols | t_ref->grant.privilege)) { - want_access &= ~(grant_table->cols | tl->grant.privilege); + want_access &= ~(grant_table->cols | t_ref->grant.privilege); goto err; // impossible } } diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index e1fc26775a4..fd3623c6148 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -5069,9 +5069,12 @@ check_table_access(THD *thd, ulong requirements,TABLE_LIST *tables, for (; i < number && tables != first_not_own_table && tables; tables= tables->next_global, i++) { + TABLE_LIST *const table_ref= tables->correspondent_table ? + tables->correspondent_table : tables; + ulong want_access= requirements; - if (tables->security_ctx) - sctx= tables->security_ctx; + if (table_ref->security_ctx) + sctx= table_ref->security_ctx; else sctx= backup_ctx; @@ -5079,26 +5082,26 @@ check_table_access(THD *thd, ulong requirements,TABLE_LIST *tables, Register access for view underlying table. Remove SHOW_VIEW_ACL, because it will be checked during making view */ - tables->grant.orig_want_privilege= (want_access & ~SHOW_VIEW_ACL); + table_ref->grant.orig_want_privilege= (want_access & ~SHOW_VIEW_ACL); - if (tables->schema_table_reformed) + if (table_ref->schema_table_reformed) { - if (check_show_access(thd, tables)) + if (check_show_access(thd, table_ref)) goto deny; continue; } - DBUG_PRINT("info", ("derived: %d view: %d", tables->derived != 0, - tables->view != 0)); - if (tables->is_anonymous_derived_table() || - (tables->table && tables->table->s && - (int)tables->table->s->tmp_table)) + DBUG_PRINT("info", ("derived: %d view: %d", table_ref->derived != 0, + table_ref->view != 0)); + if (table_ref->is_anonymous_derived_table() || + (table_ref->table && table_ref->table->s && + (int)table_ref->table->s->tmp_table)) continue; thd->security_ctx= sctx; - if (check_access(thd, want_access, tables->get_db_name(), - &tables->grant.privilege, - &tables->grant.m_internal, + if (check_access(thd, want_access, table_ref->get_db_name(), + &table_ref->grant.privilege, + &table_ref->grant.m_internal, 0, no_errors)) goto deny; } From 067ae38c0aea426219edb11bd188c0798e6a8395 Mon Sep 17 00:00:00 2001 From: Tor Didriksen Date: Mon, 13 Jul 2015 10:10:12 +0200 Subject: [PATCH 16/85] Bug #20168526 YASSL: CORRUPT SSL-KEY CRASHES CLIENT Post-push fix: broken build on windows. The problem is min/max macros from windows.h which interfere with a template function callex max. Solution: ADD_DEFINITIONS(-DNOMINMAX) --- cmake/os/Windows.cmake | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/cmake/os/Windows.cmake b/cmake/os/Windows.cmake index 54ea3cf95f9..98158ca806b 100644 --- a/cmake/os/Windows.cmake +++ b/cmake/os/Windows.cmake @@ -1,4 +1,4 @@ -# Copyright (c) 2010, 2014, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2010, 2015, 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 @@ -50,10 +50,12 @@ IF(CMAKE_C_COMPILER MATCHES "icl") SET(MSVC TRUE) ENDIF() -ADD_DEFINITIONS("-D_WINDOWS -D__WIN__ -D_CRT_SECURE_NO_DEPRECATE") -ADD_DEFINITIONS("-D_WIN32_WINNT=0x0501") +ADD_DEFINITIONS(-D_WINDOWS -D__WIN__ -D_CRT_SECURE_NO_DEPRECATE) +ADD_DEFINITIONS(-D_WIN32_WINNT=0x0501) +# We do not want the windows.h macros min/max +ADD_DEFINITIONS(-DNOMINMAX) # Speed up build process excluding unused header files -ADD_DEFINITIONS("-DWIN32_LEAN_AND_MEAN") +ADD_DEFINITIONS(-DWIN32_LEAN_AND_MEAN) # Adjust compiler and linker flags IF(MINGW AND CMAKE_SIZEOF_VOID_P EQUAL 4) From e57e1b235ea0d0cc2e43017ebdccac34db369200 Mon Sep 17 00:00:00 2001 From: "mysql-builder@oracle.com" <> Date: Tue, 14 Jul 2015 07:37:37 +0530 Subject: [PATCH 17/85] From 888fabd6909237f55ed9b9cf7a0c852c2e5f0beb Mon Sep 17 00:00:00 2001 From: Sreeharsha Ramanavarapu Date: Thu, 16 Jul 2015 07:56:39 +0530 Subject: [PATCH 18/85] Bug #21143080: UPDATE ON VARCHAR AND TEXT COLUMNS PRODUCE INCORRECT RESULTS Issue: ----- Updating varchar and text fields in the same update statement can produce incorrect results. When a varchar field is assigned to the text field and the varchar field is then set to a different value, the text field's result contains the varchar field's new value. SOLUTION: --------- Currently the blob type does not allocate space for the string to be stored. Instead it contains a pointer to the varchar string. So when the varchar field is changed as part of the update statement, the value contained in the blob also changes. The fix would be to actually store the value by allocating space for the blob's string. We can avoid allocating this space when the varchar field is not being written into. --- mysql-test/r/update.result | 13 +++++++++++++ mysql-test/t/update.test | 13 +++++++++++++ sql/field.h | 18 +++++++++++++++++- sql/field_conv.cc | 13 ++++--------- 4 files changed, 47 insertions(+), 10 deletions(-) diff --git a/mysql-test/r/update.result b/mysql-test/r/update.result index 54170ae3dad..d15130d1254 100644 --- a/mysql-test/r/update.result +++ b/mysql-test/r/update.result @@ -551,3 +551,16 @@ ERROR HY000: View 'test.v1' references invalid table(s) or column(s) or function DROP VIEW v1; DROP FUNCTION f1; DROP TABLE t1; +# Bug #21143080: UPDATE ON VARCHAR AND TEXT COLUMNS PRODUCE INCORRECT +# RESULTS +CREATE TABLE t1 (a VARCHAR(50), b TEXT, c CHAR(50)) ENGINE=INNODB; +INSERT INTO t1 (a, b, c) VALUES ('start trail', '', 'even longer string'); +UPDATE t1 SET b = a, a = 'inject'; +SELECT a, b FROM t1; +a b +inject start trail +UPDATE t1 SET b = c, c = 'inject'; +SELECT c, b FROM t1; +c b +inject even longer string +DROP TABLE t1; diff --git a/mysql-test/t/update.test b/mysql-test/t/update.test index c515f8873d8..14e08bd9b8b 100644 --- a/mysql-test/t/update.test +++ b/mysql-test/t/update.test @@ -503,3 +503,16 @@ UPDATE v1 SET pk = 7 WHERE pk > 0; DROP VIEW v1; DROP FUNCTION f1; DROP TABLE t1; + +--echo # Bug #21143080: UPDATE ON VARCHAR AND TEXT COLUMNS PRODUCE INCORRECT +--echo # RESULTS + +CREATE TABLE t1 (a VARCHAR(50), b TEXT, c CHAR(50)) ENGINE=INNODB; + +INSERT INTO t1 (a, b, c) VALUES ('start trail', '', 'even longer string'); +UPDATE t1 SET b = a, a = 'inject'; +SELECT a, b FROM t1; +UPDATE t1 SET b = c, c = 'inject'; +SELECT c, b FROM t1; + +DROP TABLE t1; diff --git a/sql/field.h b/sql/field.h index 6a181b7ae91..73922460037 100644 --- a/sql/field.h +++ b/sql/field.h @@ -1,7 +1,7 @@ #ifndef FIELD_INCLUDED #define FIELD_INCLUDED -/* Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2000, 2015, 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 @@ -511,6 +511,17 @@ public: } /* Hash value */ virtual void hash(ulong *nr, ulong *nr2); + +/** + Checks whether a string field is part of write_set. + + @return + FALSE - If field is not char/varchar/.... + - If field is char/varchar/.. and is not part of write set. + TRUE - If field is char/varchar/.. and is part of write set. +*/ + virtual bool is_updatable() const { return FALSE; } + friend int cre_myisam(char * name, register TABLE *form, uint options, ulonglong auto_increment_value); friend class Copy_field; @@ -798,6 +809,11 @@ public: int store_decimal(const my_decimal *d); uint32 max_data_length() const; + bool is_updatable() const + { + DBUG_ASSERT(table && table->write_set); + return bitmap_is_set(table->write_set, field_index); + } }; /* base class for float and double and decimal (old one) */ diff --git a/sql/field_conv.cc b/sql/field_conv.cc index 17b0d34557a..14c4fd257fe 100644 --- a/sql/field_conv.cc +++ b/sql/field_conv.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2000, 2015, 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 @@ -800,15 +800,10 @@ int field_conv(Field *to,Field *from) { // Be sure the value is stored Field_blob *blob=(Field_blob*) to; from->val_str(&blob->value); - /* - Copy value if copy_blobs is set, or source is not a string and - we have a pointer to its internal string conversion buffer. - */ - if (to->table->copy_blobs || - (!blob->value.is_alloced() && - from->real_type() != MYSQL_TYPE_STRING && - from->real_type() != MYSQL_TYPE_VARCHAR)) + + if (!blob->value.is_alloced() && from->is_updatable()) blob->value.copy(); + return blob->store(blob->value.ptr(),blob->value.length(),from->charset()); } if (from->real_type() == MYSQL_TYPE_ENUM && From 203f4d41930a140d469aeca9840a7b226afeaaf6 Mon Sep 17 00:00:00 2001 From: Pavel Ivanov Date: Thu, 16 Jul 2015 15:59:55 -0700 Subject: [PATCH 19/85] Add parenthesis in macro definitions to prevent order of operation problems. When macro is expanded in an expression like ~QPLAN_QC_NO (e.g. in the Query_cache::send_result_to_client() function in sql/sql_cache.cc) then without the parenthesis the expression will be evaluated to a wrong value. --- sql/log_slow.h | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/sql/log_slow.h b/sql/log_slow.h index 2ae07da97c3..3ae2060cc27 100644 --- a/sql/log_slow.h +++ b/sql/log_slow.h @@ -16,23 +16,23 @@ /* Defining what to log to slow log */ #define LOG_SLOW_VERBOSITY_INIT 0 -#define LOG_SLOW_VERBOSITY_INNODB 1 << 0 -#define LOG_SLOW_VERBOSITY_QUERY_PLAN 1 << 1 -#define LOG_SLOW_VERBOSITY_EXPLAIN 1 << 2 +#define LOG_SLOW_VERBOSITY_INNODB (1 << 0) +#define LOG_SLOW_VERBOSITY_QUERY_PLAN (1 << 1) +#define LOG_SLOW_VERBOSITY_EXPLAIN (1 << 2) #define QPLAN_INIT QPLAN_QC_NO -#define QPLAN_ADMIN 1 << 0 -#define QPLAN_FILESORT 1 << 1 -#define QPLAN_FILESORT_DISK 1 << 2 -#define QPLAN_FULL_JOIN 1 << 3 -#define QPLAN_FULL_SCAN 1 << 4 -#define QPLAN_QC 1 << 5 -#define QPLAN_QC_NO 1 << 6 -#define QPLAN_TMP_DISK 1 << 7 -#define QPLAN_TMP_TABLE 1 << 8 -#define QPLAN_FILESORT_PRIORITY_QUEUE 1 << 9 +#define QPLAN_ADMIN (1 << 0) +#define QPLAN_FILESORT (1 << 1) +#define QPLAN_FILESORT_DISK (1 << 2) +#define QPLAN_FULL_JOIN (1 << 3) +#define QPLAN_FULL_SCAN (1 << 4) +#define QPLAN_QC (1 << 5) +#define QPLAN_QC_NO (1 << 6) +#define QPLAN_TMP_DISK (1 << 7) +#define QPLAN_TMP_TABLE (1 << 8) +#define QPLAN_FILESORT_PRIORITY_QUEUE (1 << 9) /* ... */ -#define QPLAN_MAX ((ulong) 1) << 31 /* reserved as placeholder */ +#define QPLAN_MAX (((ulong) 1) << 31) /* reserved as placeholder */ From b5380e092c1cac3050a711c308136eee15c51826 Mon Sep 17 00:00:00 2001 From: Nisha Gopalakrishnan Date: Thu, 23 Jul 2015 10:47:58 +0530 Subject: [PATCH 20/85] BUG#19886430: VIEW CREATION WITH NAMED COLUMNS, OVER UNION, IS REJECTED. Analysis ======== View creation with named columns over UNION is rejected. Consider the following view definition: CREATE VIEW v1 (fld1, fld2) AS SELECT 1 AS a, 2 AS b UNION ALL SELECT 1 AS a, 1 AS a; A 'duplicate column' error was reported due to the duplicate alias name in the secondary SELECT. The VIEW column names are either explicitly specified or determined from the first SELECT (which can be auto generated if not specified). Since a duplicate column name check was performed even for the secondary SELECTs, an error was reported. Fix ==== Check for duplicate column names only for the named columns if specified or only for the first SELECT. --- mysql-test/r/view.result | 35 ++++++++++++++++++++++++++++++ mysql-test/t/view.test | 44 +++++++++++++++++++++++++++++++++++++ sql/sql_view.cc | 47 +++++++++------------------------------- 3 files changed, 89 insertions(+), 37 deletions(-) diff --git a/mysql-test/r/view.result b/mysql-test/r/view.result index c31b4f5216b..a3adf80c096 100644 --- a/mysql-test/r/view.result +++ b/mysql-test/r/view.result @@ -4146,3 +4146,38 @@ SHOW CREATE VIEW v4; View Create View character_set_client collation_connection v4 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v4` AS (select 'BUG#14117018' AS `col1`) union all (select '' AS `col2`) union all (select '' AS `Name_exp_3`) latin1 latin1_swedish_ci DROP VIEW v1, v2, v3, v4; +# +# BUG#19886430: VIEW CREATION WITH NAMED COLUMNS, OVER UNION, +# IS REJECTED +# Without the patch, reports an error. +CREATE VIEW v1 (fld1, fld2) AS +SELECT 1 AS a, 2 AS b +UNION ALL +SELECT 1 AS a, 1 AS a; +# The column names are explicitly specified and not duplicates, hence +# succeeds. +CREATE VIEW v2 (fld1, fld2) AS +SELECT 1 AS a, 2 AS a +UNION ALL +SELECT 1 AS a, 1 AS a; +# The column name in the first SELECT are not duplicates, hence succeeds. +CREATE VIEW v3 AS +SELECT 1 AS a, 2 AS b +UNION ALL +SELECT 1 AS a, 1 AS a; +# Should report an error, since the explicitly specified column names are +# duplicates. +CREATE VIEW v4 (fld1, fld1) AS +SELECT 1 AS a, 2 AS b +UNION ALL +SELECT 1 AS a, 1 AS a; +ERROR 42S21: Duplicate column name 'fld1' +# Should report an error, since duplicate column name is specified in the +# First SELECT. +CREATE VIEW v4 AS +SELECT 1 AS a, 2 AS a +UNION ALL +SELECT 1 AS a, 1 AS a; +ERROR 42S21: Duplicate column name 'a' +# Cleanup +DROP VIEW v1, v2, v3; diff --git a/mysql-test/t/view.test b/mysql-test/t/view.test index 959153ee851..f9c305831c2 100644 --- a/mysql-test/t/view.test +++ b/mysql-test/t/view.test @@ -4184,6 +4184,50 @@ SHOW CREATE VIEW v4; DROP VIEW v1, v2, v3, v4; + +--echo # +--echo # BUG#19886430: VIEW CREATION WITH NAMED COLUMNS, OVER UNION, +--echo # IS REJECTED + +--echo # Without the patch, reports an error. +CREATE VIEW v1 (fld1, fld2) AS + SELECT 1 AS a, 2 AS b + UNION ALL + SELECT 1 AS a, 1 AS a; + +--echo # The column names are explicitly specified and not duplicates, hence +--echo # succeeds. +CREATE VIEW v2 (fld1, fld2) AS + SELECT 1 AS a, 2 AS a + UNION ALL + SELECT 1 AS a, 1 AS a; + +--echo # The column name in the first SELECT are not duplicates, hence succeeds. +CREATE VIEW v3 AS + SELECT 1 AS a, 2 AS b + UNION ALL + SELECT 1 AS a, 1 AS a; + +--echo # Should report an error, since the explicitly specified column names are +--echo # duplicates. +--error ER_DUP_FIELDNAME +CREATE VIEW v4 (fld1, fld1) AS + SELECT 1 AS a, 2 AS b + UNION ALL + SELECT 1 AS a, 1 AS a; + +--echo # Should report an error, since duplicate column name is specified in the +--echo # First SELECT. +--error ER_DUP_FIELDNAME +CREATE VIEW v4 AS + SELECT 1 AS a, 2 AS a + UNION ALL + SELECT 1 AS a, 1 AS a; + +--echo # Cleanup +DROP VIEW v1, v2, v3; + + # Check that all connections opened by test cases in this file are really # gone so execution of other tests won't be affected by their presence. --source include/wait_until_count_sessions.inc diff --git a/sql/sql_view.cc b/sql/sql_view.cc index 6bbc475565b..18eb03da866 100644 --- a/sql/sql_view.cc +++ b/sql/sql_view.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2004, 2014, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2004, 2015, 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 @@ -164,18 +164,14 @@ err: possibly generate a conforming name for them if not. @param lex Lex for this thread. - - @retval false Operation was a success. - @retval true An error occurred. */ -static bool make_valid_column_names(LEX *lex) +static void make_valid_column_names(LEX *lex) { Item *item; uint name_len; char buff[NAME_LEN]; uint column_no= 1; - DBUG_ENTER("make_valid_column_names"); for (SELECT_LEX *sl= &lex->select_lex; sl; sl= sl->next_select()) { @@ -187,37 +183,7 @@ static bool make_valid_column_names(LEX *lex) item->orig_name= item->name; item->set_name(buff, name_len, system_charset_info); } - - /* - There is a possibility of generating same name for column in more than - one SELECT_LEX. For Example: - - CREATE TABLE t1 (Name_exp_1 INT, Name_exp_2 INT, Name_exp_3 INT); - CREATE TABLE t2 (Name_exp_1 INT, Name_exp_2 INT, Name_exp_3 INT); - - CREATE VIEW v1 AS SELECT '', t1.Name_exp_2 AS Name_exp_2 FROM t1 - UNION - SELECT '', t2.Name_exp_1 AS Name_exp_1 from t2; - - But, column names of the first SELECT_LEX is considered - for the output. - - mysql> SELECT * FROM v1; - +------------+------------+ - | Name_exp_1 | Name_exp_2 | - +------------+------------+ - | | 2 | - | | 3 | - +------------+------------+ - - So, checking for duplicate names in only "sl", current - SELECT_LEX. - */ - if (check_duplicate_names(sl->item_list, 1)) - DBUG_RETURN(true); } - - DBUG_RETURN(false); } @@ -624,7 +590,14 @@ bool mysql_create_view(THD *thd, TABLE_LIST *views, } /* Check if the auto generated column names are conforming. */ - if (make_valid_column_names(lex)) + make_valid_column_names(lex); + + /* + Only column names of the first select_lex should be checked for + duplication; any further UNION-ed part isn't used for determining + names of the view's columns. + */ + if (check_duplicate_names(select_lex->item_list, 1)) { res= TRUE; goto err; From 641ab6f36813516255738ba25d3c6b721189832e Mon Sep 17 00:00:00 2001 From: Thirunarayanan Balathandayuthapani Date: Wed, 29 Jul 2015 18:24:20 +0530 Subject: [PATCH 21/85] Bug #20796566 ERROR: INSERT BUFFER INSERT FAIL CANNOT INSERT INDEX RECORD Problem: ======= IBUF_BITMAP_FREE bit in ibuf bitmap array is used to indicate the free space available in leaf page. IBUF_BITMAP_FREE bit indicates free space more than actual existing free space for the leaf page. Solution: ========= Ibuf_bitmap_array is not updated for the secondary index leaf page when insert operation is done by updating a delete marked existing record in the index. Reviewed-by: Jimmy Yang RB: 9544 --- storage/innodb_plugin/btr/btr0cur.c | 31 ++++++++++++++++++++++++----- 1 file changed, 26 insertions(+), 5 deletions(-) diff --git a/storage/innodb_plugin/btr/btr0cur.c b/storage/innodb_plugin/btr/btr0cur.c index 93b150341b0..3dfab4cb8da 100644 --- a/storage/innodb_plugin/btr/btr0cur.c +++ b/storage/innodb_plugin/btr/btr0cur.c @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (c) 1994, 2013, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 1994, 2015, Oracle and/or its affiliates. All Rights Reserved. Copyright (c) 2008, Google Inc. Portions of this file contain modifications contributed and copyrighted by @@ -1894,6 +1894,7 @@ btr_cur_optimistic_update( ulint max_size; ulint new_rec_size; ulint old_rec_size; + ulint max_ins_size = 0; dtuple_t* new_entry; roll_ptr_t roll_ptr; mem_heap_t* heap; @@ -2004,6 +2005,11 @@ any_extern: : (old_rec_size + page_get_max_insert_size_after_reorganize(page, 1)); + if (!page_zip) { + max_ins_size = page_get_max_insert_size_after_reorganize( + page, 1); + } + if (!(((max_size >= BTR_CUR_PAGE_REORGANIZE_LIMIT) && (max_size >= new_rec_size)) || (page_get_n_recs(page) <= 1))) { @@ -2053,10 +2059,14 @@ any_extern: rec = btr_cur_insert_if_possible(cursor, new_entry, 0/*n_ext*/, mtr); ut_a(rec); /* <- We calculated above the insert would fit */ - if (page_zip && !dict_index_is_clust(index) + if (!dict_index_is_clust(index) && page_is_leaf(page)) { /* Update the free bits in the insert buffer. */ - ibuf_update_free_bits_zip(block, mtr); + if (page_zip) { + ibuf_update_free_bits_zip(block, mtr); + } else { + ibuf_update_free_bits_low(block, max_ins_size, mtr); + } } /* Restore the old explicit lock state on the record */ @@ -2165,6 +2175,7 @@ btr_cur_pessimistic_update( ulint n_reserved; ulint n_ext; ulint* offsets = NULL; + ulint max_ins_size = 0; *big_rec = NULL; @@ -2302,6 +2313,11 @@ make_external: ut_ad(flags & BTR_KEEP_POS_FLAG); } + if (!page_zip) { + max_ins_size = page_get_max_insert_size_after_reorganize( + page, 1); + } + /* Store state of explicit locks on rec on the page infimum record, before deleting rec. The page infimum acts as a dummy carrier of the locks, taking care also of lock releases, before we can move the locks @@ -2347,10 +2363,15 @@ make_external: big_rec_vec != NULL && (flags & BTR_KEEP_POS_FLAG), mtr); - if (page_zip && !dict_index_is_clust(index) + if (!dict_index_is_clust(index) && page_is_leaf(page)) { /* Update the free bits in the insert buffer. */ - ibuf_update_free_bits_zip(block, mtr); + if (page_zip) { + ibuf_update_free_bits_zip(block, mtr); + } else { + ibuf_update_free_bits_low(block, max_ins_size, + mtr); + } } err = DB_SUCCESS; From 8006ad8053672cbaa07f7f0a3561e2c5044ff6b7 Mon Sep 17 00:00:00 2001 From: Sreeharsha Ramanavarapu Date: Mon, 3 Aug 2015 08:15:59 +0530 Subject: [PATCH 22/85] Bug #20909518: HANDLE_FATAL_SIGNAL (SIG=11) IN FIND_USED_PARTITIONS | SQL/OPT_RANGE.CC:3884 Issue: ----- During partition pruning, first we identify the partition in which row can reside and then identify the subpartition. If we find a partition but not the subpartion then we hit a debug assert. While finding the subpartition we check the current thread's error status in part_val_int() function after some operation. In this case the thread's error status is already set to an error (multiple rows returned) so the function returns no partition found and results in incorrect behavior. SOLUTION: --------- Currently any error encountered in part_val_int is considered a "partition not found" type error. Instead of an assert, a check needs to be done and a valid error returned. --- sql/opt_range.cc | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/sql/opt_range.cc b/sql/opt_range.cc index 3adf27539a5..795f662f256 100644 --- a/sql/opt_range.cc +++ b/sql/opt_range.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2000, 2015, 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 @@ -3088,6 +3088,7 @@ int find_used_partitions(PART_PRUNE_PARAM *ppar, SEL_ARG *key_tree) int partno= (int)key_tree->part; bool pushed= FALSE; bool set_full_part_if_bad_ret= FALSE; + RANGE_OPT_PARAM *range_par= &(ppar->range_param); if (key_tree->left != &null_element) { @@ -3142,10 +3143,19 @@ int find_used_partitions(PART_PRUNE_PARAM *ppar, SEL_ARG *key_tree) key_tree->max_value, key_tree->min_flag | key_tree->max_flag, &subpart_iter); - DBUG_ASSERT(res); /* We can't get "no satisfying subpartitions" */ + if (res == 0) + { + /* + The only case where we can get "no satisfying subpartitions" + returned from the above call is when an error has occurred. + */ + DBUG_ASSERT(range_par->thd->is_error()); + return 0; + } + if (res == -1) return -1; /* all subpartitions satisfy */ - + uint32 subpart_id; bitmap_clear_all(&ppar->subparts_bitmap); while ((subpart_id= subpart_iter.get_next(&subpart_iter)) != From 9372c9ebd2d63f27bec2e203a4a9bda37ac4e2df Mon Sep 17 00:00:00 2001 From: Sreeharsha Ramanavarapu Date: Mon, 3 Aug 2015 10:08:46 +0530 Subject: [PATCH 23/85] Bug #20909518: HANDLE_FATAL_SIGNAL (SIG=11) IN FIND_USED_PARTITIONS | SQL/OPT_RANGE.CC:3884 Post-push fix. --- sql/opt_range.cc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/sql/opt_range.cc b/sql/opt_range.cc index 795f662f256..4b76fbd20a9 100644 --- a/sql/opt_range.cc +++ b/sql/opt_range.cc @@ -3088,7 +3088,6 @@ int find_used_partitions(PART_PRUNE_PARAM *ppar, SEL_ARG *key_tree) int partno= (int)key_tree->part; bool pushed= FALSE; bool set_full_part_if_bad_ret= FALSE; - RANGE_OPT_PARAM *range_par= &(ppar->range_param); if (key_tree->left != &null_element) { @@ -3149,7 +3148,7 @@ int find_used_partitions(PART_PRUNE_PARAM *ppar, SEL_ARG *key_tree) The only case where we can get "no satisfying subpartitions" returned from the above call is when an error has occurred. */ - DBUG_ASSERT(range_par->thd->is_error()); + DBUG_ASSERT(ppar->range_param.thd->is_error()); return 0; } From c28626d0af640dddfb2c4d970f0ce4f6ec1776cc Mon Sep 17 00:00:00 2001 From: Mithun C Y Date: Tue, 4 Aug 2015 11:45:02 +0530 Subject: [PATCH 24/85] Bug #21096444: MYSQL IS TRYING TO PERFORM A CONSISTENT READ BUT THE READ VIEW IS NOT ASSIGNED! Issue: A select for update subquery in having clause resulted deadlock and its transaction was rolled back by innodb. val_XXX interfaces do not handle errors and it do not propogate errors to its caller. sub_select did not see this error when it called evaluate_join_record and later made a call to innodb. As transaction is rolled back innodb asserted. Fix: Now evaluate_join_record checks if there is any error reported and then return the same to its caller. --- sql/sql_select.cc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/sql/sql_select.cc b/sql/sql_select.cc index 21b84cbca54..8a83b907b2e 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -11598,6 +11598,11 @@ evaluate_join_record(JOIN *join, JOIN_TAB *join_tab, rc= (*join_tab->next_select)(join, join_tab+1, 0); if (rc != NESTED_LOOP_OK && rc != NESTED_LOOP_NO_MORE_ROWS) return rc; + + /* check for errors evaluating the condition */ + if (join->thd->is_error()) + return NESTED_LOOP_ERROR; + if (join->return_tab < join_tab) return NESTED_LOOP_OK; /* From 67be190c0b7a803684eaffca53063f31fa8e1ddc Mon Sep 17 00:00:00 2001 From: sayantan dutta Date: Tue, 18 Feb 2014 17:57:54 +0530 Subject: [PATCH 25/85] Follow up Fix: Bug #18145121 - DEPRECATED PERL SYNTAX IN MTR (cherry picked from commit 3eb933e0eb55f962404a04741767177e12a9885f) Conflicts: mysql-test/mysql-test-run.pl --- mysql-test/mysql-test-run.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index 02ff577c7bf..684d262f410 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -490,7 +490,7 @@ sub main { } } - if ( not defined @$completed ) { + if ( not $completed ) { mtr_error("Test suite aborted"); } From 1d317440d6be293f1a6f38bf72951eccac38be55 Mon Sep 17 00:00:00 2001 From: sayantan dutta Date: Mon, 24 Feb 2014 18:44:37 +0530 Subject: [PATCH 26/85] Follow-up fix : Bug #18145121 - DEPRECATED PERL SYNTAX IN MTR (cherry picked from commit 1bfe5f724bc4c24da635f632247e7d263aa53970) Conflicts: mysql-test/lib/mtr_cases.pm --- mysql-test/lib/mtr_cases.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mysql-test/lib/mtr_cases.pm b/mysql-test/lib/mtr_cases.pm index b3bc2a83b92..e8d24eb399f 100644 --- a/mysql-test/lib/mtr_cases.pm +++ b/mysql-test/lib/mtr_cases.pm @@ -1,5 +1,5 @@ # -*- cperl -*- -# Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2005, 2015, 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 @@ -336,7 +336,7 @@ sub collect_one_suite($) # Build a hash of disabled testcases for this suite # ---------------------------------------------------------------------- my %disabled; - my @disabled_collection= @{$opt_skip_test_list} if defined @{$opt_skip_test_list}; + my @disabled_collection= @{$opt_skip_test_list} if $opt_skip_test_list; unshift (@disabled_collection, "$testdir/disabled.def"); for my $skip (@disabled_collection) { From f3dce250f45b3a02a30743b2c0928f8aaf132e88 Mon Sep 17 00:00:00 2001 From: Ajo Robert Date: Fri, 7 Aug 2015 16:26:10 +0530 Subject: [PATCH 27/85] Bug #20760261 mysqld crashed in materialized_cursor:: send_result_set_metadata Analysis -------- Cursor inside trigger accessing NEW/OLD row leads server exit. The reason for the bug was that implementation of function create_tmp_table() was not considering Item::TRIGGER_FIELD_ITEM as possible alternative for type of class being instantiated. This was resulting in a mismatch between a number of columns in result list and temp table definition. This mismatch leads to the failure of assertion DBUG_ASSERT(send_result_set_metadata.elements == item_list.elements) in the method Materialized_cursor::send_result_set_metadata in debug mode. Fix: --- Added code to consider Item::TRIGGER_FIELD_ITEM as valid type while creating fields. --- sql/sql_insert.cc | 55 ++++++++++++++++++++++++++++++++++------------- sql/sql_select.cc | 1 + 2 files changed, 41 insertions(+), 15 deletions(-) diff --git a/sql/sql_insert.cc b/sql/sql_insert.cc index a59e3fd14e9..1237521e68e 100644 --- a/sql/sql_insert.cc +++ b/sql/sql_insert.cc @@ -1,5 +1,5 @@ /* - Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved. + Copyright (c) 2000, 2015, 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 @@ -3531,7 +3531,6 @@ static TABLE *create_table_from_items(THD *thd, HA_CREATE_INFO *create_info, /* Add selected items to field list */ List_iterator_fast it(*items); Item *item; - Field *tmp_field; bool not_used; DBUG_ENTER("create_table_from_items"); @@ -3549,22 +3548,48 @@ static TABLE *create_table_from_items(THD *thd, HA_CREATE_INFO *create_info, while ((item=it++)) { - Create_field *cr_field; - Field *field, *def_field; + Field *tmp_table_field; if (item->type() == Item::FUNC_ITEM) + { if (item->result_type() != STRING_RESULT) - field= item->tmp_table_field(&tmp_table); + tmp_table_field= item->tmp_table_field(&tmp_table); else - field= item->tmp_table_field_from_field_type(&tmp_table, 0); + tmp_table_field= item->tmp_table_field_from_field_type(&tmp_table, 0); + } else - field= create_tmp_field(thd, &tmp_table, item, item->type(), - (Item ***) 0, &tmp_field, &def_field, 0, 0, 0, 0, - 0); - if (!field || - !(cr_field=new Create_field(field,(item->type() == Item::FIELD_ITEM ? - ((Item_field *)item)->field : - (Field*) 0)))) - DBUG_RETURN(0); + { + Field *from_field, *default_field; + tmp_table_field= create_tmp_field(thd, &tmp_table, item, item->type(), + (Item ***) 0, &from_field, &default_field, + 0, 0, 0, 0, 0); + } + + if (!tmp_table_field) + DBUG_RETURN(NULL); + + Field *table_field; + + switch (item->type()) + { + /* + We have to take into account both the real table's fields and + pseudo-fields used in trigger's body. These fields are used + to copy defaults values later inside constructor of + the class Create_field. + */ + case Item::FIELD_ITEM: + case Item::TRIGGER_FIELD_ITEM: + table_field= ((Item_field *) item)->field; + break; + default: + table_field= NULL; + } + + Create_field *cr_field= new Create_field(tmp_table_field, table_field); + + if (!cr_field) + DBUG_RETURN(NULL); + if (item->maybe_null) cr_field->flags &= ~NOT_NULL_FLAG; alter_info->create_list.push_back(cr_field); @@ -3639,7 +3664,7 @@ static TABLE *create_table_from_items(THD *thd, HA_CREATE_INFO *create_info, } reenable_binlog(thd); if (!table) // open failed - DBUG_RETURN(0); + DBUG_RETURN(NULL); } DBUG_EXECUTE_IF("sleep_create_select_before_lock", my_sleep(6000000);); diff --git a/sql/sql_select.cc b/sql/sql_select.cc index 8a83b907b2e..acf6efa5a13 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -9820,6 +9820,7 @@ Field *create_tmp_field(THD *thd, TABLE *table,Item *item, Item::Type type, } case Item::FIELD_ITEM: case Item::DEFAULT_VALUE_ITEM: + case Item::TRIGGER_FIELD_ITEM: { Item_field *field= (Item_field*) item; bool orig_modify= modify_item; From f59d68eeae37338d7b25f2571407e763fa897e15 Mon Sep 17 00:00:00 2001 From: Shaohua Wang Date: Mon, 10 Aug 2015 16:31:05 +0800 Subject: [PATCH 28/85] BUG#21102971 data corruption on arm64 The root cause is that x86 has a stronger memory model than the ARM processors. And the GCC builtins didn't issue the correct fences when setting/unsetting the lock word. In particular during the mutex release. The solution is rewriting atomic TAS operations: replace '__sync_' by '__atomic_' if possible. Reviewed-by: Sunny Bains Reviewed-by: Bin Su Reviewed-by: Debarun Banerjee Reviewed-by: Krunal Bauskar RB: 9782 RB: 9665 RB: 9783 --- storage/innobase/CMakeLists.txt | 18 +++- storage/innobase/include/os0sync.h | 122 ++++++++++++++++++++++---- storage/innobase/include/sync0sync.h | 9 +- storage/innobase/include/sync0sync.ic | 9 +- 4 files changed, 128 insertions(+), 30 deletions(-) diff --git a/storage/innobase/CMakeLists.txt b/storage/innobase/CMakeLists.txt index 4f000434eb9..a5fffac7ce1 100644 --- a/storage/innobase/CMakeLists.txt +++ b/storage/innobase/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (c) 2006, 2011, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2006, 2015, 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 @@ -85,12 +85,28 @@ IF(NOT CMAKE_CROSSCOMPILING) }" HAVE_IB_GCC_ATOMIC_BUILTINS ) + CHECK_C_SOURCE_RUNS( + "#include + int main() + { + unsigned char c; + + __atomic_test_and_set(&c, __ATOMIC_ACQUIRE); + __atomic_clear(&c, __ATOMIC_RELEASE); + return(0); + }" + HAVE_IB_GCC_ATOMIC_TEST_AND_SET + ) ENDIF() IF(HAVE_IB_GCC_ATOMIC_BUILTINS) ADD_DEFINITIONS(-DHAVE_IB_GCC_ATOMIC_BUILTINS=1) ENDIF() +IF(HAVE_IB_GCC_ATOMIC_TEST_AND_SET) + ADD_DEFINITIONS(-DHAVE_IB_GCC_ATOMIC_TEST_AND_SET=1) +ENDIF() + # either define HAVE_IB_ATOMIC_PTHREAD_T_GCC or not IF(NOT CMAKE_CROSSCOMPILING) CHECK_C_SOURCE_RUNS( diff --git a/storage/innobase/include/os0sync.h b/storage/innobase/include/os0sync.h index c6672aa73b6..07628409192 100644 --- a/storage/innobase/include/os0sync.h +++ b/storage/innobase/include/os0sync.h @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (c) 1995, 2009, Innobase Oy. All Rights Reserved. +Copyright (c) 1995, 2015, Oracle and/or its affiliates. All Rights Reserved. Copyright (c) 2008, Google Inc. Portions of this file contain modifications contributed and copyrighted by @@ -37,6 +37,20 @@ Created 9/6/1995 Heikki Tuuri #include "univ.i" #include "ut0lst.h" +#if defined __i386__ || defined __x86_64__ || defined _M_IX86 \ + || defined _M_X64 || defined __WIN__ + +#define IB_STRONG_MEMORY_MODEL + +#endif /* __i386__ || __x86_64__ || _M_IX86 || M_X64 || __WIN__ */ + +#ifdef HAVE_WINDOWS_ATOMICS +typedef LONG lock_word_t; /*!< On Windows, InterlockedExchange operates + on LONG variable */ +#else +typedef byte lock_word_t; +#endif + #ifdef __WIN__ /** Native event (slow)*/ typedef HANDLE os_native_event_t; @@ -304,11 +318,61 @@ amount of increment. */ # define os_atomic_increment_ulint(ptr, amount) \ os_atomic_increment(ptr, amount) -/**********************************************************//** -Returns the old value of *ptr, atomically sets *ptr to new_val */ +# if defined(HAVE_IB_GCC_ATOMIC_TEST_AND_SET) -# define os_atomic_test_and_set_byte(ptr, new_val) \ - __sync_lock_test_and_set(ptr, (byte) new_val) +/** Do an atomic test-and-set. +@param[in,out] ptr Memory location to set to non-zero +@return the previous value */ +static inline +lock_word_t +os_atomic_test_and_set(volatile lock_word_t* ptr) +{ + return(__atomic_test_and_set(ptr, __ATOMIC_ACQUIRE)); +} + +/** Do an atomic clear. +@param[in,out] ptr Memory location to set to zero */ +static inline +void +os_atomic_clear(volatile lock_word_t* ptr) +{ + __atomic_clear(ptr, __ATOMIC_RELEASE); +} + +# elif defined(IB_STRONG_MEMORY_MODEL) + +/** Do an atomic test and set. +@param[in,out] ptr Memory location to set to non-zero +@return the previous value */ +static inline +lock_word_t +os_atomic_test_and_set(volatile lock_word_t* ptr) +{ + return(__sync_lock_test_and_set(ptr, 1)); +} + +/** Do an atomic release. + +In theory __sync_lock_release should be used to release the lock. +Unfortunately, it does not work properly alone. The workaround is +that more conservative __sync_lock_test_and_set is used instead. + +Performance regression was observed at some conditions for Intel +architecture. Disable release barrier on Intel architecture for now. +@param[in,out] ptr Memory location to write to +@return the previous value */ +static inline +lock_word_t +os_atomic_clear(volatile lock_word_t* ptr) +{ + return(__sync_lock_test_and_set(ptr, 0)); +} + +# else + +# error "Unsupported platform" + +# endif /* HAVE_IB_GCC_ATOMIC_TEST_AND_SET */ #elif defined(HAVE_IB_SOLARIS_ATOMICS) @@ -357,11 +421,25 @@ amount of increment. */ # define os_atomic_increment_ulint(ptr, amount) \ atomic_add_long_nv(ptr, amount) -/**********************************************************//** -Returns the old value of *ptr, atomically sets *ptr to new_val */ +/** Do an atomic xchg and set to non-zero. +@param[in,out] ptr Memory location to set to non-zero +@return the previous value */ +static inline +lock_word_t +os_atomic_test_and_set(volatile lock_word_t* ptr) +{ + return(atomic_swap_uchar(ptr, 1)); +} -# define os_atomic_test_and_set_byte(ptr, new_val) \ - atomic_swap_uchar(ptr, new_val) +/** Do an atomic xchg and set to zero. +@param[in,out] ptr Memory location to set to zero +@return the previous value */ +static inline +lock_word_t +os_atomic_clear(volatile lock_word_t* ptr) +{ + return(atomic_swap_uchar(ptr, 0)); +} #elif defined(HAVE_WINDOWS_ATOMICS) @@ -403,13 +481,27 @@ amount of increment. */ # define os_atomic_increment_ulint(ptr, amount) \ ((ulint) (win_xchg_and_add(ptr, amount) + amount)) -/**********************************************************//** -Returns the old value of *ptr, atomically sets *ptr to new_val. -InterlockedExchange() operates on LONG, and the LONG will be -clobbered */ +/** Do an atomic test and set. +InterlockedExchange() operates on LONG, and the LONG will be clobbered +@param[in,out] ptr Memory location to set to non-zero +@return the previous value */ +static inline +lock_word_t +os_atomic_test_and_set(volatile lock_word_t* ptr) +{ + return(InterlockedExchange(ptr, 1)); +} -# define os_atomic_test_and_set_byte(ptr, new_val) \ - ((byte) InterlockedExchange(ptr, new_val)) +/** Do an atomic release. +InterlockedExchange() operates on LONG, and the LONG will be clobbered +@param[in,out] ptr Memory location to set to zero +@return the previous value */ +static inline +lock_word_t +os_atomic_clear(volatile lock_word_t* ptr) +{ + return(InterlockedExchange(ptr, 0)); +} #else # define IB_ATOMICS_STARTUP_MSG \ diff --git a/storage/innobase/include/sync0sync.h b/storage/innobase/include/sync0sync.h index 9b07c4758c9..b50735f4ad0 100644 --- a/storage/innobase/include/sync0sync.h +++ b/storage/innobase/include/sync0sync.h @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (c) 1995, 2012, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 1995, 2015, Oracle and/or its affiliates. All Rights Reserved. Copyright (c) 2008, Google Inc. Portions of this file contain modifications contributed and copyrighted by @@ -45,13 +45,6 @@ Created 9/5/1995 Heikki Tuuri extern my_bool timed_mutexes; #endif /* UNIV_DEBUG && !UNIV_HOTBACKUP */ -#ifdef HAVE_WINDOWS_ATOMICS -typedef LONG lock_word_t; /*!< On Windows, InterlockedExchange operates - on LONG variable */ -#else -typedef byte lock_word_t; -#endif - #if defined UNIV_PFS_MUTEX || defined UNIV_PFS_RWLOCK /* There are mutexes/rwlocks that we want to exclude from instrumentation even if their corresponding performance schema diff --git a/storage/innobase/include/sync0sync.ic b/storage/innobase/include/sync0sync.ic index 6958faa5c6f..bd2df4488b4 100644 --- a/storage/innobase/include/sync0sync.ic +++ b/storage/innobase/include/sync0sync.ic @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (c) 1995, 2009, Innobase Oy. All Rights Reserved. +Copyright (c) 1995, 2015, Oracle and/or its affiliates. All Rights Reserved. Copyright (c) 2008, Google Inc. Portions of this file contain modifications contributed and copyrighted by @@ -80,7 +80,7 @@ mutex_test_and_set( mutex_t* mutex) /*!< in: mutex */ { #if defined(HAVE_ATOMIC_BUILTINS) - return(os_atomic_test_and_set_byte(&mutex->lock_word, 1)); + return(os_atomic_test_and_set(&mutex->lock_word)); #else ibool ret; @@ -108,10 +108,7 @@ mutex_reset_lock_word( mutex_t* mutex) /*!< in: mutex */ { #if defined(HAVE_ATOMIC_BUILTINS) - /* In theory __sync_lock_release should be used to release the lock. - Unfortunately, it does not work properly alone. The workaround is - that more conservative __sync_lock_test_and_set is used instead. */ - os_atomic_test_and_set_byte(&mutex->lock_word, 0); + os_atomic_clear(&mutex->lock_word); #else mutex->lock_word = 0; From 608efca4c4e4afa1ffea251abda675fcc06efc69 Mon Sep 17 00:00:00 2001 From: Aditya A Date: Wed, 12 Aug 2015 19:17:26 +0530 Subject: [PATCH 29/85] Bug #21025880 DUPLICATE UK VALUES IN READ-COMMITTED (AGAIN) PROBLEM Whenever we insert in unique secondary index we take shared locks on all possible duplicate record present in the table. But while during a replace on the unique secondary index , we take exclusive and locks on the all duplicate record. When the records are deleted, they are first delete marked and later purged by the purge thread. While purging the record we call the lock_update_delete() which in turn calls lock_rec_inherit_to_gap() to inherit locks of the deleted records. In repeatable read mode we inherit all the locks from the record to the next record but in the read commited mode we skip inherting them as gap type locks. We make a exception here if the lock on the records is in shared mode ,we assume that it is set during insert for unique secondary index and needs to be inherited to stop constraint violation. We didnt handle the case when exclusive locks are set during replace, we skip inheriting locks of these records and hence causing constraint violation. FIX While inheriting the locks,check whether the transaction is allowed to do TRX_DUP_REPLACE/TRX_DUP_IGNORE, if true inherit the locks. [ Revewied by Jimmy #rb9709] --- storage/innobase/lock/lock0lock.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/storage/innobase/lock/lock0lock.c b/storage/innobase/lock/lock0lock.c index e6ce07428e8..559b3687b79 100644 --- a/storage/innobase/lock/lock0lock.c +++ b/storage/innobase/lock/lock0lock.c @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (c) 1996, 2012, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 1996, 2015, 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 the Free Software @@ -2457,16 +2457,16 @@ lock_rec_inherit_to_gap( /* If srv_locks_unsafe_for_binlog is TRUE or session is using READ COMMITTED isolation level, we do not want locks set by an UPDATE or a DELETE to be inherited as gap type locks. But we - DO want S-locks set by a consistency constraint to be inherited also - then. */ + DO want S-locks/X-locks (taken for replace) set by a consistency + constraint to be inherited also then. */ while (lock != NULL) { if (!lock_rec_get_insert_intention(lock) && !((srv_locks_unsafe_for_binlog || lock->trx->isolation_level <= TRX_ISO_READ_COMMITTED) - && lock_get_mode(lock) == LOCK_X)) { - + && lock_get_mode(lock) == + (lock->trx->duplicates ? LOCK_S : LOCK_X))) { lock_rec_add_to_queue(LOCK_REC | LOCK_GAP | lock_get_mode(lock), heir_block, heir_heap_no, From 557a57f3a23c486fbe12b66306ab7adffd609677 Mon Sep 17 00:00:00 2001 From: Mithun C Y Date: Mon, 17 Aug 2015 15:23:47 +0530 Subject: [PATCH 30/85] Bug #21350175: SUBQUERIES IN PROCEDURE CLAUSE OF SELECT STATEMENT CAUSES SERVER FAILURES. Analysis : ========== During JOIN::prepare of sub-query which creates the derived tables we call setup_procedure. Here we call fix_fields for parameters of procedure clause. Calling setup_procedure at this point may cause issue. If sub-query is one of parameter being fixed it might lead to complicated dependencies on derived tables being prepared. SOLUTION : ========== In 5.6 with WL#6242, we have made procedure clause parameters can only be NUM, so sub-queries are not allowed as parameters. So in 5.5 we can block sub-queries in procedure clause parameters. This eliminates above conflicting dependencies. --- mysql-test/r/subselect.result | 2 +- mysql-test/t/subselect.test | 2 +- sql/sql_yacc.yy | 12 ++++++++++++ 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/mysql-test/r/subselect.result b/mysql-test/r/subselect.result index 49cf73677b1..aec8e07e071 100644 --- a/mysql-test/r/subselect.result +++ b/mysql-test/r/subselect.result @@ -75,7 +75,7 @@ SELECT 1 FROM (SELECT 1 as a) b WHERE 1 IN (SELECT (SELECT a)); select (SELECT 1 FROM (SELECT 1) a PROCEDURE ANALYSE(1)); ERROR HY000: Incorrect usage of PROCEDURE and subquery SELECT 1 FROM (SELECT 1) a PROCEDURE ANALYSE((SELECT 1)); -ERROR HY000: Incorrect parameters to procedure 'ANALYSE' +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'SELECT 1))' at line 1 SELECT (SELECT 1) as a FROM (SELECT 1) b WHERE (SELECT a) IS NULL; ERROR 42S22: Unknown column 'a' in 'field list' SELECT (SELECT 1) as a FROM (SELECT 1) b WHERE (SELECT a) IS NOT NULL; diff --git a/mysql-test/t/subselect.test b/mysql-test/t/subselect.test index aec0db59843..a5a4b2b5c32 100644 --- a/mysql-test/t/subselect.test +++ b/mysql-test/t/subselect.test @@ -30,7 +30,7 @@ SELECT 1 IN (SELECT 1); SELECT 1 FROM (SELECT 1 as a) b WHERE 1 IN (SELECT (SELECT a)); -- error ER_WRONG_USAGE select (SELECT 1 FROM (SELECT 1) a PROCEDURE ANALYSE(1)); --- error ER_WRONG_PARAMETERS_TO_PROCEDURE +-- error ER_PARSE_ERROR SELECT 1 FROM (SELECT 1) a PROCEDURE ANALYSE((SELECT 1)); -- error ER_BAD_FIELD_ERROR SELECT (SELECT 1) as a FROM (SELECT 1) b WHERE (SELECT a) IS NULL; diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy index d9a32f2dd35..991fa390e22 100644 --- a/sql/sql_yacc.yy +++ b/sql/sql_yacc.yy @@ -9373,8 +9373,20 @@ procedure_clause: if (add_proc_to_list(lex->thd, item)) MYSQL_YYABORT; Lex->uncacheable(UNCACHEABLE_SIDEEFFECT); + + /* + PROCEDURE CLAUSE cannot handle subquery as one of its parameter, + so set expr_allows_subselect as false to disallow any subqueries + further. Reset expr_allows_subselect back to true once the + parameters are reduced. + */ + Lex->expr_allows_subselect= false; } '(' procedure_list ')' + { + /* Subqueries are allowed from now.*/ + Lex->expr_allows_subselect= true; + } ; procedure_list: From 93ac0eb1c46a708529b290fd072c9d1e3e3526e8 Mon Sep 17 00:00:00 2001 From: Karthik Kamath Date: Tue, 18 Aug 2015 10:38:06 +0530 Subject: [PATCH 31/85] BUG#11754258: INCORRECT ERROR MESSAGE WHEN CREATING UNSAFE VIEW It appears that the code refactoring done as part of the patch for the MySQL BUG#11749859 fixed this issue. This issue is not reproducible on MySQL 5.5+ versions now. As part of this patch, the test file "mysqldump.test" has been updated to remove the comment which was referring to the bug and also the line which suppresses the warning. --- mysql-test/t/mysqldump.test | 5 ----- 1 file changed, 5 deletions(-) diff --git a/mysql-test/t/mysqldump.test b/mysql-test/t/mysqldump.test index 54780b95627..11d766c3293 100644 --- a/mysql-test/t/mysqldump.test +++ b/mysql-test/t/mysqldump.test @@ -875,13 +875,8 @@ select * from t1; create view v1 as select * from v3 where b in (1, 2, 3, 4, 5, 6, 7); -# Disable warnings since LIMIT warning for unsafe statement if -# binlog_format = STATEMENT. Note: after BUG#45832, the warning should -# not be issued. ---disable_warnings create view v2 as select v3.a from v3, v1 where v1.a=v3.a and v3.b=3 limit 1; ---enable_warnings --exec $MYSQL_DUMP --skip-comments test From ee02650bac49b66a38c7c485ea2f81edd4403ffc Mon Sep 17 00:00:00 2001 From: Shishir Jaiswal Date: Tue, 18 Aug 2015 12:24:27 +0530 Subject: [PATCH 32/85] Bug #16171518 - LOAD XML DOES NOT HANDLE EMPTY ELEMENTS DESCRIPTION =========== Inability of mysql LOAD XML command to handle empty XML tags i.e. . Also the behaviour is wrong and (different than above) when there is a space in empty tag i.e. ANALYSIS ======== In read_xml() the case where we encounter a close tag ('/') we're decreasing the 'level' blindly which is wrong. Actually when its an without-space-empty-tag (succeeding char is '>'), we need to skip the decrement. In other words whenever we hit a close tag ('/'), decrease the 'level' only when (i) It's not an (without space) empty tag i.e. or, (ii) It is of format FIX === The switch case for '/' is modified. We've removed the blind decrement of 'level'. We do it only when its not an without-space-empty-tag. Also we are setting 'in_tag' to false to let program know that we're done reading current tag (required in the case of format ) --- mysql-test/r/loadxml.result | 27 ++++++++++++ mysql-test/std_data/bug16171518_1.dat | 59 +++++++++++++++++++++++++++ mysql-test/std_data/bug16171518_2.dat | 12 ++++++ mysql-test/t/loadxml.test | 14 +++++++ sql/sql_load.cc | 11 ++++- 5 files changed, 121 insertions(+), 2 deletions(-) create mode 100644 mysql-test/std_data/bug16171518_1.dat create mode 100644 mysql-test/std_data/bug16171518_2.dat diff --git a/mysql-test/r/loadxml.result b/mysql-test/r/loadxml.result index 7742f456252..1128caf9122 100644 --- a/mysql-test/r/loadxml.result +++ b/mysql-test/r/loadxml.result @@ -93,3 +93,30 @@ a b 216 !&bb b; 3 !b3 DROP TABLE t1; +# +# Bug#16171518 LOAD XML DOES NOT HANDLE EMPTY ELEMENTS +# +CREATE TABLE t1 (col1 VARCHAR(3), col2 VARCHAR(3), col3 VARCHAR(3), col4 VARCHAR(4)); +LOAD XML INFILE '../../std_data/bug16171518_1.dat' INTO TABLE t1; +SELECT * FROM t1 ORDER BY col1, col2, col3, col4; +col1 col2 col3 col4 +0bc def ghi jkl +1no NULL pqr stu +2BC DEF GHI JKL +3NO NULL PQR STU +4bc def ghi jkl +5no pqr stu vwx +6BC DEF NULL JKL +7NO PQR STU VWX +8bc def ghi NULL +9kl NULL mno pqr +ABC DEF NULL JKL +MNO NULL STU VWX +DROP TABLE t1; +CREATE TABLE t1 (col1 VARCHAR(3), col2 VARCHAR(3), col3 INTEGER); +LOAD XML INFILE '../../std_data/bug16171518_2.dat' INTO TABLE t1; +SELECT * FROM t1 ORDER BY col1, col2, col3; +col1 col2 col3 +ABC DEF NULL +GHI NULL 123 +DROP TABLE t1; diff --git a/mysql-test/std_data/bug16171518_1.dat b/mysql-test/std_data/bug16171518_1.dat new file mode 100644 index 00000000000..b65b9359ce1 --- /dev/null +++ b/mysql-test/std_data/bug16171518_1.dat @@ -0,0 +1,59 @@ + + + 0bc + def + ghi + jkl + + + 1no + + pqr + stu + + + + 2BC + DEF + GHI + JKL + + + 3NO + + PQR + STU + + + + + + + 6BC + DEF + + JKL + + + 7NO + PQR + STU + VWX + + + + 8bc + def + ghi + + + + 9kl + + mno + pqr + + + + + diff --git a/mysql-test/std_data/bug16171518_2.dat b/mysql-test/std_data/bug16171518_2.dat new file mode 100644 index 00000000000..8a483337a0f --- /dev/null +++ b/mysql-test/std_data/bug16171518_2.dat @@ -0,0 +1,12 @@ + + + ABC + DEF + + + + GHI + + 123 + + diff --git a/mysql-test/t/loadxml.test b/mysql-test/t/loadxml.test index 6faf712b6ce..93e6e82189f 100644 --- a/mysql-test/t/loadxml.test +++ b/mysql-test/t/loadxml.test @@ -116,3 +116,17 @@ LOAD XML INFILE '../../std_data/loadxml.dat' INTO TABLE t1 ROWS IDENTIFIED BY '' (a,@b) SET b=concat('!',@b); SELECT * FROM t1 ORDER BY a; DROP TABLE t1; + + +--echo # +--echo # Bug#16171518 LOAD XML DOES NOT HANDLE EMPTY ELEMENTS +--echo # +CREATE TABLE t1 (col1 VARCHAR(3), col2 VARCHAR(3), col3 VARCHAR(3), col4 VARCHAR(4)); +LOAD XML INFILE '../../std_data/bug16171518_1.dat' INTO TABLE t1; +SELECT * FROM t1 ORDER BY col1, col2, col3, col4; +DROP TABLE t1; + +CREATE TABLE t1 (col1 VARCHAR(3), col2 VARCHAR(3), col3 INTEGER); +LOAD XML INFILE '../../std_data/bug16171518_2.dat' INTO TABLE t1; +SELECT * FROM t1 ORDER BY col1, col2, col3; +DROP TABLE t1; diff --git a/sql/sql_load.cc b/sql/sql_load.cc index 05571d49cc8..5f72d3ce520 100644 --- a/sql/sql_load.cc +++ b/sql/sql_load.cc @@ -1,5 +1,5 @@ /* - Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. + Copyright (c) 2000, 2015, 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 @@ -1987,8 +1987,15 @@ int READ_INFO::read_xml() break; case '/': /* close tag */ - level--; chr= my_tospace(GET); + /* Decrease the 'level' only when (i) It's not an */ + /* (without space) empty tag i.e. or, (ii) */ + /* It is of format */ + if(chr != '>' || in_tag) + { + level--; + in_tag= false; + } if(chr != '>') /* if this is an empty tag */ tag.length(0); /* we should keep tag value */ while(chr != '>' && chr != my_b_EOF) From 75f43c5f6a5332894cf2d90ab2c04cc62c5ad18b Mon Sep 17 00:00:00 2001 From: Lars Tangvald Date: Wed, 19 Aug 2015 14:17:50 +0200 Subject: [PATCH 33/85] Small change to default config for Docker-specific rpm package Syncs "official" and our own Docker images --- packaging/rpm-docker/my.cnf | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packaging/rpm-docker/my.cnf b/packaging/rpm-docker/my.cnf index 8951b27d776..c1c03c1c668 100644 --- a/packaging/rpm-docker/my.cnf +++ b/packaging/rpm-docker/my.cnf @@ -17,6 +17,8 @@ # join_buffer_size = 128M # sort_buffer_size = 2M # read_rnd_buffer_size = 2M +skip-host-cache +skip-name-resolve datadir=/var/lib/mysql socket=/var/lib/mysql/mysql.sock secure-file-priv=/var/lib/mysql-files From f4ff086abea975222572fcfd232bf296018f5d85 Mon Sep 17 00:00:00 2001 From: Arun Kuruvila Date: Fri, 21 Aug 2015 08:35:42 +0530 Subject: [PATCH 34/85] Bug#20198490 : LOWER_CASE_TABLE_NAMES=0 ON WINDOWS LEADS TO PROBLEMS Description:- Server variable "--lower_case_tables_names" when set to "0" on windows platform which does not support case sensitive file operations leads to problems. A warning message is printed in the error log while starting the server with "--lower_case_tables_names=0". Also according to the documentation, seting "lower_case_tables_names" to "0" on a case-insensitive filesystem might lead to index corruption. Analysis:- The problem reported in the bug is:- Creating an INNODB table 'a' and executing a query, "INSERT INTO a SELECT a FROM A;" on a server started with "--lower_case_tables_names=0" and running on a case-insensitive filesystem leads innodb to flat spin. Optimizer thinks that "a" and "A" are two different tables as the variable "lower_case_table_names" is set to "0". As a result, optimizer comes up with a plan which does not need a temporary table. If the same table is used in select and insert, a temporary table is needed. This incorrect optimizer plan leads to infinite insertions. Fix:- If the server is started with "--lower_case_tables_names" set to 0 on a case-insensitive filesystem, an error, "The server option 'lower_case_table_names'is configured to use case sensitive table names but the data directory is on a case-insensitive file system which is an unsupported combination. Please consider either using a case sensitive file system for your data directory or switching to a case-insensitive table name mode.", is printed in the server error log and the server exits. --- mysql-test/r/lowercase_fs_on.result | 3 ++ mysql-test/r/lowercase_table3.result | 11 ------ .../suite/innodb/t/innodb_bug60229-master.opt | 1 - .../suite/innodb/t/innodb_bug60229.test | 4 ++ mysql-test/suite/jp/t/jp_enum_sjis-master.opt | 1 - mysql-test/suite/jp/t/jp_enum_sjis.test | 4 ++ mysql-test/suite/jp/t/jp_enum_ucs2-master.opt | 1 - mysql-test/suite/jp/t/jp_enum_ucs2.test | 4 ++ mysql-test/suite/jp/t/jp_enum_ujis-master.opt | 1 - mysql-test/suite/jp/t/jp_enum_ujis.test | 4 ++ mysql-test/suite/jp/t/jp_enum_utf8-master.opt | 1 - mysql-test/suite/jp/t/jp_enum_utf8.test | 4 ++ mysql-test/t/lowercase_fs_on.test | 38 +++++++++++++++++++ mysql-test/t/lowercase_table3-master.opt | 1 - mysql-test/t/lowercase_table3.test | 37 ------------------ sql/mysqld.cc | 15 ++++---- 16 files changed, 69 insertions(+), 61 deletions(-) create mode 100644 mysql-test/r/lowercase_fs_on.result delete mode 100644 mysql-test/r/lowercase_table3.result delete mode 100644 mysql-test/suite/innodb/t/innodb_bug60229-master.opt delete mode 100644 mysql-test/suite/jp/t/jp_enum_sjis-master.opt delete mode 100644 mysql-test/suite/jp/t/jp_enum_ucs2-master.opt delete mode 100644 mysql-test/suite/jp/t/jp_enum_ujis-master.opt delete mode 100644 mysql-test/suite/jp/t/jp_enum_utf8-master.opt create mode 100644 mysql-test/t/lowercase_fs_on.test delete mode 100644 mysql-test/t/lowercase_table3-master.opt delete mode 100644 mysql-test/t/lowercase_table3.test diff --git a/mysql-test/r/lowercase_fs_on.result b/mysql-test/r/lowercase_fs_on.result new file mode 100644 index 00000000000..a090f46cfbf --- /dev/null +++ b/mysql-test/r/lowercase_fs_on.result @@ -0,0 +1,3 @@ +# +# Bug#20198490 : LOWER_CASE_TABLE_NAMES=0 ON WINDOWS LEADS TO PROBLEMS +# diff --git a/mysql-test/r/lowercase_table3.result b/mysql-test/r/lowercase_table3.result deleted file mode 100644 index 22e80aaeb26..00000000000 --- a/mysql-test/r/lowercase_table3.result +++ /dev/null @@ -1,11 +0,0 @@ -call mtr.add_suppression("Cannot find or open table test/BUG29839 from"); -DROP TABLE IF EXISTS t1,T1; -CREATE TABLE t1 (a INT); -SELECT * FROM T1; -a -FLUSH TABLES; -DROP TABLE t1; -CREATE TABLE bug29839 (a INT) ENGINE=INNODB; -SELECT * FROM BUG29839; -ERROR 42S02: Table 'test.BUG29839' doesn't exist -DROP TABLE bug29839; diff --git a/mysql-test/suite/innodb/t/innodb_bug60229-master.opt b/mysql-test/suite/innodb/t/innodb_bug60229-master.opt deleted file mode 100644 index 9b27aef9bf8..00000000000 --- a/mysql-test/suite/innodb/t/innodb_bug60229-master.opt +++ /dev/null @@ -1 +0,0 @@ ---lower_case_table_names=0 diff --git a/mysql-test/suite/innodb/t/innodb_bug60229.test b/mysql-test/suite/innodb/t/innodb_bug60229.test index 8dcf15157d6..aee0b96a942 100644 --- a/mysql-test/suite/innodb/t/innodb_bug60229.test +++ b/mysql-test/suite/innodb/t/innodb_bug60229.test @@ -2,6 +2,10 @@ # Bug #13083023 - 60229: BROKEN COMPATIBILITY: ERROR WHILE CREATE TABLE # WITH FOREIGN KEY CONSTRAINT. +#Server variable option 'lower_case_table_names' sets '0' as default value +#in case sensitive filesystem. Using 'lower_case_table_names=0' in case of +#insensitive filsystem is not allowed. +-- source include/have_case_sensitive_file_system.inc -- source include/have_innodb.inc CREATE TABLE PERSON ( diff --git a/mysql-test/suite/jp/t/jp_enum_sjis-master.opt b/mysql-test/suite/jp/t/jp_enum_sjis-master.opt deleted file mode 100644 index 9b27aef9bf8..00000000000 --- a/mysql-test/suite/jp/t/jp_enum_sjis-master.opt +++ /dev/null @@ -1 +0,0 @@ ---lower_case_table_names=0 diff --git a/mysql-test/suite/jp/t/jp_enum_sjis.test b/mysql-test/suite/jp/t/jp_enum_sjis.test index e1f22f6fe27..1060f83ec06 100644 --- a/mysql-test/suite/jp/t/jp_enum_sjis.test +++ b/mysql-test/suite/jp/t/jp_enum_sjis.test @@ -1,3 +1,7 @@ +#Server variable option 'lower_case_table_names' sets '0' as default value +#in case sensitive filesystem. Using 'lower_case_table_names=0' in case of +#insensitive filsystem is not allowed. +-- source include/have_case_sensitive_file_system.inc --source include/have_sjis.inc --source include/have_innodb.inc --character_set sjis diff --git a/mysql-test/suite/jp/t/jp_enum_ucs2-master.opt b/mysql-test/suite/jp/t/jp_enum_ucs2-master.opt deleted file mode 100644 index 9b27aef9bf8..00000000000 --- a/mysql-test/suite/jp/t/jp_enum_ucs2-master.opt +++ /dev/null @@ -1 +0,0 @@ ---lower_case_table_names=0 diff --git a/mysql-test/suite/jp/t/jp_enum_ucs2.test b/mysql-test/suite/jp/t/jp_enum_ucs2.test index a3d7c47705d..321f8952148 100644 --- a/mysql-test/suite/jp/t/jp_enum_ucs2.test +++ b/mysql-test/suite/jp/t/jp_enum_ucs2.test @@ -1,3 +1,7 @@ +#Server variable option 'lower_case_table_names' sets '0' as default value +#in case sensitive filesystem. Using 'lower_case_table_names=0' in case of +#insensitive filsystem is not allowed. +-- source include/have_case_sensitive_file_system.inc --source include/have_ucs2.inc --source include/have_innodb.inc diff --git a/mysql-test/suite/jp/t/jp_enum_ujis-master.opt b/mysql-test/suite/jp/t/jp_enum_ujis-master.opt deleted file mode 100644 index 9b27aef9bf8..00000000000 --- a/mysql-test/suite/jp/t/jp_enum_ujis-master.opt +++ /dev/null @@ -1 +0,0 @@ ---lower_case_table_names=0 diff --git a/mysql-test/suite/jp/t/jp_enum_ujis.test b/mysql-test/suite/jp/t/jp_enum_ujis.test index 17e41e0691e..10e8ad55a3c 100644 --- a/mysql-test/suite/jp/t/jp_enum_ujis.test +++ b/mysql-test/suite/jp/t/jp_enum_ujis.test @@ -1,3 +1,7 @@ +#Server variable option 'lower_case_table_names' sets '0' as default value +#in case sensitive filesystem. Using 'lower_case_table_names=0' in case of +#insensitive filsystem is not allowed. +-- source include/have_case_sensitive_file_system.inc --source include/have_ujis.inc --source include/have_innodb.inc diff --git a/mysql-test/suite/jp/t/jp_enum_utf8-master.opt b/mysql-test/suite/jp/t/jp_enum_utf8-master.opt deleted file mode 100644 index 9b27aef9bf8..00000000000 --- a/mysql-test/suite/jp/t/jp_enum_utf8-master.opt +++ /dev/null @@ -1 +0,0 @@ ---lower_case_table_names=0 diff --git a/mysql-test/suite/jp/t/jp_enum_utf8.test b/mysql-test/suite/jp/t/jp_enum_utf8.test index ff5978da69c..f67939bd02b 100644 --- a/mysql-test/suite/jp/t/jp_enum_utf8.test +++ b/mysql-test/suite/jp/t/jp_enum_utf8.test @@ -1,3 +1,7 @@ +#Server variable option 'lower_case_table_names' sets '0' as default value +#in case sensitive filesystem. Using 'lower_case_table_names=0' in case of +#insensitive filsystem is not allowed. +-- source include/have_case_sensitive_file_system.inc --source include/have_utf8.inc --source include/have_innodb.inc --disable_warnings diff --git a/mysql-test/t/lowercase_fs_on.test b/mysql-test/t/lowercase_fs_on.test new file mode 100644 index 00000000000..6da3ef32a0b --- /dev/null +++ b/mysql-test/t/lowercase_fs_on.test @@ -0,0 +1,38 @@ +# +# Specific tests for case-insensitive file systems +# i.e. lower_case_filesystem=ON +# +-- source include/have_case_insensitive_file_system.inc +# Embedded server does not support restarting. +--source include/not_embedded.inc + +--echo # +--echo # Bug#20198490 : LOWER_CASE_TABLE_NAMES=0 ON WINDOWS LEADS TO PROBLEMS +--echo # + +let SEARCH_FILE= $MYSQLTEST_VARDIR/log/my_restart.err; + +--error 0,1 +--remove_file $SEARCH_FILE + +#Shutdown the server +--exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect +--shutdown_server +--source include/wait_until_disconnected.inc + +#Start the server with --lower_case_table_names=0 in Windows. +--enable_reconnect +--error 1 +--exec $MYSQLD_CMD --lower_case_table_names=0 > $SEARCH_FILE 2>&1 + +#Search for the error messege in the server error log. +let SEARCH_PATTERN= \[ERROR\] The server option \'lower_case_table_names\' is configured to use case sensitive table names but the data directory is on a case-insensitive file system which is an unsupported combination\. Please consider either using a case sensitive file system for your data directory or switching to a case-insensitive table name mode\.; +--source include/search_pattern_in_file.inc + +#Restart the server +--exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect +--source include/wait_until_connected_again.inc + +#Cleanup +--error 0,1 +--remove_file $SEARCH_FILE diff --git a/mysql-test/t/lowercase_table3-master.opt b/mysql-test/t/lowercase_table3-master.opt deleted file mode 100644 index 9b27aef9bf8..00000000000 --- a/mysql-test/t/lowercase_table3-master.opt +++ /dev/null @@ -1 +0,0 @@ ---lower_case_table_names=0 diff --git a/mysql-test/t/lowercase_table3.test b/mysql-test/t/lowercase_table3.test deleted file mode 100644 index f7ca8211288..00000000000 --- a/mysql-test/t/lowercase_table3.test +++ /dev/null @@ -1,37 +0,0 @@ -# -# Test of force of lower-case-table-names=0 -# (User has case insensitive file system and wants to preserve case of -# table names) -# - ---source include/have_innodb.inc ---source include/have_lowercase0.inc ---source include/have_case_insensitive_file_system.inc ---source include/not_windows.inc - -call mtr.add_suppression("Cannot find or open table test/BUG29839 from"); - ---disable_warnings -DROP TABLE IF EXISTS t1,T1; ---enable_warnings - -# -# This is actually an error, but ok as the user has forced this -# by using --lower-case-table-names=0 -CREATE TABLE t1 (a INT); -SELECT * FROM T1; -FLUSH TABLES; -DROP TABLE t1; - -# -# InnoDB should in this case be case sensitive -# Note that this is not true on windows as no this OS, InnoDB is always -# storing things in lower case. -# - -CREATE TABLE bug29839 (a INT) ENGINE=INNODB; ---error ER_NO_SUCH_TABLE -SELECT * FROM BUG29839; -DROP TABLE bug29839; - -# End of 4.1 tests diff --git a/sql/mysqld.cc b/sql/mysqld.cc index c999e0c5a0f..a2532ceddd3 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -3551,13 +3551,14 @@ static int init_common_variables() { if (lower_case_table_names_used) { - if (global_system_variables.log_warnings) - sql_print_warning("\ -You have forced lower_case_table_names to 0 through a command-line \ -option, even though your file system '%s' is case insensitive. This means \ -that you can corrupt a MyISAM table by accessing it with different cases. \ -You should consider changing lower_case_table_names to 1 or 2", - mysql_real_data_home); + sql_print_error("The server option 'lower_case_table_names' is " + "configured to use case sensitive table names but the " + "data directory is on a case-insensitive file system " + "which is an unsupported combination. Please consider " + "either using a case sensitive file system for your data " + "directory or switching to a case-insensitive table name " + "mode."); + return 1; } else { From e414cbffad0e095c545cf2aa3f646c8a36c9b398 Mon Sep 17 00:00:00 2001 From: Nisha Gopalakrishnan Date: Tue, 25 Aug 2015 14:25:46 +0530 Subject: [PATCH 35/85] BUG#20449914: HANDLE_FATAL_SIGNAL (SIG=11) IN FIELD_ITERATOR_TABLE::END_OF_FIELDS Note: This a backport of the patch for bug#19894987 to MySQL-5.5 --- sql/sql_base.cc | 14 +++++++++++--- sql/sql_handler.cc | 48 +++++++++++++++++++++++++++++++++++++++++++++- sql/sql_handler.h | 3 ++- 3 files changed, 60 insertions(+), 5 deletions(-) diff --git a/sql/sql_base.cc b/sql/sql_base.cc index 0b256974258..61a0d1ae909 100644 --- a/sql/sql_base.cc +++ b/sql/sql_base.cc @@ -1648,13 +1648,20 @@ bool close_temporary_tables(THD *thd) if (!thd->temporary_tables) DBUG_RETURN(FALSE); + /* + Ensure we don't have open HANDLERs for tables we are about to close. + This is necessary when close_temporary_tables() is called as part + of execution of BINLOG statement (e.g. for format description event). + */ + mysql_ha_rm_temporary_tables(thd); if (!mysql_bin_log.is_open()) { TABLE *tmp_next; - for (table= thd->temporary_tables; table; table= tmp_next) + for (TABLE *t= thd->temporary_tables; t; t= tmp_next) { - tmp_next= table->next; - close_temporary(table, 1, 1); + tmp_next= t->next; + mysql_lock_remove(thd, thd->lock, t); + close_temporary(t, 1, 1); } thd->temporary_tables= 0; DBUG_RETURN(FALSE); @@ -1744,6 +1751,7 @@ bool close_temporary_tables(THD *thd) strlen(table->s->table_name.str)); s_query.append(','); next= table->next; + mysql_lock_remove(thd, thd->lock, table); close_temporary(table, 1, 1); } thd->clear_error(); diff --git a/sql/sql_handler.cc b/sql/sql_handler.cc index b179d54eadf..2d8877db37a 100644 --- a/sql/sql_handler.cc +++ b/sql/sql_handler.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2001, 2015, 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 @@ -1002,3 +1002,49 @@ void mysql_ha_set_explicit_lock_duration(THD *thd) DBUG_VOID_RETURN; } + +/** + Remove temporary tables from the HANDLER's hash table. The reason + for having a separate function, rather than calling + mysql_ha_rm_tables() is that it is not always feasible (e.g. in + close_temporary_tables) to obtain a TABLE_LIST containing the + temporary tables. + + @See close_temporary_tables + @param thd Thread identifier. +*/ +void mysql_ha_rm_temporary_tables(THD *thd) +{ + DBUG_ENTER("mysql_ha_rm_temporary_tables"); + + TABLE_LIST *tmp_handler_tables= NULL; + for (uint i= 0; i < thd->handler_tables_hash.records; i++) + { + TABLE_LIST *handler_table= reinterpret_cast + (my_hash_element(&thd->handler_tables_hash, i)); + + if (handler_table->table && handler_table->table->s->tmp_table) + { + handler_table->next_local= tmp_handler_tables; + tmp_handler_tables= handler_table; + } + } + + while (tmp_handler_tables) + { + TABLE_LIST *nl= tmp_handler_tables->next_local; + mysql_ha_close_table(thd, tmp_handler_tables); + my_hash_delete(&thd->handler_tables_hash, (uchar*) tmp_handler_tables); + tmp_handler_tables= nl; + } + + /* + Mark MDL_context as no longer breaking protocol if we have + closed last HANDLER. + */ + if (thd->handler_tables_hash.records == 0) + { + thd->mdl_context.set_needs_thr_lock_abort(FALSE); + } + DBUG_VOID_RETURN; +} diff --git a/sql/sql_handler.h b/sql/sql_handler.h index b21d4595fce..c6d8c5ed0c0 100644 --- a/sql/sql_handler.h +++ b/sql/sql_handler.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2006, 2015, 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 @@ -32,5 +32,6 @@ void mysql_ha_flush_tables(THD *thd, TABLE_LIST *all_tables); void mysql_ha_rm_tables(THD *thd, TABLE_LIST *tables); void mysql_ha_cleanup(THD *thd); void mysql_ha_set_explicit_lock_duration(THD *thd); +void mysql_ha_rm_temporary_tables(THD *thd); #endif /* SQL_HANDLER_INCLUDED */ From b1895fb8c924e7152b73765cfd02b686362ca76c Mon Sep 17 00:00:00 2001 From: Balasubramanian Kandasamy Date: Wed, 26 Aug 2015 19:29:00 +0200 Subject: [PATCH 36/85] Bug#21527467 - RPM SCRIPTS FAIL WITH MULTIPLE DATADIR --- support-files/mysql.spec.sh | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/support-files/mysql.spec.sh b/support-files/mysql.spec.sh index aaeed444e2f..5af4783f919 100644 --- a/support-files/mysql.spec.sh +++ b/support-files/mysql.spec.sh @@ -635,7 +635,7 @@ install -m 644 "%{malloc_lib_source}" \ # Check local settings to support them. if [ -x %{_bindir}/my_print_defaults ] then - mysql_datadir=`%{_bindir}/my_print_defaults server mysqld | grep '^--datadir=' | sed -n 's/--datadir=//p'` + mysql_datadir=`%{_bindir}/my_print_defaults server mysqld | grep '^--datadir=' | tail -1 | sed -n 's/--datadir=//p'` PID_FILE_PATT=`%{_bindir}/my_print_defaults server mysqld | grep '^--pid-file=' | sed -n 's/--pid-file=//p'` fi if [ -z "$mysql_datadir" ] @@ -740,7 +740,7 @@ esac STATUS_FILE=$mysql_datadir/RPM_UPGRADE_MARKER -if [ -f $STATUS_FILE ]; then +if [ -f "$STATUS_FILE" ]; then echo "Some previous upgrade was not finished:" ls -ld $STATUS_FILE echo "Please check its status, then do" @@ -811,7 +811,7 @@ fi # Check local settings to support them. if [ -x %{_bindir}/my_print_defaults ] then - mysql_datadir=`%{_bindir}/my_print_defaults server mysqld | grep '^--datadir=' | sed -n 's/--datadir=//p'` + mysql_datadir=`%{_bindir}/my_print_defaults server mysqld | grep '^--datadir=' | tail -1 | sed -n 's/--datadir=//p'` fi if [ -z "$mysql_datadir" ] then @@ -824,8 +824,8 @@ STATUS_FILE=$mysql_datadir/RPM_UPGRADE_MARKER # ---------------------------------------------------------------------- # Create data directory if needed, check whether upgrade or install # ---------------------------------------------------------------------- -if [ ! -d $mysql_datadir ] ; then mkdir -m 755 $mysql_datadir; fi -if [ -f $STATUS_FILE ] ; then +if [ ! -d "$mysql_datadir" ] ; then mkdir -m 755 "$mysql_datadir" ; fi +if [ -f "$STATUS_FILE" ] ; then SERVER_TO_START=`grep '^SERVER_TO_START=' $STATUS_FILE | cut -c17-` else SERVER_TO_START='' @@ -1003,7 +1003,7 @@ fi # Check local settings to support them. if [ -x %{_bindir}/my_print_defaults ] then - mysql_datadir=`%{_bindir}/my_print_defaults server mysqld | grep '^--datadir=' | sed -n 's/--datadir=//p'` + mysql_datadir=`%{_bindir}/my_print_defaults server mysqld | grep '^--datadir=' | tail -1 | sed -n 's/--datadir=//p'` fi if [ -z "$mysql_datadir" ] then @@ -1014,7 +1014,7 @@ NEW_VERSION=%{mysql_version}-%{release} STATUS_FILE=$mysql_datadir/RPM_UPGRADE_MARKER-LAST # Note the difference! STATUS_HISTORY=$mysql_datadir/RPM_UPGRADE_HISTORY -if [ -f $STATUS_FILE ] ; then +if [ -f "$STATUS_FILE" ] ; then SERVER_TO_START=`grep '^SERVER_TO_START=' $STATUS_FILE | cut -c17-` else # This should never happen, but let's be prepared From 9abf426ee7f1ca2bab2683387137d3da0f18bc0e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Lindstr=C3=B6m?= Date: Fri, 4 Sep 2015 13:35:31 +0300 Subject: [PATCH 37/85] MDEV-8443: mysql-test - innodb.innodb_simulate_comp_failures 'innodb_plugin' is failing Reduce the number of rounds and operations to avoid testcase timeout. --- .../suite/innodb/r/innodb_simulate_comp_failures.result | 2 +- mysql-test/suite/innodb/t/innodb_simulate_comp_failures.test | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/mysql-test/suite/innodb/r/innodb_simulate_comp_failures.result b/mysql-test/suite/innodb/r/innodb_simulate_comp_failures.result index 1cb2cf77050..c2a8ba1f4db 100644 --- a/mysql-test/suite/innodb/r/innodb_simulate_comp_failures.result +++ b/mysql-test/suite/innodb/r/innodb_simulate_comp_failures.result @@ -5,4 +5,4 @@ CREATE TABLE t1(id INT AUTO_INCREMENT PRIMARY KEY, msg VARCHAR(255), KEY msg_i(m SET GLOBAL innodb_simulate_comp_failures = 25; SELECT COUNT(*) FROM t1; COUNT(*) -10000 +1500 diff --git a/mysql-test/suite/innodb/t/innodb_simulate_comp_failures.test b/mysql-test/suite/innodb/t/innodb_simulate_comp_failures.test index ae9e0a9b984..cf22935fad6 100644 --- a/mysql-test/suite/innodb/t/innodb_simulate_comp_failures.test +++ b/mysql-test/suite/innodb/t/innodb_simulate_comp_failures.test @@ -1,8 +1,8 @@ --source include/big_test.inc # test takes too long with valgrind --source include/not_valgrind.inc ---let $num_inserts = 10000 ---let $num_ops = 10000 +--let $num_inserts = 1500 +--let $num_ops = 3500 --source suite/innodb/include/innodb_simulate_comp_failures.inc # clean exit --exit From 102a85f9f30cdf8c3baa3893c68932617240bfa6 Mon Sep 17 00:00:00 2001 From: Oleksandr Byelkin Date: Thu, 3 Sep 2015 18:00:43 +0200 Subject: [PATCH 38/85] MDEV-8663: IF Statement returns multiple values erroneously (or Assertion `!null_value' failed in Item::send(Protocol*, String*)) Postreview addons by Bar Fix: keeping contract: NULL value mean NULL pointer in val_str and val_deciman. --- mysql-test/r/func_if.result | 17 ++++++++++++ mysql-test/t/func_if.test | 14 ++++++++++ sql/item_cmpfunc.cc | 6 +++-- sql/item_func.cc | 53 +++++++++++++++++-------------------- sql/item_func.h | 23 ++++++++++++++++ 5 files changed, 82 insertions(+), 31 deletions(-) diff --git a/mysql-test/r/func_if.result b/mysql-test/r/func_if.result index c7f548ae2bc..61f63cc7253 100644 --- a/mysql-test/r/func_if.result +++ b/mysql-test/r/func_if.result @@ -234,3 +234,20 @@ SELECT if(1, NULL, (SELECT min('hello'))); if(1, NULL, (SELECT min('hello'))) NULL End of 5.2 tests +# +# MDEV-8663: IF Statement returns multiple values erroneously +# (or Assertion `!null_value' failed in Item::send(Protocol*, String*) +# +CREATE TABLE `t1` ( +`datas` VARCHAR(25) NOT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +Warnings: +Warning 1286 Unknown storage engine 'InnoDB' +Warning 1266 Using storage engine MyISAM for table 't1' +INSERT INTO `t1` VALUES ('1,2'), ('2,3'), ('3,4'); +SELECT IF(FIND_IN_SET('1', `datas`), 1.5, IF(FIND_IN_SET('2', `datas`), 2, NULL)) AS `First`, '1' AS `Second`, '2' AS `Third` FROM `t1`; +First Second Third +1.5 1 2 +2.0 1 2 +NULL 1 2 +drop table t1; diff --git a/mysql-test/t/func_if.test b/mysql-test/t/func_if.test index 2b89a618aa6..8fdba77db9b 100644 --- a/mysql-test/t/func_if.test +++ b/mysql-test/t/func_if.test @@ -206,6 +206,20 @@ SELECT if(1, NULL, (SELECT min('hello'))); --echo End of 5.2 tests +--echo # +--echo # MDEV-8663: IF Statement returns multiple values erroneously +--echo # (or Assertion `!null_value' failed in Item::send(Protocol*, String*) +--echo # +CREATE TABLE `t1` ( +`datas` VARCHAR(25) NOT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +INSERT INTO `t1` VALUES ('1,2'), ('2,3'), ('3,4'); + +SELECT IF(FIND_IN_SET('1', `datas`), 1.5, IF(FIND_IN_SET('2', `datas`), 2, NULL)) AS `First`, '1' AS `Second`, '2' AS `Third` FROM `t1`; + +drop table t1; + --disable_query_log # Restore timezone to default set time_zone= @@global.time_zone; diff --git a/sql/item_cmpfunc.cc b/sql/item_cmpfunc.cc index 998cb1cbd64..4f07318d1fd 100644 --- a/sql/item_cmpfunc.cc +++ b/sql/item_cmpfunc.cc @@ -2692,7 +2692,8 @@ Item_func_if::str_op(String *str) String *res=arg->val_str(str); if (res) res->set_charset(collation.collation); - null_value=arg->null_value; + if (null_value=arg->null_value) + res= NULL; return res; } @@ -2703,7 +2704,8 @@ Item_func_if::decimal_op(my_decimal *decimal_value) DBUG_ASSERT(fixed == 1); Item *arg= args[0]->val_bool() ? args[1] : args[2]; my_decimal *value= arg->val_decimal(decimal_value); - null_value= arg->null_value; + if (null_value= arg->null_value) + value= NULL; return value; } diff --git a/sql/item_func.cc b/sql/item_func.cc index 2f5130886e6..eb5b63f549e 100644 --- a/sql/item_func.cc +++ b/sql/item_func.cc @@ -887,7 +887,7 @@ String *Item_func_hybrid_result_type::val_str(String *str) case DECIMAL_RESULT: { my_decimal decimal_value, *val; - if (!(val= decimal_op(&decimal_value))) + if (!(val= decimal_op_with_null_check(&decimal_value))) return 0; // null is set my_decimal_round(E_DEC_FATAL_ERROR, val, decimals, FALSE, val); str->set_charset(collation.collation); @@ -914,24 +914,22 @@ String *Item_func_hybrid_result_type::val_str(String *str) if (is_temporal_type(field_type())) { MYSQL_TIME ltime; - if (date_op(<ime, - field_type() == MYSQL_TYPE_TIME ? TIME_TIME_ONLY : 0) || - str->alloc(MAX_DATE_STRING_REP_LENGTH)) - { - null_value= 1; + if (date_op_with_null_check(<ime) || + (null_value= str->alloc(MAX_DATE_STRING_REP_LENGTH))) return (String *) 0; - } ltime.time_type= mysql_type_to_time_type(field_type()); str->length(my_TIME_to_str(<ime, const_cast(str->ptr()), decimals)); str->set_charset(&my_charset_bin); + DBUG_ASSERT(!null_value); return str; } - return str_op(&str_value); + return str_op_with_null_check(&str_value); case TIME_RESULT: case ROW_RESULT: case IMPOSSIBLE_RESULT: DBUG_ASSERT(0); } + DBUG_ASSERT(!null_value || (str == NULL)); return str; } @@ -944,7 +942,7 @@ double Item_func_hybrid_result_type::val_real() { my_decimal decimal_value, *val; double result; - if (!(val= decimal_op(&decimal_value))) + if (!(val= decimal_op_with_null_check(&decimal_value))) return 0.0; // null is set my_decimal2double(E_DEC_FATAL_ERROR, val, &result); return result; @@ -961,18 +959,14 @@ double Item_func_hybrid_result_type::val_real() if (is_temporal_type(field_type())) { MYSQL_TIME ltime; - if (date_op(<ime, - field_type() == MYSQL_TYPE_TIME ? TIME_TIME_ONLY : 0 )) - { - null_value= 1; + if (date_op_with_null_check(<ime)) return 0; - } ltime.time_type= mysql_type_to_time_type(field_type()); return TIME_to_double(<ime); } char *end_not_used; int err_not_used; - String *res= str_op(&str_value); + String *res= str_op_with_null_check(&str_value); return (res ? my_strntod(res->charset(), (char*) res->ptr(), res->length(), &end_not_used, &err_not_used) : 0.0); } @@ -992,7 +986,7 @@ longlong Item_func_hybrid_result_type::val_int() case DECIMAL_RESULT: { my_decimal decimal_value, *val; - if (!(val= decimal_op(&decimal_value))) + if (!(val= decimal_op_with_null_check(&decimal_value))) return 0; // null is set longlong result; my_decimal2int(E_DEC_FATAL_ERROR, val, unsigned_flag, &result); @@ -1007,18 +1001,14 @@ longlong Item_func_hybrid_result_type::val_int() if (is_temporal_type(field_type())) { MYSQL_TIME ltime; - if (date_op(<ime, - field_type() == MYSQL_TYPE_TIME ? TIME_TIME_ONLY : 0)) - { - null_value= 1; + if (date_op_with_null_check(<ime)) return 0; - } ltime.time_type= mysql_type_to_time_type(field_type()); return TIME_to_ulonglong(<ime); } int err_not_used; String *res; - if (!(res= str_op(&str_value))) + if (!(res= str_op_with_null_check(&str_value))) return 0; char *end= (char*) res->ptr() + res->length(); @@ -1040,17 +1030,21 @@ my_decimal *Item_func_hybrid_result_type::val_decimal(my_decimal *decimal_value) DBUG_ASSERT(fixed == 1); switch (cached_result_type) { case DECIMAL_RESULT: - val= decimal_op(decimal_value); + val= decimal_op_with_null_check(decimal_value); break; case INT_RESULT: { longlong result= int_op(); + if (null_value) + return NULL; int2my_decimal(E_DEC_FATAL_ERROR, result, unsigned_flag, decimal_value); break; } case REAL_RESULT: { double result= (double)real_op(); + if (null_value) + return NULL; double2my_decimal(E_DEC_FATAL_ERROR, result, decimal_value); break; } @@ -1059,19 +1053,20 @@ my_decimal *Item_func_hybrid_result_type::val_decimal(my_decimal *decimal_value) if (is_temporal_type(field_type())) { MYSQL_TIME ltime; - if (date_op(<ime, - field_type() == MYSQL_TYPE_TIME ? TIME_TIME_ONLY : 0)) + if (date_op_with_null_check(<ime)) { my_decimal_set_zero(decimal_value); - null_value= 1; return 0; } ltime.time_type= mysql_type_to_time_type(field_type()); return date2my_decimal(<ime, decimal_value); } String *res; - if (!(res= str_op(&str_value))) + if (!(res= str_op_with_null_check(&str_value))) + { + null_value= 1; return NULL; + } str2my_decimal(E_DEC_FATAL_ERROR, (char*) res->ptr(), res->length(), res->charset(), decimal_value); @@ -1094,7 +1089,7 @@ bool Item_func_hybrid_result_type::get_date(MYSQL_TIME *ltime, case DECIMAL_RESULT: { my_decimal value, *res; - if (!(res= decimal_op(&value)) || + if (!(res= decimal_op_with_null_check(&value)) || decimal_to_datetime_with_warn(res, ltime, fuzzydate, field_name_or_null())) goto err; @@ -1124,7 +1119,7 @@ bool Item_func_hybrid_result_type::get_date(MYSQL_TIME *ltime, return date_op(ltime, fuzzydate); char buff[40]; String tmp(buff,sizeof(buff), &my_charset_bin),*res; - if (!(res= str_op(&tmp)) || + if (!(res= str_op_with_null_check(&tmp)) || str_to_datetime_with_warn(res->charset(), res->ptr(), res->length(), ltime, fuzzydate) <= MYSQL_TIMESTAMP_ERROR) goto err; diff --git a/sql/item_func.h b/sql/item_func.h index 4b11238c10d..36474e79cdc 100644 --- a/sql/item_func.h +++ b/sql/item_func.h @@ -411,6 +411,29 @@ public: class Item_func_hybrid_result_type: public Item_func { + /* + Helper methods to make sure that the result of + decimal_op(), str_op() and date_op() is properly synched with null_value. + */ + bool date_op_with_null_check(MYSQL_TIME *ltime) + { + bool rc= date_op(ltime, + field_type() == MYSQL_TYPE_TIME ? TIME_TIME_ONLY : 0); + DBUG_ASSERT(!rc ^ null_value); + return rc; + } + String *str_op_with_null_check(String *str) + { + String *res= str_op(str); + DBUG_ASSERT((res != NULL) ^ null_value); + return res; + } + my_decimal *decimal_op_with_null_check(my_decimal *decimal_buffer) + { + my_decimal *res= decimal_op(decimal_buffer); + DBUG_ASSERT((res != NULL) ^ null_value); + return res; + } protected: Item_result cached_result_type; From 0ce0b88080fd39f6841206b64d8723af9779e849 Mon Sep 17 00:00:00 2001 From: Oleksandr Byelkin Date: Tue, 1 Sep 2015 11:47:06 +0200 Subject: [PATCH 39/85] MDEV-8450: PATCH] Wrong macro expansion in Query_cache::send_result_to_client() Expression in macro protected by () --- include/maria.h | 2 +- include/my_alarm.h | 2 +- include/my_base.h | 8 ++++---- include/mysql.h | 4 ++-- sql/log_event.h | 2 +- sql/sql_admin.h | 2 +- sql/sql_const.h | 4 ++-- sql/threadpool_unix.cc | 2 +- sql/unireg.h | 12 ++++++------ storage/archive/archive_test.c | 2 +- storage/connect/tabmul.cpp | 2 +- storage/federated/ha_federated.h | 2 +- storage/maria/ma_blockrec.h | 2 +- storage/myisam/myisamdef.h | 2 +- strings/conf_to_src.c | 2 +- strings/ctype.c | 2 +- 16 files changed, 26 insertions(+), 26 deletions(-) diff --git a/include/maria.h b/include/maria.h index 16a9beab62a..cdaeadef4de 100644 --- a/include/maria.h +++ b/include/maria.h @@ -43,7 +43,7 @@ extern "C" { #define MARIA_NAME_IEXT ".MAI" #define MARIA_NAME_DEXT ".MAD" /* Max extra space to use when sorting keys */ -#define MARIA_MAX_TEMP_LENGTH 2*1024L*1024L*1024L +#define MARIA_MAX_TEMP_LENGTH (2*1024L*1024L*1024L) /* Possible values for maria_block_size (must be power of 2) */ #define MARIA_KEY_BLOCK_LENGTH 8192 /* default key block length */ #define MARIA_MIN_KEY_BLOCK_LENGTH 1024 /* Min key block length */ diff --git a/include/my_alarm.h b/include/my_alarm.h index c3707cba395..73bb6ab76cc 100644 --- a/include/my_alarm.h +++ b/include/my_alarm.h @@ -50,7 +50,7 @@ extern ulong my_time_to_wait_for_lock; #define ALARM_INIT #define ALARM_END #define ALARM_TEST (alarm_pos++ >= alarm_end_pos) -#define ALARM_REINIT alarm_end_pos+=MY_HOW_OFTEN_TO_WRITE +#define ALARM_REINIT (alarm_end_pos+=MY_HOW_OFTEN_TO_WRITE) #endif /* HAVE_ALARM */ #ifdef __cplusplus diff --git a/include/my_base.h b/include/my_base.h index cdf8e189031..5c3dd8db9d9 100644 --- a/include/my_base.h +++ b/include/my_base.h @@ -536,13 +536,13 @@ typedef ulong key_part_map; #define SEARCH_NULL_ARE_EQUAL 32768 /* NULL in keys are equal */ #define SEARCH_NULL_ARE_NOT_EQUAL 65536 /* NULL in keys are not equal */ /* Use this when inserting a key in position order */ -#define SEARCH_INSERT SEARCH_NULL_ARE_NOT_EQUAL*2 +#define SEARCH_INSERT (SEARCH_NULL_ARE_NOT_EQUAL*2) /* Only part of the key is specified while reading */ -#define SEARCH_PART_KEY SEARCH_INSERT*2 +#define SEARCH_PART_KEY (SEARCH_INSERT*2) /* Used when user key (key 2) contains transaction id's */ -#define SEARCH_USER_KEY_HAS_TRANSID SEARCH_PART_KEY*2 +#define SEARCH_USER_KEY_HAS_TRANSID (SEARCH_PART_KEY*2) /* Used when page key (key 1) contains transaction id's */ -#define SEARCH_PAGE_KEY_HAS_TRANSID SEARCH_USER_KEY_HAS_TRANSID*2 +#define SEARCH_PAGE_KEY_HAS_TRANSID (SEARCH_USER_KEY_HAS_TRANSID*2) /* bits in opt_flag */ #define QUICK_USED 1 diff --git a/include/mysql.h b/include/mysql.h index d9d9739dd1f..f088ad668a1 100644 --- a/include/mysql.h +++ b/include/mysql.h @@ -79,8 +79,8 @@ extern unsigned int mariadb_deinitialize_ssl; extern unsigned int mysql_port; extern char *mysql_unix_port; -#define CLIENT_NET_READ_TIMEOUT 365*24*3600 /* Timeout on read */ -#define CLIENT_NET_WRITE_TIMEOUT 365*24*3600 /* Timeout on write */ +#define CLIENT_NET_READ_TIMEOUT (365*24*3600) /* Timeout on read */ +#define CLIENT_NET_WRITE_TIMEOUT (365*24*3600) /* Timeout on write */ #define IS_PRI_KEY(n) ((n) & PRI_KEY_FLAG) #define IS_NOT_NULL(n) ((n) & NOT_NULL_FLAG) diff --git a/sql/log_event.h b/sql/log_event.h index 6a3e6f174bb..1349ec6187a 100644 --- a/sql/log_event.h +++ b/sql/log_event.h @@ -295,7 +295,7 @@ struct sql_ex_info to the slave. It is used to increase the thd(max_allowed) for both the DUMP thread on the master and the SQL/IO thread on the slave. */ -#define MAX_MAX_ALLOWED_PACKET 1024*1024*1024 +#define MAX_MAX_ALLOWED_PACKET (1024*1024*1024) /* Event header offsets; diff --git a/sql/sql_admin.h b/sql/sql_admin.h index 77fc41e2ec4..96594fad0cb 100644 --- a/sql/sql_admin.h +++ b/sql/sql_admin.h @@ -17,7 +17,7 @@ #define SQL_TABLE_MAINTENANCE_H /* Must be able to hold ALTER TABLE t PARTITION BY ... KEY ALGORITHM = 1 ... */ -#define SQL_ADMIN_MSG_TEXT_SIZE 128 * 1024 +#define SQL_ADMIN_MSG_TEXT_SIZE (128 * 1024) bool mysql_assign_to_keycache(THD* thd, TABLE_LIST* table_list, LEX_STRING *key_cache_name); diff --git a/sql/sql_const.h b/sql/sql_const.h index 2cbc616559d..9110902cde7 100644 --- a/sql/sql_const.h +++ b/sql/sql_const.h @@ -142,7 +142,7 @@ */ #define STACK_MIN_SIZE 16000 // Abort if less stack during eval. -#define STACK_MIN_SIZE_FOR_OPEN 1024*80 +#define STACK_MIN_SIZE_FOR_OPEN (1024*80) #define STACK_BUFF_ALLOC 352 ///< For stack overrun checks #ifndef MYSQLD_NET_RETRY_COUNT #define MYSQLD_NET_RETRY_COUNT 10 ///< Abort read after this many int. @@ -238,7 +238,7 @@ #define DEFAULT_CONCURRENCY 10 #define DELAYED_LIMIT 100 /**< pause after xxx inserts */ #define DELAYED_QUEUE_SIZE 1000 -#define DELAYED_WAIT_TIMEOUT 5*60 /**< Wait for delayed insert */ +#define DELAYED_WAIT_TIMEOUT (5*60) /**< Wait for delayed insert */ #define MAX_CONNECT_ERRORS 100 ///< errors before disabling host #define LONG_TIMEOUT ((ulong) 3600L*24L*365L) diff --git a/sql/threadpool_unix.cc b/sql/threadpool_unix.cc index 68c032fb67b..e720e43498a 100644 --- a/sql/threadpool_unix.cc +++ b/sql/threadpool_unix.cc @@ -1634,7 +1634,7 @@ int tp_get_idle_thread_count() Delay in microseconds, after which "pool blocked" message is printed. (30 sec == 30 Mio usec) */ -#define BLOCK_MSG_DELAY 30*1000000 +#define BLOCK_MSG_DELAY (30*1000000) #define MAX_THREADS_REACHED_MSG \ "Threadpool could not create additional thread to handle queries, because the \ diff --git a/sql/unireg.h b/sql/unireg.h index 2d51aa39fd4..b13dd494c74 100644 --- a/sql/unireg.h +++ b/sql/unireg.h @@ -110,36 +110,36 @@ The flag means that we need to process tables only to get necessary data. Views are not processed. */ -#define OPEN_TABLE_ONLY OPEN_FRM_FILE_ONLY*2 +#define OPEN_TABLE_ONLY (OPEN_FRM_FILE_ONLY*2) /** This flag is used in function get_all_tables() which fills I_S tables with data which are retrieved from frm files and storage engine The flag means that we need to process views only to get necessary data. Tables are not processed. */ -#define OPEN_VIEW_ONLY OPEN_TABLE_ONLY*2 +#define OPEN_VIEW_ONLY (OPEN_TABLE_ONLY*2) /** This flag is used in function get_all_tables() which fills I_S tables with data which are retrieved from frm files and storage engine. The flag means that we need to open a view using open_normal_and_derived_tables() function. */ -#define OPEN_VIEW_FULL OPEN_VIEW_ONLY*2 +#define OPEN_VIEW_FULL (OPEN_VIEW_ONLY*2) /** This flag is used in function get_all_tables() which fills I_S tables with data which are retrieved from frm files and storage engine. The flag means that I_S table uses optimization algorithm. */ -#define OPTIMIZE_I_S_TABLE OPEN_VIEW_FULL*2 +#define OPTIMIZE_I_S_TABLE (OPEN_VIEW_FULL*2) /** This flag is used to instruct tdc_open_view() to check metadata version. */ -#define CHECK_METADATA_VERSION OPEN_TRIGGER_ONLY*2 +#define CHECK_METADATA_VERSION (OPEN_TRIGGER_ONLY*2) /* The flag means that we need to process trigger files only. */ -#define OPEN_TRIGGER_ONLY OPTIMIZE_I_S_TABLE*2 +#define OPEN_TRIGGER_ONLY (OPTIMIZE_I_S_TABLE*2) #define SC_INFO_LENGTH 4 /* Form format constant */ #define TE_INFO_LENGTH 3 diff --git a/storage/archive/archive_test.c b/storage/archive/archive_test.c index d01c1e0b22e..bb052b8409c 100644 --- a/storage/archive/archive_test.c +++ b/storage/archive/archive_test.c @@ -33,7 +33,7 @@ #define ARCHIVE_ROW_HEADER_SIZE 4 -#define BUFFER_LEN 1024 + ARCHIVE_ROW_HEADER_SIZE +#define BUFFER_LEN (1024 + ARCHIVE_ROW_HEADER_SIZE) char test_string[BUFFER_LEN]; diff --git a/storage/connect/tabmul.cpp b/storage/connect/tabmul.cpp index 3008ca1b8ca..ea287558b44 100644 --- a/storage/connect/tabmul.cpp +++ b/storage/connect/tabmul.cpp @@ -123,7 +123,7 @@ PTDB TDBMUL::Duplicate(PGLOBAL g) bool TDBMUL::InitFileNames(PGLOBAL g) { #define PFNZ 4096 -#define FNSZ _MAX_DRIVE+_MAX_DIR+_MAX_FNAME+_MAX_EXT +#define FNSZ (_MAX_DRIVE+_MAX_DIR+_MAX_FNAME+_MAX_EXT) char *pfn[PFNZ]; char *filename; int rc, n = 0; diff --git a/storage/federated/ha_federated.h b/storage/federated/ha_federated.h index cfda0eadf3e..a23375cbe58 100644 --- a/storage/federated/ha_federated.h +++ b/storage/federated/ha_federated.h @@ -34,7 +34,7 @@ */ #define HA_FEDERATED_ERROR_WITH_REMOTE_SYSTEM 10000 -#define FEDERATED_QUERY_BUFFER_SIZE STRING_BUFFER_USUAL_SIZE * 5 +#define FEDERATED_QUERY_BUFFER_SIZE (STRING_BUFFER_USUAL_SIZE * 5) #define FEDERATED_RECORDS_IN_RANGE 2 #define FEDERATED_MAX_KEY_LENGTH 3500 // Same as innodb diff --git a/storage/maria/ma_blockrec.h b/storage/maria/ma_blockrec.h index 40ca2591236..1caf09ef1f5 100644 --- a/storage/maria/ma_blockrec.h +++ b/storage/maria/ma_blockrec.h @@ -44,7 +44,7 @@ /* Number of extents reserved MARIA_BITMAP_BLOCKS to store head part */ #define ELEMENTS_RESERVED_FOR_MAIN_PART 4 /* This is just used to prealloc a dynamic array */ -#define AVERAGE_BLOB_SIZE 1024L*1024L +#define AVERAGE_BLOB_SIZE (1024L*1024L) /* Number of pages to store continuous blob parts */ #define BLOB_SEGMENT_MIN_SIZE 128 diff --git a/storage/myisam/myisamdef.h b/storage/myisam/myisamdef.h index 8ca052af4ac..07c4a5b473a 100644 --- a/storage/myisam/myisamdef.h +++ b/storage/myisam/myisamdef.h @@ -307,7 +307,7 @@ struct st_myisam_info int rtree_recursion_depth; }; -#define USE_WHOLE_KEY HA_MAX_KEY_BUFF*2 /* Use whole key in _mi_search() */ +#define USE_WHOLE_KEY (HA_MAX_KEY_BUFF*2) /* Use whole key in _mi_search() */ #define F_EXTRA_LCK -1 /* bits in opt_flag */ #define MEMMAP_USED 32 diff --git a/strings/conf_to_src.c b/strings/conf_to_src.c index 8d25ac8e7ed..28d2fd1515e 100644 --- a/strings/conf_to_src.c +++ b/strings/conf_to_src.c @@ -23,7 +23,7 @@ #define ROW_LEN 16 #define ROW16_LEN 8 -#define MAX_BUF 64*1024 +#define MAX_BUF (64*1024) static struct charset_info_st all_charsets[512]; diff --git a/strings/ctype.c b/strings/ctype.c index 048fbe3d368..d8a1dd7502b 100644 --- a/strings/ctype.c +++ b/strings/ctype.c @@ -264,7 +264,7 @@ static const struct my_cs_file_section_st } #define MY_CS_CSDESCR_SIZE 64 -#define MY_CS_TAILORING_SIZE 32*1024 +#define MY_CS_TAILORING_SIZE (32*1024) #define MY_CS_UCA_VERSION_SIZE 64 #define MY_CS_CONTEXT_SIZE 64 From 29ac245dd04c5416d57a90b0ab3c4d08cbc4d723 Mon Sep 17 00:00:00 2001 From: Oleksandr Byelkin Date: Mon, 7 Sep 2015 13:13:52 +0200 Subject: [PATCH 40/85] MDEV-8473: mysqlbinlog -v does not properly decode DECIMAL values in an RBR log Backport of upstream patch. revno: 5696 --- .../binlog/r/binlog_mysqlbinlog_row.result | 6 +- .../r/binlog_mysqlbinlog_row_innodb.result | 72 +++++++++---------- .../r/binlog_mysqlbinlog_row_myisam.result | 72 +++++++++---------- sql/log_event.cc | 13 ++-- 4 files changed, 79 insertions(+), 84 deletions(-) diff --git a/mysql-test/suite/binlog/r/binlog_mysqlbinlog_row.result b/mysql-test/suite/binlog/r/binlog_mysqlbinlog_row.result index 469e670ae9d..3604f5e8f8e 100644 --- a/mysql-test/suite/binlog/r/binlog_mysqlbinlog_row.result +++ b/mysql-test/suite/binlog/r/binlog_mysqlbinlog_row.result @@ -1409,7 +1409,7 @@ BEGIN #010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F ### INSERT INTO `test`.`t1` ### SET -### @1=000000124.450000000 /* DECIMAL(10,5) meta=2565 nullable=1 is_null=0 */ +### @1=124.45000 /* DECIMAL(10,5) meta=2565 nullable=1 is_null=0 */ # at # #010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0 SET TIMESTAMP=1000000000/*!*/; @@ -1426,7 +1426,7 @@ BEGIN #010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F ### INSERT INTO `test`.`t1` ### SET -### @1=-000000543.210000000 /* DECIMAL(10,5) meta=2565 nullable=1 is_null=0 */ +### @1=-543.21000 /* DECIMAL(10,5) meta=2565 nullable=1 is_null=0 */ # at # #010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0 SET TIMESTAMP=1000000000/*!*/; @@ -1443,7 +1443,7 @@ BEGIN #010909 4:46:40 server id 1 end_log_pos # Delete_rows: table id # flags: STMT_END_F ### DELETE FROM `test`.`t1` ### WHERE -### @1=000000124.450000000 /* DECIMAL(10,5) meta=2565 nullable=1 is_null=0 */ +### @1=124.45000 /* DECIMAL(10,5) meta=2565 nullable=1 is_null=0 */ # at # #010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0 SET TIMESTAMP=1000000000/*!*/; diff --git a/mysql-test/suite/binlog/r/binlog_mysqlbinlog_row_innodb.result b/mysql-test/suite/binlog/r/binlog_mysqlbinlog_row_innodb.result index 8e75d203ecc..e942071abcd 100644 --- a/mysql-test/suite/binlog/r/binlog_mysqlbinlog_row_innodb.result +++ b/mysql-test/suite/binlog/r/binlog_mysqlbinlog_row_innodb.result @@ -2390,9 +2390,9 @@ BEGIN ### @22=-1.797... /* DOUBLE meta=8 nullable=1 is_null=0 */ ### @23=2.225... /* DOUBLE meta=8 nullable=1 is_null=0 */ ### @24=0 /* DOUBLE meta=8 nullable=1 is_null=0 */ -### @25=-000000009.999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ -### @26=000000000 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ -### @27=000000000 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ +### @25=-9999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ +### @26=0 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ +### @27=0 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ ### @28='1000:01:01' /* DATE meta=0 nullable=1 is_null=0 */ ### @29=1000-01-01 00:00:00 /* DATETIME meta=0 nullable=1 is_null=0 */ ### @30=75601 /* TIMESTAMP meta=0 nullable=0 is_null=0 */ @@ -2483,9 +2483,9 @@ BEGIN ### @22=1.797... /* DOUBLE meta=8 nullable=1 is_null=0 */ ### @23=1.797... /* DOUBLE meta=8 nullable=1 is_null=0 */ ### @24=1.797... /* DOUBLE meta=8 nullable=1 is_null=0 */ -### @25=000000009.999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ -### @26=000000009.999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ -### @27=000000009.999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ +### @25=9999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ +### @26=9999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ +### @27=9999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ ### @28='9999:12:31' /* DATE meta=0 nullable=1 is_null=0 */ ### @29=9999-12-31 23:59:59 /* DATETIME meta=0 nullable=1 is_null=0 */ ### @30=2146522447 /* TIMESTAMP meta=0 nullable=0 is_null=0 */ @@ -2659,9 +2659,9 @@ BEGIN ### @22=-2.225... /* DOUBLE meta=8 nullable=1 is_null=0 */ ### @23=2.225... /* DOUBLE meta=8 nullable=1 is_null=0 */ ### @24=1 /* DOUBLE meta=8 nullable=1 is_null=0 */ -### @25=-000000009.999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ -### @26=000000009.999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ -### @27=000000001 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ +### @25=-9999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ +### @26=9999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ +### @27=1 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ ### @28='2008:08:04' /* DATE meta=0 nullable=1 is_null=0 */ ### @29=2008-08-04 16:18:06 /* DATETIME meta=0 nullable=1 is_null=0 */ ### @30=1217855904 /* TIMESTAMP meta=0 nullable=0 is_null=0 */ @@ -2752,9 +2752,9 @@ BEGIN ### @22=-1.797... /* DOUBLE meta=8 nullable=1 is_null=0 */ ### @23=2.225... /* DOUBLE meta=8 nullable=1 is_null=0 */ ### @24=0 /* DOUBLE meta=8 nullable=1 is_null=0 */ -### @25=-000000009.999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ -### @26=000000000 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ -### @27=000000000 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ +### @25=-9999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ +### @26=0 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ +### @27=0 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ ### @28='1000:01:01' /* DATE meta=0 nullable=1 is_null=0 */ ### @29=1000-01-01 00:00:00 /* DATETIME meta=0 nullable=1 is_null=0 */ ### @30=75601 /* TIMESTAMP meta=0 nullable=0 is_null=0 */ @@ -2832,9 +2832,9 @@ BEGIN ### @22=1.797... /* DOUBLE meta=8 nullable=1 is_null=0 */ ### @23=1.797... /* DOUBLE meta=8 nullable=1 is_null=0 */ ### @24=1.797... /* DOUBLE meta=8 nullable=1 is_null=0 */ -### @25=000000009.999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ -### @26=000000009.999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ -### @27=000000009.999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ +### @25=9999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ +### @26=9999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ +### @27=9999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ ### @28='9999:12:31' /* DATE meta=0 nullable=1 is_null=0 */ ### @29=9999-12-31 23:59:59 /* DATETIME meta=0 nullable=1 is_null=0 */ ### @30=2146522447 /* TIMESTAMP meta=0 nullable=0 is_null=0 */ @@ -2925,9 +2925,9 @@ BEGIN ### @22=1.797... /* DOUBLE meta=8 nullable=1 is_null=0 */ ### @23=1.797... /* DOUBLE meta=8 nullable=1 is_null=0 */ ### @24=1.797... /* DOUBLE meta=8 nullable=1 is_null=0 */ -### @25=000000009.999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ -### @26=000000009.999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ -### @27=000000009.999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ +### @25=9999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ +### @26=9999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ +### @27=9999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ ### @28='9999:12:31' /* DATE meta=0 nullable=1 is_null=0 */ ### @29=9999-12-31 23:59:59 /* DATETIME meta=0 nullable=1 is_null=0 */ ### @30=2146522447 /* TIMESTAMP meta=0 nullable=0 is_null=0 */ @@ -3005,9 +3005,9 @@ BEGIN ### @22=-1.797... /* DOUBLE meta=8 nullable=1 is_null=0 */ ### @23=2.225... /* DOUBLE meta=8 nullable=1 is_null=0 */ ### @24=0 /* DOUBLE meta=8 nullable=1 is_null=0 */ -### @25=-000000009.999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ -### @26=000000000 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ -### @27=000000000 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ +### @25=-9999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ +### @26=0 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ +### @27=0 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ ### @28='1000:01:01' /* DATE meta=0 nullable=1 is_null=0 */ ### @29=1000-01-01 00:00:00 /* DATETIME meta=0 nullable=1 is_null=0 */ ### @30=75601 /* TIMESTAMP meta=0 nullable=0 is_null=0 */ @@ -3178,9 +3178,9 @@ BEGIN ### @22=-2.225... /* DOUBLE meta=8 nullable=1 is_null=0 */ ### @23=2.225... /* DOUBLE meta=8 nullable=1 is_null=0 */ ### @24=1 /* DOUBLE meta=8 nullable=1 is_null=0 */ -### @25=-000000009.999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ -### @26=000000009.999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ -### @27=000000001 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ +### @25=-9999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ +### @26=9999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ +### @27=1 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ ### @28='2008:08:04' /* DATE meta=0 nullable=1 is_null=0 */ ### @29=2008-08-04 16:18:06 /* DATETIME meta=0 nullable=1 is_null=0 */ ### @30=1217855904 /* TIMESTAMP meta=0 nullable=0 is_null=0 */ @@ -3271,9 +3271,9 @@ BEGIN ### @22=-2.225... /* DOUBLE meta=8 nullable=1 is_null=0 */ ### @23=2.225... /* DOUBLE meta=8 nullable=1 is_null=0 */ ### @24=1 /* DOUBLE meta=8 nullable=1 is_null=0 */ -### @25=-000000009.999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ -### @26=000000009.999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ -### @27=000000001 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ +### @25=-9999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ +### @26=9999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ +### @27=1 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ ### @28='2008:08:04' /* DATE meta=0 nullable=1 is_null=0 */ ### @29=2008-08-04 16:18:06 /* DATETIME meta=0 nullable=1 is_null=0 */ ### @30=1217855904 /* TIMESTAMP meta=0 nullable=0 is_null=0 */ @@ -3444,9 +3444,9 @@ BEGIN ### @22=1.797... /* DOUBLE meta=8 nullable=1 is_null=0 */ ### @23=1.797... /* DOUBLE meta=8 nullable=1 is_null=0 */ ### @24=1.797... /* DOUBLE meta=8 nullable=1 is_null=0 */ -### @25=000000009.999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ -### @26=000000009.999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ -### @27=000000009.999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ +### @25=9999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ +### @26=9999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ +### @27=9999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ ### @28='9999:12:31' /* DATE meta=0 nullable=1 is_null=0 */ ### @29=9999-12-31 23:59:59 /* DATETIME meta=0 nullable=1 is_null=0 */ ### @30=2146522447 /* TIMESTAMP meta=0 nullable=0 is_null=0 */ @@ -3537,9 +3537,9 @@ BEGIN ### @22=-1.797... /* DOUBLE meta=8 nullable=1 is_null=0 */ ### @23=2.225... /* DOUBLE meta=8 nullable=1 is_null=0 */ ### @24=0 /* DOUBLE meta=8 nullable=1 is_null=0 */ -### @25=-000000009.999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ -### @26=000000000 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ -### @27=000000000 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ +### @25=-9999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ +### @26=0 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ +### @27=0 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ ### @28='1000:01:01' /* DATE meta=0 nullable=1 is_null=0 */ ### @29=1000-01-01 00:00:00 /* DATETIME meta=0 nullable=1 is_null=0 */ ### @30=75601 /* TIMESTAMP meta=0 nullable=0 is_null=0 */ @@ -3630,9 +3630,9 @@ BEGIN ### @22=-2.225... /* DOUBLE meta=8 nullable=1 is_null=0 */ ### @23=2.225... /* DOUBLE meta=8 nullable=1 is_null=0 */ ### @24=1 /* DOUBLE meta=8 nullable=1 is_null=0 */ -### @25=-000000009.999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ -### @26=000000009.999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ -### @27=000000001 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ +### @25=-9999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ +### @26=9999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ +### @27=1 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ ### @28='2008:08:04' /* DATE meta=0 nullable=1 is_null=0 */ ### @29=2008-08-04 16:18:06 /* DATETIME meta=0 nullable=1 is_null=0 */ ### @30=1217855904 /* TIMESTAMP meta=0 nullable=0 is_null=0 */ diff --git a/mysql-test/suite/binlog/r/binlog_mysqlbinlog_row_myisam.result b/mysql-test/suite/binlog/r/binlog_mysqlbinlog_row_myisam.result index b4ea8551ca6..29a1704743c 100644 --- a/mysql-test/suite/binlog/r/binlog_mysqlbinlog_row_myisam.result +++ b/mysql-test/suite/binlog/r/binlog_mysqlbinlog_row_myisam.result @@ -2390,9 +2390,9 @@ BEGIN ### @22=-1.797... /* DOUBLE meta=8 nullable=1 is_null=0 */ ### @23=2.225... /* DOUBLE meta=8 nullable=1 is_null=0 */ ### @24=0 /* DOUBLE meta=8 nullable=1 is_null=0 */ -### @25=-000000009.999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ -### @26=000000000 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ -### @27=000000000 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ +### @25=-9999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ +### @26=0 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ +### @27=0 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ ### @28='1000:01:01' /* DATE meta=0 nullable=1 is_null=0 */ ### @29=1000-01-01 00:00:00 /* DATETIME meta=0 nullable=1 is_null=0 */ ### @30=75601 /* TIMESTAMP meta=0 nullable=0 is_null=0 */ @@ -2485,9 +2485,9 @@ BEGIN ### @22=1.797... /* DOUBLE meta=8 nullable=1 is_null=0 */ ### @23=1.797... /* DOUBLE meta=8 nullable=1 is_null=0 */ ### @24=1.797... /* DOUBLE meta=8 nullable=1 is_null=0 */ -### @25=000000009.999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ -### @26=000000009.999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ -### @27=000000009.999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ +### @25=9999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ +### @26=9999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ +### @27=9999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ ### @28='9999:12:31' /* DATE meta=0 nullable=1 is_null=0 */ ### @29=9999-12-31 23:59:59 /* DATETIME meta=0 nullable=1 is_null=0 */ ### @30=2146522447 /* TIMESTAMP meta=0 nullable=0 is_null=0 */ @@ -2663,9 +2663,9 @@ BEGIN ### @22=-2.225... /* DOUBLE meta=8 nullable=1 is_null=0 */ ### @23=2.225... /* DOUBLE meta=8 nullable=1 is_null=0 */ ### @24=1 /* DOUBLE meta=8 nullable=1 is_null=0 */ -### @25=-000000009.999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ -### @26=000000009.999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ -### @27=000000001 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ +### @25=-9999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ +### @26=9999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ +### @27=1 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ ### @28='2008:08:04' /* DATE meta=0 nullable=1 is_null=0 */ ### @29=2008-08-04 16:18:06 /* DATETIME meta=0 nullable=1 is_null=0 */ ### @30=1217855904 /* TIMESTAMP meta=0 nullable=0 is_null=0 */ @@ -2758,9 +2758,9 @@ BEGIN ### @22=-1.797... /* DOUBLE meta=8 nullable=1 is_null=0 */ ### @23=2.225... /* DOUBLE meta=8 nullable=1 is_null=0 */ ### @24=0 /* DOUBLE meta=8 nullable=1 is_null=0 */ -### @25=-000000009.999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ -### @26=000000000 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ -### @27=000000000 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ +### @25=-9999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ +### @26=0 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ +### @27=0 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ ### @28='1000:01:01' /* DATE meta=0 nullable=1 is_null=0 */ ### @29=1000-01-01 00:00:00 /* DATETIME meta=0 nullable=1 is_null=0 */ ### @30=75601 /* TIMESTAMP meta=0 nullable=0 is_null=0 */ @@ -2838,9 +2838,9 @@ BEGIN ### @22=1.797... /* DOUBLE meta=8 nullable=1 is_null=0 */ ### @23=1.797... /* DOUBLE meta=8 nullable=1 is_null=0 */ ### @24=1.797... /* DOUBLE meta=8 nullable=1 is_null=0 */ -### @25=000000009.999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ -### @26=000000009.999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ -### @27=000000009.999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ +### @25=9999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ +### @26=9999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ +### @27=9999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ ### @28='9999:12:31' /* DATE meta=0 nullable=1 is_null=0 */ ### @29=9999-12-31 23:59:59 /* DATETIME meta=0 nullable=1 is_null=0 */ ### @30=2146522447 /* TIMESTAMP meta=0 nullable=0 is_null=0 */ @@ -2933,9 +2933,9 @@ BEGIN ### @22=1.797... /* DOUBLE meta=8 nullable=1 is_null=0 */ ### @23=1.797... /* DOUBLE meta=8 nullable=1 is_null=0 */ ### @24=1.797... /* DOUBLE meta=8 nullable=1 is_null=0 */ -### @25=000000009.999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ -### @26=000000009.999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ -### @27=000000009.999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ +### @25=9999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ +### @26=9999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ +### @27=9999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ ### @28='9999:12:31' /* DATE meta=0 nullable=1 is_null=0 */ ### @29=9999-12-31 23:59:59 /* DATETIME meta=0 nullable=1 is_null=0 */ ### @30=2146522447 /* TIMESTAMP meta=0 nullable=0 is_null=0 */ @@ -3013,9 +3013,9 @@ BEGIN ### @22=-1.797... /* DOUBLE meta=8 nullable=1 is_null=0 */ ### @23=2.225... /* DOUBLE meta=8 nullable=1 is_null=0 */ ### @24=0 /* DOUBLE meta=8 nullable=1 is_null=0 */ -### @25=-000000009.999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ -### @26=000000000 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ -### @27=000000000 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ +### @25=-9999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ +### @26=0 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ +### @27=0 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ ### @28='1000:01:01' /* DATE meta=0 nullable=1 is_null=0 */ ### @29=1000-01-01 00:00:00 /* DATETIME meta=0 nullable=1 is_null=0 */ ### @30=75601 /* TIMESTAMP meta=0 nullable=0 is_null=0 */ @@ -3188,9 +3188,9 @@ BEGIN ### @22=-2.225... /* DOUBLE meta=8 nullable=1 is_null=0 */ ### @23=2.225... /* DOUBLE meta=8 nullable=1 is_null=0 */ ### @24=1 /* DOUBLE meta=8 nullable=1 is_null=0 */ -### @25=-000000009.999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ -### @26=000000009.999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ -### @27=000000001 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ +### @25=-9999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ +### @26=9999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ +### @27=1 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ ### @28='2008:08:04' /* DATE meta=0 nullable=1 is_null=0 */ ### @29=2008-08-04 16:18:06 /* DATETIME meta=0 nullable=1 is_null=0 */ ### @30=1217855904 /* TIMESTAMP meta=0 nullable=0 is_null=0 */ @@ -3283,9 +3283,9 @@ BEGIN ### @22=-2.225... /* DOUBLE meta=8 nullable=1 is_null=0 */ ### @23=2.225... /* DOUBLE meta=8 nullable=1 is_null=0 */ ### @24=1 /* DOUBLE meta=8 nullable=1 is_null=0 */ -### @25=-000000009.999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ -### @26=000000009.999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ -### @27=000000001 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ +### @25=-9999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ +### @26=9999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ +### @27=1 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ ### @28='2008:08:04' /* DATE meta=0 nullable=1 is_null=0 */ ### @29=2008-08-04 16:18:06 /* DATETIME meta=0 nullable=1 is_null=0 */ ### @30=1217855904 /* TIMESTAMP meta=0 nullable=0 is_null=0 */ @@ -3458,9 +3458,9 @@ BEGIN ### @22=1.797... /* DOUBLE meta=8 nullable=1 is_null=0 */ ### @23=1.797... /* DOUBLE meta=8 nullable=1 is_null=0 */ ### @24=1.797... /* DOUBLE meta=8 nullable=1 is_null=0 */ -### @25=000000009.999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ -### @26=000000009.999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ -### @27=000000009.999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ +### @25=9999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ +### @26=9999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ +### @27=9999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ ### @28='9999:12:31' /* DATE meta=0 nullable=1 is_null=0 */ ### @29=9999-12-31 23:59:59 /* DATETIME meta=0 nullable=1 is_null=0 */ ### @30=2146522447 /* TIMESTAMP meta=0 nullable=0 is_null=0 */ @@ -3553,9 +3553,9 @@ BEGIN ### @22=-1.797... /* DOUBLE meta=8 nullable=1 is_null=0 */ ### @23=2.225... /* DOUBLE meta=8 nullable=1 is_null=0 */ ### @24=0 /* DOUBLE meta=8 nullable=1 is_null=0 */ -### @25=-000000009.999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ -### @26=000000000 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ -### @27=000000000 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ +### @25=-9999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ +### @26=0 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ +### @27=0 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ ### @28='1000:01:01' /* DATE meta=0 nullable=1 is_null=0 */ ### @29=1000-01-01 00:00:00 /* DATETIME meta=0 nullable=1 is_null=0 */ ### @30=75601 /* TIMESTAMP meta=0 nullable=0 is_null=0 */ @@ -3648,9 +3648,9 @@ BEGIN ### @22=-2.225... /* DOUBLE meta=8 nullable=1 is_null=0 */ ### @23=2.225... /* DOUBLE meta=8 nullable=1 is_null=0 */ ### @24=1 /* DOUBLE meta=8 nullable=1 is_null=0 */ -### @25=-000000009.999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ -### @26=000000009.999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ -### @27=000000001 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ +### @25=-9999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ +### @26=9999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ +### @27=1 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ ### @28='2008:08:04' /* DATE meta=0 nullable=1 is_null=0 */ ### @29=2008-08-04 16:18:06 /* DATETIME meta=0 nullable=1 is_null=0 */ ### @30=1217855904 /* TIMESTAMP meta=0 nullable=0 is_null=0 */ diff --git a/sql/log_event.cc b/sql/log_event.cc index 2d5c3f232a4..c962f19f703 100644 --- a/sql/log_event.cc +++ b/sql/log_event.cc @@ -2012,15 +2012,10 @@ log_event_print_value(IO_CACHE *file, const uchar *ptr, my_decimal dec; binary2my_decimal(E_DEC_FATAL_ERROR, (uchar*) ptr, &dec, precision, decimals); - int i, end; - char buff[512], *pos; - pos= buff; - pos+= sprintf(buff, "%s", dec.sign() ? "-" : ""); - end= ROUND_UP(dec.frac) + ROUND_UP(dec.intg)-1; - for (i=0; i < end; i++) - pos+= sprintf(pos, "%09d.", dec.buf[i]); - pos+= sprintf(pos, "%09d", dec.buf[i]); - my_b_printf(file, "%s", buff); + int length= DECIMAL_MAX_STR_LENGTH; + char buff[DECIMAL_MAX_STR_LENGTH + 1]; + decimal2string(&dec, buff, &length, 0, 0, 0); + my_b_write(file, (uchar*)buff, length); my_snprintf(typestr, typestr_length, "DECIMAL(%d,%d)", precision, decimals); return bin_size; From abd31ca2b6cde024772fcac0f4953219d76c6344 Mon Sep 17 00:00:00 2001 From: Oleksandr Byelkin Date: Wed, 6 May 2015 13:19:22 +0200 Subject: [PATCH 41/85] MDEV-7990: ERROR 1526 when procedure executed for second time ALTER TABLE partition ... pMAX values less than MAXVALUE Made dipper copy of the lists, so now one execution has no influence on the other. --- mysql-test/r/partition_alter.result | 53 +++++++++++++++++++++++ mysql-test/t/partition_alter.test | 66 +++++++++++++++++++++++++++++ sql/partition_info.cc | 35 +++++++++++++++ 3 files changed, 154 insertions(+) create mode 100644 mysql-test/r/partition_alter.result create mode 100644 mysql-test/t/partition_alter.test diff --git a/mysql-test/r/partition_alter.result b/mysql-test/r/partition_alter.result new file mode 100644 index 00000000000..cbd90b5ba7c --- /dev/null +++ b/mysql-test/r/partition_alter.result @@ -0,0 +1,53 @@ +CREATE TABLE `test_data` ( +`hid` bigint(20) unsigned NOT NULL, +`itid` bigint(20) unsigned NOT NULL, +`clocktime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, +`values` double(16,4) NOT NULL, +PRIMARY KEY (`hid`,`itid`,`clocktime`) +) ; +INSERT INTO `test_data` (`hid`, `itid`, `clocktime`, `values`) VALUES +(1, 1, '2015-03-10 06:25:16', 0.0000), +(1, 1, '2015-03-10 06:26:24', 0.0000), +(1, 1, '2015-03-10 06:27:32', 0.0000), +(1, 1, '2015-03-10 06:28:40', 0.0000), +(1, 1, '2015-03-10 06:29:49', 0.0000), +(1, 1, '2015-03-10 06:30:57', 0.0000), +(1, 1, '2015-03-10 06:32:05', 0.0000), +(1, 1, '2015-03-10 06:33:14', 0.0000), +(1, 1, '2015-03-10 06:34:22', 0.0000), +(1, 1, '2015-03-10 06:35:30', 0.0000), +(1, 1, '2015-03-10 06:36:39', 0.0000), +(1, 1, '2015-03-10 06:37:47', 0.0000), +(1, 1, '2015-03-10 06:38:55', 0.0000), +(1, 1, '2015-03-10 06:40:03', 0.0000), +(1, 1, '2015-03-10 06:41:09', 0.0000), +(1, 1, '2015-03-10 06:42:21', 0.0000), +(1, 1, '2015-03-10 06:43:29', 0.0000), +(1, 1, '2015-03-10 06:44:37', 0.0000), +(1, 1, '2015-03-10 06:45:46', 0.0000), +(1, 1, '2015-03-10 06:47:05', 0.0000), +(1, 1, '2015-03-10 06:48:21', 0.0000), +(1, 1, '2015-03-10 06:49:41', 0.0000), +(1, 1, '2015-03-10 06:50:58', 0.0000), +(1, 1, '2015-03-10 06:52:08', 0.0000), +(1, 1, '2015-03-10 06:53:17', 0.0000), +(1, 1, '2015-03-10 06:54:25', 0.0000), +(563, 1, '2015-03-17 14:28:28', 0.3125), +(563, 1, '2015-03-17 14:29:39', 0.2775), +(563, 1, '2015-03-17 14:30:49', 0.2675); +CREATE PROCEDURE `create_part_max`() +alter table `test_data` + partition by range(unix_timestamp(clocktime)) ( +partition partMAX values less than MAXVALUE +); +call create_part_max(); +call create_part_max(); +drop procedure create_part_max; +prepare stmt from "alter table `test_data` + partition by range(unix_timestamp(clocktime)) ( + partition partMAX values less than MAXVALUE + )"; +execute stmt; +execute stmt; +deallocate prepare stmt; +drop table test_data; diff --git a/mysql-test/t/partition_alter.test b/mysql-test/t/partition_alter.test new file mode 100644 index 00000000000..592d8fdaeaa --- /dev/null +++ b/mysql-test/t/partition_alter.test @@ -0,0 +1,66 @@ +--source include/have_partition.inc + +CREATE TABLE `test_data` ( + `hid` bigint(20) unsigned NOT NULL, + `itid` bigint(20) unsigned NOT NULL, + `clocktime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `values` double(16,4) NOT NULL, + PRIMARY KEY (`hid`,`itid`,`clocktime`) + ) ; + +INSERT INTO `test_data` (`hid`, `itid`, `clocktime`, `values`) VALUES + (1, 1, '2015-03-10 06:25:16', 0.0000), + (1, 1, '2015-03-10 06:26:24', 0.0000), + (1, 1, '2015-03-10 06:27:32', 0.0000), + (1, 1, '2015-03-10 06:28:40', 0.0000), + (1, 1, '2015-03-10 06:29:49', 0.0000), + (1, 1, '2015-03-10 06:30:57', 0.0000), + (1, 1, '2015-03-10 06:32:05', 0.0000), + (1, 1, '2015-03-10 06:33:14', 0.0000), + (1, 1, '2015-03-10 06:34:22', 0.0000), + (1, 1, '2015-03-10 06:35:30', 0.0000), + (1, 1, '2015-03-10 06:36:39', 0.0000), + (1, 1, '2015-03-10 06:37:47', 0.0000), + (1, 1, '2015-03-10 06:38:55', 0.0000), + (1, 1, '2015-03-10 06:40:03', 0.0000), + (1, 1, '2015-03-10 06:41:09', 0.0000), + (1, 1, '2015-03-10 06:42:21', 0.0000), + (1, 1, '2015-03-10 06:43:29', 0.0000), + (1, 1, '2015-03-10 06:44:37', 0.0000), + (1, 1, '2015-03-10 06:45:46', 0.0000), + (1, 1, '2015-03-10 06:47:05', 0.0000), + (1, 1, '2015-03-10 06:48:21', 0.0000), + (1, 1, '2015-03-10 06:49:41', 0.0000), + (1, 1, '2015-03-10 06:50:58', 0.0000), + (1, 1, '2015-03-10 06:52:08', 0.0000), + (1, 1, '2015-03-10 06:53:17', 0.0000), + (1, 1, '2015-03-10 06:54:25', 0.0000), + (563, 1, '2015-03-17 14:28:28', 0.3125), + (563, 1, '2015-03-17 14:29:39', 0.2775), + (563, 1, '2015-03-17 14:30:49', 0.2675); + + +CREATE PROCEDURE `create_part_max`() + alter table `test_data` + partition by range(unix_timestamp(clocktime)) ( + partition partMAX values less than MAXVALUE + ); + +call create_part_max(); + +call create_part_max(); + +drop procedure create_part_max; + +prepare stmt from "alter table `test_data` + partition by range(unix_timestamp(clocktime)) ( + partition partMAX values less than MAXVALUE + )"; + +execute stmt; +execute stmt; + +deallocate prepare stmt; + +drop table test_data; + diff --git a/sql/partition_info.cc b/sql/partition_info.cc index 73b88d64224..4a42d7965b8 100644 --- a/sql/partition_info.cc +++ b/sql/partition_info.cc @@ -77,6 +77,41 @@ partition_info *partition_info::get_clone() part_clone->subpartitions.push_back(subpart_clone); } clone->partitions.push_back(part_clone); + part_clone->list_val_list.empty(); + List_iterator list_val_it(part->list_val_list); + part_elem_value *new_val_arr= + (part_elem_value *)sql_alloc(sizeof(part_elem_value) * + part->list_val_list.elements); + if (!new_val_arr) + { + mem_alloc_error(sizeof(part_elem_value) * part->list_val_list.elements); + DBUG_RETURN(NULL); + } + p_column_list_val *new_colval_arr= + (p_column_list_val*)sql_alloc(sizeof(p_column_list_val) * + num_columns * + part->list_val_list.elements); + if (!new_colval_arr) + { + mem_alloc_error(sizeof(p_column_list_val) * num_columns * + part->list_val_list.elements); + DBUG_RETURN(NULL); + } + part_elem_value *val; + while ((val= list_val_it++)) + { + part_elem_value *new_val= new_val_arr++; + memcpy(new_val, val, sizeof(part_elem_value)); + if (!val->null_value) + { + p_column_list_val *new_colval= new_colval_arr; + new_colval_arr+= num_columns; + memcpy(new_colval, val->col_val_array, + sizeof(p_column_list_val) * num_columns); + new_val->col_val_array= new_colval; + } + part_clone->list_val_list.push_back(new_val); + } } DBUG_RETURN(clone); } From 0243a2d432abb609af890aea5a417862aa4514cb Mon Sep 17 00:00:00 2001 From: Robert Golebiowski Date: Fri, 18 Sep 2015 10:35:09 +0200 Subject: [PATCH 42/85] Bug #21025377 CAN'T CONNECT TO SSL ENABLED SERVER FIRST 30 SEC AFTER INITIAL STARTUP Updated yassl to yassl-2.3.7e (cherry picked from commit 6e21c8c04b922bdb60b6a7c174709d2e1bdd3618) --- extra/yassl/README | 7 +++++++ extra/yassl/include/openssl/ssl.h | 2 +- extra/yassl/taocrypt/src/asn.cpp | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/extra/yassl/README b/extra/yassl/README index 2560c09addd..47ec1a66ea3 100644 --- a/extra/yassl/README +++ b/extra/yassl/README @@ -12,6 +12,13 @@ before calling SSL_new(); *** end Note *** +yaSSL Patch notes, version 2.3.7e (6/26/2015) + This release of yaSSL includes a fix for Date less than comparison. + Previously yaSSL would return true on less than comparisons if the Dates + were equal. Reported by Oracle. No security problem, but if a cert was + generated right now, a server started using it in the same second, and a + client tried to verify it in the same second it would report not yet valid. + yaSSL Patch notes, version 2.3.7d (6/22/2015) This release of yaSSL includes a fix for input_buffer set_current with index 0. SSL_peek() at front of waiting data could trigger. Robert diff --git a/extra/yassl/include/openssl/ssl.h b/extra/yassl/include/openssl/ssl.h index 692d8b270d2..9e16f9278a7 100644 --- a/extra/yassl/include/openssl/ssl.h +++ b/extra/yassl/include/openssl/ssl.h @@ -35,7 +35,7 @@ #include "rsa.h" -#define YASSL_VERSION "2.3.7d" +#define YASSL_VERSION "2.3.7e" #if defined(__cplusplus) diff --git a/extra/yassl/taocrypt/src/asn.cpp b/extra/yassl/taocrypt/src/asn.cpp index 342255c91b8..c419ec0a992 100644 --- a/extra/yassl/taocrypt/src/asn.cpp +++ b/extra/yassl/taocrypt/src/asn.cpp @@ -71,7 +71,7 @@ bool operator>(tm& a, tm& b) bool operator<(tm& a, tm&b) { - return !(a>b); + return (b>a); } From b9768521bdeb1a8069c7b871f4536792b65fd79b Mon Sep 17 00:00:00 2001 From: Robert Golebiowski Date: Fri, 18 Sep 2015 11:18:25 +0200 Subject: [PATCH 43/85] Updated yassl to yassl-2.3.8 (cherry picked from commit 7f9941eab55ed672bfcccd382dafbdbcfdc75aaa) --- extra/yassl/README | 8 ++++++++ extra/yassl/include/openssl/ssl.h | 2 +- extra/yassl/include/yassl_error.hpp | 3 ++- extra/yassl/src/handshake.cpp | 2 ++ extra/yassl/src/yassl_error.cpp | 4 ++++ extra/yassl/src/yassl_imp.cpp | 15 ++++++++++++++- 6 files changed, 31 insertions(+), 3 deletions(-) diff --git a/extra/yassl/README b/extra/yassl/README index 47ec1a66ea3..bf0e1c9f40f 100644 --- a/extra/yassl/README +++ b/extra/yassl/README @@ -12,6 +12,14 @@ before calling SSL_new(); *** end Note *** +yaSSL Release notes, version 2.3.8 (9/17/2015) + This release of yaSSL fixes a high security vulnerability. All users + SHOULD update. If using yaSSL for TLS on the server side with private + RSA keys allowing ephemeral key exchange you MUST update and regenerate + the RSA private keys. This report is detailed in: + https://people.redhat.com/~fweimer/rsa-crt-leaks.pdf + yaSSL now detects RSA signature faults and returns an error. + yaSSL Patch notes, version 2.3.7e (6/26/2015) This release of yaSSL includes a fix for Date less than comparison. Previously yaSSL would return true on less than comparisons if the Dates diff --git a/extra/yassl/include/openssl/ssl.h b/extra/yassl/include/openssl/ssl.h index 9e16f9278a7..b0a7592f870 100644 --- a/extra/yassl/include/openssl/ssl.h +++ b/extra/yassl/include/openssl/ssl.h @@ -35,7 +35,7 @@ #include "rsa.h" -#define YASSL_VERSION "2.3.7e" +#define YASSL_VERSION "2.3.8" #if defined(__cplusplus) diff --git a/extra/yassl/include/yassl_error.hpp b/extra/yassl/include/yassl_error.hpp index beba7b0b5dd..d63244dca90 100644 --- a/extra/yassl/include/yassl_error.hpp +++ b/extra/yassl/include/yassl_error.hpp @@ -53,7 +53,8 @@ enum YasslError { compress_error = 118, decompress_error = 119, pms_version_error = 120, - sanityCipher_error = 121 + sanityCipher_error = 121, + rsaSignFault_error = 122 // !!!! add error message to .cpp !!!! diff --git a/extra/yassl/src/handshake.cpp b/extra/yassl/src/handshake.cpp index 33303b1106d..aa2de39333c 100644 --- a/extra/yassl/src/handshake.cpp +++ b/extra/yassl/src/handshake.cpp @@ -1172,6 +1172,8 @@ void sendCertificateVerify(SSL& ssl, BufferOutput buffer) CertificateVerify verify; verify.Build(ssl); + if (ssl.GetError()) return; + RecordLayerHeader rlHeader; HandShakeHeader hsHeader; mySTL::auto_ptr out(NEW_YS output_buffer); diff --git a/extra/yassl/src/yassl_error.cpp b/extra/yassl/src/yassl_error.cpp index e5d69367339..5169b7dd5d0 100644 --- a/extra/yassl/src/yassl_error.cpp +++ b/extra/yassl/src/yassl_error.cpp @@ -148,6 +148,10 @@ void SetErrorString(YasslError error, char* buffer) strncpy(buffer, "sanity check on cipher text size error", max); break; + case rsaSignFault_error: + strncpy(buffer, "rsa signature fault error", max); + break; + // openssl errors case SSL_ERROR_WANT_READ : strncpy(buffer, "the read operation would block", max); diff --git a/extra/yassl/src/yassl_imp.cpp b/extra/yassl/src/yassl_imp.cpp index 69ba469b928..1baa5adedf8 100644 --- a/extra/yassl/src/yassl_imp.cpp +++ b/extra/yassl/src/yassl_imp.cpp @@ -196,9 +196,16 @@ void DH_Server::build(SSL& ssl) sha.update(tmp.get_buffer(), tmp.get_size()); sha.get_digest(&hash[MD5_LEN]); - if (ssl.getSecurity().get_parms().sig_algo_ == rsa_sa_algo) + if (ssl.getSecurity().get_parms().sig_algo_ == rsa_sa_algo) { auth->sign(signature_, hash, sizeof(hash), ssl.getCrypto().get_random()); + // check for rsa signautre fault + if (!auth->verify(hash, sizeof(hash), signature_, + auth->get_signatureLength())) { + ssl.SetError(rsaSignFault_error); + return; + } + } else { auth->sign(signature_, &hash[MD5_LEN], SHA_LEN, ssl.getCrypto().get_random()); @@ -2159,6 +2166,12 @@ void CertificateVerify::Build(SSL& ssl) memcpy(sig.get(), len, VERIFY_HEADER); rsa.sign(sig.get() + VERIFY_HEADER, hashes_.md5_, sizeof(Hashes), ssl.getCrypto().get_random()); + // check for rsa signautre fault + if (!rsa.verify(hashes_.md5_, sizeof(Hashes), sig.get() + VERIFY_HEADER, + rsa.get_cipherLength())) { + ssl.SetError(rsaSignFault_error); + return; + } } else { // DSA DSS dss(cert.get_privateKey(), cert.get_privateKeyLength(), false); From 8d0d4451d34a8f6c3dd1732d7a813408b6a95b38 Mon Sep 17 00:00:00 2001 From: Sergei Petrunia Date: Mon, 21 Sep 2015 17:32:37 +0300 Subject: [PATCH 44/85] Backport to 10.0: MDEV-8779: mysqld got signal 11 in sql/opt_range_mrr.cc:100(step_down_to) The crash was caused by range optimizer using RANGE_OPT_PARAM::min_key (and max_key) to store keys. Buffer size was a good upper bound for range analysis and partition pruning, but not for EITS selectivity calculations. Fixed by making these buffers variable-size. The sizes are calculated from [pseudo]indexes used for range analysis. --- mysql-test/r/selectivity_no_engine.result | 17 +++++++++ mysql-test/t/selectivity_no_engine.test | 17 +++++++++ sql/opt_range.cc | 43 ++++++++++++++++++++--- 3 files changed, 73 insertions(+), 4 deletions(-) diff --git a/mysql-test/r/selectivity_no_engine.result b/mysql-test/r/selectivity_no_engine.result index a14832f9c0a..31037e90a84 100644 --- a/mysql-test/r/selectivity_no_engine.result +++ b/mysql-test/r/selectivity_no_engine.result @@ -276,6 +276,23 @@ id select_type table type possible_keys key key_len ref rows filtered Extra Warnings: Note 1003 select `test`.`ta`.`a` AS `a`,`test`.`tb`.`a` AS `a` from `test`.`t1` `ta` join `test`.`t2` `tb` where ((`test`.`tb`.`a` = `test`.`ta`.`a`) and (`test`.`ta`.`a` < 40) and (`test`.`ta`.`a` < 100)) drop table t0,t1,t2; +# +# MDEV-8779: mysqld got signal 11 in sql/opt_range_mrr.cc:100(step_down_to) +# +set @tmp_mdev8779=@@optimizer_use_condition_selectivity; +set optimizer_use_condition_selectivity=5; +CREATE TABLE t1 ( +i int(10) unsigned NOT NULL AUTO_INCREMENT, +n varchar(2048) NOT NULL, +d tinyint(1) unsigned NOT NULL, +p int(10) unsigned NOT NULL, +PRIMARY KEY (i) +) DEFAULT CHARSET=utf8; +insert into t1 values (1,'aaa',1,1), (2,'bbb',2,2); +SELECT * FROM t1 WHERE t1.d = 0 AND t1.p = '1' AND t1.i != '-1' AND t1.n = 'some text'; +i n d p +set optimizer_use_condition_selectivity= @tmp_mdev8779; +DROP TABLE t1; # # End of the test file # diff --git a/mysql-test/t/selectivity_no_engine.test b/mysql-test/t/selectivity_no_engine.test index fc425daff6d..2a31c01ed97 100644 --- a/mysql-test/t/selectivity_no_engine.test +++ b/mysql-test/t/selectivity_no_engine.test @@ -210,6 +210,23 @@ explain extended select * from t1 ta, t2 tb where ta.a < 40 and tb.a < 100 and t drop table t0,t1,t2; +--echo # +--echo # MDEV-8779: mysqld got signal 11 in sql/opt_range_mrr.cc:100(step_down_to) +--echo # +set @tmp_mdev8779=@@optimizer_use_condition_selectivity; +set optimizer_use_condition_selectivity=5; +CREATE TABLE t1 ( + i int(10) unsigned NOT NULL AUTO_INCREMENT, + n varchar(2048) NOT NULL, + d tinyint(1) unsigned NOT NULL, + p int(10) unsigned NOT NULL, + PRIMARY KEY (i) +) DEFAULT CHARSET=utf8; +insert into t1 values (1,'aaa',1,1), (2,'bbb',2,2); +SELECT * FROM t1 WHERE t1.d = 0 AND t1.p = '1' AND t1.i != '-1' AND t1.n = 'some text'; +set optimizer_use_condition_selectivity= @tmp_mdev8779; +DROP TABLE t1; + --echo # --echo # End of the test file --echo # diff --git a/sql/opt_range.cc b/sql/opt_range.cc index 3597ade2cba..b6f85a29a43 100644 --- a/sql/opt_range.cc +++ b/sql/opt_range.cc @@ -876,8 +876,8 @@ public: Used to store 'current key tuples', in both range analysis and partitioning (list) analysis */ - uchar min_key[MAX_KEY_LENGTH+MAX_FIELD_WIDTH], - max_key[MAX_KEY_LENGTH+MAX_FIELD_WIDTH]; + uchar *min_key; + uchar *max_key; /* Number of SEL_ARG objects allocated by SEL_ARG::clone_tree operations */ uint alloced_sel_args; @@ -3066,13 +3066,13 @@ int SQL_SELECT::test_quick_select(THD *thd, key_map keys_to_use, DBUG_RETURN(0); // Can't use range } key_parts= param.key_parts; - thd->mem_root= &alloc; /* Make an array with description of all key parts of all table keys. This is used in get_mm_parts function. */ key_info= head->key_info; + uint max_key_len= 0; for (idx=0 ; idx < head->s->keys ; idx++, key_info++) { KEY_PART_INFO *key_part_info; @@ -3085,6 +3085,7 @@ int SQL_SELECT::test_quick_select(THD *thd, key_map keys_to_use, param.key[param.keys]=key_parts; key_part_info= key_info->key_part; + uint cur_key_len= 0; for (uint part= 0 ; part < n_key_parts ; part++, key_parts++, key_part_info++) { @@ -3092,6 +3093,7 @@ int SQL_SELECT::test_quick_select(THD *thd, key_map keys_to_use, key_parts->part= part; key_parts->length= key_part_info->length; key_parts->store_length= key_part_info->store_length; + cur_key_len += key_part_info->store_length; key_parts->field= key_part_info->field; key_parts->null_bit= key_part_info->null_bit; key_parts->image_type = @@ -3100,10 +3102,21 @@ int SQL_SELECT::test_quick_select(THD *thd, key_map keys_to_use, key_parts->flag= (uint8) key_part_info->key_part_flag; } param.real_keynr[param.keys++]=idx; + if (cur_key_len > max_key_len) + max_key_len= cur_key_len; } param.key_parts_end=key_parts; param.alloced_sel_args= 0; + if (!(param.min_key= (uchar*)alloc_root(&alloc,max_key_len)) || + !(param.max_key= (uchar*)alloc_root(&alloc,max_key_len))) + { + thd->no_errors=0; + free_root(&alloc,MYF(0)); // Return memory & allocator + DBUG_RETURN(0); // Can't use range + } + + thd->mem_root= &alloc; /* Calculate cost of full index read for the shortest covering index */ if (!head->covering_keys.is_clear_all()) { @@ -3327,7 +3340,7 @@ bool create_key_parts_for_pseudo_indexes(RANGE_OPT_PARAM *param, return TRUE; param->key_parts= key_part; - + uint max_key_len= 0; for (field_ptr= table->field; *field_ptr; field_ptr++) { if (bitmap_is_set(used_fields, (*field_ptr)->field_index)) @@ -3342,6 +3355,8 @@ bool create_key_parts_for_pseudo_indexes(RANGE_OPT_PARAM *param, store_length+= HA_KEY_NULL_LENGTH; if (field->real_type() == MYSQL_TYPE_VARCHAR) store_length+= HA_KEY_BLOB_LENGTH; + if (max_key_len < store_length) + max_key_len= store_length; key_part->store_length= store_length; key_part->field= field; key_part->image_type= Field::itRAW; @@ -3351,6 +3366,12 @@ bool create_key_parts_for_pseudo_indexes(RANGE_OPT_PARAM *param, key_part++; } } + + if (!(param->min_key= (uchar*)alloc_root(param->mem_root, max_key_len)) || + !(param->max_key= (uchar*)alloc_root(param->mem_root, max_key_len))) + { + return true; + } param->keys= keys; param->key_parts_end= key_part; @@ -4899,12 +4920,15 @@ static bool create_partition_index_description(PART_PRUNE_PARAM *ppar) Field **field= (ppar->part_fields)? part_info->part_field_array : part_info->subpart_field_array; bool in_subpart_fields= FALSE; + uint max_key_len= 0; + uint cur_key_len; for (uint part= 0; part < total_parts; part++, key_part++) { key_part->key= 0; key_part->part= part; key_part->length= (uint16)(*field)->key_length(); key_part->store_length= (uint16)get_partition_field_store_length(*field); + cur_key_len += key_part->store_length; DBUG_PRINT("info", ("part %u length %u store_length %u", part, key_part->length, key_part->store_length)); @@ -4930,10 +4954,21 @@ static bool create_partition_index_description(PART_PRUNE_PARAM *ppar) { field= part_info->subpart_field_array; in_subpart_fields= TRUE; + max_key_len= cur_key_len; + cur_key_len= 0; } } range_par->key_parts_end= key_part; + if (cur_key_len > max_key_len) + max_key_len= cur_key_len; + + if (!(range_par->min_key= (uchar*)alloc_root(alloc,max_key_len)) || + !(range_par->max_key= (uchar*)alloc_root(alloc,max_key_len))) + { + return true; + } + DBUG_EXECUTE("info", print_partitioning_index(range_par->key_parts, range_par->key_parts_end);); return FALSE; From 81727cd774054cd92260c4c0d4e2f09b6a80a4ca Mon Sep 17 00:00:00 2001 From: Sergei Petrunia Date: Tue, 22 Sep 2015 12:54:01 +0300 Subject: [PATCH 45/85] Backport to 10.0: MDEV-8779: mysqld got signal 11 in sql/opt_range_mrr.cc:100(step_down_to) Post fix: initialize a variable --- sql/opt_range.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sql/opt_range.cc b/sql/opt_range.cc index b6f85a29a43..63ed2aa5185 100644 --- a/sql/opt_range.cc +++ b/sql/opt_range.cc @@ -4921,7 +4921,7 @@ static bool create_partition_index_description(PART_PRUNE_PARAM *ppar) part_info->subpart_field_array; bool in_subpart_fields= FALSE; uint max_key_len= 0; - uint cur_key_len; + uint cur_key_len= 0; for (uint part= 0; part < total_parts; part++, key_part++) { key_part->key= 0; From fea156813a80c93f7256c136a3bef4a8efa38131 Mon Sep 17 00:00:00 2001 From: Kristian Nielsen Date: Tue, 22 Sep 2015 13:35:23 +0200 Subject: [PATCH 46/85] Fix sporadic test failure in rpl_gtid_mdev4820.test Use sync_with_master_gtid.inc instead of --sync_with_master. The latter is not correct because the test case uses RESET MASTER; this invalidates the existing binlog positions on the slave. In this particular case, there was a small window where --sync_with_master could trigger too early (on the old position), causing the test case to miss one event. --- mysql-test/suite/rpl/r/rpl_gtid_mdev4820.result | 2 ++ mysql-test/suite/rpl/t/rpl_gtid_mdev4820.test | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/mysql-test/suite/rpl/r/rpl_gtid_mdev4820.result b/mysql-test/suite/rpl/r/rpl_gtid_mdev4820.result index cf488e889b4..be420cb021b 100644 --- a/mysql-test/suite/rpl/r/rpl_gtid_mdev4820.result +++ b/mysql-test/suite/rpl/r/rpl_gtid_mdev4820.result @@ -18,6 +18,7 @@ RESET MASTER; SET GLOBAL gtid_slave_pos= 'OLD_GTID_POS'; include/start_slave.inc INSERT INTO t1 VALUES (4); +include/save_master_gtid.inc SET sql_log_bin= 0; CALL mtr.add_suppression("The binlog on the master is missing the GTID"); SET sql_log_bin= 1; @@ -25,6 +26,7 @@ include/wait_for_slave_io_error.inc [errno=1236] STOP SLAVE SQL_THREAD; SET GLOBAL gtid_slave_pos= 'OLD_GTID_POS'; include/start_slave.inc +include/sync_with_master_gtid.inc SELECT * FROM t1 ORDER BY a; a 1 diff --git a/mysql-test/suite/rpl/t/rpl_gtid_mdev4820.test b/mysql-test/suite/rpl/t/rpl_gtid_mdev4820.test index 304816a65d1..7f4d851f95c 100644 --- a/mysql-test/suite/rpl/t/rpl_gtid_mdev4820.test +++ b/mysql-test/suite/rpl/t/rpl_gtid_mdev4820.test @@ -34,7 +34,7 @@ eval SET GLOBAL gtid_slave_pos= '$old_gtid_pos'; --connection server_1 INSERT INTO t1 VALUES (4); ---save_master_pos +--source include/save_master_gtid.inc --connection server_2 SET sql_log_bin= 0; @@ -48,7 +48,7 @@ STOP SLAVE SQL_THREAD; eval SET GLOBAL gtid_slave_pos= '$old_gtid_pos'; --source include/start_slave.inc ---sync_with_master +--source include/sync_with_master_gtid.inc SELECT * FROM t1 ORDER BY a; --source include/stop_slave.inc From 5cc149febaad181cac65903a62dfe507ae4b6f76 Mon Sep 17 00:00:00 2001 From: Oleksandr Byelkin Date: Thu, 24 Sep 2015 10:28:47 +0200 Subject: [PATCH 47/85] The compiler warnings fixed. --- sql/item_cmpfunc.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sql/item_cmpfunc.cc b/sql/item_cmpfunc.cc index 4f07318d1fd..1d4771ae133 100644 --- a/sql/item_cmpfunc.cc +++ b/sql/item_cmpfunc.cc @@ -2692,7 +2692,7 @@ Item_func_if::str_op(String *str) String *res=arg->val_str(str); if (res) res->set_charset(collation.collation); - if (null_value=arg->null_value) + if ((null_value=arg->null_value)) res= NULL; return res; } @@ -2704,7 +2704,7 @@ Item_func_if::decimal_op(my_decimal *decimal_value) DBUG_ASSERT(fixed == 1); Item *arg= args[0]->val_bool() ? args[1] : args[2]; my_decimal *value= arg->val_decimal(decimal_value); - if (null_value= arg->null_value) + if ((null_value= arg->null_value)) value= NULL; return value; } From dca4ab92b8e32ae1abe54666cf2313d94d5804a4 Mon Sep 17 00:00:00 2001 From: Elena Stepanova Date: Thu, 24 Sep 2015 21:24:28 +0300 Subject: [PATCH 48/85] MDEV-8841 innodb_zip.innodb-create-options fails in buildbot The real problem is that when innodb.xa_recovery test intentionally crashes the server, system tables can be opened and marked as crashed, and the next test in line gets blamed for the error which appears in the error log. Fixed by flushing the tables before crashing the server --- mysql-test/suite/innodb/t/xa_recovery.test | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/mysql-test/suite/innodb/t/xa_recovery.test b/mysql-test/suite/innodb/t/xa_recovery.test index ff6da07f6ac..aec606de77e 100644 --- a/mysql-test/suite/innodb/t/xa_recovery.test +++ b/mysql-test/suite/innodb/t/xa_recovery.test @@ -6,6 +6,12 @@ if (`select plugin_auth_version <= "5.5.43-MariaDB-37.2" from information_schema # Embedded server does not support restarting. --source include/not_embedded.inc +# MDEV-8841 - close tables opened by previous tests, +# so they don't get marked crashed when the server gets crashed +--disable_query_log +FLUSH TABLES; +--enable_query_log + CREATE TABLE t1 (a INT) ENGINE=InnoDB; INSERT INTO t1 VALUES (1); connect (con1,localhost,root); From 86ed494aef0e7fb1f75af32d0665e9b42f36ee17 Mon Sep 17 00:00:00 2001 From: Elena Stepanova Date: Sat, 26 Sep 2015 02:48:55 +0300 Subject: [PATCH 49/85] MDEV-8849 rpl.rpl_innodb_bug30888 sporadically fails in buildbot with testcase timeout The test would take really long if it was run without --mem. Fixed by adding --innodb-flush-log-at-trx-commit=2 --- mysql-test/suite/rpl/t/rpl_innodb_bug30888.opt | 1 + 1 file changed, 1 insertion(+) create mode 100644 mysql-test/suite/rpl/t/rpl_innodb_bug30888.opt diff --git a/mysql-test/suite/rpl/t/rpl_innodb_bug30888.opt b/mysql-test/suite/rpl/t/rpl_innodb_bug30888.opt new file mode 100644 index 00000000000..e6685732d90 --- /dev/null +++ b/mysql-test/suite/rpl/t/rpl_innodb_bug30888.opt @@ -0,0 +1 @@ +--innodb-flush-log-at-trx-commit=2 From 256360956f0ed0bdf1e4e9bb666f10f9812e10a5 Mon Sep 17 00:00:00 2001 From: Elena Stepanova Date: Sat, 26 Sep 2015 02:51:29 +0300 Subject: [PATCH 50/85] Increased the version number --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 904aeda33ab..45f770d8f07 100644 --- a/VERSION +++ b/VERSION @@ -1,4 +1,4 @@ MYSQL_VERSION_MAJOR=5 MYSQL_VERSION_MINOR=5 -MYSQL_VERSION_PATCH=45 +MYSQL_VERSION_PATCH=46 MYSQL_VERSION_EXTRA= From bdcf37076595b003d74edc6a23c53ac23fba64a8 Mon Sep 17 00:00:00 2001 From: Elena Stepanova Date: Sun, 27 Sep 2015 16:00:48 +0300 Subject: [PATCH 51/85] MDEV-7933 plugins.feedback_plugin_send depends on being executed after plugins.feedback_plugin_load The culprit is the feedback_plugin_load test, which is run both separately and from inside feedback_plugin_send.test. The test queries I_S.FEEDBACK, and every time it does, 'FEEDBACK used' value is increased. Fixed by checking that the value is increased instead of recording the actual value in the result file. --- .../plugins/r/feedback_plugin_load.result | 7 +++++-- .../plugins/r/feedback_plugin_send.result | 7 +++++-- .../suite/plugins/t/feedback_plugin_load.test | 19 ++++++++++++++++++- 3 files changed, 28 insertions(+), 5 deletions(-) diff --git a/mysql-test/suite/plugins/r/feedback_plugin_load.result b/mysql-test/suite/plugins/r/feedback_plugin_load.result index 443b91bf0cc..ea6eae98601 100644 --- a/mysql-test/suite/plugins/r/feedback_plugin_load.result +++ b/mysql-test/suite/plugins/r/feedback_plugin_load.result @@ -1,10 +1,13 @@ select plugin_status from information_schema.plugins where plugin_name='feedback'; plugin_status ACTIVE +SELECT variable_value INTO @feedback_used FROM information_schema.feedback where variable_name = 'FEEDBACK used'; +SELECT variable_value = @feedback_used + 1 FROM information_schema.feedback where variable_name = 'FEEDBACK used'; +variable_value = @feedback_used + 1 +1 select * from information_schema.feedback where variable_name like 'feed%' - and variable_name not like '%_uid'; + and variable_name not like '%_uid' and variable_name not like 'FEEDBACK used'; VARIABLE_NAME VARIABLE_VALUE -FEEDBACK used 1 FEEDBACK version 1.1 FEEDBACK_SEND_RETRY_WAIT 60 FEEDBACK_SEND_TIMEOUT 60 diff --git a/mysql-test/suite/plugins/r/feedback_plugin_send.result b/mysql-test/suite/plugins/r/feedback_plugin_send.result index 2852240ca5b..90a37f7ffbc 100644 --- a/mysql-test/suite/plugins/r/feedback_plugin_send.result +++ b/mysql-test/suite/plugins/r/feedback_plugin_send.result @@ -1,10 +1,13 @@ select plugin_status from information_schema.plugins where plugin_name='feedback'; plugin_status ACTIVE +SELECT variable_value INTO @feedback_used FROM information_schema.feedback where variable_name = 'FEEDBACK used'; +SELECT variable_value = @feedback_used + 1 FROM information_schema.feedback where variable_name = 'FEEDBACK used'; +variable_value = @feedback_used + 1 +1 select * from information_schema.feedback where variable_name like 'feed%' - and variable_name not like '%_uid'; + and variable_name not like '%_uid' and variable_name not like 'FEEDBACK used'; VARIABLE_NAME VARIABLE_VALUE -FEEDBACK used 2 FEEDBACK version 1.1 FEEDBACK_SEND_RETRY_WAIT 60 FEEDBACK_SEND_TIMEOUT 60 diff --git a/mysql-test/suite/plugins/t/feedback_plugin_load.test b/mysql-test/suite/plugins/t/feedback_plugin_load.test index 5ad301667b4..f7c62b96b49 100644 --- a/mysql-test/suite/plugins/t/feedback_plugin_load.test +++ b/mysql-test/suite/plugins/t/feedback_plugin_load.test @@ -4,7 +4,24 @@ if (`select count(*) = 0 from information_schema.plugins where plugin_name = 'fe } select plugin_status from information_schema.plugins where plugin_name='feedback'; + +# Every SELECT from INFORMATION_SCHEMA.FEEDBACK increases the value of 'FEEDBACK used'. +# We cannot record the actual value, because the test can be executed more than once, +# but we can check that the value indeed increases as expected. +# There is still a room for some race condition, e.g. if at the very moment +# between first SELECT to store the value and the next SELECT to check that it increases, +# the feedback plugin is activated. But the probability of it is close to 0, +# so lets get back to it if it ever happens. + +# Lets say the plugin was used X times before this SELECT +SELECT variable_value INTO @feedback_used FROM information_schema.feedback where variable_name = 'FEEDBACK used'; + +# Now $feedback_used == X+1, and 'FEEDBACK used' is also X+1. And variable_value is increased again when we run the next SELECT +SELECT variable_value = @feedback_used + 1 FROM information_schema.feedback where variable_name = 'FEEDBACK used'; + +# Now when we are happy with 'FEEDBACK used', we can check everything else + --replace_result https http --sorted_result select * from information_schema.feedback where variable_name like 'feed%' - and variable_name not like '%_uid'; + and variable_name not like '%_uid' and variable_name not like 'FEEDBACK used'; From ce7d8c5ee8c459ac692715994fa73b8f29e9e48a Mon Sep 17 00:00:00 2001 From: Elena Stepanova Date: Sun, 27 Sep 2015 18:01:47 +0300 Subject: [PATCH 52/85] MDEV-7330 plugins.feedback_plugin_send fails sporadically in buildbot The test restarts the server and expects that the feedback plugin will send a report on shutdown, and will write about it in the error log. But the server is only given 10 sec to shut down properly, which is not always enough. Added a parameter to restart_mysqld.inc, and set it to a bigger value in feedback_plugin_send --- mysql-test/include/restart_mysqld.inc | 17 ++++++++++++++++- .../suite/plugins/t/feedback_plugin_send.test | 9 +++++++++ 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/mysql-test/include/restart_mysqld.inc b/mysql-test/include/restart_mysqld.inc index 7cb9c7994d8..ed0fe64a547 100644 --- a/mysql-test/include/restart_mysqld.inc +++ b/mysql-test/include/restart_mysqld.inc @@ -1,3 +1,8 @@ +# ==== Usage ==== +# +# [--let $shutdown_timeout= 30] +# [--let $allow_rpl_inited= 1] +# --source include/restart_mysqld.inc if ($rpl_inited) { @@ -7,6 +12,16 @@ if ($rpl_inited) } } +--let $server_shutdown_timeout= 10 +if ($shutdown_timeout) +{ + --let $server_shutdown_timeout= $shutdown_timeout +} +if ($shutdown_timeout == 0) +{ + --let $server_shutdown_timeout= 0 +} + # Write file to make mysql-test-run.pl expect the "crash", but don't start # it until it's told to --let $_server_id= `SELECT @@server_id` @@ -15,7 +30,7 @@ if ($rpl_inited) # Send shutdown to the connected server and give # it 10 seconds to die before zapping it -shutdown_server 10; +shutdown_server $server_shutdown_timeout; # Write file to make mysql-test-run.pl start up the server again --exec echo "restart" > $_expect_file_name diff --git a/mysql-test/suite/plugins/t/feedback_plugin_send.test b/mysql-test/suite/plugins/t/feedback_plugin_send.test index 45b507f8e78..31542c33482 100644 --- a/mysql-test/suite/plugins/t/feedback_plugin_send.test +++ b/mysql-test/suite/plugins/t/feedback_plugin_send.test @@ -14,6 +14,15 @@ if (!$MTR_FEEDBACK_PLUGIN) { # is doing some work in other workers. # sleep 310; + +# The test expects that the plugin will send a report at least 2 times, +# now (5 min after loading) and on server shutdown which happens below. +# Since we have already waited for 5 min, let's be generous +# and make sure the server has enough time to shut down properly. +# We won't lose anything if the shutdown is fast, but if it's slow, the plugin +# will still be able to finish the job and write about it in the error log. + +--let $shutdown_timeout= 60 source include/restart_mysqld.inc; replace_result https http; From f804b74fd498bce2d527008146b5a0288580d75c Mon Sep 17 00:00:00 2001 From: Elena Stepanova Date: Mon, 28 Sep 2015 03:40:29 +0300 Subject: [PATCH 53/85] MDEV-8154 rpl.show_status_stop_slave_race-7126 sporadically causes internal check failure The patch was pushed into 10.0, but it needs to be applied to 5.5 as well --- .../suite/rpl/r/show_status_stop_slave_race-7126.result | 2 ++ .../suite/rpl/t/show_status_stop_slave_race-7126.test | 7 +++++++ 2 files changed, 9 insertions(+) diff --git a/mysql-test/suite/rpl/r/show_status_stop_slave_race-7126.result b/mysql-test/suite/rpl/r/show_status_stop_slave_race-7126.result index e71bb2e29c9..c2a0498509b 100644 --- a/mysql-test/suite/rpl/r/show_status_stop_slave_race-7126.result +++ b/mysql-test/suite/rpl/r/show_status_stop_slave_race-7126.result @@ -1,2 +1,4 @@ include/master-slave.inc [connection master] +start slave; +include/rpl_end.inc diff --git a/mysql-test/suite/rpl/t/show_status_stop_slave_race-7126.test b/mysql-test/suite/rpl/t/show_status_stop_slave_race-7126.test index a79a1885a6c..38759c9b16a 100644 --- a/mysql-test/suite/rpl/t/show_status_stop_slave_race-7126.test +++ b/mysql-test/suite/rpl/t/show_status_stop_slave_race-7126.test @@ -10,3 +10,10 @@ --exec $MYSQL_SLAP --silent --socket=$SLAVE_MYSOCK -q "START SLAVE; STOP SLAVE; SHOW GLOBAL STATUS" -c 2 --number-of-queries=100 --create-schema=test # All done. + +--connection slave +start slave; + +--connection master +--source include/rpl_end.inc + From 02a38fd27e71fb6657a4da294bd8dd2e1c2b216c Mon Sep 17 00:00:00 2001 From: Oleksandr Byelkin Date: Thu, 24 Sep 2015 17:25:52 +0200 Subject: [PATCH 54/85] MDEV-8624: MariaDB hangs on query with many logical condition Made no_rows_in_result()/restore_to_before_no_rows_in_result() not looking annecessary deep with walk() method. --- mysql-test/r/func_misc.result | 198 +++++++++++++++++++++++++++++++++ mysql-test/t/func_misc.test | 199 ++++++++++++++++++++++++++++++++++ sql/item_func.h | 16 +-- 3 files changed, 405 insertions(+), 8 deletions(-) diff --git a/mysql-test/r/func_misc.result b/mysql-test/r/func_misc.result index d654dbccb0e..a121bd324ee 100644 --- a/mysql-test/r/func_misc.result +++ b/mysql-test/r/func_misc.result @@ -374,5 +374,203 @@ NULL Warnings: Warning 1411 Incorrect timeout value: '-1' for function get_lock # +# MDEV-8624 MariaDB hangs on query with many logical condition +# +CREATE TABLE `t1` ( +`id` int(11) NOT NULL AUTO_INCREMENT, +`submitdate` datetime DEFAULT NULL, +`lastpage` int(11) DEFAULT NULL, +`startlanguage` varchar(20) COLLATE utf8_unicode_ci NOT NULL, +`token` varchar(36) COLLATE utf8_unicode_ci DEFAULT NULL, +`datestamp` datetime NOT NULL, +`startdate` datetime NOT NULL, +`ipaddr` text COLLATE utf8_unicode_ci, +`refurl` text COLLATE utf8_unicode_ci, +`57813X540X1723` text COLLATE utf8_unicode_ci, +`57813X540X1724` text COLLATE utf8_unicode_ci, +`57813X540X1725` text COLLATE utf8_unicode_ci, +`57813X540X1726` double DEFAULT NULL, +`57813X540X1909` double DEFAULT NULL, +`57813X541X17271` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL, +`57813X541X17272` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL, +`57813X541X17273` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL, +`57813X541X17274` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL, +`57813X541X17275` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL, +`57813X541X17276` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL, +`57813X541X17281` text COLLATE utf8_unicode_ci, +`57813X541X17282` text COLLATE utf8_unicode_ci, +`57813X541X17283` text COLLATE utf8_unicode_ci, +`57813X541X17284` text COLLATE utf8_unicode_ci, +`57813X541X17285` text COLLATE utf8_unicode_ci, +`57813X541X17286` text COLLATE utf8_unicode_ci, +`57813X542X18131` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL, +`57813X542X18132` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL, +`57813X542X18133` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL, +`57813X542X18134` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL, +`57813X542X18135` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL, +`57813X542X18136` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL, +`57813X542X18137` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL, +`57813X542X18138` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL, +`57813X542X18139` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL, +`57813X542X18141` text COLLATE utf8_unicode_ci, +`57813X542X18142` text COLLATE utf8_unicode_ci, +`57813X542X18143` text COLLATE utf8_unicode_ci, +`57813X542X18144` text COLLATE utf8_unicode_ci, +`57813X542X18145` text COLLATE utf8_unicode_ci, +`57813X542X18146` text COLLATE utf8_unicode_ci, +`57813X542X18147` text COLLATE utf8_unicode_ci, +`57813X542X18148` text COLLATE utf8_unicode_ci, +`57813X542X18149` text COLLATE utf8_unicode_ci, +`57813X543X18451` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL, +`57813X543X18452` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL, +`57813X543X18453` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL, +`57813X543X18454` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL, +`57813X543X18455` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL, +`57813X543X18456` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL, +`57813X543X18461` text COLLATE utf8_unicode_ci, +`57813X543X18462` text COLLATE utf8_unicode_ci, +`57813X543X18463` text COLLATE utf8_unicode_ci, +`57813X543X18464` text COLLATE utf8_unicode_ci, +`57813X543X18465` text COLLATE utf8_unicode_ci, +`57813X543X18466` text COLLATE utf8_unicode_ci, +`57813X544X18711` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL, +`57813X544X18712` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL, +`57813X544X18713` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL, +`57813X544X18714` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL, +`57813X544X18715` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL, +`57813X544X18716` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL, +`57813X544X18717` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL, +`57813X544X18718` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL, +`57813X544X18721` text COLLATE utf8_unicode_ci, +`57813X544X18722` text COLLATE utf8_unicode_ci, +`57813X544X18723` text COLLATE utf8_unicode_ci, +`57813X544X18724` text COLLATE utf8_unicode_ci, +`57813X544X18725` text COLLATE utf8_unicode_ci, +`57813X544X18726` text COLLATE utf8_unicode_ci, +`57813X544X18727` text COLLATE utf8_unicode_ci, +`57813X544X18728` text COLLATE utf8_unicode_ci, +`57813X546X1902` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL, +`57813X546X1903` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL, +`57813X546X1904` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL, +`57813X545X1901` varchar(1) COLLATE utf8_unicode_ci DEFAULT NULL, +PRIMARY KEY (`id`), +KEY `lime_survey_57813_idx` (`token`), +KEY `57813X540X1723` (`57813X540X1723`(100)), +KEY `57813X540X1724` (`57813X540X1724`(100)), +KEY `57813X540X1726` (`57813X540X1726`), +KEY `57813X540X1725` (`57813X540X1725`(100)), +KEY `57813X546X1902` (`57813X546X1902`), +KEY `57813X546X1903` (`57813X546X1903`), +KEY `57813X546X1904` (`57813X546X1904`) +); +SELECT +COUNT(*) as `N`, +ROUND( +( +SUM( +( +( +IF( 57813X541X17271 IS NOT NULL AND 57813X541X17271 != '' AND 57813X541X17271 != '99', 57813X541X17271, 0 ) + +IF( 57813X541X17272 IS NOT NULL AND 57813X541X17272 != '' AND 57813X541X17272 != '99', 57813X541X17272, 0 ) + +IF( 57813X541X17273 IS NOT NULL AND 57813X541X17273 != '' AND 57813X541X17273 != '99', 57813X541X17273, 0 ) + +IF( 57813X541X17274 IS NOT NULL AND 57813X541X17274 != '' AND 57813X541X17274 != '99', 57813X541X17274, 0 ) + +IF( 57813X541X17275 IS NOT NULL AND 57813X541X17275 != '' AND 57813X541X17275 != '99', 57813X541X17275, 0 ) + +IF( 57813X541X17276 IS NOT NULL AND 57813X541X17276 != '' AND 57813X541X17276 != '99', 57813X541X17276, 0 ) + +IF( 57813X542X18131 IS NOT NULL AND 57813X542X18131 != '' AND 57813X542X18131 != '99', 57813X542X18131, 0 ) + +IF( 57813X542X18132 IS NOT NULL AND 57813X542X18132 != '' AND 57813X542X18132 != '99', 57813X542X18132, 0 ) + +IF( 57813X542X18133 IS NOT NULL AND 57813X542X18133 != '' AND 57813X542X18133 != '99', 57813X542X18133, 0 ) + +IF( 57813X542X18134 IS NOT NULL AND 57813X542X18134 != '' AND 57813X542X18134 != '99', 57813X542X18134, 0 ) + +IF( 57813X542X18135 IS NOT NULL AND 57813X542X18135 != '' AND 57813X542X18135 != '99', 57813X542X18135, 0 ) + +IF( 57813X542X18136 IS NOT NULL AND 57813X542X18136 != '' AND 57813X542X18136 != '99', 57813X542X18136, 0 ) + +IF( 57813X542X18137 IS NOT NULL AND 57813X542X18137 != '' AND 57813X542X18137 != '99', 57813X542X18137, 0 ) + +IF( 57813X542X18138 IS NOT NULL AND 57813X542X18138 != '' AND 57813X542X18138 != '99', 57813X542X18138, 0 ) + +IF( 57813X542X18139 IS NOT NULL AND 57813X542X18139 != '' AND 57813X542X18139 != '99', 57813X542X18139, 0 ) + +IF( 57813X543X18451 IS NOT NULL AND 57813X543X18451 != '' AND 57813X543X18451 != '99', 57813X543X18451, 0 ) + +IF( 57813X543X18452 IS NOT NULL AND 57813X543X18452 != '' AND 57813X543X18452 != '99', 57813X543X18452, 0 ) + +IF( 57813X543X18453 IS NOT NULL AND 57813X543X18453 != '' AND 57813X543X18453 != '99', 57813X543X18453, 0 ) + +IF( 57813X543X18454 IS NOT NULL AND 57813X543X18454 != '' AND 57813X543X18454 != '99', 57813X543X18454, 0 ) + +IF( 57813X543X18455 IS NOT NULL AND 57813X543X18455 != '' AND 57813X543X18455 != '99', 57813X543X18455, 0 ) + +IF( 57813X543X18456 IS NOT NULL AND 57813X543X18456 != '' AND 57813X543X18456 != '99', 57813X543X18456, 0 ) + +IF( 57813X544X18711 IS NOT NULL AND 57813X544X18711 != '' AND 57813X544X18711 != '99', 57813X544X18711, 0 ) + +IF( 57813X544X18712 IS NOT NULL AND 57813X544X18712 != '' AND 57813X544X18712 != '99', 57813X544X18712, 0 ) + +IF( 57813X544X18713 IS NOT NULL AND 57813X544X18713 != '' AND 57813X544X18713 != '99', 57813X544X18713, 0 ) + +IF( 57813X544X18714 IS NOT NULL AND 57813X544X18714 != '' AND 57813X544X18714 != '99', 57813X544X18714, 0 ) + +IF( 57813X544X18715 IS NOT NULL AND 57813X544X18715 != '' AND 57813X544X18715 != '99', 57813X544X18715, 0 ) + +IF( 57813X544X18716 IS NOT NULL AND 57813X544X18716 != '' AND 57813X544X18716 != '99', 57813X544X18716, 0 ) + +IF( 57813X544X18717 IS NOT NULL AND 57813X544X18717 != '' AND 57813X544X18717 != '99', 57813X544X18717, 0 ) + +IF( 57813X544X18718 IS NOT NULL AND 57813X544X18718 != '' AND 57813X544X18718 != '99', 57813X544X18718, 0 ) +) +/ +( +IF( 57813X541X17271 IS NOT NULL AND 57813X541X17271 != '' AND 57813X541X17271 != '99', 1, 0 ) + +IF( 57813X541X17272 IS NOT NULL AND 57813X541X17272 != '' AND 57813X541X17272 != '99', 1, 0 ) + +IF( 57813X541X17273 IS NOT NULL AND 57813X541X17273 != '' AND 57813X541X17273 != '99', 1, 0 ) + +IF( 57813X541X17274 IS NOT NULL AND 57813X541X17274 != '' AND 57813X541X17274 != '99', 1, 0 ) + +IF( 57813X541X17275 IS NOT NULL AND 57813X541X17275 != '' AND 57813X541X17275 != '99', 1, 0 ) + +IF( 57813X541X17276 IS NOT NULL AND 57813X541X17276 != '' AND 57813X541X17276 != '99', 1, 0 ) + +IF( 57813X542X18131 IS NOT NULL AND 57813X542X18131 != '' AND 57813X542X18131 != '99', 1, 0 ) + +IF( 57813X542X18132 IS NOT NULL AND 57813X542X18132 != '' AND 57813X542X18132 != '99', 1, 0 ) + +IF( 57813X542X18133 IS NOT NULL AND 57813X542X18133 != '' AND 57813X542X18133 != '99', 1, 0 ) + +IF( 57813X542X18134 IS NOT NULL AND 57813X542X18134 != '' AND 57813X542X18134 != '99', 1, 0 ) + +IF( 57813X542X18135 IS NOT NULL AND 57813X542X18135 != '' AND 57813X542X18135 != '99', 1, 0 ) + +IF( 57813X542X18136 IS NOT NULL AND 57813X542X18136 != '' AND 57813X542X18136 != '99', 1, 0 ) + +IF( 57813X542X18137 IS NOT NULL AND 57813X542X18137 != '' AND 57813X542X18137 != '99', 1, 0 ) + +IF( 57813X542X18138 IS NOT NULL AND 57813X542X18138 != '' AND 57813X542X18138 != '99', 1, 0 ) + +IF( 57813X542X18139 IS NOT NULL AND 57813X542X18139 != '' AND 57813X542X18139 != '99', 1, 0 ) + +IF( 57813X543X18451 IS NOT NULL AND 57813X543X18451 != '' AND 57813X543X18451 != '99', 1, 0 ) + +IF( 57813X543X18452 IS NOT NULL AND 57813X543X18452 != '' AND 57813X543X18452 != '99', 1, 0 ) + +IF( 57813X543X18453 IS NOT NULL AND 57813X543X18453 != '' AND 57813X543X18453 != '99', 1, 0 ) + +IF( 57813X543X18454 IS NOT NULL AND 57813X543X18454 != '' AND 57813X543X18454 != '99', 1, 0 ) + +IF( 57813X543X18455 IS NOT NULL AND 57813X543X18455 != '' AND 57813X543X18455 != '99', 1, 0 ) + +IF( 57813X543X18456 IS NOT NULL AND 57813X543X18456 != '' AND 57813X543X18456 != '99', 1, 0 ) + +IF( 57813X544X18711 IS NOT NULL AND 57813X544X18711 != '' AND 57813X544X18711 != '99', 1, 0 ) + +IF( 57813X544X18712 IS NOT NULL AND 57813X544X18712 != '' AND 57813X544X18712 != '99', 1, 0 ) + +IF( 57813X544X18713 IS NOT NULL AND 57813X544X18713 != '' AND 57813X544X18713 != '99', 1, 0 ) + +IF( 57813X544X18714 IS NOT NULL AND 57813X544X18714 != '' AND 57813X544X18714 != '99', 1, 0 ) + +IF( 57813X544X18715 IS NOT NULL AND 57813X544X18715 != '' AND 57813X544X18715 != '99', 1, 0 ) + +IF( 57813X544X18716 IS NOT NULL AND 57813X544X18716 != '' AND 57813X544X18716 != '99', 1, 0 ) + +IF( 57813X544X18717 IS NOT NULL AND 57813X544X18717 != '' AND 57813X544X18717 != '99', 1, 0 ) + +IF( 57813X544X18718 IS NOT NULL AND 57813X544X18718 != '' AND 57813X544X18718 != '99', 1, 0 ) +) +) +) +/ COUNT(*) ), 4) as `AVG` +FROM `t1` +WHERE `submitdate` IS NOT NULL +AND ( +( 57813X541X17271 IS NOT NULL AND 57813X541X17271 != '' AND 57813X541X17271 != '99' ) OR +( 57813X541X17272 IS NOT NULL AND 57813X541X17272 != '' AND 57813X541X17272 != '99' ) OR +( 57813X541X17273 IS NOT NULL AND 57813X541X17273 != '' AND 57813X541X17273 != '99' ) OR +( 57813X541X17274 IS NOT NULL AND 57813X541X17274 != '' AND 57813X541X17274 != '99' ) OR +( 57813X541X17275 IS NOT NULL AND 57813X541X17275 != '' AND 57813X541X17275 != '99' ) OR +( 57813X541X17276 IS NOT NULL AND 57813X541X17276 != '' AND 57813X541X17276 != '99' ) OR +( 57813X542X18131 IS NOT NULL AND 57813X542X18131 != '' AND 57813X542X18131 != '99' ) OR +( 57813X542X18132 IS NOT NULL AND 57813X542X18132 != '' AND 57813X542X18132 != '99' ) OR +( 57813X542X18133 IS NOT NULL AND 57813X542X18133 != '' AND 57813X542X18133 != '99' ) OR +( 57813X542X18134 IS NOT NULL AND 57813X542X18134 != '' AND 57813X542X18134 != '99' ) OR +( 57813X542X18135 IS NOT NULL AND 57813X542X18135 != '' AND 57813X542X18135 != '99' ) OR +( 57813X542X18136 IS NOT NULL AND 57813X542X18136 != '' AND 57813X542X18136 != '99' ) OR +( 57813X542X18137 IS NOT NULL AND 57813X542X18137 != '' AND 57813X542X18137 != '99' ) OR +( 57813X542X18138 IS NOT NULL AND 57813X542X18138 != '' AND 57813X542X18138 != '99' ) OR +( 57813X542X18139 IS NOT NULL AND 57813X542X18139 != '' AND 57813X542X18139 != '99' ) OR +( 57813X543X18451 IS NOT NULL AND 57813X543X18451 != '' AND 57813X543X18451 != '99' ) OR +( 57813X543X18452 IS NOT NULL AND 57813X543X18452 != '' AND 57813X543X18452 != '99' ) OR +( 57813X543X18453 IS NOT NULL AND 57813X543X18453 != '' AND 57813X543X18453 != '99' ) OR +( 57813X543X18454 IS NOT NULL AND 57813X543X18454 != '' AND 57813X543X18454 != '99' ) OR +( 57813X543X18455 IS NOT NULL AND 57813X543X18455 != '' AND 57813X543X18455 != '99' ) OR +( 57813X543X18456 IS NOT NULL AND 57813X543X18456 != '' AND 57813X543X18456 != '99' ) OR +( 57813X544X18711 IS NOT NULL AND 57813X544X18711 != '' AND 57813X544X18711 != '99' ) OR +( 57813X544X18712 IS NOT NULL AND 57813X544X18712 != '' AND 57813X544X18712 != '99' ) OR +( 57813X544X18713 IS NOT NULL AND 57813X544X18713 != '' AND 57813X544X18713 != '99' ) OR +( 57813X544X18714 IS NOT NULL AND 57813X544X18714 != '' AND 57813X544X18714 != '99' ) OR +( 57813X544X18715 IS NOT NULL AND 57813X544X18715 != '' AND 57813X544X18715 != '99' ) OR +( 57813X544X18716 IS NOT NULL AND 57813X544X18716 != '' AND 57813X544X18716 != '99' ) OR +( 57813X544X18717 IS NOT NULL AND 57813X544X18717 != '' AND 57813X544X18717 != '99' ) OR +( 57813X544X18718 IS NOT NULL AND 57813X544X18718 != '' AND 57813X544X18718 != '99' ) ) +AND 57813X540X1723 = 'Test'; +N AVG +0 NULL +drop table t1; +# # End of 5.5 tests # diff --git a/mysql-test/t/func_misc.test b/mysql-test/t/func_misc.test index 25d8cc1067a..5991220e273 100644 --- a/mysql-test/t/func_misc.test +++ b/mysql-test/t/func_misc.test @@ -397,6 +397,205 @@ drop table t1,tv; SELECT GET_LOCK('ul1', NULL); SELECT GET_LOCK('ul1', -1); +--echo # +--echo # MDEV-8624 MariaDB hangs on query with many logical condition +--echo # +CREATE TABLE `t1` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `submitdate` datetime DEFAULT NULL, + `lastpage` int(11) DEFAULT NULL, + `startlanguage` varchar(20) COLLATE utf8_unicode_ci NOT NULL, + `token` varchar(36) COLLATE utf8_unicode_ci DEFAULT NULL, + `datestamp` datetime NOT NULL, + `startdate` datetime NOT NULL, + `ipaddr` text COLLATE utf8_unicode_ci, + `refurl` text COLLATE utf8_unicode_ci, + `57813X540X1723` text COLLATE utf8_unicode_ci, + `57813X540X1724` text COLLATE utf8_unicode_ci, + `57813X540X1725` text COLLATE utf8_unicode_ci, + `57813X540X1726` double DEFAULT NULL, + `57813X540X1909` double DEFAULT NULL, + `57813X541X17271` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL, + `57813X541X17272` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL, + `57813X541X17273` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL, + `57813X541X17274` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL, + `57813X541X17275` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL, + `57813X541X17276` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL, + `57813X541X17281` text COLLATE utf8_unicode_ci, + `57813X541X17282` text COLLATE utf8_unicode_ci, + `57813X541X17283` text COLLATE utf8_unicode_ci, + `57813X541X17284` text COLLATE utf8_unicode_ci, + `57813X541X17285` text COLLATE utf8_unicode_ci, + `57813X541X17286` text COLLATE utf8_unicode_ci, + `57813X542X18131` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL, + `57813X542X18132` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL, + `57813X542X18133` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL, + `57813X542X18134` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL, + `57813X542X18135` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL, + `57813X542X18136` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL, + `57813X542X18137` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL, + `57813X542X18138` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL, + `57813X542X18139` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL, + `57813X542X18141` text COLLATE utf8_unicode_ci, + `57813X542X18142` text COLLATE utf8_unicode_ci, + `57813X542X18143` text COLLATE utf8_unicode_ci, + `57813X542X18144` text COLLATE utf8_unicode_ci, + `57813X542X18145` text COLLATE utf8_unicode_ci, + `57813X542X18146` text COLLATE utf8_unicode_ci, + `57813X542X18147` text COLLATE utf8_unicode_ci, + `57813X542X18148` text COLLATE utf8_unicode_ci, + `57813X542X18149` text COLLATE utf8_unicode_ci, + `57813X543X18451` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL, + `57813X543X18452` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL, + `57813X543X18453` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL, + `57813X543X18454` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL, + `57813X543X18455` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL, + `57813X543X18456` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL, + `57813X543X18461` text COLLATE utf8_unicode_ci, + `57813X543X18462` text COLLATE utf8_unicode_ci, + `57813X543X18463` text COLLATE utf8_unicode_ci, + `57813X543X18464` text COLLATE utf8_unicode_ci, + `57813X543X18465` text COLLATE utf8_unicode_ci, + `57813X543X18466` text COLLATE utf8_unicode_ci, + `57813X544X18711` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL, + `57813X544X18712` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL, + `57813X544X18713` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL, + `57813X544X18714` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL, + `57813X544X18715` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL, + `57813X544X18716` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL, + `57813X544X18717` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL, + `57813X544X18718` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL, + `57813X544X18721` text COLLATE utf8_unicode_ci, + `57813X544X18722` text COLLATE utf8_unicode_ci, + `57813X544X18723` text COLLATE utf8_unicode_ci, + `57813X544X18724` text COLLATE utf8_unicode_ci, + `57813X544X18725` text COLLATE utf8_unicode_ci, + `57813X544X18726` text COLLATE utf8_unicode_ci, + `57813X544X18727` text COLLATE utf8_unicode_ci, + `57813X544X18728` text COLLATE utf8_unicode_ci, + `57813X546X1902` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL, + `57813X546X1903` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL, + `57813X546X1904` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL, + `57813X545X1901` varchar(1) COLLATE utf8_unicode_ci DEFAULT NULL, + PRIMARY KEY (`id`), + KEY `lime_survey_57813_idx` (`token`), + KEY `57813X540X1723` (`57813X540X1723`(100)), + KEY `57813X540X1724` (`57813X540X1724`(100)), + KEY `57813X540X1726` (`57813X540X1726`), + KEY `57813X540X1725` (`57813X540X1725`(100)), + KEY `57813X546X1902` (`57813X546X1902`), + KEY `57813X546X1903` (`57813X546X1903`), + KEY `57813X546X1904` (`57813X546X1904`) +); + +SELECT +COUNT(*) as `N`, +ROUND( + ( + SUM( + ( + ( + IF( 57813X541X17271 IS NOT NULL AND 57813X541X17271 != '' AND 57813X541X17271 != '99', 57813X541X17271, 0 ) + + IF( 57813X541X17272 IS NOT NULL AND 57813X541X17272 != '' AND 57813X541X17272 != '99', 57813X541X17272, 0 ) + + IF( 57813X541X17273 IS NOT NULL AND 57813X541X17273 != '' AND 57813X541X17273 != '99', 57813X541X17273, 0 ) + + IF( 57813X541X17274 IS NOT NULL AND 57813X541X17274 != '' AND 57813X541X17274 != '99', 57813X541X17274, 0 ) + + IF( 57813X541X17275 IS NOT NULL AND 57813X541X17275 != '' AND 57813X541X17275 != '99', 57813X541X17275, 0 ) + + IF( 57813X541X17276 IS NOT NULL AND 57813X541X17276 != '' AND 57813X541X17276 != '99', 57813X541X17276, 0 ) + + IF( 57813X542X18131 IS NOT NULL AND 57813X542X18131 != '' AND 57813X542X18131 != '99', 57813X542X18131, 0 ) + + IF( 57813X542X18132 IS NOT NULL AND 57813X542X18132 != '' AND 57813X542X18132 != '99', 57813X542X18132, 0 ) + + IF( 57813X542X18133 IS NOT NULL AND 57813X542X18133 != '' AND 57813X542X18133 != '99', 57813X542X18133, 0 ) + + IF( 57813X542X18134 IS NOT NULL AND 57813X542X18134 != '' AND 57813X542X18134 != '99', 57813X542X18134, 0 ) + + IF( 57813X542X18135 IS NOT NULL AND 57813X542X18135 != '' AND 57813X542X18135 != '99', 57813X542X18135, 0 ) + + IF( 57813X542X18136 IS NOT NULL AND 57813X542X18136 != '' AND 57813X542X18136 != '99', 57813X542X18136, 0 ) + + IF( 57813X542X18137 IS NOT NULL AND 57813X542X18137 != '' AND 57813X542X18137 != '99', 57813X542X18137, 0 ) + + IF( 57813X542X18138 IS NOT NULL AND 57813X542X18138 != '' AND 57813X542X18138 != '99', 57813X542X18138, 0 ) + + IF( 57813X542X18139 IS NOT NULL AND 57813X542X18139 != '' AND 57813X542X18139 != '99', 57813X542X18139, 0 ) + + IF( 57813X543X18451 IS NOT NULL AND 57813X543X18451 != '' AND 57813X543X18451 != '99', 57813X543X18451, 0 ) + + IF( 57813X543X18452 IS NOT NULL AND 57813X543X18452 != '' AND 57813X543X18452 != '99', 57813X543X18452, 0 ) + + IF( 57813X543X18453 IS NOT NULL AND 57813X543X18453 != '' AND 57813X543X18453 != '99', 57813X543X18453, 0 ) + + IF( 57813X543X18454 IS NOT NULL AND 57813X543X18454 != '' AND 57813X543X18454 != '99', 57813X543X18454, 0 ) + + IF( 57813X543X18455 IS NOT NULL AND 57813X543X18455 != '' AND 57813X543X18455 != '99', 57813X543X18455, 0 ) + + IF( 57813X543X18456 IS NOT NULL AND 57813X543X18456 != '' AND 57813X543X18456 != '99', 57813X543X18456, 0 ) + + IF( 57813X544X18711 IS NOT NULL AND 57813X544X18711 != '' AND 57813X544X18711 != '99', 57813X544X18711, 0 ) + + IF( 57813X544X18712 IS NOT NULL AND 57813X544X18712 != '' AND 57813X544X18712 != '99', 57813X544X18712, 0 ) + + IF( 57813X544X18713 IS NOT NULL AND 57813X544X18713 != '' AND 57813X544X18713 != '99', 57813X544X18713, 0 ) + + IF( 57813X544X18714 IS NOT NULL AND 57813X544X18714 != '' AND 57813X544X18714 != '99', 57813X544X18714, 0 ) + + IF( 57813X544X18715 IS NOT NULL AND 57813X544X18715 != '' AND 57813X544X18715 != '99', 57813X544X18715, 0 ) + + IF( 57813X544X18716 IS NOT NULL AND 57813X544X18716 != '' AND 57813X544X18716 != '99', 57813X544X18716, 0 ) + + IF( 57813X544X18717 IS NOT NULL AND 57813X544X18717 != '' AND 57813X544X18717 != '99', 57813X544X18717, 0 ) + + IF( 57813X544X18718 IS NOT NULL AND 57813X544X18718 != '' AND 57813X544X18718 != '99', 57813X544X18718, 0 ) + ) + / + ( + IF( 57813X541X17271 IS NOT NULL AND 57813X541X17271 != '' AND 57813X541X17271 != '99', 1, 0 ) + + IF( 57813X541X17272 IS NOT NULL AND 57813X541X17272 != '' AND 57813X541X17272 != '99', 1, 0 ) + + IF( 57813X541X17273 IS NOT NULL AND 57813X541X17273 != '' AND 57813X541X17273 != '99', 1, 0 ) + + IF( 57813X541X17274 IS NOT NULL AND 57813X541X17274 != '' AND 57813X541X17274 != '99', 1, 0 ) + + IF( 57813X541X17275 IS NOT NULL AND 57813X541X17275 != '' AND 57813X541X17275 != '99', 1, 0 ) + + IF( 57813X541X17276 IS NOT NULL AND 57813X541X17276 != '' AND 57813X541X17276 != '99', 1, 0 ) + + IF( 57813X542X18131 IS NOT NULL AND 57813X542X18131 != '' AND 57813X542X18131 != '99', 1, 0 ) + + IF( 57813X542X18132 IS NOT NULL AND 57813X542X18132 != '' AND 57813X542X18132 != '99', 1, 0 ) + + IF( 57813X542X18133 IS NOT NULL AND 57813X542X18133 != '' AND 57813X542X18133 != '99', 1, 0 ) + + IF( 57813X542X18134 IS NOT NULL AND 57813X542X18134 != '' AND 57813X542X18134 != '99', 1, 0 ) + + IF( 57813X542X18135 IS NOT NULL AND 57813X542X18135 != '' AND 57813X542X18135 != '99', 1, 0 ) + + IF( 57813X542X18136 IS NOT NULL AND 57813X542X18136 != '' AND 57813X542X18136 != '99', 1, 0 ) + + IF( 57813X542X18137 IS NOT NULL AND 57813X542X18137 != '' AND 57813X542X18137 != '99', 1, 0 ) + + IF( 57813X542X18138 IS NOT NULL AND 57813X542X18138 != '' AND 57813X542X18138 != '99', 1, 0 ) + + IF( 57813X542X18139 IS NOT NULL AND 57813X542X18139 != '' AND 57813X542X18139 != '99', 1, 0 ) + + IF( 57813X543X18451 IS NOT NULL AND 57813X543X18451 != '' AND 57813X543X18451 != '99', 1, 0 ) + + IF( 57813X543X18452 IS NOT NULL AND 57813X543X18452 != '' AND 57813X543X18452 != '99', 1, 0 ) + + IF( 57813X543X18453 IS NOT NULL AND 57813X543X18453 != '' AND 57813X543X18453 != '99', 1, 0 ) + + IF( 57813X543X18454 IS NOT NULL AND 57813X543X18454 != '' AND 57813X543X18454 != '99', 1, 0 ) + + IF( 57813X543X18455 IS NOT NULL AND 57813X543X18455 != '' AND 57813X543X18455 != '99', 1, 0 ) + + IF( 57813X543X18456 IS NOT NULL AND 57813X543X18456 != '' AND 57813X543X18456 != '99', 1, 0 ) + + IF( 57813X544X18711 IS NOT NULL AND 57813X544X18711 != '' AND 57813X544X18711 != '99', 1, 0 ) + + IF( 57813X544X18712 IS NOT NULL AND 57813X544X18712 != '' AND 57813X544X18712 != '99', 1, 0 ) + + IF( 57813X544X18713 IS NOT NULL AND 57813X544X18713 != '' AND 57813X544X18713 != '99', 1, 0 ) + + IF( 57813X544X18714 IS NOT NULL AND 57813X544X18714 != '' AND 57813X544X18714 != '99', 1, 0 ) + + IF( 57813X544X18715 IS NOT NULL AND 57813X544X18715 != '' AND 57813X544X18715 != '99', 1, 0 ) + + IF( 57813X544X18716 IS NOT NULL AND 57813X544X18716 != '' AND 57813X544X18716 != '99', 1, 0 ) + + IF( 57813X544X18717 IS NOT NULL AND 57813X544X18717 != '' AND 57813X544X18717 != '99', 1, 0 ) + + IF( 57813X544X18718 IS NOT NULL AND 57813X544X18718 != '' AND 57813X544X18718 != '99', 1, 0 ) + ) + ) + ) + / COUNT(*) ), 4) as `AVG` +FROM `t1` +WHERE `submitdate` IS NOT NULL +AND ( + ( 57813X541X17271 IS NOT NULL AND 57813X541X17271 != '' AND 57813X541X17271 != '99' ) OR + ( 57813X541X17272 IS NOT NULL AND 57813X541X17272 != '' AND 57813X541X17272 != '99' ) OR + ( 57813X541X17273 IS NOT NULL AND 57813X541X17273 != '' AND 57813X541X17273 != '99' ) OR + ( 57813X541X17274 IS NOT NULL AND 57813X541X17274 != '' AND 57813X541X17274 != '99' ) OR + ( 57813X541X17275 IS NOT NULL AND 57813X541X17275 != '' AND 57813X541X17275 != '99' ) OR + ( 57813X541X17276 IS NOT NULL AND 57813X541X17276 != '' AND 57813X541X17276 != '99' ) OR + ( 57813X542X18131 IS NOT NULL AND 57813X542X18131 != '' AND 57813X542X18131 != '99' ) OR + ( 57813X542X18132 IS NOT NULL AND 57813X542X18132 != '' AND 57813X542X18132 != '99' ) OR + ( 57813X542X18133 IS NOT NULL AND 57813X542X18133 != '' AND 57813X542X18133 != '99' ) OR + ( 57813X542X18134 IS NOT NULL AND 57813X542X18134 != '' AND 57813X542X18134 != '99' ) OR + ( 57813X542X18135 IS NOT NULL AND 57813X542X18135 != '' AND 57813X542X18135 != '99' ) OR + ( 57813X542X18136 IS NOT NULL AND 57813X542X18136 != '' AND 57813X542X18136 != '99' ) OR + ( 57813X542X18137 IS NOT NULL AND 57813X542X18137 != '' AND 57813X542X18137 != '99' ) OR + ( 57813X542X18138 IS NOT NULL AND 57813X542X18138 != '' AND 57813X542X18138 != '99' ) OR + ( 57813X542X18139 IS NOT NULL AND 57813X542X18139 != '' AND 57813X542X18139 != '99' ) OR + ( 57813X543X18451 IS NOT NULL AND 57813X543X18451 != '' AND 57813X543X18451 != '99' ) OR + ( 57813X543X18452 IS NOT NULL AND 57813X543X18452 != '' AND 57813X543X18452 != '99' ) OR + ( 57813X543X18453 IS NOT NULL AND 57813X543X18453 != '' AND 57813X543X18453 != '99' ) OR + ( 57813X543X18454 IS NOT NULL AND 57813X543X18454 != '' AND 57813X543X18454 != '99' ) OR + ( 57813X543X18455 IS NOT NULL AND 57813X543X18455 != '' AND 57813X543X18455 != '99' ) OR + ( 57813X543X18456 IS NOT NULL AND 57813X543X18456 != '' AND 57813X543X18456 != '99' ) OR + ( 57813X544X18711 IS NOT NULL AND 57813X544X18711 != '' AND 57813X544X18711 != '99' ) OR + ( 57813X544X18712 IS NOT NULL AND 57813X544X18712 != '' AND 57813X544X18712 != '99' ) OR + ( 57813X544X18713 IS NOT NULL AND 57813X544X18713 != '' AND 57813X544X18713 != '99' ) OR + ( 57813X544X18714 IS NOT NULL AND 57813X544X18714 != '' AND 57813X544X18714 != '99' ) OR + ( 57813X544X18715 IS NOT NULL AND 57813X544X18715 != '' AND 57813X544X18715 != '99' ) OR + ( 57813X544X18716 IS NOT NULL AND 57813X544X18716 != '' AND 57813X544X18716 != '99' ) OR + ( 57813X544X18717 IS NOT NULL AND 57813X544X18717 != '' AND 57813X544X18717 != '99' ) OR + ( 57813X544X18718 IS NOT NULL AND 57813X544X18718 != '' AND 57813X544X18718 != '99' ) ) +AND 57813X540X1723 = 'Test'; + +drop table t1; + --echo # --echo # End of 5.5 tests --echo # diff --git a/sql/item_func.h b/sql/item_func.h index 36474e79cdc..33fa49f9168 100644 --- a/sql/item_func.h +++ b/sql/item_func.h @@ -377,17 +377,17 @@ public: void no_rows_in_result() { - bool_func_call_args info; - info.original_func_item= this; - info.bool_function= &Item::no_rows_in_result; - walk(&Item::call_bool_func_processor, FALSE, (uchar*) &info); + for (uint i= 0; i < arg_count; i++) + { + args[i]->no_rows_in_result(); + } } void restore_to_before_no_rows_in_result() { - bool_func_call_args info; - info.original_func_item= this; - info.bool_function= &Item::restore_to_before_no_rows_in_result; - walk(&Item::call_bool_func_processor, FALSE, (uchar*) &info); + for (uint i= 0; i < arg_count; i++) + { + args[i]->no_rows_in_result(); + } } }; From a95711e45d45ec3f024468373087160fc9e4ff6b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Lindstr=C3=B6m?= Date: Tue, 29 Sep 2015 08:39:54 +0300 Subject: [PATCH 55/85] MDEV-8855: innodb.innodb-fk-warnings fails on Windows Fixed incorrect access to freed memory. --- storage/innobase/dict/dict0dict.c | 4 +++- storage/xtradb/dict/dict0dict.c | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/storage/innobase/dict/dict0dict.c b/storage/innobase/dict/dict0dict.c index 6693c731b6c..ad900385325 100644 --- a/storage/innobase/dict/dict0dict.c +++ b/storage/innobase/dict/dict0dict.c @@ -4225,7 +4225,6 @@ col_loop2: ptr = dict_accept(cs, ptr, ")", &success); if (!success || foreign->n_fields != i) { - dict_foreign_free(foreign); dict_foreign_report_syntax_err( "%s table %s with foreign key constraint" @@ -4238,6 +4237,9 @@ col_loop2: " failed. Foreign key constraint parse error in %s" " close to %s. Too few referenced columns, you have %d when you should have %d.", operation, create_name, start_of_latest_foreign, orig, i, foreign->n_fields); + + dict_foreign_free(foreign); + return(DB_CANNOT_ADD_CONSTRAINT); } diff --git a/storage/xtradb/dict/dict0dict.c b/storage/xtradb/dict/dict0dict.c index a7d9412ff15..4132bf69b17 100644 --- a/storage/xtradb/dict/dict0dict.c +++ b/storage/xtradb/dict/dict0dict.c @@ -4357,7 +4357,6 @@ col_loop2: ptr = dict_accept(cs, ptr, ")", &success); if (!success || foreign->n_fields != i) { - dict_foreign_free(foreign); dict_foreign_report_syntax_err( "%s table %s with foreign key constraint" @@ -4370,6 +4369,9 @@ col_loop2: " failed. Foreign key constraint parse error in %s" " close to %s. Too few referenced columns, you have %d when you should have %d.", operation, create_name, start_of_latest_foreign, orig, i, foreign->n_fields); + + dict_foreign_free(foreign); + return(DB_CANNOT_ADD_CONSTRAINT); } From 006acf7454730ca6b6a603b2cd74b9bde3b6c020 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Lindstr=C3=B6m?= Date: Wed, 30 Sep 2015 10:49:45 +0300 Subject: [PATCH 56/85] Bug #68148: drop index on a foreign key column leads to missing table MDEV-8845: Table disappear after modifying FK Added test case. --- .../suite/innodb/r/innodb_bug68148.result | 36 ++++++++++++++++ .../suite/innodb/t/innodb_bug68148.test | 41 +++++++++++++++++++ 2 files changed, 77 insertions(+) create mode 100644 mysql-test/suite/innodb/r/innodb_bug68148.result create mode 100644 mysql-test/suite/innodb/t/innodb_bug68148.test diff --git a/mysql-test/suite/innodb/r/innodb_bug68148.result b/mysql-test/suite/innodb/r/innodb_bug68148.result new file mode 100644 index 00000000000..88247053389 --- /dev/null +++ b/mysql-test/suite/innodb/r/innodb_bug68148.result @@ -0,0 +1,36 @@ +set global innodb_file_per_table=1; +CREATE TABLE ref_table1 (id int(11) NOT NULL, PRIMARY KEY(id)) ENGINE=InnoDB; +CREATE TABLE ref_table2 (id int(11) NOT NULL, PRIMARY KEY(id)) ENGINE=InnoDB; +CREATE TABLE `main` ( +`id` int(11) NOT NULL AUTO_INCREMENT, +`ref_id1` int(11) NOT NULL, +`ref_id2` int(11) NOT NULL, +PRIMARY KEY (`id`), +UNIQUE KEY `idx_1` (`ref_id1`,`ref_id2`), +KEY `FK_set_out_analysis_route_id` (`ref_id2`), +CONSTRAINT `FK_1` FOREIGN KEY (`ref_id1`) REFERENCES `ref_table1` (`id`) , +CONSTRAINT `FK_2` FOREIGN KEY (`ref_id2`) REFERENCES `ref_table2` (`id`) +) ENGINE=InnoDB; +SET FOREIGN_KEY_CHECKS=0; +DROP INDEX `idx_1` ON `main`; +SHOW TABLES; +Tables_in_test +main +ref_table1 +ref_table2 +# restart and see if we can still access the main table +SET FOREIGN_KEY_CHECKS=0; +ALTER TABLE `main` ADD INDEX `idx_1` (`ref_id1`); +SHOW CREATE TABLE `main`; +Table Create Table +main CREATE TABLE `main` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `ref_id1` int(11) NOT NULL, + `ref_id2` int(11) NOT NULL, + PRIMARY KEY (`id`), + KEY `FK_set_out_analysis_route_id` (`ref_id2`), + KEY `idx_1` (`ref_id1`), + CONSTRAINT `FK_1` FOREIGN KEY (`ref_id1`) REFERENCES `ref_table1` (`id`), + CONSTRAINT `FK_2` FOREIGN KEY (`ref_id2`) REFERENCES `ref_table2` (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +DROP TABLE main, ref_table1, ref_table2; diff --git a/mysql-test/suite/innodb/t/innodb_bug68148.test b/mysql-test/suite/innodb/t/innodb_bug68148.test new file mode 100644 index 00000000000..531baa30e48 --- /dev/null +++ b/mysql-test/suite/innodb/t/innodb_bug68148.test @@ -0,0 +1,41 @@ +-- source include/have_innodb.inc +-- source include/not_embedded.inc + +# +# Bug #68148: drop index on a foreign key column leads to missing table +# MDEV-8845: Table disappear after modifying FK +# + +set global innodb_file_per_table=1; + +CREATE TABLE ref_table1 (id int(11) NOT NULL, PRIMARY KEY(id)) ENGINE=InnoDB; + +CREATE TABLE ref_table2 (id int(11) NOT NULL, PRIMARY KEY(id)) ENGINE=InnoDB; + +CREATE TABLE `main` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `ref_id1` int(11) NOT NULL, + `ref_id2` int(11) NOT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `idx_1` (`ref_id1`,`ref_id2`), + KEY `FK_set_out_analysis_route_id` (`ref_id2`), + CONSTRAINT `FK_1` FOREIGN KEY (`ref_id1`) REFERENCES `ref_table1` (`id`) , + CONSTRAINT `FK_2` FOREIGN KEY (`ref_id2`) REFERENCES `ref_table2` (`id`) +) ENGINE=InnoDB; + +SET FOREIGN_KEY_CHECKS=0; + +DROP INDEX `idx_1` ON `main`; +SHOW TABLES; + +--echo # restart and see if we can still access the main table +--source include/restart_mysqld.inc + +# This is required to access the table +SET FOREIGN_KEY_CHECKS=0; +ALTER TABLE `main` ADD INDEX `idx_1` (`ref_id1`); +SHOW CREATE TABLE `main`; + +DROP TABLE main, ref_table1, ref_table2; + + From 727da9c8ec0e6f4baa3f03e0c4b6a11846611417 Mon Sep 17 00:00:00 2001 From: Sergey Vojtovich Date: Thu, 1 Oct 2015 13:04:59 +0400 Subject: [PATCH 57/85] MDEV-8379 - SUSE mariadb patches Fixed unclean prototype declaration. According to ISO/IEC 9899:TC2: ... 10. The special case of an unnamed parameter of type void as the only item in the list specifies that the function has no parameters. ... 14. An identifier list declares only the identifiers of the parameters of the function. An empty list in a function declarator that is part of a definition of that function specifies that the function has no parameters. The empty list in a function declarator that is not part of a definition of that function specifies that no information about the number or types of the parameters is supplied. 124) ... 6.11.6 Function declarators The use of function declarators with empty parentheses (not prototype-format parameter type declarators) is an obsolescent feature. ... Patch contributed by Michal Hrusecky. --- include/my_dbug.h | 4 ++-- include/my_global.h | 2 +- include/my_pthread.h | 8 ++++---- include/my_sys.h | 12 ++++++------ 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/include/my_dbug.h b/include/my_dbug.h index bcf2015466d..f4c854bc10c 100644 --- a/include/my_dbug.h +++ b/include/my_dbug.h @@ -58,7 +58,7 @@ extern void _db_end_(void); extern void _db_lock_file_(void); extern void _db_unlock_file_(void); extern FILE *_db_fp_(void); -extern void _db_flush_(); +extern void _db_flush_(void); extern void dbug_swap_code_state(void **code_state_store); extern void dbug_free_code_state(void **code_state_store); extern const char* _db_get_func_(void); @@ -123,7 +123,7 @@ extern const char* _db_get_func_(void); #ifdef __WIN__ #define DBUG_SUICIDE() DBUG_ABORT() #else -extern void _db_suicide_(); +extern void _db_suicide_(void); #define DBUG_SUICIDE() (_db_flush_(), _db_suicide_()) #endif diff --git a/include/my_global.h b/include/my_global.h index e9a472e686e..3027eed7e17 100644 --- a/include/my_global.h +++ b/include/my_global.h @@ -555,7 +555,7 @@ typedef int my_socket; /* File descriptor for sockets */ /* Type for fuctions that handles signals */ #define sig_handler RETSIGTYPE C_MODE_START -typedef void (*sig_return)();/* Returns type from signal */ +typedef void (*sig_return)(void); /* Returns type from signal */ C_MODE_END #if defined(__GNUC__) && !defined(_lint) typedef char pchar; /* Mixed prototypes can take char */ diff --git a/include/my_pthread.h b/include/my_pthread.h index 7770c28f45f..bb4d0c88ebd 100644 --- a/include/my_pthread.h +++ b/include/my_pthread.h @@ -701,8 +701,8 @@ extern void my_thread_end(void); extern const char *my_thread_name(void); extern my_thread_id my_thread_dbug_id(void); extern int pthread_dummy(int); -extern void my_mutex_init(); -extern void my_mutex_end(); +extern void my_mutex_init(void); +extern void my_mutex_end(void); /* All thread specific variables are in the following struct */ @@ -745,8 +745,8 @@ struct st_my_thread_var }; extern struct st_my_thread_var *_my_thread_var(void) __attribute__ ((const)); -extern void **my_thread_var_dbug(); -extern safe_mutex_t **my_thread_var_mutex_in_use(); +extern void **my_thread_var_dbug(void); +extern safe_mutex_t **my_thread_var_mutex_in_use(void); extern uint my_thread_end_wait_time; extern my_bool safe_mutex_deadlock_detector; #define my_thread_var (_my_thread_var()) diff --git a/include/my_sys.h b/include/my_sys.h index 741116a1dd5..036084a0ae0 100644 --- a/include/my_sys.h +++ b/include/my_sys.h @@ -642,7 +642,7 @@ extern void my_osmaperr(unsigned long last_error); #endif extern void init_glob_errs(void); -extern const char** get_global_errmsgs(); +extern const char** get_global_errmsgs(void); extern void wait_for_free_space(const char *filename, int errors); extern FILE *my_fopen(const char *FileName,int Flags,myf MyFlags); extern FILE *my_fdopen(File Filedes,const char *name, int Flags,myf MyFlags); @@ -667,7 +667,7 @@ extern void my_printf_error(uint my_err, const char *format, ATTRIBUTE_FORMAT(printf, 2, 4); extern void my_printv_error(uint error, const char *format, myf MyFlags, va_list ap); -extern int my_error_register(const char** (*get_errmsgs) (), +extern int my_error_register(const char** (*get_errmsgs) (void), uint first, uint last); extern const char **my_error_unregister(uint first, uint last); extern void my_message(uint my_err, const char *str,myf MyFlags); @@ -885,12 +885,12 @@ extern uint my_set_max_open_files(uint files); void my_free_open_file_info(void); extern my_bool my_gethwaddr(uchar *to); -extern int my_getncpus(); +extern int my_getncpus(void); #define HRTIME_RESOLUTION 1000000ULL /* microseconds */ typedef struct {ulonglong val;} my_hrtime_t; -void my_time_init(); -extern my_hrtime_t my_hrtime(); +void my_time_init(void); +extern my_hrtime_t my_hrtime(void); extern ulonglong my_interval_timer(void); extern ulonglong my_getcputime(void); @@ -949,7 +949,7 @@ int my_msync(int, void *, size_t, int); void my_uuid_init(ulong seed1, ulong seed2); void my_uuid(uchar *guid); void my_uuid2str(const uchar *guid, char *s); -void my_uuid_end(); +void my_uuid_end(void); /* character sets */ extern void my_charset_loader_init_mysys(MY_CHARSET_LOADER *loader); From bb22eb55dba5ebe41af2f554e74520d66bbbcf26 Mon Sep 17 00:00:00 2001 From: Sergey Vojtovich Date: Thu, 1 Oct 2015 13:40:23 +0400 Subject: [PATCH 58/85] MDEV-8379 - SUSE mariadb patches Corrected variable name in dead code for consistency. Patch contributed by Michal Hrusecky. --- storage/innobase/row/row0log.cc | 4 ++-- storage/xtradb/row/row0log.cc | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/storage/innobase/row/row0log.cc b/storage/innobase/row/row0log.cc index 74ebe159677..0bc6f33df97 100644 --- a/storage/innobase/row/row0log.cc +++ b/storage/innobase/row/row0log.cc @@ -2586,7 +2586,7 @@ all_done: and be ignored when the operation is unsupported. */ fallocate(index->online_log->fd, FALLOC_FL_PUNCH_HOLE | FALLOC_FL_KEEP_SIZE, - ofs, srv_buf_size); + ofs, srv_sort_buf_size); #endif /* FALLOC_FL_PUNCH_HOLE */ next_mrec = index->online_log->head.block; @@ -3417,7 +3417,7 @@ all_done: and be ignored when the operation is unsupported. */ fallocate(index->online_log->fd, FALLOC_FL_PUNCH_HOLE | FALLOC_FL_KEEP_SIZE, - ofs, srv_buf_size); + ofs, srv_sort_buf_size); #endif /* FALLOC_FL_PUNCH_HOLE */ next_mrec = index->online_log->head.block; diff --git a/storage/xtradb/row/row0log.cc b/storage/xtradb/row/row0log.cc index 4a50be3d098..84992ed08cc 100644 --- a/storage/xtradb/row/row0log.cc +++ b/storage/xtradb/row/row0log.cc @@ -2584,7 +2584,7 @@ all_done: and be ignored when the operation is unsupported. */ fallocate(index->online_log->fd, FALLOC_FL_PUNCH_HOLE | FALLOC_FL_KEEP_SIZE, - ofs, srv_buf_size); + ofs, srv_sort_buf_size); #endif /* FALLOC_FL_PUNCH_HOLE */ next_mrec = index->online_log->head.block; @@ -3412,7 +3412,7 @@ all_done: and be ignored when the operation is unsupported. */ fallocate(index->online_log->fd, FALLOC_FL_PUNCH_HOLE | FALLOC_FL_KEEP_SIZE, - ofs, srv_buf_size); + ofs, srv_sort_buf_size); #endif /* FALLOC_FL_PUNCH_HOLE */ next_mrec = index->online_log->head.block; From a7dd24cdaa739727f06a44a5386af092f17c10e3 Mon Sep 17 00:00:00 2001 From: Sergei Petrunia Date: Tue, 6 Oct 2015 13:52:27 +0300 Subject: [PATCH 59/85] MDEV-8299: MyISAM or Aria table gets corrupted after EXPLAIN INSERT and INSERT [EXPLAIN] INSERT .. SELECT creates a select_insert object. select_insert calls handler->start_bulk_insert() during initialization. For MyISAM/Aria this requires that a matching call to handler->end_bulk_insert() call is made. Regular INSERT .. SELECT accomplishes this by calling either select_result->send_eof() or select_result->abort_result_set(). EXPLAIN INSERT ... SELECT didn't call either, which resulted in improper de-initializaiton of handler object. Make it call abort_result_set(), which invokes handler->end_bulk_insert(). --- mysql-test/r/explain_non_select.result | 15 +++++++++++++++ mysql-test/t/explain_non_select.test | 16 ++++++++++++++++ sql/sql_parse.cc | 10 ++++++++++ 3 files changed, 41 insertions(+) diff --git a/mysql-test/r/explain_non_select.result b/mysql-test/r/explain_non_select.result index 0eee7ee9b1e..8e336a0f8c0 100644 --- a/mysql-test/r/explain_non_select.result +++ b/mysql-test/r/explain_non_select.result @@ -232,3 +232,18 @@ id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE user index NULL PRIMARY 420 NULL 4 Using index DROP TABLE t1; DROP VIEW v1; +# +# MDEV-8299: MyISAM or Aria table gets corrupted after EXPLAIN INSERT and INSERT +# +CREATE TABLE t1 (pk INT NOT NULL AUTO_INCREMENT PRIMARY KEY, i INT, KEY(i)) ENGINE=MyISAM; +INSERT INTO t1 (i) VALUES (100),(200); +CREATE TABLE t2 (j INT) ENGINE=MyISAM; +INSERT INTO t2 VALUES (10),(20); +EXPLAIN INSERT INTO t1 (i) SELECT j FROM t2; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 ALL NULL NULL NULL NULL 2 +INSERT INTO t1 (i) VALUES (300); +CHECK TABLE t1; +Table Op Msg_type Msg_text +test.t1 check status OK +DROP TABLE t1, t2; diff --git a/mysql-test/t/explain_non_select.test b/mysql-test/t/explain_non_select.test index e36fd518b61..52996a8c24a 100644 --- a/mysql-test/t/explain_non_select.test +++ b/mysql-test/t/explain_non_select.test @@ -208,3 +208,19 @@ INSERT INTO t1 VALUES (1),(2); EXPLAIN UPDATE v1, mysql.user SET v1.a = v1.a + 1; DROP TABLE t1; DROP VIEW v1; + +--echo # +--echo # MDEV-8299: MyISAM or Aria table gets corrupted after EXPLAIN INSERT and INSERT +--echo # +CREATE TABLE t1 (pk INT NOT NULL AUTO_INCREMENT PRIMARY KEY, i INT, KEY(i)) ENGINE=MyISAM; +INSERT INTO t1 (i) VALUES (100),(200); + +CREATE TABLE t2 (j INT) ENGINE=MyISAM; +INSERT INTO t2 VALUES (10),(20); + +EXPLAIN INSERT INTO t1 (i) SELECT j FROM t2; +INSERT INTO t1 (i) VALUES (300); +CHECK TABLE t1; + +DROP TABLE t1, t2; + diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index 1374a93e6b9..93e6bdebd53 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -3549,6 +3549,16 @@ end_with_restore_list: query_cache_invalidate3(thd, first_table, 1); first_table->next_local= save_table; } + if (explain) + { + /* + sel_result needs to be cleaned up properly. + INSERT... SELECT statement will call either send_eof() or + abort_result_set(). EXPLAIN doesn't call either, so we need + to cleanup manually. + */ + sel_result->abort_result_set(); + } delete sel_result; } From 7ccde2cbd55814d6f8525552d27674a5d1f577bf Mon Sep 17 00:00:00 2001 From: Oleksandr Byelkin Date: Thu, 23 Apr 2015 19:04:11 +0200 Subject: [PATCH 60/85] MDEV-7565: Server crash with Signal 6 (part 2) Preparation of subselect moved earlier (before checks which needs it prepared). --- mysql-test/r/subselect.result | 12 ++++++++++++ mysql-test/r/subselect_no_mat.result | 12 ++++++++++++ mysql-test/r/subselect_no_opts.result | 12 ++++++++++++ mysql-test/r/subselect_no_scache.result | 12 ++++++++++++ mysql-test/r/subselect_no_semijoin.result | 12 ++++++++++++ mysql-test/t/subselect.test | 12 ++++++++++++ sql/opt_subselect.cc | 12 ++++++------ 7 files changed, 78 insertions(+), 6 deletions(-) diff --git a/mysql-test/r/subselect.result b/mysql-test/r/subselect.result index 4afde93925d..8eac09a2a17 100644 --- a/mysql-test/r/subselect.result +++ b/mysql-test/r/subselect.result @@ -7015,3 +7015,15 @@ select exists(select 1 from t1 group by `c` in (select `c` from t1)); exists(select 1 from t1 group by `c` in (select `c` from t1)) 0 drop table t1; +# +# MDEV-7565: Server crash with Signal 6 (part 2) +# +Select +(Select Sum(`TestCase`.Revenue) From mysql.slow_log E +Where TestCase.TemplateID not in (Select 1 from mysql.slow_log where 2=2) +) As `ControlRev` +From +(Select 3 as Revenue, 4 as TemplateID) As `TestCase` +Group By TestCase.Revenue, TestCase.TemplateID; +ControlRev +NULL diff --git a/mysql-test/r/subselect_no_mat.result b/mysql-test/r/subselect_no_mat.result index 9df216da3cb..aed0e6a7e30 100644 --- a/mysql-test/r/subselect_no_mat.result +++ b/mysql-test/r/subselect_no_mat.result @@ -7012,6 +7012,18 @@ select exists(select 1 from t1 group by `c` in (select `c` from t1)); exists(select 1 from t1 group by `c` in (select `c` from t1)) 0 drop table t1; +# +# MDEV-7565: Server crash with Signal 6 (part 2) +# +Select +(Select Sum(`TestCase`.Revenue) From mysql.slow_log E +Where TestCase.TemplateID not in (Select 1 from mysql.slow_log where 2=2) +) As `ControlRev` +From +(Select 3 as Revenue, 4 as TemplateID) As `TestCase` +Group By TestCase.Revenue, TestCase.TemplateID; +ControlRev +NULL set optimizer_switch=default; select @@optimizer_switch like '%materialization=on%'; @@optimizer_switch like '%materialization=on%' diff --git a/mysql-test/r/subselect_no_opts.result b/mysql-test/r/subselect_no_opts.result index 7b93f277274..07c95851828 100644 --- a/mysql-test/r/subselect_no_opts.result +++ b/mysql-test/r/subselect_no_opts.result @@ -7010,4 +7010,16 @@ select exists(select 1 from t1 group by `c` in (select `c` from t1)); exists(select 1 from t1 group by `c` in (select `c` from t1)) 0 drop table t1; +# +# MDEV-7565: Server crash with Signal 6 (part 2) +# +Select +(Select Sum(`TestCase`.Revenue) From mysql.slow_log E +Where TestCase.TemplateID not in (Select 1 from mysql.slow_log where 2=2) +) As `ControlRev` +From +(Select 3 as Revenue, 4 as TemplateID) As `TestCase` +Group By TestCase.Revenue, TestCase.TemplateID; +ControlRev +NULL set @optimizer_switch_for_subselect_test=null; diff --git a/mysql-test/r/subselect_no_scache.result b/mysql-test/r/subselect_no_scache.result index b6d3a89ea7a..9a49fedb093 100644 --- a/mysql-test/r/subselect_no_scache.result +++ b/mysql-test/r/subselect_no_scache.result @@ -7021,6 +7021,18 @@ select exists(select 1 from t1 group by `c` in (select `c` from t1)); exists(select 1 from t1 group by `c` in (select `c` from t1)) 0 drop table t1; +# +# MDEV-7565: Server crash with Signal 6 (part 2) +# +Select +(Select Sum(`TestCase`.Revenue) From mysql.slow_log E +Where TestCase.TemplateID not in (Select 1 from mysql.slow_log where 2=2) +) As `ControlRev` +From +(Select 3 as Revenue, 4 as TemplateID) As `TestCase` +Group By TestCase.Revenue, TestCase.TemplateID; +ControlRev +NULL set optimizer_switch=default; select @@optimizer_switch like '%subquery_cache=on%'; @@optimizer_switch like '%subquery_cache=on%' diff --git a/mysql-test/r/subselect_no_semijoin.result b/mysql-test/r/subselect_no_semijoin.result index d51d211e71d..658888d45f5 100644 --- a/mysql-test/r/subselect_no_semijoin.result +++ b/mysql-test/r/subselect_no_semijoin.result @@ -7010,5 +7010,17 @@ select exists(select 1 from t1 group by `c` in (select `c` from t1)); exists(select 1 from t1 group by `c` in (select `c` from t1)) 0 drop table t1; +# +# MDEV-7565: Server crash with Signal 6 (part 2) +# +Select +(Select Sum(`TestCase`.Revenue) From mysql.slow_log E +Where TestCase.TemplateID not in (Select 1 from mysql.slow_log where 2=2) +) As `ControlRev` +From +(Select 3 as Revenue, 4 as TemplateID) As `TestCase` +Group By TestCase.Revenue, TestCase.TemplateID; +ControlRev +NULL set @optimizer_switch_for_subselect_test=null; set @join_cache_level_for_subselect_test=NULL; diff --git a/mysql-test/t/subselect.test b/mysql-test/t/subselect.test index d1c3774947a..dd9603ca5d4 100644 --- a/mysql-test/t/subselect.test +++ b/mysql-test/t/subselect.test @@ -5890,3 +5890,15 @@ DROP TABLE t1,t2; create table t1 (c int); select exists(select 1 from t1 group by `c` in (select `c` from t1)); drop table t1; + +--echo # +--echo # MDEV-7565: Server crash with Signal 6 (part 2) +--echo # +Select + (Select Sum(`TestCase`.Revenue) From mysql.slow_log E + Where TestCase.TemplateID not in (Select 1 from mysql.slow_log where 2=2) + ) As `ControlRev` +From +(Select 3 as Revenue, 4 as TemplateID) As `TestCase` +Group By TestCase.Revenue, TestCase.TemplateID; + diff --git a/sql/opt_subselect.cc b/sql/opt_subselect.cc index ebf640c2987..a8e1ff97b82 100644 --- a/sql/opt_subselect.cc +++ b/sql/opt_subselect.cc @@ -703,6 +703,12 @@ int check_and_do_in_subquery_rewrites(JOIN *join) if (!optimizer_flag(thd, OPTIMIZER_SWITCH_IN_TO_EXISTS) && !optimizer_flag(thd, OPTIMIZER_SWITCH_MATERIALIZATION)) my_error(ER_ILLEGAL_SUBQUERY_OPTIMIZER_SWITCHES, MYF(0)); + /* + Transform each subquery predicate according to its overloaded + transformer. + */ + if (subselect->select_transformer(join)) + DBUG_RETURN(-1); /* If the subquery predicate is IN/=ANY, analyse and set all possible @@ -754,12 +760,6 @@ int check_and_do_in_subquery_rewrites(JOIN *join) allany_subs->add_strategy(strategy); } - /* - Transform each subquery predicate according to its overloaded - transformer. - */ - if (subselect->select_transformer(join)) - DBUG_RETURN(-1); } } DBUG_RETURN(0); From 2e3e8180483628e6744b6590acf5dd546c6a6076 Mon Sep 17 00:00:00 2001 From: Oleksandr Byelkin Date: Thu, 23 Apr 2015 19:11:06 +0200 Subject: [PATCH 61/85] MDEV-7445: Server crash with Signal 6 Problem was in rewriting left expression which had 2 references on it. Solved with making subselect reference main. Item_in_optimized can have not Item_in_subselect reference in left part so type casting with no check is dangerous. Item::cols() should be checked after Item::fix_fields(). --- mysql-test/r/subselect.result | 20 +++++++++++++ mysql-test/r/subselect_no_mat.result | 20 +++++++++++++ mysql-test/r/subselect_no_opts.result | 20 +++++++++++++ mysql-test/r/subselect_no_scache.result | 20 +++++++++++++ mysql-test/r/subselect_no_semijoin.result | 20 +++++++++++++ mysql-test/t/subselect.test | 21 +++++++++++++ sql/item_cmpfunc.cc | 36 +++++++++++++++++++---- sql/opt_subselect.cc | 24 +++++++-------- 8 files changed, 164 insertions(+), 17 deletions(-) diff --git a/mysql-test/r/subselect.result b/mysql-test/r/subselect.result index 8eac09a2a17..19a845150d8 100644 --- a/mysql-test/r/subselect.result +++ b/mysql-test/r/subselect.result @@ -7027,3 +7027,23 @@ From Group By TestCase.Revenue, TestCase.TemplateID; ControlRev NULL +# +# MDEV-7445:Server crash with Signal 6 +# +CREATE PROCEDURE procedure2() +BEGIN +Select +(Select Sum(`TestCase`.Revenue) From mysql.slow_log E +Where TestCase.TemplateID not in (Select 1 from mysql.slow_log where 2=2) +) As `ControlRev` + From +(Select 3 as Revenue, 4 as TemplateID) As `TestCase` +Group By TestCase.Revenue, TestCase.TemplateID; +END | +call procedure2(); +ControlRev +NULL +call procedure2(); +ControlRev +NULL +drop procedure procedure2; diff --git a/mysql-test/r/subselect_no_mat.result b/mysql-test/r/subselect_no_mat.result index aed0e6a7e30..649f954fa96 100644 --- a/mysql-test/r/subselect_no_mat.result +++ b/mysql-test/r/subselect_no_mat.result @@ -7024,6 +7024,26 @@ From Group By TestCase.Revenue, TestCase.TemplateID; ControlRev NULL +# +# MDEV-7445:Server crash with Signal 6 +# +CREATE PROCEDURE procedure2() +BEGIN +Select +(Select Sum(`TestCase`.Revenue) From mysql.slow_log E +Where TestCase.TemplateID not in (Select 1 from mysql.slow_log where 2=2) +) As `ControlRev` + From +(Select 3 as Revenue, 4 as TemplateID) As `TestCase` +Group By TestCase.Revenue, TestCase.TemplateID; +END | +call procedure2(); +ControlRev +NULL +call procedure2(); +ControlRev +NULL +drop procedure procedure2; set optimizer_switch=default; select @@optimizer_switch like '%materialization=on%'; @@optimizer_switch like '%materialization=on%' diff --git a/mysql-test/r/subselect_no_opts.result b/mysql-test/r/subselect_no_opts.result index 07c95851828..aa06ba11d19 100644 --- a/mysql-test/r/subselect_no_opts.result +++ b/mysql-test/r/subselect_no_opts.result @@ -7022,4 +7022,24 @@ From Group By TestCase.Revenue, TestCase.TemplateID; ControlRev NULL +# +# MDEV-7445:Server crash with Signal 6 +# +CREATE PROCEDURE procedure2() +BEGIN +Select +(Select Sum(`TestCase`.Revenue) From mysql.slow_log E +Where TestCase.TemplateID not in (Select 1 from mysql.slow_log where 2=2) +) As `ControlRev` + From +(Select 3 as Revenue, 4 as TemplateID) As `TestCase` +Group By TestCase.Revenue, TestCase.TemplateID; +END | +call procedure2(); +ControlRev +NULL +call procedure2(); +ControlRev +NULL +drop procedure procedure2; set @optimizer_switch_for_subselect_test=null; diff --git a/mysql-test/r/subselect_no_scache.result b/mysql-test/r/subselect_no_scache.result index 9a49fedb093..a9ee039f3d0 100644 --- a/mysql-test/r/subselect_no_scache.result +++ b/mysql-test/r/subselect_no_scache.result @@ -7033,6 +7033,26 @@ From Group By TestCase.Revenue, TestCase.TemplateID; ControlRev NULL +# +# MDEV-7445:Server crash with Signal 6 +# +CREATE PROCEDURE procedure2() +BEGIN +Select +(Select Sum(`TestCase`.Revenue) From mysql.slow_log E +Where TestCase.TemplateID not in (Select 1 from mysql.slow_log where 2=2) +) As `ControlRev` + From +(Select 3 as Revenue, 4 as TemplateID) As `TestCase` +Group By TestCase.Revenue, TestCase.TemplateID; +END | +call procedure2(); +ControlRev +NULL +call procedure2(); +ControlRev +NULL +drop procedure procedure2; set optimizer_switch=default; select @@optimizer_switch like '%subquery_cache=on%'; @@optimizer_switch like '%subquery_cache=on%' diff --git a/mysql-test/r/subselect_no_semijoin.result b/mysql-test/r/subselect_no_semijoin.result index 658888d45f5..4d5c3474ac1 100644 --- a/mysql-test/r/subselect_no_semijoin.result +++ b/mysql-test/r/subselect_no_semijoin.result @@ -7022,5 +7022,25 @@ From Group By TestCase.Revenue, TestCase.TemplateID; ControlRev NULL +# +# MDEV-7445:Server crash with Signal 6 +# +CREATE PROCEDURE procedure2() +BEGIN +Select +(Select Sum(`TestCase`.Revenue) From mysql.slow_log E +Where TestCase.TemplateID not in (Select 1 from mysql.slow_log where 2=2) +) As `ControlRev` + From +(Select 3 as Revenue, 4 as TemplateID) As `TestCase` +Group By TestCase.Revenue, TestCase.TemplateID; +END | +call procedure2(); +ControlRev +NULL +call procedure2(); +ControlRev +NULL +drop procedure procedure2; set @optimizer_switch_for_subselect_test=null; set @join_cache_level_for_subselect_test=NULL; diff --git a/mysql-test/t/subselect.test b/mysql-test/t/subselect.test index dd9603ca5d4..4fb404b1fff 100644 --- a/mysql-test/t/subselect.test +++ b/mysql-test/t/subselect.test @@ -5902,3 +5902,24 @@ From (Select 3 as Revenue, 4 as TemplateID) As `TestCase` Group By TestCase.Revenue, TestCase.TemplateID; +--echo # +--echo # MDEV-7445:Server crash with Signal 6 +--echo # + +--delimiter | +CREATE PROCEDURE procedure2() +BEGIN + Select + (Select Sum(`TestCase`.Revenue) From mysql.slow_log E + Where TestCase.TemplateID not in (Select 1 from mysql.slow_log where 2=2) + ) As `ControlRev` + From + (Select 3 as Revenue, 4 as TemplateID) As `TestCase` + Group By TestCase.Revenue, TestCase.TemplateID; + +END | +--delimiter ; +call procedure2(); +call procedure2(); + +drop procedure procedure2; diff --git a/sql/item_cmpfunc.cc b/sql/item_cmpfunc.cc index 1d4771ae133..678288971ad 100644 --- a/sql/item_cmpfunc.cc +++ b/sql/item_cmpfunc.cc @@ -1442,9 +1442,25 @@ bool Item_in_optimizer::eval_not_null_tables(uchar *opt_arg) bool Item_in_optimizer::fix_left(THD *thd, Item **ref) { DBUG_ENTER("Item_in_optimizer::fix_left"); - if ((!args[0]->fixed && args[0]->fix_fields(thd, args)) || - (!cache && !(cache= Item_cache::get_cache(args[0])))) + Item **ref0= args; + if (args[1]->type() == Item::SUBSELECT_ITEM && + ((Item_subselect *)args[1])->is_in_predicate()) + { + /* + left_expr->fix_fields() may cause left_expr to be substituted for + another item. (e.g. an Item_field may be changed into Item_ref). This + transformation is undone at the end of statement execution (e.g. the + Item_ref is deleted). However, Item_in_optimizer::args[0] may keep + the pointer to the post-transformation item. Because of that, on the + next execution we need to copy args[1]->left_expr again. + */ + ref0= &(((Item_in_subselect *)args[1])->left_expr); + args[0]= ref0[0]; + } + if ((!args[0]->fixed && args[0]->fix_fields(thd, ref0)) || + (!cache && !(cache= Item_cache::get_cache(ref0[0])))) DBUG_RETURN(1); + args[0]= ref0[0]; DBUG_PRINT("info", ("actual fix fields")); cache->setup(args[0]); @@ -1500,6 +1516,16 @@ bool Item_in_optimizer::fix_left(THD *thd, Item **ref) bool Item_in_optimizer::fix_fields(THD *thd, Item **ref) { DBUG_ASSERT(fixed == 0); + Item_subselect *sub= 0; + uint col; + + /* + MAX/MIN optimization can convert the subquery into + expr + Item_singlerow_subselect + */ + if (args[1]->type() == Item::SUBSELECT_ITEM) + sub= (Item_subselect *)args[1]; + if (fix_left(thd, ref)) return TRUE; if (args[0]->maybe_null) @@ -1507,10 +1533,10 @@ bool Item_in_optimizer::fix_fields(THD *thd, Item **ref) if (!args[1]->fixed && args[1]->fix_fields(thd, args+1)) return TRUE; - Item_in_subselect * sub= (Item_in_subselect *)args[1]; - if (args[0]->cols() != sub->engine->cols()) + if ((sub && ((col= args[0]->cols()) != sub->engine->cols())) || + (!sub && (args[1]->cols() != (col= 1)))) { - my_error(ER_OPERAND_COLUMNS, MYF(0), args[0]->cols()); + my_error(ER_OPERAND_COLUMNS, MYF(0), col); return TRUE; } if (args[1]->maybe_null) diff --git a/sql/opt_subselect.cc b/sql/opt_subselect.cc index a8e1ff97b82..5b1a7f2f22a 100644 --- a/sql/opt_subselect.cc +++ b/sql/opt_subselect.cc @@ -620,6 +620,18 @@ int check_and_do_in_subquery_rewrites(JOIN *join) thd->stmt_arena->state != Query_arena::PREPARED) */ { + SELECT_LEX *current= thd->lex->current_select; + thd->lex->current_select= current->return_after_parsing(); + char const *save_where= thd->where; + thd->where= "IN/ALL/ANY subquery"; + + bool failure= !in_subs->left_expr->fixed && + in_subs->left_expr->fix_fields(thd, &in_subs->left_expr); + thd->lex->current_select= current; + thd->where= save_where; + if (failure) + DBUG_RETURN(-1); /* purecov: deadcode */ + /* Check if the left and right expressions have the same # of columns, i.e. we don't have a case like @@ -633,18 +645,6 @@ int check_and_do_in_subquery_rewrites(JOIN *join) my_error(ER_OPERAND_COLUMNS, MYF(0), in_subs->left_expr->cols()); DBUG_RETURN(-1); } - - SELECT_LEX *current= thd->lex->current_select; - thd->lex->current_select= current->return_after_parsing(); - char const *save_where= thd->where; - thd->where= "IN/ALL/ANY subquery"; - - bool failure= !in_subs->left_expr->fixed && - in_subs->left_expr->fix_fields(thd, &in_subs->left_expr); - thd->lex->current_select= current; - thd->where= save_where; - if (failure) - DBUG_RETURN(-1); /* purecov: deadcode */ } DBUG_PRINT("info", ("Checking if subq can be converted to semi-join")); From 0ab93fd6f3050cabac5fbb503173c95bb7073cfc Mon Sep 17 00:00:00 2001 From: Oleksandr Byelkin Date: Thu, 23 Apr 2015 19:16:57 +0200 Subject: [PATCH 62/85] MDEV-7445:Server crash with Signal 6 MDEV-7565: Server crash with Signal 6 (part 2) followup test suite and its fix. --- mysql-test/r/subselect.result | 8 +++++++- mysql-test/r/subselect_no_mat.result | 8 +++++++- mysql-test/r/subselect_no_opts.result | 8 +++++++- mysql-test/r/subselect_no_scache.result | 8 +++++++- mysql-test/r/subselect_no_semijoin.result | 8 +++++++- mysql-test/t/subselect.test | 7 +++++++ sql/item_subselect.cc | 20 +++++++++++++------- 7 files changed, 55 insertions(+), 12 deletions(-) diff --git a/mysql-test/r/subselect.result b/mysql-test/r/subselect.result index 19a845150d8..0ab2d487e99 100644 --- a/mysql-test/r/subselect.result +++ b/mysql-test/r/subselect.result @@ -3590,7 +3590,7 @@ delete from t1 where c <= 1140006215 and (select b from t2 where a = 2) = 1; drop table t1, t2; CREATE TABLE t1 (a INT); CREATE VIEW v1 AS SELECT * FROM t1 WHERE no_such_column = ANY (SELECT 1); -ERROR 42S22: Unknown column 'no_such_column' in 'where clause' +ERROR 42S22: Unknown column 'no_such_column' in 'IN/ALL/ANY subquery' CREATE VIEW v2 AS SELECT * FROM t1 WHERE no_such_column = (SELECT 1); ERROR 42S22: Unknown column 'no_such_column' in 'where clause' SELECT * FROM t1 WHERE no_such_column = ANY (SELECT 1); @@ -7047,3 +7047,9 @@ call procedure2(); ControlRev NULL drop procedure procedure2; +SELECT +(SELECT user FROM mysql.user +WHERE h.host in (SELECT host FROM mysql.user) +) AS sq +FROM mysql.host h GROUP BY h.host; +sq diff --git a/mysql-test/r/subselect_no_mat.result b/mysql-test/r/subselect_no_mat.result index 649f954fa96..5780351e811 100644 --- a/mysql-test/r/subselect_no_mat.result +++ b/mysql-test/r/subselect_no_mat.result @@ -3594,7 +3594,7 @@ delete from t1 where c <= 1140006215 and (select b from t2 where a = 2) = 1; drop table t1, t2; CREATE TABLE t1 (a INT); CREATE VIEW v1 AS SELECT * FROM t1 WHERE no_such_column = ANY (SELECT 1); -ERROR 42S22: Unknown column 'no_such_column' in 'where clause' +ERROR 42S22: Unknown column 'no_such_column' in 'IN/ALL/ANY subquery' CREATE VIEW v2 AS SELECT * FROM t1 WHERE no_such_column = (SELECT 1); ERROR 42S22: Unknown column 'no_such_column' in 'where clause' SELECT * FROM t1 WHERE no_such_column = ANY (SELECT 1); @@ -7044,6 +7044,12 @@ call procedure2(); ControlRev NULL drop procedure procedure2; +SELECT +(SELECT user FROM mysql.user +WHERE h.host in (SELECT host FROM mysql.user) +) AS sq +FROM mysql.host h GROUP BY h.host; +sq set optimizer_switch=default; select @@optimizer_switch like '%materialization=on%'; @@optimizer_switch like '%materialization=on%' diff --git a/mysql-test/r/subselect_no_opts.result b/mysql-test/r/subselect_no_opts.result index aa06ba11d19..4bea029341b 100644 --- a/mysql-test/r/subselect_no_opts.result +++ b/mysql-test/r/subselect_no_opts.result @@ -3590,7 +3590,7 @@ delete from t1 where c <= 1140006215 and (select b from t2 where a = 2) = 1; drop table t1, t2; CREATE TABLE t1 (a INT); CREATE VIEW v1 AS SELECT * FROM t1 WHERE no_such_column = ANY (SELECT 1); -ERROR 42S22: Unknown column 'no_such_column' in 'where clause' +ERROR 42S22: Unknown column 'no_such_column' in 'IN/ALL/ANY subquery' CREATE VIEW v2 AS SELECT * FROM t1 WHERE no_such_column = (SELECT 1); ERROR 42S22: Unknown column 'no_such_column' in 'where clause' SELECT * FROM t1 WHERE no_such_column = ANY (SELECT 1); @@ -7042,4 +7042,10 @@ call procedure2(); ControlRev NULL drop procedure procedure2; +SELECT +(SELECT user FROM mysql.user +WHERE h.host in (SELECT host FROM mysql.user) +) AS sq +FROM mysql.host h GROUP BY h.host; +sq set @optimizer_switch_for_subselect_test=null; diff --git a/mysql-test/r/subselect_no_scache.result b/mysql-test/r/subselect_no_scache.result index a9ee039f3d0..fdb3b129d46 100644 --- a/mysql-test/r/subselect_no_scache.result +++ b/mysql-test/r/subselect_no_scache.result @@ -3596,7 +3596,7 @@ delete from t1 where c <= 1140006215 and (select b from t2 where a = 2) = 1; drop table t1, t2; CREATE TABLE t1 (a INT); CREATE VIEW v1 AS SELECT * FROM t1 WHERE no_such_column = ANY (SELECT 1); -ERROR 42S22: Unknown column 'no_such_column' in 'where clause' +ERROR 42S22: Unknown column 'no_such_column' in 'IN/ALL/ANY subquery' CREATE VIEW v2 AS SELECT * FROM t1 WHERE no_such_column = (SELECT 1); ERROR 42S22: Unknown column 'no_such_column' in 'where clause' SELECT * FROM t1 WHERE no_such_column = ANY (SELECT 1); @@ -7053,6 +7053,12 @@ call procedure2(); ControlRev NULL drop procedure procedure2; +SELECT +(SELECT user FROM mysql.user +WHERE h.host in (SELECT host FROM mysql.user) +) AS sq +FROM mysql.host h GROUP BY h.host; +sq set optimizer_switch=default; select @@optimizer_switch like '%subquery_cache=on%'; @@optimizer_switch like '%subquery_cache=on%' diff --git a/mysql-test/r/subselect_no_semijoin.result b/mysql-test/r/subselect_no_semijoin.result index 4d5c3474ac1..cb6d35d3606 100644 --- a/mysql-test/r/subselect_no_semijoin.result +++ b/mysql-test/r/subselect_no_semijoin.result @@ -3590,7 +3590,7 @@ delete from t1 where c <= 1140006215 and (select b from t2 where a = 2) = 1; drop table t1, t2; CREATE TABLE t1 (a INT); CREATE VIEW v1 AS SELECT * FROM t1 WHERE no_such_column = ANY (SELECT 1); -ERROR 42S22: Unknown column 'no_such_column' in 'where clause' +ERROR 42S22: Unknown column 'no_such_column' in 'IN/ALL/ANY subquery' CREATE VIEW v2 AS SELECT * FROM t1 WHERE no_such_column = (SELECT 1); ERROR 42S22: Unknown column 'no_such_column' in 'where clause' SELECT * FROM t1 WHERE no_such_column = ANY (SELECT 1); @@ -7042,5 +7042,11 @@ call procedure2(); ControlRev NULL drop procedure procedure2; +SELECT +(SELECT user FROM mysql.user +WHERE h.host in (SELECT host FROM mysql.user) +) AS sq +FROM mysql.host h GROUP BY h.host; +sq set @optimizer_switch_for_subselect_test=null; set @join_cache_level_for_subselect_test=NULL; diff --git a/mysql-test/t/subselect.test b/mysql-test/t/subselect.test index 4fb404b1fff..3eb056d879b 100644 --- a/mysql-test/t/subselect.test +++ b/mysql-test/t/subselect.test @@ -5923,3 +5923,10 @@ call procedure2(); call procedure2(); drop procedure procedure2; + + +SELECT + (SELECT user FROM mysql.user + WHERE h.host in (SELECT host FROM mysql.user) + ) AS sq +FROM mysql.host h GROUP BY h.host; diff --git a/sql/item_subselect.cc b/sql/item_subselect.cc index 4837cb45a91..12e1b011c41 100644 --- a/sql/item_subselect.cc +++ b/sql/item_subselect.cc @@ -2653,10 +2653,12 @@ bool Item_in_subselect::fix_fields(THD *thd_arg, Item **ref) { uint outer_cols_num; List *inner_cols; + char const *save_where= thd->where; if (test_strategy(SUBS_SEMI_JOIN)) return !( (*ref)= new Item_int(1)); + thd->where= "IN/ALL/ANY subquery"; /* Check if the outer and inner IN operands match in those cases when we will not perform IN=>EXISTS transformation. Currently this is when we @@ -2687,7 +2689,7 @@ bool Item_in_subselect::fix_fields(THD *thd_arg, Item **ref) if (outer_cols_num != inner_cols->elements) { my_error(ER_OPERAND_COLUMNS, MYF(0), outer_cols_num); - return TRUE; + goto err; } if (outer_cols_num > 1) { @@ -2697,20 +2699,24 @@ bool Item_in_subselect::fix_fields(THD *thd_arg, Item **ref) { inner_col= inner_col_it++; if (inner_col->check_cols(left_expr->element_index(i)->cols())) - return TRUE; + goto err; } } } - if (thd_arg->lex->is_view_context_analysis() && - left_expr && !left_expr->fixed && + if (left_expr && !left_expr->fixed && left_expr->fix_fields(thd_arg, &left_expr)) - return TRUE; + goto err; else - if (Item_subselect::fix_fields(thd_arg, ref)) - return TRUE; + if (Item_subselect::fix_fields(thd_arg, ref)) + goto err; fixed= TRUE; + thd->where= save_where; return FALSE; + +err: + thd->where= save_where; + return TRUE; } From 54b998173b128bb8362b5dbafbd66c4199776937 Mon Sep 17 00:00:00 2001 From: Oleksandr Byelkin Date: Thu, 23 Apr 2015 20:08:57 +0200 Subject: [PATCH 63/85] MDEV-7846: Server crashes in Item_subselect::fix_fields or fails with Thread stack overrun Substitute into transformed subselects original left expression and than register its change in case it was substituted. --- mysql-test/r/subselect.result | 28 +++++++++++++++++++ mysql-test/r/subselect_no_mat.result | 28 +++++++++++++++++++ mysql-test/r/subselect_no_opts.result | 28 +++++++++++++++++++ mysql-test/r/subselect_no_scache.result | 28 +++++++++++++++++++ mysql-test/r/subselect_no_semijoin.result | 28 +++++++++++++++++++ mysql-test/t/subselect.test | 34 +++++++++++++++++++++++ sql/item_cmpfunc.cc | 8 +++--- sql/item_subselect.cc | 8 ++---- sql/item_subselect.h | 1 + sql/opt_subselect.cc | 4 ++- 10 files changed, 185 insertions(+), 10 deletions(-) diff --git a/mysql-test/r/subselect.result b/mysql-test/r/subselect.result index 0ab2d487e99..cf52ba2e2be 100644 --- a/mysql-test/r/subselect.result +++ b/mysql-test/r/subselect.result @@ -7053,3 +7053,31 @@ WHERE h.host in (SELECT host FROM mysql.user) ) AS sq FROM mysql.host h GROUP BY h.host; sq +# +# MDEV-7846:Server crashes in Item_subselect::fix +#_fields or fails with Thread stack overrun +# +CREATE TABLE t1 (column1 INT) ENGINE=MyISAM; +INSERT INTO t1 VALUES (3),(9); +CREATE TABLE t2 (column2 INT) ENGINE=MyISAM; +INSERT INTO t2 VALUES (1),(4); +CREATE TABLE t3 (column3 INT) ENGINE=MyISAM; +INSERT INTO t3 VALUES (6),(8); +CREATE TABLE t4 (column4 INT) ENGINE=MyISAM; +INSERT INTO t4 VALUES (2),(5); +PREPARE stmt FROM " +SELECT ( + SELECT MAX( table1.column1 ) AS field1 + FROM t1 AS table1 + WHERE table3.column3 IN ( SELECT table2.column2 AS field2 FROM t2 AS table2 ) +) AS sq +FROM t3 AS table3, t4 AS table4 GROUP BY sq +"; +EXECUTE stmt; +sq +NULL +EXECUTE stmt; +sq +NULL +deallocate prepare stmt; +drop table t1,t2,t3,t4; diff --git a/mysql-test/r/subselect_no_mat.result b/mysql-test/r/subselect_no_mat.result index 5780351e811..73a69e98c5b 100644 --- a/mysql-test/r/subselect_no_mat.result +++ b/mysql-test/r/subselect_no_mat.result @@ -7050,6 +7050,34 @@ WHERE h.host in (SELECT host FROM mysql.user) ) AS sq FROM mysql.host h GROUP BY h.host; sq +# +# MDEV-7846:Server crashes in Item_subselect::fix +#_fields or fails with Thread stack overrun +# +CREATE TABLE t1 (column1 INT) ENGINE=MyISAM; +INSERT INTO t1 VALUES (3),(9); +CREATE TABLE t2 (column2 INT) ENGINE=MyISAM; +INSERT INTO t2 VALUES (1),(4); +CREATE TABLE t3 (column3 INT) ENGINE=MyISAM; +INSERT INTO t3 VALUES (6),(8); +CREATE TABLE t4 (column4 INT) ENGINE=MyISAM; +INSERT INTO t4 VALUES (2),(5); +PREPARE stmt FROM " +SELECT ( + SELECT MAX( table1.column1 ) AS field1 + FROM t1 AS table1 + WHERE table3.column3 IN ( SELECT table2.column2 AS field2 FROM t2 AS table2 ) +) AS sq +FROM t3 AS table3, t4 AS table4 GROUP BY sq +"; +EXECUTE stmt; +sq +NULL +EXECUTE stmt; +sq +NULL +deallocate prepare stmt; +drop table t1,t2,t3,t4; set optimizer_switch=default; select @@optimizer_switch like '%materialization=on%'; @@optimizer_switch like '%materialization=on%' diff --git a/mysql-test/r/subselect_no_opts.result b/mysql-test/r/subselect_no_opts.result index 4bea029341b..1512e39c52d 100644 --- a/mysql-test/r/subselect_no_opts.result +++ b/mysql-test/r/subselect_no_opts.result @@ -7048,4 +7048,32 @@ WHERE h.host in (SELECT host FROM mysql.user) ) AS sq FROM mysql.host h GROUP BY h.host; sq +# +# MDEV-7846:Server crashes in Item_subselect::fix +#_fields or fails with Thread stack overrun +# +CREATE TABLE t1 (column1 INT) ENGINE=MyISAM; +INSERT INTO t1 VALUES (3),(9); +CREATE TABLE t2 (column2 INT) ENGINE=MyISAM; +INSERT INTO t2 VALUES (1),(4); +CREATE TABLE t3 (column3 INT) ENGINE=MyISAM; +INSERT INTO t3 VALUES (6),(8); +CREATE TABLE t4 (column4 INT) ENGINE=MyISAM; +INSERT INTO t4 VALUES (2),(5); +PREPARE stmt FROM " +SELECT ( + SELECT MAX( table1.column1 ) AS field1 + FROM t1 AS table1 + WHERE table3.column3 IN ( SELECT table2.column2 AS field2 FROM t2 AS table2 ) +) AS sq +FROM t3 AS table3, t4 AS table4 GROUP BY sq +"; +EXECUTE stmt; +sq +NULL +EXECUTE stmt; +sq +NULL +deallocate prepare stmt; +drop table t1,t2,t3,t4; set @optimizer_switch_for_subselect_test=null; diff --git a/mysql-test/r/subselect_no_scache.result b/mysql-test/r/subselect_no_scache.result index fdb3b129d46..26cea1f9f70 100644 --- a/mysql-test/r/subselect_no_scache.result +++ b/mysql-test/r/subselect_no_scache.result @@ -7059,6 +7059,34 @@ WHERE h.host in (SELECT host FROM mysql.user) ) AS sq FROM mysql.host h GROUP BY h.host; sq +# +# MDEV-7846:Server crashes in Item_subselect::fix +#_fields or fails with Thread stack overrun +# +CREATE TABLE t1 (column1 INT) ENGINE=MyISAM; +INSERT INTO t1 VALUES (3),(9); +CREATE TABLE t2 (column2 INT) ENGINE=MyISAM; +INSERT INTO t2 VALUES (1),(4); +CREATE TABLE t3 (column3 INT) ENGINE=MyISAM; +INSERT INTO t3 VALUES (6),(8); +CREATE TABLE t4 (column4 INT) ENGINE=MyISAM; +INSERT INTO t4 VALUES (2),(5); +PREPARE stmt FROM " +SELECT ( + SELECT MAX( table1.column1 ) AS field1 + FROM t1 AS table1 + WHERE table3.column3 IN ( SELECT table2.column2 AS field2 FROM t2 AS table2 ) +) AS sq +FROM t3 AS table3, t4 AS table4 GROUP BY sq +"; +EXECUTE stmt; +sq +NULL +EXECUTE stmt; +sq +NULL +deallocate prepare stmt; +drop table t1,t2,t3,t4; set optimizer_switch=default; select @@optimizer_switch like '%subquery_cache=on%'; @@optimizer_switch like '%subquery_cache=on%' diff --git a/mysql-test/r/subselect_no_semijoin.result b/mysql-test/r/subselect_no_semijoin.result index cb6d35d3606..4c6f03780dd 100644 --- a/mysql-test/r/subselect_no_semijoin.result +++ b/mysql-test/r/subselect_no_semijoin.result @@ -7048,5 +7048,33 @@ WHERE h.host in (SELECT host FROM mysql.user) ) AS sq FROM mysql.host h GROUP BY h.host; sq +# +# MDEV-7846:Server crashes in Item_subselect::fix +#_fields or fails with Thread stack overrun +# +CREATE TABLE t1 (column1 INT) ENGINE=MyISAM; +INSERT INTO t1 VALUES (3),(9); +CREATE TABLE t2 (column2 INT) ENGINE=MyISAM; +INSERT INTO t2 VALUES (1),(4); +CREATE TABLE t3 (column3 INT) ENGINE=MyISAM; +INSERT INTO t3 VALUES (6),(8); +CREATE TABLE t4 (column4 INT) ENGINE=MyISAM; +INSERT INTO t4 VALUES (2),(5); +PREPARE stmt FROM " +SELECT ( + SELECT MAX( table1.column1 ) AS field1 + FROM t1 AS table1 + WHERE table3.column3 IN ( SELECT table2.column2 AS field2 FROM t2 AS table2 ) +) AS sq +FROM t3 AS table3, t4 AS table4 GROUP BY sq +"; +EXECUTE stmt; +sq +NULL +EXECUTE stmt; +sq +NULL +deallocate prepare stmt; +drop table t1,t2,t3,t4; set @optimizer_switch_for_subselect_test=null; set @join_cache_level_for_subselect_test=NULL; diff --git a/mysql-test/t/subselect.test b/mysql-test/t/subselect.test index 3eb056d879b..00ab48b2c63 100644 --- a/mysql-test/t/subselect.test +++ b/mysql-test/t/subselect.test @@ -5930,3 +5930,37 @@ SELECT WHERE h.host in (SELECT host FROM mysql.user) ) AS sq FROM mysql.host h GROUP BY h.host; + + +--echo # +--echo # MDEV-7846:Server crashes in Item_subselect::fix +--echo #_fields or fails with Thread stack overrun +--echo # +CREATE TABLE t1 (column1 INT) ENGINE=MyISAM; +INSERT INTO t1 VALUES (3),(9); + +CREATE TABLE t2 (column2 INT) ENGINE=MyISAM; + +INSERT INTO t2 VALUES (1),(4); + +CREATE TABLE t3 (column3 INT) ENGINE=MyISAM; +INSERT INTO t3 VALUES (6),(8); + +CREATE TABLE t4 (column4 INT) ENGINE=MyISAM; +INSERT INTO t4 VALUES (2),(5); + + +PREPARE stmt FROM " +SELECT ( + SELECT MAX( table1.column1 ) AS field1 + FROM t1 AS table1 + WHERE table3.column3 IN ( SELECT table2.column2 AS field2 FROM t2 AS table2 ) +) AS sq +FROM t3 AS table3, t4 AS table4 GROUP BY sq +"; + +EXECUTE stmt; +EXECUTE stmt; + +deallocate prepare stmt; +drop table t1,t2,t3,t4; diff --git a/sql/item_cmpfunc.cc b/sql/item_cmpfunc.cc index 678288971ad..c2adb58677d 100644 --- a/sql/item_cmpfunc.cc +++ b/sql/item_cmpfunc.cc @@ -1455,12 +1455,12 @@ bool Item_in_optimizer::fix_left(THD *thd, Item **ref) next execution we need to copy args[1]->left_expr again. */ ref0= &(((Item_in_subselect *)args[1])->left_expr); - args[0]= ref0[0]; } - if ((!args[0]->fixed && args[0]->fix_fields(thd, ref0)) || - (!cache && !(cache= Item_cache::get_cache(ref0[0])))) + if ((!(*ref0)->fixed && (*ref0)->fix_fields(thd, ref0)) || + (!cache && !(cache= Item_cache::get_cache(*ref0)))) DBUG_RETURN(1); - args[0]= ref0[0]; + if (args[0] != (*ref0)) + current_thd->change_item_tree(args, (*ref0)); DBUG_PRINT("info", ("actual fix fields")); cache->setup(args[0]); diff --git a/sql/item_subselect.cc b/sql/item_subselect.cc index 12e1b011c41..1107945ae99 100644 --- a/sql/item_subselect.cc +++ b/sql/item_subselect.cc @@ -1363,7 +1363,7 @@ Item_in_subselect::Item_in_subselect(Item * left_exp, upper_item(0) { DBUG_ENTER("Item_in_subselect::Item_in_subselect"); - left_expr= left_exp; + left_expr_orig= left_expr= left_exp; func= &eq_creator; init(select_lex, new select_exists_subselect(this)); max_columns= UINT_MAX; @@ -1387,7 +1387,7 @@ Item_allany_subselect::Item_allany_subselect(Item * left_exp, :Item_in_subselect(), func_creator(fc), all(all_arg) { DBUG_ENTER("Item_allany_subselect::Item_allany_subselect"); - left_expr= left_exp; + left_expr_orig= left_expr= left_exp; func= func_creator(all_arg); init(select_lex, new select_exists_subselect(this)); max_columns= 1; @@ -2586,15 +2586,13 @@ Item_in_subselect::select_in_like_transformer(JOIN *join) arena= thd->activate_stmt_arena_if_needed(&backup); if (!optimizer) { - result= (!(optimizer= new Item_in_optimizer(left_expr, this))); + result= (!(optimizer= new Item_in_optimizer(left_expr_orig, this))); if (result) goto out; } thd->lex->current_select= current->return_after_parsing(); result= optimizer->fix_left(thd, optimizer->arguments()); - /* fix_fields can change reference to left_expr, we need reassign it */ - left_expr= optimizer->arguments()[0]; thd->lex->current_select= current; if (changed) diff --git a/sql/item_subselect.h b/sql/item_subselect.h index 592e7711a10..930bd665e3a 100644 --- a/sql/item_subselect.h +++ b/sql/item_subselect.h @@ -449,6 +449,7 @@ protected: Item **having_item); public: Item *left_expr; + Item *left_expr_orig; /* Priority of this predicate in the convert-to-semi-join-nest process. */ int sj_convert_priority; /* diff --git a/sql/opt_subselect.cc b/sql/opt_subselect.cc index 5b1a7f2f22a..1363be002b9 100644 --- a/sql/opt_subselect.cc +++ b/sql/opt_subselect.cc @@ -1593,7 +1593,9 @@ static bool convert_subq_to_sj(JOIN *parent_join, Item_in_subselect *subq_pred) { nested_join->sj_outer_expr_list.push_back(subq_pred->left_expr); Item_func_eq *item_eq= - new Item_func_eq(subq_pred->left_expr, subq_lex->ref_pointer_array[0]); + new Item_func_eq(subq_pred->left_expr_orig, subq_lex->ref_pointer_array[0]); + if (subq_pred->left_expr_orig != subq_pred->left_expr) + thd->change_item_tree(item_eq->arguments(), subq_pred->left_expr); item_eq->in_equality_no= 0; sj_nest->sj_on_expr= and_items(sj_nest->sj_on_expr, item_eq); } From 504802f333d3ba2a7385ca14f5b40a3facc72de8 Mon Sep 17 00:00:00 2001 From: Oleksandr Byelkin Date: Wed, 5 Aug 2015 11:57:35 +0200 Subject: [PATCH 64/85] MDEV-7846: postreview fix --- sql/item_cmpfunc.cc | 13 ++++++++++++- sql/item_subselect.h | 5 +++++ sql/opt_subselect.cc | 9 +++++++++ 3 files changed, 26 insertions(+), 1 deletion(-) diff --git a/sql/item_cmpfunc.cc b/sql/item_cmpfunc.cc index c2adb58677d..0c48592eb9f 100644 --- a/sql/item_cmpfunc.cc +++ b/sql/item_cmpfunc.cc @@ -1442,6 +1442,12 @@ bool Item_in_optimizer::eval_not_null_tables(uchar *opt_arg) bool Item_in_optimizer::fix_left(THD *thd, Item **ref) { DBUG_ENTER("Item_in_optimizer::fix_left"); + /* + Here we will store pointer on place of main storage of left expression. + For usual IN (ALL/ANY) it is subquery left_expr. + For other cases (MAX/MIN optimization, non-transformed EXISTS (10.0)) + it is args[0]. + */ Item **ref0= args; if (args[1]->type() == Item::SUBSELECT_ITEM && ((Item_subselect *)args[1])->is_in_predicate()) @@ -1455,12 +1461,17 @@ bool Item_in_optimizer::fix_left(THD *thd, Item **ref) next execution we need to copy args[1]->left_expr again. */ ref0= &(((Item_in_subselect *)args[1])->left_expr); + args[0]= ((Item_in_subselect *)args[1])->left_expr; } if ((!(*ref0)->fixed && (*ref0)->fix_fields(thd, ref0)) || (!cache && !(cache= Item_cache::get_cache(*ref0)))) DBUG_RETURN(1); + /* + During fix_field() expression could be substituted. + So we copy changes before use + */ if (args[0] != (*ref0)) - current_thd->change_item_tree(args, (*ref0)); + args[0]= (*ref0); DBUG_PRINT("info", ("actual fix fields")); cache->setup(args[0]); diff --git a/sql/item_subselect.h b/sql/item_subselect.h index 930bd665e3a..0ee5f73eb35 100644 --- a/sql/item_subselect.h +++ b/sql/item_subselect.h @@ -449,6 +449,11 @@ protected: Item **having_item); public: Item *left_expr; + /* + Important for PS/SP: left_expr_orig is the item that left_expr originally + pointed at. That item is allocated on the statement arena, while + left_expr could later be changed to something on the execution arena. + */ Item *left_expr_orig; /* Priority of this predicate in the convert-to-semi-join-nest process. */ int sj_convert_priority; diff --git a/sql/opt_subselect.cc b/sql/opt_subselect.cc index 1363be002b9..827290fd15b 100644 --- a/sql/opt_subselect.cc +++ b/sql/opt_subselect.cc @@ -1592,6 +1592,15 @@ static bool convert_subq_to_sj(JOIN *parent_join, Item_in_subselect *subq_pred) if (subq_pred->left_expr->cols() == 1) { nested_join->sj_outer_expr_list.push_back(subq_pred->left_expr); + /* + Create Item_func_eq. Note that + 1. this is done on the statement, not execution, arena + 2. if it's a PS then this happens only once - on the first execution. + On following re-executions, the item will be fix_field-ed normally. + 3. Thus it should be created as if it was fix_field'ed, in particular + all pointers to items in the execution arena should be protected + with thd->change_item_tree + */ Item_func_eq *item_eq= new Item_func_eq(subq_pred->left_expr_orig, subq_lex->ref_pointer_array[0]); if (subq_pred->left_expr_orig != subq_pred->left_expr) From 1289794799e7ad5ae4f6a26a545dff7b77ee8637 Mon Sep 17 00:00:00 2001 From: Sergei Petrunia Date: Tue, 6 Oct 2015 15:54:37 +0300 Subject: [PATCH 65/85] Fix for MDEV-8321, MDEV-6223 EXPLAIN INSERT ... SELECT tried to use SELECT's execution path. This caused a collection of problems: - SELECT_DESCRIBE flag was not put into select_lex->options, which means it was not in JOIN::select_options either (except for the first member of the UNION). - This caused UNION members to be executed. They would attempt to write join output rows to the output. - (Actual cause of the crash) second join sibling would call result->send_eof() when finished execution. Then, Explain_query::print_explain would attempt to write to query output again, and cause an assertion due to non-empty query output. --- mysql-test/r/explain_non_select.result | 26 ++++++++++++++++++++++++++ mysql-test/t/explain_non_select.test | 26 ++++++++++++++++++++++++++ sql/sql_parse.cc | 5 ++++- sql/sql_union.cc | 2 -- 4 files changed, 56 insertions(+), 3 deletions(-) diff --git a/mysql-test/r/explain_non_select.result b/mysql-test/r/explain_non_select.result index 8e336a0f8c0..5a6b9f841c2 100644 --- a/mysql-test/r/explain_non_select.result +++ b/mysql-test/r/explain_non_select.result @@ -247,3 +247,29 @@ CHECK TABLE t1; Table Op Msg_type Msg_text test.t1 check status OK DROP TABLE t1, t2; +# +# MDEV-8321: Assertion `! is_set()' failed in Diagnostics_area::set_eof_status on EXPLAIN INSERT ... UNION +# +CREATE TABLE t1 (a INT); +CREATE TABLE t2 (b INT); +CREATE TABLE t3 (c INT); +INSERT INTO t1 VALUES (1),(2); +INSERT INTO t2 VALUES (3),(4); +INSERT INTO t3 VALUES (5),(6); +EXPLAIN INSERT INTO t1 SELECT * FROM t2 UNION SELECT * FROM t3; +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY t2 ALL NULL NULL NULL NULL 2 +2 UNION t3 ALL NULL NULL NULL NULL 2 +NULL UNION RESULT ALL NULL NULL NULL NULL NULL +drop table t1,t2,t3; +# +# MDEV-6223: Assertion `! is_set()' fails in Diagnostics_area::set_eof_status on EXPLAIN INSERT executed as a PS +# +CREATE TABLE t1 (a INT) ENGINE = MyISAM; +CREATE TABLE t2 (b INT) ENGINE = MyISAM; +INSERT INTO t2 VALUES (1),(2); +PREPARE stmt FROM 'EXPLAIN INSERT INTO t1 SELECT * FROM t2'; +EXECUTE stmt; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 ALL NULL NULL NULL NULL 2 +drop table t1,t2; diff --git a/mysql-test/t/explain_non_select.test b/mysql-test/t/explain_non_select.test index 52996a8c24a..d9ff0fb7245 100644 --- a/mysql-test/t/explain_non_select.test +++ b/mysql-test/t/explain_non_select.test @@ -224,3 +224,29 @@ CHECK TABLE t1; DROP TABLE t1, t2; +--echo # +--echo # MDEV-8321: Assertion `! is_set()' failed in Diagnostics_area::set_eof_status on EXPLAIN INSERT ... UNION +--echo # + +CREATE TABLE t1 (a INT); +CREATE TABLE t2 (b INT); +CREATE TABLE t3 (c INT); + +# Data is not necessary, tables can be empty as well +INSERT INTO t1 VALUES (1),(2); +INSERT INTO t2 VALUES (3),(4); +INSERT INTO t3 VALUES (5),(6); + +EXPLAIN INSERT INTO t1 SELECT * FROM t2 UNION SELECT * FROM t3; +drop table t1,t2,t3; + +--echo # +--echo # MDEV-6223: Assertion `! is_set()' fails in Diagnostics_area::set_eof_status on EXPLAIN INSERT executed as a PS +--echo # +CREATE TABLE t1 (a INT) ENGINE = MyISAM; +CREATE TABLE t2 (b INT) ENGINE = MyISAM; +INSERT INTO t2 VALUES (1),(2); +PREPARE stmt FROM 'EXPLAIN INSERT INTO t1 SELECT * FROM t2'; +EXECUTE stmt; +drop table t1,t2; + diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index 93e6bdebd53..b2636cfff95 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -3533,7 +3533,10 @@ end_with_restore_list: lex->duplicates, lex->ignore))) { - res= handle_select(thd, lex, sel_result, OPTION_SETUP_TABLES_DONE); + if (explain) + res= mysql_explain_union(thd, &thd->lex->unit, sel_result); + else + res= handle_select(thd, lex, sel_result, OPTION_SETUP_TABLES_DONE); /* Invalidate the table in the query cache if something changed after unlocking when changes become visible. diff --git a/sql/sql_union.cc b/sql/sql_union.cc index a316fbad726..71875433c39 100644 --- a/sql/sql_union.cc +++ b/sql/sql_union.cc @@ -286,8 +286,6 @@ bool st_select_lex_unit::prepare(THD *thd_arg, select_result *sel_result, { if (!(tmp_result= union_result= new select_union)) goto err; - if (describe) - tmp_result= sel_result; } else tmp_result= sel_result; From 4a602046c01c0fce881124f7ce29b17099bb54e7 Mon Sep 17 00:00:00 2001 From: Sergei Petrunia Date: Tue, 6 Oct 2015 16:15:34 +0300 Subject: [PATCH 66/85] MDEV-8903: Buildbot valgrind failure: Invalid read of size 1 in sql_memdup... When we calculate max_key_len for RANGE_OPT_PARAM::min_key/max_key, take into account that QUICK_RANGE::QUICK_RANGE for some reason assumes that there is one more byte there: max_key((uchar*) sql_memdup(max_key_arg,max_length_arg+1)), --- sql/opt_range.cc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sql/opt_range.cc b/sql/opt_range.cc index 63ed2aa5185..3f12748c071 100644 --- a/sql/opt_range.cc +++ b/sql/opt_range.cc @@ -3108,6 +3108,7 @@ int SQL_SELECT::test_quick_select(THD *thd, key_map keys_to_use, param.key_parts_end=key_parts; param.alloced_sel_args= 0; + max_key_len++; /* Take into account the "+1" in QUICK_RANGE::QUICK_RANGE */ if (!(param.min_key= (uchar*)alloc_root(&alloc,max_key_len)) || !(param.max_key= (uchar*)alloc_root(&alloc,max_key_len))) { @@ -3367,6 +3368,7 @@ bool create_key_parts_for_pseudo_indexes(RANGE_OPT_PARAM *param, } } + max_key_len++; /* Take into account the "+1" in QUICK_RANGE::QUICK_RANGE */ if (!(param->min_key= (uchar*)alloc_root(param->mem_root, max_key_len)) || !(param->max_key= (uchar*)alloc_root(param->mem_root, max_key_len))) { @@ -4963,6 +4965,7 @@ static bool create_partition_index_description(PART_PRUNE_PARAM *ppar) if (cur_key_len > max_key_len) max_key_len= cur_key_len; + max_key_len++; /* Take into account the "+1" in QUICK_RANGE::QUICK_RANGE */ if (!(range_par->min_key= (uchar*)alloc_root(alloc,max_key_len)) || !(range_par->max_key= (uchar*)alloc_root(alloc,max_key_len))) { From d278fb4922b6788b1531b8ff6ff015eaf2a629f5 Mon Sep 17 00:00:00 2001 From: Monty Date: Thu, 8 Oct 2015 09:58:44 +0300 Subject: [PATCH 67/85] Fixed tokudb test result to make it stable (was altering between index and range) --- .../tokudb/r/cluster_filter_hidden.result | 32 ++++++++--------- .../tokudb/t/cluster_filter_hidden.test | 34 +++++++++---------- 2 files changed, 32 insertions(+), 34 deletions(-) diff --git a/storage/tokudb/mysql-test/tokudb/r/cluster_filter_hidden.result b/storage/tokudb/mysql-test/tokudb/r/cluster_filter_hidden.result index 7e92604d0f5..48f66942bc3 100644 --- a/storage/tokudb/mysql-test/tokudb/r/cluster_filter_hidden.result +++ b/storage/tokudb/mysql-test/tokudb/r/cluster_filter_hidden.result @@ -9,7 +9,7 @@ insert into t1 values (4,40,400,4000,40000,400000); insert into t1 values (5,50,500,5000,50000,500000); explain select * from t1; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 index NULL b NULL NULL NULL; Using index +1 SIMPLE t1 index NULL b NULL NULL NULL Using index select * from t1; a b c d e f 1 10 100 1000 10000 100000 @@ -19,7 +19,7 @@ a b c d e f 5 50 500 5000 50000 500000 explain select * from t1 where b > 0; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 index b b NULL NULL NULL; Using where; Using index +1 SIMPLE t1 index b b NULL NULL NULL Using where; Using index select * from t1 where b > 0; a b c d e f 1 10 100 1000 10000 100000 @@ -29,7 +29,7 @@ a b c d e f 5 50 500 5000 50000 500000 explain select * from t1 where d > 0; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 index d d NULL NULL NULL; Using where; Using index +1 SIMPLE t1 index d d NULL NULL NULL Using where; Using index select * from t1 where d > 0; a b c d e f 1 10 100 1000 10000 100000 @@ -39,7 +39,7 @@ a b c d e f 5 50 500 5000 50000 500000 explain select a from t1 where d > 0; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 index d d NULL NULL NULL; Using where; Using index +1 SIMPLE t1 index d d NULL NULL NULL Using where; Using index select a from t1 where d > 0; a 1 @@ -71,7 +71,7 @@ e f update t1 set a = a+1, b = b+10; explain select * from t1; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 index NULL b NULL NULL NULL; Using index +1 SIMPLE t1 index NULL b NULL NULL NULL Using index select * from t1; a b c d e f 2 20 100 1000 10000 100000 @@ -81,7 +81,7 @@ a b c d e f 6 60 500 5000 50000 500000 explain select * from t1 where b > 0; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 index b b NULL NULL NULL; Using where; Using index +1 SIMPLE t1 index b b NULL NULL NULL Using where; Using index select * from t1 where b > 0; a b c d e f 2 20 100 1000 10000 100000 @@ -91,7 +91,7 @@ a b c d e f 6 60 500 5000 50000 500000 explain select * from t1 where d > 0; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 index d d NULL NULL NULL; Using where; Using index +1 SIMPLE t1 index d d NULL NULL NULL Using where; Using index select * from t1 where d > 0; a b c d e f 2 20 100 1000 10000 100000 @@ -101,7 +101,7 @@ a b c d e f 6 60 500 5000 50000 500000 explain select a from t1 where d > 0; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 index d d NULL NULL NULL; Using where; Using index +1 SIMPLE t1 index d d NULL NULL NULL Using where; Using index select a from t1 where d > 0; a 2 @@ -133,28 +133,28 @@ e f delete from t1 where b > 35; explain select * from t1; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 index NULL b NULL NULL NULL; Using index +1 SIMPLE t1 index NULL b NULL NULL NULL Using index select * from t1; a b c d e f 2 20 100 1000 10000 100000 3 30 200 2000 20000 200000 explain select * from t1 where b > 0; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 index b b NULL NULL NULL; Using where; Using index +1 SIMPLE t1 index b b NULL NULL NULL Using where; Using index select * from t1 where b > 0; a b c d e f 2 20 100 1000 10000 100000 3 30 200 2000 20000 200000 explain select * from t1 where d > 0; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 index d d NULL NULL NULL; Using where; Using index +1 SIMPLE t1 index d d NULL NULL NULL Using where; Using index select * from t1 where d > 0; a b c d e f 2 20 100 1000 10000 100000 3 30 200 2000 20000 200000 explain select a from t1 where d > 0; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 index d d NULL NULL NULL; Using where; Using index +1 SIMPLE t1 index d d NULL NULL NULL Using where; Using index select a from t1 where d > 0; a 2 @@ -175,28 +175,28 @@ alter table t1 drop index b, drop index d; alter table t1 add key b(b) clustering=yes, add index d(d,a) clustering=yes; explain select * from t1; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 index NULL b NULL NULL NULL; Using index +1 SIMPLE t1 index NULL b NULL NULL NULL Using index select * from t1; a b c d e f 2 20 100 1000 10000 100000 3 30 200 2000 20000 200000 explain select * from t1 where b > 0; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 index b b NULL NULL NULL; Using where; Using index +1 SIMPLE t1 X b b NULL NULL NULL Using where; Using index select * from t1 where b > 0; a b c d e f 2 20 100 1000 10000 100000 3 30 200 2000 20000 200000 explain select * from t1 where d > 0; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 index d d NULL NULL NULL; Using where; Using index +1 SIMPLE t1 X d d NULL NULL NULL Using where; Using index select * from t1 where d > 0; a b c d e f 2 20 100 1000 10000 100000 3 30 200 2000 20000 200000 explain select a from t1 where d > 0; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 NULL d d NULL NULL NULL; Using where; Using index +1 SIMPLE t1 NULL d d NULL NULL NULL Using where; Using index select a from t1 where d > 0; a 2 diff --git a/storage/tokudb/mysql-test/tokudb/t/cluster_filter_hidden.test b/storage/tokudb/mysql-test/tokudb/t/cluster_filter_hidden.test index 2abc9a91ff1..1a72b8e9303 100644 --- a/storage/tokudb/mysql-test/tokudb/t/cluster_filter_hidden.test +++ b/storage/tokudb/mysql-test/tokudb/t/cluster_filter_hidden.test @@ -14,19 +14,19 @@ insert into t1 values (4,40,400,4000,40000,400000); insert into t1 values (5,50,500,5000,50000,500000); # ignore key_len and rows columns ---replace_column 7 NULL 9 NULL; +--replace_column 7 NULL 9 NULL explain select * from t1; select * from t1; ---replace_column 7 NULL 9 NULL; +--replace_column 7 NULL 9 NULL explain select * from t1 where b > 0; select * from t1 where b > 0; ---replace_column 7 NULL 9 NULL; +--replace_column 7 NULL 9 NULL explain select * from t1 where d > 0; select * from t1 where d > 0; ---replace_column 7 NULL 9 NULL; +--replace_column 7 NULL 9 NULL explain select a from t1 where d > 0; select a from t1 where d > 0; select e,f from t1 where c > 0; @@ -34,19 +34,19 @@ select e,f from t1 where b > 0; select e,f from t1 where d > 0; update t1 set a = a+1, b = b+10; ---replace_column 7 NULL 9 NULL; +--replace_column 7 NULL 9 NULL explain select * from t1; select * from t1; ---replace_column 7 NULL 9 NULL; +--replace_column 7 NULL 9 NULL explain select * from t1 where b > 0; select * from t1 where b > 0; ---replace_column 7 NULL 9 NULL; +--replace_column 7 NULL 9 NULL explain select * from t1 where d > 0; select * from t1 where d > 0; ---replace_column 7 NULL 9 NULL; +--replace_column 7 NULL 9 NULL explain select a from t1 where d > 0; select a from t1 where d > 0; select e,f from t1 where c > 0; @@ -54,19 +54,19 @@ select e,f from t1 where b > 0; select e,f from t1 where d > 0; delete from t1 where b > 35; ---replace_column 7 NULL 9 NULL; +--replace_column 7 NULL 9 NULL explain select * from t1; select * from t1; ---replace_column 7 NULL 9 NULL; +--replace_column 7 NULL 9 NULL explain select * from t1 where b > 0; select * from t1 where b > 0; ---replace_column 7 NULL 9 NULL; +--replace_column 7 NULL 9 NULL explain select * from t1 where d > 0; select * from t1 where d > 0; ---replace_column 7 NULL 9 NULL; +--replace_column 7 NULL 9 NULL explain select a from t1 where d > 0; select a from t1 where d > 0; select e,f from t1 where c > 0; @@ -78,25 +78,23 @@ alter table t1 drop index b, drop index d; alter table t1 add key b(b) clustering=yes, add index d(d,a) clustering=yes; ---replace_column 7 NULL 9 NULL; +--replace_column 7 NULL 9 NULL explain select * from t1; select * from t1; ---replace_column 7 NULL 9 NULL; +--replace_column 4 X 7 NULL 9 NULL explain select * from t1 where b > 0; select * from t1 where b > 0; ---replace_column 7 NULL 9 NULL; +--replace_column 4 X 7 NULL 9 NULL explain select * from t1 where d > 0; select * from t1 where d > 0; ---replace_column 4 NULL 7 NULL 9 NULL; +--replace_column 4 NULL 7 NULL 9 NULL explain select a from t1 where d > 0; select a from t1 where d > 0; select e,f from t1 where c > 0; select e,f from t1 where b > 0; select e,f from t1 where d > 0; - - DROP TABLE t1; From ca051fa0275a09ff63ef4172dc6db9d8ee6cdcea Mon Sep 17 00:00:00 2001 From: Monty Date: Thu, 8 Oct 2015 10:16:35 +0300 Subject: [PATCH 68/85] Allow row events in replication stream for slave in all cases (even when configured with --binlog-format=statement). Before we got an error on the slave and the slave stopped if the master was configured with --binlog-format=mixed or --binlog-format=row. --- mysql-test/suite/rpl/r/rpl_row_to_stmt.result | 28 +++++++++++++++++++ .../suite/rpl/t/rpl_row_to_stmt-master.opt | 1 + .../suite/rpl/t/rpl_row_to_stmt-slave.opt | 1 + mysql-test/suite/rpl/t/rpl_row_to_stmt.test | 23 +++++++++++++++ sql/sql_class.cc | 15 ++++------ 5 files changed, 59 insertions(+), 9 deletions(-) create mode 100644 mysql-test/suite/rpl/r/rpl_row_to_stmt.result create mode 100644 mysql-test/suite/rpl/t/rpl_row_to_stmt-master.opt create mode 100644 mysql-test/suite/rpl/t/rpl_row_to_stmt-slave.opt create mode 100644 mysql-test/suite/rpl/t/rpl_row_to_stmt.test diff --git a/mysql-test/suite/rpl/r/rpl_row_to_stmt.result b/mysql-test/suite/rpl/r/rpl_row_to_stmt.result new file mode 100644 index 00000000000..2dfa82b0305 --- /dev/null +++ b/mysql-test/suite/rpl/r/rpl_row_to_stmt.result @@ -0,0 +1,28 @@ +include/master-slave.inc +[connection master] +use test; +create table t1 (a int primary key); +insert into t1 values (1),(2),(3),(4),(5); +update t1 set a=a*10; +use test; +select * from t1; +a +10 +20 +30 +40 +50 +include/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +slave-bin.000001 # Gtid # # GTID #-#-# +slave-bin.000001 # Query # # use `test`; create table t1 (a int primary key) +slave-bin.000001 # Gtid # # BEGIN GTID #-#-# +slave-bin.000001 # Table_map # # table_id: # (test.t1) +slave-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F +slave-bin.000001 # Query # # COMMIT +slave-bin.000001 # Gtid # # BEGIN GTID #-#-# +slave-bin.000001 # Table_map # # table_id: # (test.t1) +slave-bin.000001 # Update_rows_v1 # # table_id: # flags: STMT_END_F +slave-bin.000001 # Query # # COMMIT +drop table t1; +include/rpl_end.inc diff --git a/mysql-test/suite/rpl/t/rpl_row_to_stmt-master.opt b/mysql-test/suite/rpl/t/rpl_row_to_stmt-master.opt new file mode 100644 index 00000000000..83ed8522e72 --- /dev/null +++ b/mysql-test/suite/rpl/t/rpl_row_to_stmt-master.opt @@ -0,0 +1 @@ +--binlog-format=row diff --git a/mysql-test/suite/rpl/t/rpl_row_to_stmt-slave.opt b/mysql-test/suite/rpl/t/rpl_row_to_stmt-slave.opt new file mode 100644 index 00000000000..af3a211967b --- /dev/null +++ b/mysql-test/suite/rpl/t/rpl_row_to_stmt-slave.opt @@ -0,0 +1 @@ +--binlog-format=statement diff --git a/mysql-test/suite/rpl/t/rpl_row_to_stmt.test b/mysql-test/suite/rpl/t/rpl_row_to_stmt.test new file mode 100644 index 00000000000..5ca583d881f --- /dev/null +++ b/mysql-test/suite/rpl/t/rpl_row_to_stmt.test @@ -0,0 +1,23 @@ +# +# check that master starterd with log-format=ROW replication can replicate to +# slave started with log-format=STATEMENT +# + +--source include/have_binlog_format_row.inc +--source include/master-slave.inc + +use test; + +create table t1 (a int primary key); +insert into t1 values (1),(2),(3),(4),(5); +update t1 set a=a*10; + +sync_slave_with_master; +use test; +select * from t1; +source include/show_binlog_events.inc; + +connection master; +drop table t1; + +--source include/rpl_end.inc diff --git a/sql/sql_class.cc b/sql/sql_class.cc index d2221d210e0..978adf6a353 100644 --- a/sql/sql_class.cc +++ b/sql/sql_class.cc @@ -5156,16 +5156,13 @@ void xid_cache_delete(XID_STATE *xid_state) BINLOG_FORMAT = STATEMENT and at least one table uses a storage engine limited to row-logging. - 6. Error: Cannot execute row injection: binlogging impossible since - BINLOG_FORMAT = STATEMENT. - - 7. Warning: Unsafe statement binlogged in statement format since + 6. Warning: Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. In addition, we can produce the following error (not depending on the variables of the decision diagram): - 8. Error: Cannot execute statement: binlogging impossible since more + 7. Error: Cannot execute statement: binlogging impossible since more than one engine is involved and at least one engine is self-logging. @@ -5444,10 +5441,10 @@ int THD::decide_logging_format(TABLE_LIST *tables) if (lex->is_stmt_row_injection()) { /* - 6. Error: Cannot execute row injection since - BINLOG_FORMAT = STATEMENT + We have to log the statement as row or give an error. + Better to accept what master gives us than stopping replication. */ - my_error((error= ER_BINLOG_ROW_INJECTION_AND_STMT_MODE), MYF(0)); + set_current_stmt_binlog_format_row(); } else if ((flags_write_all_set & HA_BINLOG_STMT_CAPABLE) == 0 && sqlcom_can_generate_row_events(this)) @@ -5472,7 +5469,7 @@ int THD::decide_logging_format(TABLE_LIST *tables) DBUG_PRINT("info", ("binlog_unsafe_warning_flags: 0x%x", binlog_unsafe_warning_flags)); } - /* log in statement format! */ + /* log in statement format (or row if row event)! */ } /* No statement-only engines and binlog_format != STATEMENT. I.e., nothing prevents us from row logging if needed. */ From 7c1e2fe35c2b948bd934e8a0bed30fbe018053dd Mon Sep 17 00:00:00 2001 From: Monty Date: Thu, 8 Oct 2015 10:17:07 +0300 Subject: [PATCH 69/85] Better error message if failed --- scripts/mysql_install_db.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scripts/mysql_install_db.sh b/scripts/mysql_install_db.sh index 6cfe75961f3..d08d04914ee 100644 --- a/scripts/mysql_install_db.sh +++ b/scripts/mysql_install_db.sh @@ -202,8 +202,10 @@ cannot_find_file() fi echo - echo "If you compiled from source, you need to run 'make install' to" + echo "If you compiled from source, you need to either run 'make install' to" echo "copy the software into the correct location ready for operation." + echo "If you don't want to do a full install, you can use the --srcddir" + echo "option to only install the mysql database and privilege tables" echo echo "If you are using a binary release, you must either be at the top" echo "level of the extracted archive, or pass the --basedir option" From a69a6ddac8175a611d97711d167e26ad5d1f9dc8 Mon Sep 17 00:00:00 2001 From: Monty Date: Thu, 8 Oct 2015 10:45:09 +0300 Subject: [PATCH 70/85] MDEV-4487 Allow replication from MySQL 5.6+ when GTID is enabled on the master MDEV-8685 MariaDB fails to decode Anonymous_GTID entries MDEV-5705 Replication testing: 5.6->10.0 - Ignoring GTID events from MySQL 5.6+ (Allows replication from MySQL 5.6+ with GTID enabled) - Added ignorable events from MySQL 5.6 - mysqlbinlog now writes information about GTID and ignorable events. - Added more information in error message when replication stops because of wrong information in binary log. - Fixed wrong test when write_on_release() should flush cache. --- sql/log_event.cc | 127 +++++++++++++++++++++++++++++++++++++++++++---- sql/log_event.h | 72 +++++++++++++++++++++++++++ sql/slave.cc | 6 +++ 3 files changed, 194 insertions(+), 11 deletions(-) diff --git a/sql/log_event.cc b/sql/log_event.cc index fef0e70b164..411229d319a 100644 --- a/sql/log_event.cc +++ b/sql/log_event.cc @@ -305,7 +305,7 @@ public: ~Write_on_release_cache() { copy_event_cache_to_file_and_reinit(m_cache, m_file); - if (m_flags | FLUSH_F) + if (m_flags & FLUSH_F) fflush(m_file); } @@ -813,6 +813,15 @@ const char* Log_event::get_type_str(Log_event_type type) case BINLOG_CHECKPOINT_EVENT: return "Binlog_checkpoint"; case GTID_EVENT: return "Gtid"; case GTID_LIST_EVENT: return "Gtid_list"; + + /* The following is only for mysqlbinlog */ + case IGNORABLE_LOG_EVENT: return "Ignorable log event"; + case ROWS_QUERY_LOG_EVENT: return "MySQL Rows_query"; + case GTID_LOG_EVENT: return "MySQL Gtid"; + case ANONYMOUS_GTID_LOG_EVENT: return "MySQL Anonymous_Gtid"; + case PREVIOUS_GTIDS_LOG_EVENT: return "MySQL Previous_gtids"; + case HEARTBEAT_LOG_EVENT: return "Heartbeat"; + default: return "Unknown"; /* impossible */ } } @@ -1416,6 +1425,8 @@ Log_event* Log_event::read_log_event(IO_CACHE* file, DBUG_ENTER("Log_event::read_log_event"); DBUG_ASSERT(description_event != 0); char head[LOG_EVENT_MINIMAL_HEADER_LEN]; + my_off_t position= my_b_tell(file); + /* First we only want to read at most LOG_EVENT_MINIMAL_HEADER_LEN, just to check the event for sanity and to know its length; no need to really parse @@ -1427,7 +1438,7 @@ Log_event* Log_event::read_log_event(IO_CACHE* file, LOG_EVENT_MINIMAL_HEADER_LEN); LOCK_MUTEX; - DBUG_PRINT("info", ("my_b_tell: %lu", (ulong) my_b_tell(file))); + DBUG_PRINT("info", ("my_b_tell: %llu", (ulonglong) position)); if (my_b_read(file, (uchar *) head, header_size)) { DBUG_PRINT("info", ("Log_event::read_log_event(IO_CACHE*,Format_desc*) \ @@ -1484,8 +1495,9 @@ err: { DBUG_ASSERT(error != 0); sql_print_error("Error in Log_event::read_log_event(): " - "'%s', data_len: %lu, event_type: %d", - error,data_len,(uchar)(head[EVENT_TYPE_OFFSET])); + "'%s' at offset: %llu data_len: %lu event_type: %d", + error, position, data_len, + (uchar)(head[EVENT_TYPE_OFFSET])); my_free(buf); /* The SQL slave thread will check if file->error<0 to know @@ -1518,10 +1530,12 @@ Log_event* Log_event::read_log_event(const char* buf, uint event_len, DBUG_PRINT("info", ("binlog_version: %d", description_event->binlog_version)); DBUG_DUMP("data", (unsigned char*) buf, event_len); - /* Check the integrity */ + /* + Check the integrity; This is needed because handle_slave_io() doesn't + check if packet is of proper length. + */ if (event_len < EVENT_LEN_OFFSET || - (uchar)buf[EVENT_TYPE_OFFSET] >= ENUM_END_EVENT || - (uint) event_len != uint4korr(buf+EVENT_LEN_OFFSET)) + event_len != uint4korr(buf+EVENT_LEN_OFFSET)) { *error="Sanity check failed"; // Needed to free buffer DBUG_RETURN(NULL); // general sanity check - will fail on a partial read @@ -1703,6 +1717,15 @@ Log_event* Log_event::read_log_event(const char* buf, uint event_len, case DELETE_ROWS_EVENT: ev = new Delete_rows_log_event(buf, event_len, description_event); break; + + /* MySQL GTID events are ignored */ + case GTID_LOG_EVENT: + case ANONYMOUS_GTID_LOG_EVENT: + case PREVIOUS_GTIDS_LOG_EVENT: + ev= new Ignorable_log_event(buf, description_event, + get_type_str((Log_event_type) event_type)); + break; + case TABLE_MAP_EVENT: ev = new Table_map_log_event(buf, event_len, description_event); break; @@ -1720,10 +1743,22 @@ Log_event* Log_event::read_log_event(const char* buf, uint event_len, ev = new Annotate_rows_log_event(buf, event_len, description_event); break; default: - DBUG_PRINT("error",("Unknown event code: %d", - (int) buf[EVENT_TYPE_OFFSET])); - ev= NULL; - break; + /* + Create an object of Ignorable_log_event for unrecognized sub-class. + So that SLAVE SQL THREAD will only update the position and continue. + */ + if (uint2korr(buf + FLAGS_OFFSET) & LOG_EVENT_IGNORABLE_F) + { + ev= new Ignorable_log_event(buf, description_event, + get_type_str((Log_event_type) event_type)); + } + else + { + DBUG_PRINT("error",("Unknown event code: %d", + (int) buf[EVENT_TYPE_OFFSET])); + ev= NULL; + break; + } } } @@ -4891,6 +4926,9 @@ Format_description_log_event(uint8 binlog_ver, const char* server_ver) post_header_len[HEARTBEAT_LOG_EVENT-1]= 0; post_header_len[IGNORABLE_LOG_EVENT-1]= 0; post_header_len[ROWS_QUERY_LOG_EVENT-1]= 0; + post_header_len[GTID_LOG_EVENT-1]= 0; + post_header_len[ANONYMOUS_GTID_LOG_EVENT-1]= 0; + post_header_len[PREVIOUS_GTIDS_LOG_EVENT-1]= 0; post_header_len[WRITE_ROWS_EVENT-1]= ROWS_HEADER_LEN_V2; post_header_len[UPDATE_ROWS_EVENT-1]= ROWS_HEADER_LEN_V2; post_header_len[DELETE_ROWS_EVENT-1]= ROWS_HEADER_LEN_V2; @@ -12639,6 +12677,52 @@ Incident_log_event::write_data_body(IO_CACHE *file) } +Ignorable_log_event::Ignorable_log_event(const char *buf, + const Format_description_log_event + *descr_event, + const char *event_name) + :Log_event(buf, descr_event), number((int) (uchar) buf[EVENT_TYPE_OFFSET]), + description(event_name) +{ + DBUG_ENTER("Ignorable_log_event::Ignorable_log_event"); + DBUG_VOID_RETURN; +} + +Ignorable_log_event::~Ignorable_log_event() +{ +} + +#ifndef MYSQL_CLIENT +/* Pack info for its unrecognized ignorable event */ +void Ignorable_log_event::pack_info(THD *thd, Protocol *protocol) +{ + char buf[256]; + size_t bytes; + bytes= my_snprintf(buf, sizeof(buf), "# Ignorable event type %d (%s)", + number, description); + protocol->store(buf, bytes, &my_charset_bin); +} +#endif + +#ifdef MYSQL_CLIENT +/* Print for its unrecognized ignorable event */ +void +Ignorable_log_event::print(FILE *file, + PRINT_EVENT_INFO *print_event_info) +{ + if (print_event_info->short_form) + return; + + print_header(&print_event_info->head_cache, print_event_info, FALSE); + my_b_printf(&print_event_info->head_cache, "\tIgnorable\n"); + my_b_printf(&print_event_info->head_cache, + "# Ignorable event type %d (%s)\n", number, description); + copy_event_cache_to_file_and_reinit(&print_event_info->head_cache, + file); +} +#endif + + #ifdef MYSQL_CLIENT /** The default values for these variables should be values that are @@ -12720,4 +12804,25 @@ bool rpl_get_position_info(const char **log_file_name, ulonglong *log_pos, return TRUE; #endif } + +/** + Check if we should write event to the relay log + + This is used to skip events that is only supported by MySQL + + Return: + 0 ok + 1 Don't write event +*/ + +bool event_that_should_be_ignored(const char *buf) +{ + uint event_type= (uchar)buf[EVENT_TYPE_OFFSET]; + if (event_type == GTID_LOG_EVENT || + event_type == ANONYMOUS_GTID_LOG_EVENT || + event_type == PREVIOUS_GTIDS_LOG_EVENT || + (uint2korr(buf + FLAGS_OFFSET) & LOG_EVENT_IGNORABLE_F)) + return 1; + return 0; +} #endif diff --git a/sql/log_event.h b/sql/log_event.h index 1349ec6187a..8661e6e49e5 100644 --- a/sql/log_event.h +++ b/sql/log_event.h @@ -260,6 +260,7 @@ struct sql_ex_info #define EXECUTE_LOAD_QUERY_HEADER_LEN (QUERY_HEADER_LEN + EXECUTE_LOAD_QUERY_EXTRA_HEADER_LEN) #define INCIDENT_HEADER_LEN 2 #define HEARTBEAT_HEADER_LEN 0 +#define IGNORABLE_HEADER_LEN 0 #define ROWS_HEADER_LEN_V2 10 #define ANNOTATE_ROWS_HEADER_LEN 0 #define BINLOG_CHECKPOINT_HEADER_LEN 4 @@ -519,6 +520,17 @@ struct sql_ex_info */ #define LOG_EVENT_RELAY_LOG_F 0x40 +/** + @def LOG_EVENT_IGNORABLE_F + + For an event, 'e', carrying a type code, that a slave, + 's', does not recognize, 's' will check 'e' for + LOG_EVENT_IGNORABLE_F, and if the flag is set, then 'e' + is ignored. Otherwise, 's' acknowledges that it has + found an unknown event in the relay log. +*/ +#define LOG_EVENT_IGNORABLE_F 0x80 + /** @def LOG_EVENT_SKIP_REPLICATION_F @@ -697,6 +709,11 @@ enum Log_event_type UPDATE_ROWS_EVENT = 31, DELETE_ROWS_EVENT = 32, + /* MySQL 5.6 GTID events, ignored by MariaDB */ + GTID_LOG_EVENT= 33, + ANONYMOUS_GTID_LOG_EVENT= 34, + PREVIOUS_GTIDS_LOG_EVENT= 35, + /* Add new events here - right above this comment! Existing events (except ENUM_END_EVENT) should never change their numbers @@ -4740,6 +4757,60 @@ private: LEX_STRING m_message; }; +/** + @class Ignorable_log_event + + Base class for ignorable log events. Events deriving from + this class can be safely ignored by slaves that cannot + recognize them. Newer slaves, will be able to read and + handle them. This has been designed to be an open-ended + architecture, so adding new derived events shall not harm + the old slaves that support ignorable log event mechanism + (they will just ignore unrecognized ignorable events). + + @note The only thing that makes an event ignorable is that it has + the LOG_EVENT_IGNORABLE_F flag set. It is not strictly necessary + that ignorable event types derive from Ignorable_log_event; they may + just as well derive from Log_event and pass LOG_EVENT_IGNORABLE_F as + argument to the Log_event constructor. +**/ + +class Ignorable_log_event : public Log_event { +public: + int number; + const char *description; + +#ifndef MYSQL_CLIENT + Ignorable_log_event(THD *thd_arg) + :Log_event(thd_arg, LOG_EVENT_IGNORABLE_F, FALSE), + number(0), description("internal") + { + DBUG_ENTER("Ignorable_log_event::Ignorable_log_event"); + DBUG_VOID_RETURN; + } +#endif + + Ignorable_log_event(const char *buf, + const Format_description_log_event *descr_event, + const char *event_name); + virtual ~Ignorable_log_event(); + +#ifndef MYSQL_CLIENT + void pack_info(THD *, Protocol*); +#endif + +#ifdef MYSQL_CLIENT + virtual void print(FILE *file, PRINT_EVENT_INFO *print_event_info); +#endif + + virtual Log_event_type get_type_code() { return IGNORABLE_LOG_EVENT; } + + virtual bool is_valid() const { return 1; } + + virtual int get_data_size() { return IGNORABLE_HEADER_LEN; } +}; + + static inline bool copy_event_cache_to_file_and_reinit(IO_CACHE *cache, FILE *file) { @@ -4797,6 +4868,7 @@ bool rpl_get_position_info(const char **log_file_name, ulonglong *log_pos, ulonglong *relay_log_pos); bool event_checksum_test(uchar *buf, ulong event_len, uint8 alg); +bool event_that_should_be_ignored(const char *buf); uint8 get_checksum_alg(const char* buf, ulong len); extern TYPELIB binlog_checksum_typelib; diff --git a/sql/slave.cc b/sql/slave.cc index 0243272c443..5af48b6a793 100644 --- a/sql/slave.cc +++ b/sql/slave.cc @@ -5615,6 +5615,11 @@ static int queue_event(Master_info* mi,const char* buf, ulong event_len) error_msg.append(llbuf, strlen(llbuf)); goto err; } + + /* + Heartbeat events doesn't count in the binlog size, so we don't have to + increment mi->master_log_pos + */ goto skip_relay_logging; } break; @@ -5844,6 +5849,7 @@ static int queue_event(Master_info* mi,const char* buf, ulong event_len) else if ((s_id == global_system_variables.server_id && !mi->rli.replicate_same_server_id) || + event_that_should_be_ignored(buf) || /* the following conjunction deals with IGNORE_SERVER_IDS, if set If the master is on the ignore list, execution of From 6dd41145ac6d33db08157e96cbc3b400b54f898b Mon Sep 17 00:00:00 2001 From: Monty Date: Thu, 8 Oct 2015 10:45:32 +0300 Subject: [PATCH 71/85] Better error messages if slave is not properly configured --- .../suite/rpl/r/rpl_row_reset_slave.result | 2 +- .../suite/rpl/r/rpl_stm_reset_slave.result | 2 +- sql/sql_repl.cc | 16 +++++++++++++--- 3 files changed, 15 insertions(+), 5 deletions(-) diff --git a/mysql-test/suite/rpl/r/rpl_row_reset_slave.result b/mysql-test/suite/rpl/r/rpl_row_reset_slave.result index 1cf70ba7e67..33284ce58c6 100644 --- a/mysql-test/suite/rpl/r/rpl_row_reset_slave.result +++ b/mysql-test/suite/rpl/r/rpl_row_reset_slave.result @@ -47,7 +47,7 @@ include/start_slave.inc include/stop_slave.inc reset slave all; start slave; -ERROR HY000: The server is not configured as slave; fix in config file or with CHANGE MASTER TO +ERROR HY000: Misconfigured slave: MASTER_HOST was not set; Fix in config file or with CHANGE MASTER TO CHANGE MASTER TO MASTER_HOST= 'MASTER_HOST', MASTER_USER= 'MASTER_USER', MASTER_PORT= MASTER_PORT; include/start_slave.inc include/rpl_end.inc diff --git a/mysql-test/suite/rpl/r/rpl_stm_reset_slave.result b/mysql-test/suite/rpl/r/rpl_stm_reset_slave.result index e5870cec2c9..7eb29085099 100644 --- a/mysql-test/suite/rpl/r/rpl_stm_reset_slave.result +++ b/mysql-test/suite/rpl/r/rpl_stm_reset_slave.result @@ -47,7 +47,7 @@ include/start_slave.inc include/stop_slave.inc reset slave all; start slave; -ERROR HY000: The server is not configured as slave; fix in config file or with CHANGE MASTER TO +ERROR HY000: Misconfigured slave: MASTER_HOST was not set; Fix in config file or with CHANGE MASTER TO CHANGE MASTER TO MASTER_HOST= 'MASTER_HOST', MASTER_USER= 'MASTER_USER', MASTER_PORT= MASTER_PORT; include/start_slave.inc include/rpl_end.inc diff --git a/sql/sql_repl.cc b/sql/sql_repl.cc index 31e2cc2d269..d6a4819172d 100644 --- a/sql/sql_repl.cc +++ b/sql/sql_repl.cc @@ -2869,7 +2869,19 @@ int start_slave(THD* thd , Master_info* mi, bool net_report) if (init_master_info(mi,master_info_file_tmp,relay_log_info_file_tmp, 0, thread_mask)) slave_errno=ER_MASTER_INFO; - else if (server_id_supplied && *mi->host) + else if (!server_id_supplied) + { + slave_errno= ER_BAD_SLAVE; net_report= 0; + my_message(slave_errno, "Misconfigured slave: server_id was not set; Fix in config file", + MYF(0)); + } + else if (!*mi->host) + { + slave_errno= ER_BAD_SLAVE; net_report= 0; + my_message(slave_errno, "Misconfigured slave: MASTER_HOST was not set; Fix in config file or with CHANGE MASTER TO", + MYF(0)); + } + else { /* If we will start SQL thread we will care about UNTIL options If @@ -2963,8 +2975,6 @@ int start_slave(THD* thd , Master_info* mi, bool net_report) relay_log_info_file_tmp, thread_mask); } - else - slave_errno = ER_BAD_SLAVE; } else { From c8d511293aae155210089b6de4143d11569af18d Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Thu, 8 Oct 2015 00:32:07 +0200 Subject: [PATCH 72/85] MDEV-8796 Delete with sub query with information_schema.TABLES deletes too many rows make_cond_for_info_schema() does preserve outer fields --- mysql-test/r/information_schema2.result | 24 ++++++++++++------------ mysql-test/t/information_schema2.test | 19 ++++++++----------- sql/sql_show.cc | 15 ++++++++------- 3 files changed, 28 insertions(+), 30 deletions(-) diff --git a/mysql-test/r/information_schema2.result b/mysql-test/r/information_schema2.result index 3f7f3ecd4e1..7e9bdd7088f 100644 --- a/mysql-test/r/information_schema2.result +++ b/mysql-test/r/information_schema2.result @@ -6,15 +6,15 @@ select variable_name from information_schema.session_variables where variable_na (select variable_name from information_schema.session_variables where variable_name = 'basedir'); variable_name BASEDIR -create table t1 (a char); -insert t1 values ('a'),('t'),('z'); -flush status; -select a, exists (select 1 from information_schema.columns where table_schema=concat('tes',a)) from t1; -a exists (select 1 from information_schema.columns where table_schema=concat('tes',a)) -a 0 -t 1 -z 0 -show status like 'created_tmp_tables'; -Variable_name Value -Created_tmp_tables 38 -drop table t1; +create table t1 (x int); +create table t2 (x int); +create table t3 (x int); +create table t4 AS select table_name from information_schema.TABLES where table_schema = database() and table_type = 'BASE TABLE' ; +delete from t4 where table_name not in (select table_name from information_schema.TABLES where table_schema = database() and table_type = 'BASE TABLE'); +select * from t4; +table_name +t1 +t2 +t3 +t4 +drop table t1, t2, t3, t4; diff --git a/mysql-test/t/information_schema2.test b/mysql-test/t/information_schema2.test index 06bc6d1bf55..9810c5a0aae 100644 --- a/mysql-test/t/information_schema2.test +++ b/mysql-test/t/information_schema2.test @@ -8,15 +8,12 @@ select variable_name from information_schema.session_variables where variable_na (select variable_name from information_schema.session_variables where variable_name = 'basedir'); # -# information_schema tables inside subqueries, they should not be re-populated -# (i_s.columns needs to scan i_s itself, creating a tmp table for every i_s -# table. if it's re-populated, it'll do that multiple times) +# MDEV-8796 Delete with sub query with information_schema.TABLES deletes too many rows # -create table t1 (a char); -insert t1 values ('a'),('t'),('z'); -flush status; -select a, exists (select 1 from information_schema.columns where table_schema=concat('tes',a)) from t1; -# fix the result in ps-protocol ---replace_result 39 38 -show status like 'created_tmp_tables'; -drop table t1; +create table t1 (x int); +create table t2 (x int); +create table t3 (x int); +create table t4 AS select table_name from information_schema.TABLES where table_schema = database() and table_type = 'BASE TABLE' ; +delete from t4 where table_name not in (select table_name from information_schema.TABLES where table_schema = database() and table_type = 'BASE TABLE'); +select * from t4; +drop table t1, t2, t3, t4; diff --git a/sql/sql_show.cc b/sql/sql_show.cc index 1e27e654318..86fc11ca236 100644 --- a/sql/sql_show.cc +++ b/sql/sql_show.cc @@ -7730,13 +7730,14 @@ bool get_schema_tables_result(JOIN *join, TABLE_LIST *table_list= tab->table->pos_in_table_list; if (table_list->schema_table && thd->fill_information_schema_tables()) { -#if MYSQL_VERSION_ID > 100105 -#error I_S tables only need to be re-populated if make_cond_for_info_schema() will preserve outer fields - bool is_subselect= (&lex->unit != lex->current_select->master_unit() && - lex->current_select->master_unit()->item); -#else -#define is_subselect false -#endif + /* + I_S tables only need to be re-populated if make_cond_for_info_schema() + preserves outer fields + */ + bool is_subselect= &lex->unit != lex->current_select->master_unit() && + lex->current_select->master_unit()->item && + tab->select_cond && + tab->select_cond->used_tables() & OUTER_REF_TABLE_BIT; /* A value of 0 indicates a dummy implementation */ if (table_list->schema_table->fill_table == 0) From db79f4cf613c77391216988d2a9273a68e0c3c11 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Thu, 8 Oct 2015 23:02:43 +0200 Subject: [PATCH 73/85] 5.5.45-37.4 --- storage/xtradb/dict/dict0dict.c | 20 +++++-- storage/xtradb/include/row0purge.h | 13 ++++- storage/xtradb/include/srv0srv.h | 1 - storage/xtradb/include/univ.i | 2 +- storage/xtradb/os/os0file.c | 13 ++++- storage/xtradb/row/row0purge.c | 93 +++++++++++++++++++++++++----- storage/xtradb/srv/srv0srv.c | 1 - 7 files changed, 116 insertions(+), 27 deletions(-) diff --git a/storage/xtradb/dict/dict0dict.c b/storage/xtradb/dict/dict0dict.c index 26e361966d6..9915f0a10eb 100644 --- a/storage/xtradb/dict/dict0dict.c +++ b/storage/xtradb/dict/dict0dict.c @@ -2667,10 +2667,14 @@ dict_foreign_remove_from_cache( if (rbt != NULL && foreign->id != NULL) { const ib_rbt_node_t* node = rbt_lookup(rbt, foreign->id); - dict_foreign_t* val = *(dict_foreign_t**) node->value; - if (val == foreign) { - rbt_delete(rbt, foreign->id); + if (node != NULL) { + dict_foreign_t* val + = *(dict_foreign_t**) node->value; + + if (val == foreign) { + rbt_delete(rbt, foreign->id); + } } } } @@ -2686,10 +2690,14 @@ dict_foreign_remove_from_cache( if (rbt != NULL && foreign->id != NULL) { const ib_rbt_node_t* node = rbt_lookup(rbt, foreign->id); - dict_foreign_t* val = *(dict_foreign_t**) node->value; - if (val == foreign) { - rbt_delete(rbt, foreign->id); + if (node != NULL) { + dict_foreign_t* val + = *(dict_foreign_t**) node->value; + + if (val == foreign) { + rbt_delete(rbt, foreign->id); + } } } } diff --git a/storage/xtradb/include/row0purge.h b/storage/xtradb/include/row0purge.h index fa9c9291d5d..9a638c80493 100644 --- a/storage/xtradb/include/row0purge.h +++ b/storage/xtradb/include/row0purge.h @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (c) 1997, 2009, Innobase Oy. All Rights Reserved. +Copyright (c) 1997, 2015, 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 the Free Software @@ -111,6 +111,17 @@ struct purge_node_struct{ purge of a row */ }; +#ifdef UNIV_DEBUG +/***********************************************************//** +Validate the persisent cursor in the purge node. The purge node has two +references to the clustered index record - one via the ref member, and the +other via the persistent cursor. These two references must match each +other if the found_clust flag is set. +@return true if the persistent cursor is consistent with the ref member.*/ +ibool +row_purge_validate_pcur(purge_node_t* node); +#endif /* UNIV_DEBUG */ + #ifndef UNIV_NONINL #include "row0purge.ic" #endif diff --git a/storage/xtradb/include/srv0srv.h b/storage/xtradb/include/srv0srv.h index a396206334d..3ccad0640b6 100644 --- a/storage/xtradb/include/srv0srv.h +++ b/storage/xtradb/include/srv0srv.h @@ -264,7 +264,6 @@ extern ulint srv_ibuf_active_contract; extern ulint srv_ibuf_accel_rate; extern ulint srv_checkpoint_age_target; extern ulint srv_flush_neighbor_pages; -extern ulint srv_enable_unsafe_group_commit; extern ulint srv_read_ahead; extern ulint srv_adaptive_flushing_method; diff --git a/storage/xtradb/include/univ.i b/storage/xtradb/include/univ.i index 58bf30e8fe6..83af32760e2 100644 --- a/storage/xtradb/include/univ.i +++ b/storage/xtradb/include/univ.i @@ -64,7 +64,7 @@ component, i.e. we show M.N.P as M.N */ (INNODB_VERSION_MAJOR << 8 | INNODB_VERSION_MINOR) #ifndef PERCONA_INNODB_VERSION -#define PERCONA_INNODB_VERSION 37.3 +#define PERCONA_INNODB_VERSION 37.4 #endif #define INNODB_VERSION_STR MYSQL_SERVER_VERSION diff --git a/storage/xtradb/os/os0file.c b/storage/xtradb/os/os0file.c index 1169c8a6c78..ebcacc5c94f 100644 --- a/storage/xtradb/os/os0file.c +++ b/storage/xtradb/os/os0file.c @@ -1,6 +1,6 @@ /*********************************************************************** -Copyright (c) 1995, 2010, Innobase Oy. All Rights Reserved. +Copyright (c) 1995, 2015, Oracle and/or its affiliates. All Rights Reserved. Copyright (c) 2009, Percona Inc. Portions of this file contain modifications contributed and copyrighted @@ -1288,16 +1288,19 @@ os_file_create_simple_no_error_handling_func( #else /* __WIN__ */ os_file_t file; int create_flag; + const char* mode_str = NULL; ut_a(name); if (create_mode == OS_FILE_OPEN) { + mode_str = "OPEN"; if (access_type == OS_FILE_READ_ONLY) { create_flag = O_RDONLY; } else { create_flag = O_RDWR; } } else if (create_mode == OS_FILE_CREATE) { + mode_str = "CREATE"; create_flag = O_RDWR | O_CREAT | O_EXCL; } else { create_flag = 0; @@ -1322,6 +1325,14 @@ os_file_create_simple_no_error_handling_func( #endif } else { *success = TRUE; + + /* This function is always called for data files, we should + disable OS caching (O_DIRECT) here as we do in + os_file_create_func(), so we open the same file in the same + mode, see man page of open(2). */ + if (srv_unix_file_flush_method == SRV_UNIX_O_DIRECT) { + os_file_set_nocache(file, name, mode_str); + } } return(file); diff --git a/storage/xtradb/row/row0purge.c b/storage/xtradb/row/row0purge.c index efcfdc3bac5..9018582f5d6 100644 --- a/storage/xtradb/row/row0purge.c +++ b/storage/xtradb/row/row0purge.c @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (c) 1997, 2011, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 1997, 2015, 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 the Free Software @@ -43,6 +43,7 @@ Created 3/14/1997 Heikki Tuuri #include "row0vers.h" #include "row0mysql.h" #include "log0log.h" +#include "rem0cmp.h" /************************************************************************* IMPORTANT NOTE: Any operation that generates redo MUST check that there @@ -80,7 +81,7 @@ row_purge_node_create( /***********************************************************//** Repositions the pcur in the purge node on the clustered index record, -if found. +if found. If the record is not found, close pcur. @return TRUE if the record was found */ static ibool @@ -90,23 +91,28 @@ row_purge_reposition_pcur( purge_node_t* node, /*!< in: row purge node */ mtr_t* mtr) /*!< in: mtr */ { - ibool found; - if (node->found_clust) { - found = btr_pcur_restore_position(mode, &(node->pcur), mtr); + ut_ad(row_purge_validate_pcur(node)); - return(found); + node->found_clust = btr_pcur_restore_position( + mode, &(node->pcur), mtr); + + } else { + + node->found_clust = row_search_on_row_ref( + &(node->pcur), mode, node->table, node->ref, mtr); + + if (node->found_clust) { + btr_pcur_store_position(&(node->pcur), mtr); + } } - found = row_search_on_row_ref(&(node->pcur), mode, node->table, - node->ref, mtr); - node->found_clust = found; - - if (found) { - btr_pcur_store_position(&(node->pcur), mtr); + /* Close the current cursor if we fail to position it correctly. */ + if (!node->found_clust) { + btr_pcur_close(&node->pcur); } - return(found); + return(node->found_clust); } /***********************************************************//** @@ -143,8 +149,8 @@ row_purge_remove_clust_if_poss_low( if (!success) { /* The record is already removed */ - - btr_pcur_commit_specify_mtr(pcur, &mtr); + /* Persistent cursor is closed if reposition fails. */ + mtr_commit(&mtr); return(TRUE); } @@ -258,7 +264,12 @@ row_purge_poss_sec( btr_pcur_get_rec(&node->pcur), &mtr, index, entry); - btr_pcur_commit_specify_mtr(&node->pcur, &mtr); + /* Persistent cursor is closed if reposition fails. */ + if (node->found_clust) { + btr_pcur_commit_specify_mtr(&node->pcur, &mtr); + } else { + mtr_commit(&mtr); + } return(can_delete); } @@ -806,3 +817,53 @@ row_purge_step( return(thr); } + +#ifdef UNIV_DEBUG +/***********************************************************//** +Validate the persisent cursor in the purge node. The purge node has two +references to the clustered index record - one via the ref member, and the +other via the persistent cursor. These two references must match each +other if the found_clust flag is set. +@return true if the stored copy of persistent cursor is consistent +with the ref member.*/ +ibool +row_purge_validate_pcur( + purge_node_t* node) +{ + dict_index_t* clust_index; + ulint* offsets; + int st; + + if (!node->found_clust) { + return(TRUE); + } + + if (node->index == NULL) { + return(TRUE); + } + + if (node->pcur.old_stored != BTR_PCUR_OLD_STORED) { + return(TRUE); + } + + clust_index = node->pcur.btr_cur.index; + + offsets = rec_get_offsets(node->pcur.old_rec, clust_index, NULL, + node->pcur.old_n_fields, &node->heap); + + /* Here we are comparing the purge ref record and the stored initial + part in persistent cursor. Both cases we store n_uniq fields of the + cluster index and so it is fine to do the comparison. We note this + dependency here as pcur and ref belong to different modules. */ + st = cmp_dtuple_rec(node->ref, node->pcur.old_rec, offsets); + + if (st != 0) { + fprintf(stderr, "Purge node pcur validation failed\n"); + dtuple_print(stderr, node->ref); + rec_print(stderr, node->pcur.old_rec, clust_index); + return(FALSE); + } + + return(TRUE); +} +#endif /* UNIV_DEBUG */ diff --git a/storage/xtradb/srv/srv0srv.c b/storage/xtradb/srv/srv0srv.c index 154565dfd83..a830f22ba7d 100644 --- a/storage/xtradb/srv/srv0srv.c +++ b/storage/xtradb/srv/srv0srv.c @@ -427,7 +427,6 @@ UNIV_INTERN ulint srv_ibuf_accel_rate = 100; UNIV_INTERN ulint srv_checkpoint_age_target = 0; UNIV_INTERN ulint srv_flush_neighbor_pages = 1; /* 0:disable 1:area 2:contiguous */ -UNIV_INTERN ulint srv_enable_unsafe_group_commit = 0; /* 0:disable 1:enable */ UNIV_INTERN ulint srv_read_ahead = 3; /* 1: random 2: linear 3: Both */ UNIV_INTERN ulint srv_adaptive_flushing_method = 0; /* 0: native 1: estimate 2: keep_average */ From 50775094cf64864e246da8cbd8de222654579ec7 Mon Sep 17 00:00:00 2001 From: iangilfillan Date: Wed, 9 Sep 2015 14:32:52 +0200 Subject: [PATCH 74/85] MDEV-7680: Update man pages --- man/aria_chk.1 | 3 +- man/aria_dump_log.1 | 5 +- man/aria_ftdump.1 | 3 +- man/aria_pack.1 | 3 +- man/aria_read_log.1 | 3 +- man/comp_err.1 | 23 +- man/innochecksum.1 | 42 ++- man/make_win_bin_dist.1 | 17 +- man/msql2mysql.1 | 17 +- man/my_print_defaults.1 | 41 ++- man/myisam_ftdump.1 | 17 +- man/myisamchk.1 | 185 ++++++---- man/myisamlog.1 | 17 +- man/myisampack.1 | 19 +- man/mysql-stress-test.pl.1 | 23 +- man/mysql-test-run.pl.1 | 549 ++++++++++++++++++++++------ man/mysql.1 | 17 +- man/mysql.server.1 | 44 +-- man/mysql_client_test.1 | 25 +- man/mysql_config.1 | 39 +- man/mysql_convert_table_format.1 | 26 +- man/mysql_find_rows.1 | 17 +- man/mysql_fix_extensions.1 | 17 +- man/mysql_install_db.1 | 154 ++++++-- man/mysql_plugin.1 | 37 +- man/mysql_secure_installation.1 | 21 +- man/mysql_setpermission.1 | 35 +- man/mysql_tzinfo_to_sql.1 | 20 +- man/mysql_upgrade.1 | 450 +++++++++++++++++++---- man/mysql_waitpid.1 | 17 +- man/mysql_zap.1 | 17 +- man/mysqlaccess.1 | 28 +- man/mysqladmin.1 | 220 +++++++++--- man/mysqlbinlog.1 | 278 +++++++++----- man/mysqlbug.1 | 25 +- man/mysqlcheck.1 | 320 +++++++++++++---- man/mysqld.8 | 17 +- man/mysqld_multi.1 | 17 +- man/mysqld_safe.1 | 62 +--- man/mysqldump.1 | 596 +++++++++++++++++++++++-------- man/mysqldumpslow.1 | 26 +- man/mysqlhotcopy.1 | 39 +- man/mysqlimport.1 | 223 +++++++++--- man/mysqlshow.1 | 225 ++++++++++-- man/mysqlslap.1 | 393 +++++++++++--------- man/mysqltest.1 | 363 +++++++++++++++---- man/ndbd.8 | 17 +- man/ndbd_redo_log_reader.1 | 17 +- man/ndbmtd.8 | 17 +- man/perror.1 | 19 +- man/replace.1 | 17 +- man/resolve_stack_dump.1 | 17 +- man/resolveip.1 | 17 +- 53 files changed, 3330 insertions(+), 1526 deletions(-) diff --git a/man/aria_chk.1 b/man/aria_chk.1 index 4dc5bf8c78f..9b2a19b31af 100644 --- a/man/aria_chk.1 +++ b/man/aria_chk.1 @@ -241,5 +241,4 @@ Read this file after the global files are read. .SH "SEE ALSO" \fBmyisamchk(1)\fR .PP -For more information, please refer to the MariaDB Knowledge Base, -which is available online at http://mariadb.com/kb/ +For more information, please refer to the MariaDB Knowledge Base, available online at https://mariadb.com/kb/ diff --git a/man/aria_dump_log.1 b/man/aria_dump_log.1 index 41318d97f7a..16463fc222d 100644 --- a/man/aria_dump_log.1 +++ b/man/aria_dump_log.1 @@ -50,5 +50,6 @@ Only read default options from the given file #. Read this file after the global files are read. .PP .SH "SEE ALSO" -For more information, please refer to the MariaDB Knowledge Base, -which is available online at http://mariadb.com/kb/ +For more information, please refer to the MariaDB Knowledge Base, available online at https://mariadb.com/kb/ +.SH AUTHOR +MariaDB Foundation (http://www.mariadb.org/). diff --git a/man/aria_ftdump.1 b/man/aria_ftdump.1 index 4d6c1373e31..7b5ba5f5211 100644 --- a/man/aria_ftdump.1 +++ b/man/aria_ftdump.1 @@ -25,5 +25,4 @@ Be verbose. .SH "SEE ALSO" \fBmyisam_ftdump(1)\fR .PP -For more information, please refer to the MariaDB Knowledge Base, -which is available online at http://mariadb.com/kb/ +For more information, please refer to the MariaDB Knowledge Base, available online at https://mariadb.com/kb/ diff --git a/man/aria_pack.1 b/man/aria_pack.1 index ee47f5ff3bb..2557507b999 100644 --- a/man/aria_pack.1 +++ b/man/aria_pack.1 @@ -72,5 +72,4 @@ Read this file after the global files are read. .SH "SEE ALSO" \fBmyisampack(1)\fR .PP -For more information, please refer to the MariaDB Knowledge Base, -which is available online at http://mariadb.com/kb/ +For more information, please refer to the MariaDB Knowledge Base, available online at https://mariadb.com/kb/ diff --git a/man/aria_read_log.1 b/man/aria_read_log.1 index 701104fe047..4570c2ceee9 100644 --- a/man/aria_read_log.1 +++ b/man/aria_read_log.1 @@ -104,5 +104,4 @@ Read this file after the global files are read. .SH "SEE ALSO" \fBmyisamlog(1)\fR .PP -For more information, please refer to the MariaDB Knowledge Base, -which is available online at http://mariadb.com/kb/ +For more information, please refer to the MariaDB Knowledge Base, available online at https://mariadb.com/kb/ diff --git a/man/comp_err.1 b/man/comp_err.1 index 817243b84f6..942556bfdda 100644 --- a/man/comp_err.1 +++ b/man/comp_err.1 @@ -1,13 +1,6 @@ '\" t -.\" Title: \fBcomp_err\fR -.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] -.\" Generator: DocBook XSL Stylesheets v1.75.2 -.\" Date: 04/06/2010 -.\" Manual: MySQL Database System -.\" Source: MySQL 5.1 -.\" Language: English .\" -.TH "\FBCOMP_ERR\FR" "1" "04/06/2010" "MySQL 5\&.1" "MySQL Database System" +.TH "\FBCOMP_ERR\FR" "1" "04/08/2015" "MariaDB 10\&.0" "MariaDB Database System" .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- @@ -20,7 +13,7 @@ .\" ----------------------------------------------------------------- .\" comp_err .SH "NAME" -comp_err \- compile MySQL error message file +comp_err \- compile MariaDB error message file .SH "SYNOPSIS" .HP \w'\fBcomp_err\ [\fR\fB\fIoptions\fR\fR\fB]\fR\ 'u \fBcomp_err [\fR\fB\fIoptions\fR\fR\fB]\fR @@ -33,11 +26,11 @@ file that is used by \fBmysqld\fR to determine the error messages to display for different error codes\&. \fBcomp_err\fR -normally is run automatically when MySQL is built\&. It compiles the +normally is run automatically when MariaDB is built\&. It compiles the errmsg\&.sys file from the plaintext file located at sql/share/errmsg\&.txt -in MySQL source distributions\&. +in MariaDB source distributions\&. .PP \fBcomp_err\fR also generates @@ -254,7 +247,7 @@ Display version information and exit\&. .SH "COPYRIGHT" .br .PP -Copyright 2007-2008 MySQL AB, 2008-2010 Sun Microsystems, Inc. +Copyright 2007-2008 MySQL AB, 2008-2010 Sun Microsystems, Inc., 2010-2015 MariaDB Foundation .PP This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. .PP @@ -263,8 +256,6 @@ This documentation is distributed in the hope that it will be useful, but WITHOU You should have received a copy of the GNU General Public License along with the program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or see http://www.gnu.org/licenses/. .sp .SH "SEE ALSO" -For more information, please refer to the MySQL Reference Manual, -which may already be installed locally and which is also available -online at http://dev.mysql.com/doc/. +For more information, please refer to the MariaDB Knowledge Base, available online at https://mariadb.com/kb/ .SH AUTHOR -Sun Microsystems, Inc. (http://www.mysql.com/). +MariaDB Foundation (http://www.mariadb.org/). diff --git a/man/innochecksum.1 b/man/innochecksum.1 index 6ad9b6b6d78..4e48b4d69cc 100644 --- a/man/innochecksum.1 +++ b/man/innochecksum.1 @@ -1,13 +1,6 @@ '\" t -.\" Title: \fBinnochecksum\fR -.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] -.\" Generator: DocBook XSL Stylesheets v1.75.2 -.\" Date: 04/06/2010 -.\" Manual: MySQL Database System -.\" Source: MySQL 5.1 -.\" Language: English .\" -.TH "\FBINNOCHECKSUM\FR" "1" "04/06/2010" "MySQL 5\&.1" "MySQL Database System" +.TH "\FBINNOCHECKSUM\FR" "1" "04/08/2015" "MariaDB 10\&.0" "MariaDB Database System" .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- @@ -69,7 +62,7 @@ supports the following options\&. For options that refer to page numbers, the nu .sp -1 .IP \(bu 2.3 .\} -\fB\-c\fR +\fB\-c, --count\fR .sp Print a count of the number of pages in the file\&. .RE @@ -82,7 +75,7 @@ Print a count of the number of pages in the file\&. .sp -1 .IP \(bu 2.3 .\} -\fB\-d\fR +\fB\-d, --debug\fR .sp Debug mode; prints checksums for each page\&. .RE @@ -95,7 +88,7 @@ Debug mode; prints checksums for each page\&. .sp -1 .IP \(bu 2.3 .\} -\fB\-e \fR\fB\fInum\fR\fR +\fB\-e \fR\fB\fInum\fB, --end-page=#\fR\fR .sp End at this page number\&. .RE @@ -108,7 +101,7 @@ End at this page number\&. .sp -1 .IP \(bu 2.3 .\} -\fB\-p \fR\fB\fInum\fR\fR +\fB\-p \fR\fB\fInum\fB, --page-num=#\fR\fR .sp Check only this page number\&. .RE @@ -121,7 +114,7 @@ Check only this page number\&. .sp -1 .IP \(bu 2.3 .\} -\fB\-s \fR\fB\fInum\fR\fR +\fB\-s \fR\fB\fInum\fB, --start-page\fR\fR .sp Start at this page number\&. .RE @@ -134,14 +127,27 @@ Start at this page number\&. .sp -1 .IP \(bu 2.3 .\} -\fB\-v\fR +\fB\-u, --skip-corrupt\fR\fR +.sp +Skip corrupt pages\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +\fB\-v, --verbose\fR .sp Verbose mode; print a progress indicator every five seconds\&. .RE .SH "COPYRIGHT" .br .PP -Copyright 2007-2008 MySQL AB, 2008-2010 Sun Microsystems, Inc. +Copyright 2007-2008 MySQL AB, 2008-2010 Sun Microsystems, Inc., 2010-2015 MariaDB Foundation .PP This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. .PP @@ -150,8 +156,6 @@ This documentation is distributed in the hope that it will be useful, but WITHOU You should have received a copy of the GNU General Public License along with the program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or see http://www.gnu.org/licenses/. .sp .SH "SEE ALSO" -For more information, please refer to the MySQL Reference Manual, -which may already be installed locally and which is also available -online at http://dev.mysql.com/doc/. +For more information, please refer to the MariaDB Knowledge Base, available online at https://mariadb.com/kb/ .SH AUTHOR -Sun Microsystems, Inc. (http://www.mysql.com/). +MariaDB Foundation (http://www.mariadb.org/). diff --git a/man/make_win_bin_dist.1 b/man/make_win_bin_dist.1 index 131e4a5f1c1..5d9070e7bd4 100644 --- a/man/make_win_bin_dist.1 +++ b/man/make_win_bin_dist.1 @@ -1,13 +1,6 @@ '\" t -.\" Title: \fBmake_win_bin_dist\fR -.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] -.\" Generator: DocBook XSL Stylesheets v1.75.2 -.\" Date: 04/06/2010 -.\" Manual: MySQL Database System -.\" Source: MySQL 5.1 -.\" Language: English .\" -.TH "\FBMAKE_WIN_BIN_DIST" "1" "04/06/2010" "MySQL 5\&.1" "MySQL Database System" +.TH "\FBMAKE_WIN_BIN_DIST" "1" "04/08/2015" "MariaDB 10\&.0" "MariaDB Database System" .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- @@ -169,7 +162,7 @@ directories)\&. .SH "COPYRIGHT" .br .PP -Copyright 2007-2008 MySQL AB, 2008-2010 Sun Microsystems, Inc. +Copyright 2007-2008 MySQL AB, 2008-2010 Sun Microsystems, Inc., 2010-2015 MariaDB Foundation .PP This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. .PP @@ -178,8 +171,6 @@ This documentation is distributed in the hope that it will be useful, but WITHOU You should have received a copy of the GNU General Public License along with the program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or see http://www.gnu.org/licenses/. .sp .SH "SEE ALSO" -For more information, please refer to the MySQL Reference Manual, -which may already be installed locally and which is also available -online at http://dev.mysql.com/doc/. +For more information, please refer to the MariaDB Knowledge Base, available online at https://mariadb.com/kb/ .SH AUTHOR -Sun Microsystems, Inc. (http://www.mysql.com/). +MariaDB Foundation (http://www.mariadb.org/). diff --git a/man/msql2mysql.1 b/man/msql2mysql.1 index 61512e312d9..96e4cd3ae5b 100644 --- a/man/msql2mysql.1 +++ b/man/msql2mysql.1 @@ -1,13 +1,6 @@ '\" t -.\" Title: \fBmsql2mysql\fR -.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] -.\" Generator: DocBook XSL Stylesheets v1.75.2 -.\" Date: 04/06/2010 -.\" Manual: MySQL Database System -.\" Source: MySQL 5.1 -.\" Language: English .\" -.TH "\FBMSQL2MYSQL\FR" "1" "04/06/2010" "MySQL 5\&.1" "MySQL Database System" +.TH "\FBMSQL2MYSQL\FR" "1" "04/08/2015" "MariaDB 10\&.0" "MariaDB Database System" .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- @@ -60,7 +53,7 @@ utility to make the function name substitutions\&. See .SH "COPYRIGHT" .br .PP -Copyright 2007-2008 MySQL AB, 2008-2010 Sun Microsystems, Inc. +Copyright 2007-2008 MySQL AB, 2008-2010 Sun Microsystems, Inc., 2010-2015 MariaDB Foundation .PP This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. .PP @@ -69,8 +62,6 @@ This documentation is distributed in the hope that it will be useful, but WITHOU You should have received a copy of the GNU General Public License along with the program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or see http://www.gnu.org/licenses/. .sp .SH "SEE ALSO" -For more information, please refer to the MySQL Reference Manual, -which may already be installed locally and which is also available -online at http://dev.mysql.com/doc/. +For more information, please refer to the MariaDB Knowledge Base, available online at https://mariadb.com/kb/ .SH AUTHOR -Sun Microsystems, Inc. (http://www.mysql.com/). +MariaDB Foundation (http://www.mariadb.org/). diff --git a/man/my_print_defaults.1 b/man/my_print_defaults.1 index b44f250f663..2406fa9cb47 100644 --- a/man/my_print_defaults.1 +++ b/man/my_print_defaults.1 @@ -1,13 +1,6 @@ '\" t -.\" Title: \fBmy_print_defaults\fR -.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] -.\" Generator: DocBook XSL Stylesheets v1.75.2 -.\" Date: 04/06/2010 -.\" Manual: MySQL Database System -.\" Source: MySQL 5.1 -.\" Language: English .\" -.TH "\FBMY_PRINT_DEFAULTS" "1" "04/06/2010" "MySQL 5\&.1" "MySQL Database System" +.TH "\FBMY_PRINT_DEFAULTS" "1" "04/08/2015" "MariaDB 10\&.0" "MariaDB Database System" .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- @@ -87,7 +80,9 @@ Display a help message and exit\&. \fB\-\-defaults\-file=\fR\fB\fIfile_name\fR\fR, \fB\-c \fR\fB\fIfile_name\fR\fR .sp -Read only the given option file\&. +Read only the given option file\&. If no extension is given, default extension(.ini or .cnf) will +be used\&. \fB\-\-config-file\fR is deprecated, use \fB\-\-defaults\-file\fR instead\&. If \fB\-\-defaults\-file\fR is +the first option, then read this file only, do not read global or per\-user config files; should be the first option. .RE .sp .RS 4 @@ -126,7 +121,8 @@ string is \fB\-\-extra\-file=\fR\fB\fIfile_name\fR\fR, \fB\-e \fR\fB\fIfile_name\fR\fR .sp -Read this option file after the global option file but (on Unix) before the user option file\&. +Read this option file after the global option file but (on Unix) before the user option +file\&. Should be the first option\&. \fB\-\-extra\-file\fR is deprecated, use \fB\-\-defaults\-extra\-file\fR\&. .RE .sp .RS 4 @@ -153,12 +149,27 @@ In addition to the groups named on the command line, read groups that have the g .sp -1 .IP \(bu 2.3 .\} +.\" my_print_defaults: --mysqld option +.\" mysqld option: my_print_defaults +\fB\-\-mysqld\fR +.sp +Read the same set of groups that the mysqld binary does. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} .\" my_print_defaults: no-defaults option .\" no-defaults option: my_print_defaults \fB\-\-no\-defaults\fR, \fB\-n\fR .sp -Return an empty string\&. +Return an empty string (useful for scripts)\&. .RE .sp .RS 4 @@ -195,7 +206,7 @@ Display version information and exit\&. .SH "COPYRIGHT" .br .PP -Copyright 2007-2008 MySQL AB, 2008-2010 Sun Microsystems, Inc. +Copyright 2007-2008 MySQL AB, 2008-2010 Sun Microsystems, Inc., 2010-2015 MariaDB Foundation .PP This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. .PP @@ -204,8 +215,6 @@ This documentation is distributed in the hope that it will be useful, but WITHOU You should have received a copy of the GNU General Public License along with the program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or see http://www.gnu.org/licenses/. .sp .SH "SEE ALSO" -For more information, please refer to the MySQL Reference Manual, -which may already be installed locally and which is also available -online at http://dev.mysql.com/doc/. +For more information, please refer to the MariaDB Knowledge Base, available online at https://mariadb.com/kb/ .SH AUTHOR -Sun Microsystems, Inc. (http://www.mysql.com/). +MariaDB Foundation (http://www.mariadb.org/). diff --git a/man/myisam_ftdump.1 b/man/myisam_ftdump.1 index f85467aabe0..b2928a17183 100644 --- a/man/myisam_ftdump.1 +++ b/man/myisam_ftdump.1 @@ -1,13 +1,6 @@ '\" t -.\" Title: \fBmyisam_ftdump\fR -.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] -.\" Generator: DocBook XSL Stylesheets v1.75.2 -.\" Date: 04/06/2010 -.\" Manual: MySQL Database System -.\" Source: MySQL 5.1 -.\" Language: English .\" -.TH "\FBMYISAM_FTDUMP\FR" "1" "04/06/2010" "MySQL 5\&.1" "MySQL Database System" +.TH "\FBMYISAM_FTDUMP\FR" "1" "04/08/2015" "MariaDB 10\&.0" "MariaDB Database System" .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- @@ -242,7 +235,7 @@ Verbose mode\&. Print more output about what the program does\&. .SH "COPYRIGHT" .br .PP -Copyright 2007-2008 MySQL AB, 2008-2010 Sun Microsystems, Inc. +Copyright 2007-2008 MySQL AB, 2008-2010 Sun Microsystems, Inc., 2010-2015 MariaDB Foundation .PP This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. .PP @@ -251,8 +244,6 @@ This documentation is distributed in the hope that it will be useful, but WITHOU You should have received a copy of the GNU General Public License along with the program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or see http://www.gnu.org/licenses/. .sp .SH "SEE ALSO" -For more information, please refer to the MySQL Reference Manual, -which may already be installed locally and which is also available -online at http://dev.mysql.com/doc/. +For more information, please refer to the MariaDB Knowledge Base, available online at https://mariadb.com/kb/ .SH AUTHOR -Sun Microsystems, Inc. (http://www.mysql.com/). +MariaDB Foundation (http://www.mariadb.org/). diff --git a/man/myisamchk.1 b/man/myisamchk.1 index 98ce3805515..df5cb4db604 100644 --- a/man/myisamchk.1 +++ b/man/myisamchk.1 @@ -1,13 +1,6 @@ '\" t -.\" Title: \fBmyisamchk\fR -.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] -.\" Generator: DocBook XSL Stylesheets v1.75.2 -.\" Date: 04/06/2010 -.\" Manual: MySQL Database System -.\" Source: MySQL 5.1 -.\" Language: English .\" -.TH "\FBMYISAMCHK\FR" "1" "04/06/2010" "MySQL 5\&.1" "MySQL Database System" +.TH "\FBMYISAMCHK\FR" "1" "04/08/2015" "MariaDB 10\&.0" "MariaDB Database System" .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- @@ -125,7 +118,7 @@ shell> \fBmyisamchk \fR\fB\fI/path/to/database_dir/\fR\fR\fB*\&.MYI\fR .RE .\} .PP -You can even check all tables in all databases by specifying a wildcard with the path to the MySQL data directory: +You can even check all tables in all databases by specifying a wildcard with the path to the MariaDB data directory: .sp .if n \{\ .RS 4 @@ -184,7 +177,7 @@ the section called \(lqMYISAMCHK MEMORY USAGE\(rq\&. .ps -1 .br .PP -\fIYou must ensure that no other program is using the tables while you are running \fR\fI\fBmyisamchk\fR\fR\&. The most effective means of doing so is to shut down the MySQL server while running +\fIYou must ensure that no other program is using the tables while you are running \fR\fI\fBmyisamchk\fR\fR\&. The most effective means of doing so is to shut down the MariaDB server while running \fBmyisamchk\fR, or to lock all tables that \fBmyisamchk\fR is being used on\&. @@ -218,8 +211,7 @@ However, the easiest way to avoid this problem is to use CHECK TABLE instead of \fBmyisamchk\fR -to check tables\&. See -Section\ \&12.4.2.3, \(lqCHECK TABLE Syntax\(rq\&. +to check tables\&. .sp .5v .RE .PP @@ -227,9 +219,6 @@ Section\ \&12.4.2.3, \(lqCHECK TABLE Syntax\(rq\&. supports the following options, which can be specified on the command line or in the [myisamchk] option file group\&. -\fBmyisamchk\fR -also supports the options for processing option files described at -Section\ \&4.2.3.3.1, \(lqCommand-Line Options that Affect Option-File Handling\(rq\&. .SH "MYISAMCHK GENERAL OPTIONS" .\" options: myisamchk .\" myisamchk: options @@ -366,6 +355,66 @@ with external locking disabled, the table can be locked only by another \fBmyisamchk\fR command\&. .RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +.\" myisamchk: print argument list option +.\" print argument list option: myisamchk +\fB\-\-print\-defaults\fR +.sp +Print the program argument list and exit\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +.\" myisamchk: no defaults option +.\" no defaults option: myisamchk +\fB\-\-no\-defaults\fR +.sp +Don't read default options from any option file\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +.\" myisamchk: defaults file option +.\" defaults file option: myisamchk +\fB\-\-defaults\-file=#\fR +.sp +Only read default options from the given file\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +.\" myisamchk: defaults extrafile option +.\" defaults extra file option: myisamchk +\fB\-\-defaults\-extra\-file=#\fR +.sp +Read this file after the global files are read\&. +.RE .PP You can also set the following variables by using \fB\-\-\fR\fB\fIvar_name\fR\fR\fB=\fR\fB\fIvalue\fR\fR @@ -375,6 +424,7 @@ syntax: .\" ft_min_word_len myisamchk variable .\" ft_stopword_file myisamchk variable .\" key_buffer_size myisamchk variable +.\" key_cache_block_size myisamchk variable .\" myisam_block_size myisamchk variable .\" read_buffer_size myisamchk variable .\" sort_buffer_size myisamchk variable @@ -426,6 +476,11 @@ T}:T{ 523264 T} T{ +key_cache_block_size +T}:T{ +1024 +T} +T{ myisam_block_size T}:T{ 1024 @@ -696,7 +751,8 @@ finds any errors in the table\&. The repair type is the same as that specified w \fB\-\-recover\fR or \fB\-r\fR -option\&. +option\&. States will be updated as with +\fB\-\-update\-state\fR\&. .RE .sp .RS 4 @@ -816,8 +872,7 @@ file as .\" character-sets-dir option: myisamchk \fB\-\-character\-sets\-dir=\fR\fB\fIpath\fR\fR .sp -The directory where character sets are installed\&. See -Section\ \&9.5, \(lqCharacter Set Configuration\(rq\&. +The directory where character sets are installed\&. .RE .sp .RS 4 @@ -833,6 +888,24 @@ Section\ \&9.5, \(lqCharacter Set Configuration\(rq\&. \fB\-\-correct\-checksum\fR .sp Correct the checksum information for the table\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +.\" myisamchk: create-missing-keys option +.\" create-missing-keys option: myisamchk +\fB\-\-create\-missing\-keys\fR +.sp +Create missing keys. This assumes that the data file is correct and that the +number of rows stored in the index file is correct\&. Enables +\fB\-\-quick\fR\&. + .RE .sp .RS 4 @@ -885,7 +958,12 @@ the section called \(lqMYISAMCHK TABLE INFORMATION\(rq\&. \fB\-f\fR .sp Overwrite old intermediate files (files with names like -\fItbl_name\fR\&.TMD) instead of aborting\&. +\fItbl_name\fR\&.TMD) instead of aborting\&. Add another +\fB\-\-force\fR +to avoid 'myisam_sort_buffer_size is too small' errors\&. In this case +we will attempt to do the repair with the given +\fBmyisam_sort_buffer_size\fR +and dynamically allocate as many management buffers as needed\&. .RE .sp .RS 4 @@ -914,24 +992,6 @@ For .sp -1 .IP \(bu 2.3 .\} -.\" myisamchk: no-symlinks option -.\" no-symlinks option: myisamchk -\fB\-\-no\-symlinks\fR, -\fB\-l\fR -.sp -Do not follow symbolic links\&. Normally -\fBmyisamchk\fR -repairs the table that a symlink points to\&. This option does not exist as of MySQL 4\&.0 because versions from 4\&.0 on do not remove symlinks during repair operations\&. -.RE -.sp -.RS 4 -.ie n \{\ -\h'-04'\(bu\h'+03'\c -.\} -.el \{\ -.sp -1 -.IP \(bu 2.3 -.\} .\" myisamchk: max-record-length option .\" max-record-length option: myisamchk \fB\-\-max\-record\-length=\fR\fB\fIlen\fR\fR @@ -976,7 +1036,7 @@ and .sp Achieve a faster repair by modifying only the index file, not the data file\&. You can specify this option twice to force \fBmyisamchk\fR -to modify the original data file in case of duplicate keys\&. +to modify the original data file in case of duplicate keys\&. NOTE: Tables where the data file is corrupted can't be fixed with this option\&. .RE .sp .RS 4 @@ -1043,19 +1103,6 @@ key_buffer_size\&. .sp -1 .IP \(bu 2.3 .\} -.\" myisamchk: set-character-set option -.\" set-character-set option: myisamchk -\fB\-\-set\-character\-set=\fR\fB\fIname\fR\fR -.sp -Change the character set used by the table indexes\&. This option was replaced by -\fB\-\-set\-collation\fR -in MySQL 5\&.0\&.3\&. -.RE -.sp -.RS 4 -.ie n \{\ -\h'-04'\(bu\h'+03'\c -.\} .el \{\ .sp -1 .IP \(bu 2.3 @@ -1251,6 +1298,22 @@ sorts and moves records, it just overwrites record offsets in the index\&. If ke \fBmyisamchk\fR must unpack key blocks first, then re\-create indexes and pack the key blocks again\&. (In this case, re\-creating indexes is faster than updating offsets for each index\&.) .RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +.\" myisamchk: stats_method option +.\" stats_method option: myisamchk +\fB\-\-stats\-method=name\fR +.sp +Specifies how index statistics collection code should treat NULLs\&. Possible values +of name are "nulls_unequal" (default), "nulls_equal" (emulate MySQL 4 behavior), and "nulls_ignored"\&. +.RE .SH "MYISAMCHK TABLE INFORMATION" .\" table description: myisamchk .\" tables: information @@ -1275,7 +1338,7 @@ Runs \fBmyisamchk\fR in \(lqdescribe mode\(rq -to produce a description of your table\&. If you start the MySQL server with external locking disabled, +to produce a description of your table\&. If you start the MariaDB server with external locking disabled, \fBmyisamchk\fR may report an error for a table that is updated while it runs\&. However, because \fBmyisamchk\fR @@ -1623,7 +1686,7 @@ Section\ \&6.6.4, \(lqMyISAM Table Optimization\(rq\&. .\} Datafile pointer .sp -The size of the data file pointer, in bytes\&. It is usually 2, 3, 4, or 5 bytes\&. Most tables manage with 2 bytes, but this cannot be controlled from MySQL yet\&. For fixed tables, this is a row address\&. For dynamic tables, this is a byte address\&. +The size of the data file pointer, in bytes\&. It is usually 2, 3, 4, or 5 bytes\&. Most tables manage with 2 bytes, but this cannot be controlled from MariaDB yet\&. For fixed tables, this is a row address\&. For dynamic tables, this is a byte address\&. .RE .sp .RS 4 @@ -1636,7 +1699,7 @@ The size of the data file pointer, in bytes\&. It is usually 2, 3, 4, or 5 bytes .\} Keyfile pointer .sp -The size of the index file pointer, in bytes\&. It is usually 1, 2, or 3 bytes\&. Most tables manage with 2 bytes, but this is calculated automatically by MySQL\&. It is always a block address\&. +The size of the index file pointer, in bytes\&. It is usually 1, 2, or 3 bytes\&. Most tables manage with 2 bytes, but this is calculated automatically by MariaDB\&. It is always a block address\&. .RE .sp .RS 4 @@ -1785,7 +1848,7 @@ Address of the root index block\&. .\} Blocksize .sp -The size of each index block\&. By default this is 1024, but the value may be changed at compile time when MySQL is built from source\&. +The size of each index block\&. By default this is 1024, but the value may be changed at compile time when MariaDB is built from source\&. .RE .sp .RS 4 @@ -2137,7 +2200,7 @@ What percentage of the keyblocks are used\&. When a table has just been reorgani .\} Packed .sp -MySQL tries to pack key values that have a common suffix\&. This can only be used for indexes on +MariaDB tries to pack key values that have a common suffix\&. This can only be used for indexes on CHAR and VARCHAR @@ -2193,7 +2256,7 @@ The average row length\&. This is the exact row length for tables with fixed\-le .\} Packed .sp -MySQL strips spaces from the end of strings\&. The +MariaDB strips spaces from the end of strings\&. The Packed value indicates the percentage of savings achieved by doing this\&. .RE @@ -2444,7 +2507,7 @@ instead of .SH "COPYRIGHT" .br .PP -Copyright 2007-2008 MySQL AB, 2008-2010 Sun Microsystems, Inc. +Copyright 2007-2008 MySQL AB, 2008-2010 Sun Microsystems, Inc., 2010-2015 MariaDB Foundation .PP This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. .PP @@ -2453,8 +2516,6 @@ This documentation is distributed in the hope that it will be useful, but WITHOU You should have received a copy of the GNU General Public License along with the program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or see http://www.gnu.org/licenses/. .sp .SH "SEE ALSO" -For more information, please refer to the MySQL Reference Manual, -which may already be installed locally and which is also available -online at http://dev.mysql.com/doc/. +For more information, please refer to the MariaDB Knowledge Base, available online at https://mariadb.com/kb/ .SH AUTHOR -Sun Microsystems, Inc. (http://www.mysql.com/). +MariaDB Foundation (http://www.mariadb.org/). diff --git a/man/myisamlog.1 b/man/myisamlog.1 index 1ea424cd949..57728d14e2e 100644 --- a/man/myisamlog.1 +++ b/man/myisamlog.1 @@ -1,13 +1,6 @@ '\" t -.\" Title: \fBmyisamlog\fR -.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] -.\" Generator: DocBook XSL Stylesheets v1.75.2 -.\" Date: 04/06/2010 -.\" Manual: MySQL Database System -.\" Source: MySQL 5.1 -.\" Language: English .\" -.TH "\FBMYISAMLOG\FR" "1" "04/06/2010" "MySQL 5\&.1" "MySQL Database System" +.TH "\FBMYISAMLOG\FR" "1" "04/08/2015" "MariaDB 10\&.0" "MariaDB Database System" .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- @@ -225,7 +218,7 @@ Display version information\&. .SH "COPYRIGHT" .br .PP -Copyright 2007-2008 MySQL AB, 2008-2010 Sun Microsystems, Inc. +Copyright 2007-2008 MySQL AB, 2008-2010 Sun Microsystems, Inc., 2010-2015 MariaDB Foundation .PP This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. .PP @@ -234,8 +227,6 @@ This documentation is distributed in the hope that it will be useful, but WITHOU You should have received a copy of the GNU General Public License along with the program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or see http://www.gnu.org/licenses/. .sp .SH "SEE ALSO" -For more information, please refer to the MySQL Reference Manual, -which may already be installed locally and which is also available -online at http://dev.mysql.com/doc/. +For more information, please refer to the MariaDB Knowledge Base, available online at https://mariadb.com/kb/ .SH AUTHOR -Sun Microsystems, Inc. (http://www.mysql.com/). +MariaDB Foundation (http://www.mariadb.org/). diff --git a/man/myisampack.1 b/man/myisampack.1 index 0f5efd0fb8d..37eca1f4a04 100644 --- a/man/myisampack.1 +++ b/man/myisampack.1 @@ -1,13 +1,6 @@ '\" t -.\" Title: \fBmyisampack\fR -.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] -.\" Generator: DocBook XSL Stylesheets v1.75.2 -.\" Date: 04/06/2010 -.\" Manual: MySQL Database System -.\" Source: MySQL 5.1 -.\" Language: English .\" -.TH "\FBMYISAMPACK\FR" "1" "04/06/2010" "MySQL 5\&.1" "MySQL Database System" +.TH "\FBMYISAMPACK\FR" "1" "04/08/2015" "MariaDB 10\&.0" "MariaDB Database System" .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- @@ -72,7 +65,7 @@ if the table might be updated by the server during the packing process\&. It is .sp -1 .IP \(bu 2.3 .\} -After packing a table, it becomes read only\&. This is generally intended (such as when accessing packed tables on a CD)\&. Allowing writes to a packed table is on our TODO list, but with low priority\&. +After packing a table, it becomes read only\&. This is generally intended (such as when accessing packed tables on a CD)\&. .RE .PP Invoke @@ -832,7 +825,7 @@ option to .SH "COPYRIGHT" .br .PP -Copyright 2007-2008 MySQL AB, 2008-2010 Sun Microsystems, Inc. +Copyright 2007-2008 MySQL AB, 2008-2010 Sun Microsystems, Inc., 2010-2015 MariaDB Foundation .PP This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. .PP @@ -841,8 +834,6 @@ This documentation is distributed in the hope that it will be useful, but WITHOU You should have received a copy of the GNU General Public License along with the program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or see http://www.gnu.org/licenses/. .sp .SH "SEE ALSO" -For more information, please refer to the MySQL Reference Manual, -which may already be installed locally and which is also available -online at http://dev.mysql.com/doc/. +For more information, please refer to the MariaDB Knowledge Base, available online at https://mariadb.com/kb/ .SH AUTHOR -Sun Microsystems, Inc. (http://www.mysql.com/). +MariaDB Foundation (http://www.mariadb.org/). diff --git a/man/mysql-stress-test.pl.1 b/man/mysql-stress-test.pl.1 index 78ba75847ad..19fe4a1aac6 100644 --- a/man/mysql-stress-test.pl.1 +++ b/man/mysql-stress-test.pl.1 @@ -1,13 +1,6 @@ '\" t -.\" Title: \fBmysql-stress-test.pl\fR -.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] -.\" Generator: DocBook XSL Stylesheets v1.75.2 -.\" Date: 03/31/2010 -.\" Manual: MySQL Database System -.\" Source: MySQL -.\" Language: English .\" -.TH "\FBMYSQL\-STRESS\-TE" "1" "03/31/2010" "MySQL" "MySQL Database System" +.TH "\FBMYSQL\-STRESS\-TE" "1" "04/08/2015" "MariaDB 10\&.0" "MariaDB Database System" .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- @@ -28,7 +21,7 @@ mysql-stress-test.pl \- server stress test program .PP The \fBmysql\-stress\-test\&.pl\fR -Perl script performs stress\-testing of the MySQL server\&. (MySQL 5\&.0 and up only) +Perl script performs stress\-testing of the MariaDB server\&. .PP \fBmysql\-stress\-test\&.pl\fR requires a version of Perl that has been built with threads support\&. @@ -250,7 +243,7 @@ The TCP/IP port number to use for connecting to the server\&. The default is 330 \fB\-\-server\-socket=\fR\fB\fIfile_name\fR\fR .sp For connections to -localhost, the Unix socket file to use, or, on Windows, the name of the named pipe to use\&. The default if +localhost, the Unix socket file to use, or, on Windows, the name of the named pipe to use\&. The default is /tmp/mysql\&.sock\&. .RE .sp @@ -266,7 +259,7 @@ localhost, the Unix socket file to use, or, on Windows, the name of the named pi .\" server-user option: mysql-stress-test.pl \fB\-\-server\-user=\fR\fB\fIuser_name\fR\fR .sp -The MySQL user name to use when connecting to the server\&. The default is +The MariaDB user name to use when connecting to the server\&. The default is root\&. .RE .sp @@ -489,7 +482,7 @@ Verbose mode\&. Print more information about what the program does\&. .SH "COPYRIGHT" .br .PP -Copyright \(co 2007, 2010, Oracle and/or its affiliates +Copyright \(co 2007, 2010, Oracle and/or its affiliates, 2010-2015 MariaDB Foundation .PP This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. .PP @@ -498,8 +491,6 @@ This documentation is distributed in the hope that it will be useful, but WITHOU You should have received a copy of the GNU General Public License along with the program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or see http://www.gnu.org/licenses/. .sp .SH "SEE ALSO" -For more information, please refer to the MySQL Reference Manual, -which may already be installed locally and which is also available -online at http://dev.mysql.com/doc/. +For more information, please refer to the MariaDB Knowledge Base, available online at https://mariadb.com/kb/ .SH AUTHOR -Sun Microsystems, Inc. (http://www.mysql.com/). +MariaDB Foundation (http://www.mariadb.org/). diff --git a/man/mysql-test-run.pl.1 b/man/mysql-test-run.pl.1 index 20abc250b15..91d82084606 100644 --- a/man/mysql-test-run.pl.1 +++ b/man/mysql-test-run.pl.1 @@ -1,13 +1,6 @@ '\" t -.\" Title: \fBmysql-test-run.pl\fR -.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] -.\" Generator: DocBook XSL Stylesheets v1.75.2 -.\" Date: 03/31/2010 -.\" Manual: MySQL Database System -.\" Source: MySQL -.\" Language: English .\" -.TH "\FBMYSQL\-TEST\-RUN\" "1" "03/31/2010" "MySQL" "MySQL Database System" +.TH "\FBMYSQL\-TEST\-RUN\" "1" "04/08/2015" "MariaDB 10\&.0" "MariaDB Database System" .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- @@ -20,7 +13,7 @@ .\" ----------------------------------------------------------------- .\" mysql-test-run.pl .SH "NAME" -mysql-test-run.pl \- run MySQL test suite +mysql-test-run.pl \- run MariaDB test suite .SH "SYNOPSIS" .HP \w'\fBmysql\-test\-run\&.pl\ [\fR\fB\fIoptions\fR\fR\fB]\fR\ 'u \fBmysql\-test\-run\&.pl [\fR\fB\fIoptions\fR\fR\fB]\fR @@ -28,7 +21,7 @@ mysql-test-run.pl \- run MySQL test suite .PP The \fBmysql\-test\-run\&.pl\fR -Perl script is the main application used to run the MySQL test suite\&. It invokes +Perl script is the main application used to run the MariaDB test suite\&. It invokes \fBmysqltest\fR to run individual test cases\&. .PP @@ -381,9 +374,54 @@ Display a help message and exit\&. Allow tests marked as "big" to run\&. Tests can be thus marked by including the line \fB\-\-source include/big_test\&.inc\fR, and they will only be run if this option is given, or if the environment variable BIG_TEST -is set to 1\&. +is set to 1\&. Repeat this option twice to run only "big" tests\&. .sp -This is typically done for tests that take very long to run, or that use very much resources, so that they are not suitable for running as part of a normal test suite run\&. +This is typically used for tests that take a very long to run, or that use many resources, so that they are not suitable for running as part of a normal test suite run\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +.\" mysql-test-run.pl: boot-dbx option +.\" boot-dbx option: mysql-test-run.pl +\fB\-\-boot\-dbx\fR +.sp +Run the mysqld server used for bootstrapping the database through the dbx debugger\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +.\" mysql-test-run.pl: boot-ddd option +.\" boot-ddd option: mysql-test-run.pl +\fB\-\-boot\-ddd\fR +.sp +Run the mysqld server used for bootstrapping the database through the ddd debugger\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +.\" mysql-test-run.pl: boot-gdb option +.\" boot-gdb option: mysql-test-run.pl +\fB\-\-boot\-gdb\fR +.sp +Run the mysqld server used for bootstrapping the database through the gdb debugger\&. .RE .sp .RS 4 @@ -396,7 +434,7 @@ This is typically done for tests that take very long to run, or that use very mu .\} .\" mysql-test-run.pl: build-thread option .\" build-thread option: mysql-test-run.pl -\fB\-\-build\-thread=\fR\fB\fInumber\fR\fR +\fB\-\-[mtr\-]build\-thread=\fR\fB\fInumber\fR\fR .sp Specify a number to calculate port numbers from\&. The formula is 10 * \fIbuild_thread\fR @@ -410,7 +448,7 @@ auto) can also be set with the MTR_BUILD_THREAD environment variable\&. .sp -From MySQL 5\&.1\&.45, the more logical +The more logical \fB\-\-port\-base\fR is supported as an alternative\&. .RE @@ -471,6 +509,25 @@ The path to the directory where client binaries are located\&. .sp -1 .IP \(bu 2.3 .\} +.\" mysql-test-run.pl: client-dbx option +.\" client-dbx option: mysql-test-run.pl +\fB\-\-client\-dbx\fR +.sp +Start +\fBmysqltest\fR +in the +\fBdbx\fR +debugger\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} .\" mysql-test-run.pl: client-ddd option .\" client-ddd option: mysql-test-run.pl \fB\-\-client\-ddd\fR @@ -560,8 +617,7 @@ is given only once, it has no effect\&. For test runs specific to a given test s \fB\-\-combination\fR is to create a combinations -file in the suite directory\&. The file should contain a section of options for each test run\&. See -Section\ \&4.9, \(lqPassing Options from mysql-test-run.pl to mysqld or mysqltest\(rq\&. +file in the suite directory\&. The file should contain a section of options for each test run\&. .RE .sp .RS 4 @@ -609,10 +665,7 @@ Compress all information sent between the client and the server if both support .\" cursor-protocol option: mysql-test-run.pl \fB\-\-cursor\-protocol\fR .sp -Pass the -\fB\-\-cursor\-protocol\fR -option to -\fBmysqltest\fR +Use the cursor protocol between client and server (implies \fB\-\-ps\-protocol\fR)\&. .RE @@ -625,12 +678,31 @@ option to .sp -1 .IP \(bu 2.3 .\} +.\" mysql-test-run.pl: dbx option +.\" dbx option: mysql-test-run.pl +\fB\-\-dbx\fR +.sp +Start the +\fBmysqld(s)\fR +in the +\fBdbx\fR +debugger\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} .\" mysql-test-run.pl: ddd option .\" ddd option: mysql-test-run.pl \fB\-\-ddd\fR .sp -Start -\fBmysqld\fR +Start the +\fBmysqld(s)\fR in the \fBddd\fR debugger\&. @@ -659,6 +731,36 @@ Dump trace output for all clients and servers\&. .sp -1 .IP \(bu 2.3 .\} +.\" mysql-test-run.pl: debug-common option +.\" debug-common option: mysql-test-run.pl +\fB\-\-debug\-common\fR +.sp +Same as \fB--debug\fR, but sets the 'd' debug flags to "query,info,error,enter,exit"\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +.\" mysql-test-run.pl: debug-server option +.\" debug-server option: mysql-test-run.pl +\fB\-\-debug\-server\fR +.sp +Use debug version of server, but without turning on tracing\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} .\" mysql-test-run.pl: debugger option .\" debugger option: mysql-test-run.pl \fB\-\-debugger=\fR\fB\fIdebugger\fR\fR @@ -691,11 +793,22 @@ to prefix is used so that \fBmysqld\fR does not fail if Debug Sync is not compiled in\&. +.RE .sp -For information about using the Debug Sync facility for testing, see -Section\ \&4.14, \(lqThread Synchronization in Test Cases\(rq\&. +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +.\" mysql-test-run.pl: default-myisam option +.\" default-myisam option: mysql-test-run.pl +\fB\-\-default\-myisam\fR .sp -This option was added in MySQL 5\&.1\&.41/5\&.5\&.0/6\&.0\&.6\&. +Set default storage engine to MyISAM for non-innodb tests\&. This is +needed after switching default storage engine to InnoDB\&. .RE .sp .RS 4 @@ -707,7 +820,7 @@ This option was added in MySQL 5\&.1\&.41/5\&.5\&.0/6\&.0\&.6\&. .IP \(bu 2.3 .\} .\" mysql-test-run.pl: defaults-file option -.\" default-file option: mysql-test-run.pl +.\" defaults-file option: mysql-test-run.pl \fB\-\-defaults\-file=\fR\fB\fIfile_name\fR\fR .sp Use the named file as fixed config file template for all tests\&. @@ -738,11 +851,12 @@ Add setting from the named file to all generated configs\&. .\} .\" mysql-test-run.pl: do-test option .\" do-test option: mysql-test-run.pl -\fB\-\-do\-test=\fR\fB\fIprefix\fR\fR +\fB\-\-do\-test=\fR\fB\fIprefix\fR\fR|\fB\fIregex\fR\fR .sp Run all test cases having a name that begins with the given \fIprefix\fR -value\&. This option provides a convenient way to run a family of similarly named tests\&. +value, or fulfils the +\fIregex\fR\&. This option provides a convenient way to run a family of similarly named tests\&. .sp The argument for the \fB\-\-do\-test\fR @@ -772,6 +886,21 @@ xmainytestz\&. .sp -1 .IP \(bu 2.3 .\} +.\" mysql-test-run.pl: dry-run option +.\" dry-run option: mysql-test-run.pl +\fB\-\-dry\-run\fR +.sp +Don't run any tests, print the list of tests that were selected for execution\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} .\" mysql-test-run.pl: embedded-server option .\" embedded-server option: mysql-test-run.pl \fB\-\-embedded\-server\fR @@ -795,7 +924,7 @@ built with the embedded server\&. .sp Ignore any disabled\&.def -file, and run also tests marked as disbaled\&. Success or failure of those tests will be reported the same way as other tests\&. +file, and also run tests marked as disabled\&. Success or failure of those tests will be reported the same way as other tests\&. .RE .sp .RS 4 @@ -814,7 +943,7 @@ Specify a file that contains a list of test cases that should be displayed with [ exp\-fail ] code rather than [ fail ] -if they fail\&. This option was added in MySQL 5\&.1\&.33\&. +if they fail\&. .sp For an example of a file that might be specified via this option, see mysql\-test/collections/default\&.experimental\&. @@ -836,10 +965,10 @@ mysql\-test/collections/default\&.experimental\&. Use an already running server\&. The option/value pair is what is needed by the \fBmysql\fR client to connect to the server\&. Each +\fB\-\-extern\fR option +can only take one option/value pair as an argument, so you need to repeat \fB\-\-extern\fR -can only take one option/value pair as argument, so it you need more you need to repeat -\fB\-\-extern\fR -for each of them\&. Example: +for each pair needed\&. Example: .sp .if n \{\ .RS 4 @@ -880,6 +1009,21 @@ Do not perform controlled shutdown when servers need to be restarted or at the e .sp -1 .IP \(bu 2.3 .\} +.\" mysql-test-run.pl: force-restart option +.\" force-restart option: mysql-test-run.pl +\fB\-\-force\-restart\fR +.sp +Always restart servers between tests\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} .\" mysql-test-run.pl: force option .\" force option: mysql-test-run.pl \fB\-\-force\fR @@ -903,9 +1047,25 @@ causes execution to continue regardless of test case failure\&. .\" gcov option: mysql-test-run.pl \fB\-\-gcov\fR .sp -Run tests with the +Collect coverage information after the test\&. The result is a \fBgcov\fR -test coverage tool\&. +file per source and header file\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +.\" mysql-test-run.pl: gcov-src-dir option +.\" gcov-src-dir option: mysql-test-run.pl +\fB\-\-gcov\-src\-dir\fR +.sp +Colllect coverage only within the given subdirectory\&. For example, if you're only developing the SQL layer, +it makes sense to use \fB--gcov-src-dir=sql\fR\&. .RE .sp .RS 4 @@ -920,8 +1080,8 @@ test coverage tool\&. .\" gdb option: mysql-test-run.pl \fB\-\-gdb\fR .sp -Start -\fBmysqld\fR +Start the +\fBmysqld(s)\fR in the \fBgdb\fR debugger\&. @@ -939,11 +1099,26 @@ debugger\&. .\" gprof option: mysql-test-run.pl \fB\-\-gprof\fR .sp -Run tests with the +Collect profiling information using the \fBgprof\fR profiling tool\&. -\fB\-\-gprof\fR -was added in 5\&.1\&.45\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +.\" mysql-test-run.pl: manual-dbx option +.\" manual-dbx option: mysql-test-run.pl +\fB\-\-manual\-dbx\fR +.sp +Use a server that has already been started by the user in the +\fBdbx\fR +debugger\&. .RE .sp .RS 4 @@ -1003,6 +1178,23 @@ debugger\&. .sp -1 .IP \(bu 2.3 .\} +.\" mysql-test-run.pl: manual-lldb option +.\" manual-lldb option: mysql-test-run.pl +\fB\-\-manual\-lldb\fR +.sp +Use a server that has already been started by the user in the +\fBlldb\fR +debugger\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} .\" mysql-test-run.pl: mark-progress option .\" mark-progress option: mysql-test-run.pl \fB\-\-mark\-progress\fR @@ -1025,8 +1217,6 @@ var/log/\fItestname\fR\&.progress\&. .sp The maximum number of simultaneous server connections that may be used per test\&. If not set, the maximum is 128\&. Minimum allowed limit is 8, maximum is 5120\&. Corresponds to the same option for \fBmysqltest\fR\&. -.sp -This option is available from MySQL 5\&.1\&.45\&. .RE .sp .RS 4 @@ -1073,7 +1263,7 @@ MTR_MAX_SAVE_DATADIR .\" max-test-fail option: mysql-test-run.pl \fB\-\-max\-test\-fail=\fR\fB\fIN\fR\fR .sp -Stop execution after the specified number of tests have failed, to avoid using up resources (and time) in case of massive failures\&. retries are noe counted, nor are failures of tests marked experimental\&. Defaults to 10, set to 0 for no limit\&. May also be set with the environment variable +Stop execution after the specified number of tests have failed, to avoid using up resources (and time) in case of massive failures\&. retries are not counted, nor are failures of tests marked experimental\&. Defaults to 10, set to 0 for no limit\&. May also be set with the environment variable MTR_MAX_TEST_FAIL .RE .sp @@ -1129,8 +1319,22 @@ option next time\&. Extra options to pass to \fBmysqld\fR\&. The value should consist of one or more comma\-separated \fBmysqld\fR -options\&. See -Section\ \&4.9, \(lqPassing Options from mysql-test-run.pl to mysqld or mysqltest\(rq\&. +options\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +.\" mysql-test-run.pl: mysqld-env option +.\" mysqld-env option: mysql-test-run.pl +\fB\-\-mysqld\-env=\fR\fB\fIVAR=VAL\fR\fR +.sp +Specify additional environment settings for "mysqld"\&. Use additional \fB--mysqld-env\fR options to set more than one variable\&. .RE .sp .RS 4 @@ -1233,7 +1437,7 @@ Run tests using parallel threads\&. By default, 1 thread is used\&. Use \fB\-\-parallel=auto\fR for auto\-setting of -\fIN\fR\&. The auto value was added in MySQL 5\&.1\&.36\&. +\fIN\fR\&. .RE .sp .RS 4 @@ -1246,7 +1450,7 @@ for auto\-setting of .\} .\" mysql-test-run.pl: port-base option .\" port-base option: mysql-test-run.pl -\fB\-\-port\-base=\fR\fB\fIP\fR\fR +\fB\-\-[mtr\-]port\-base=\fR\fB\fIP\fR\fR .sp Specify base of port numbers to be used; a block of 10 will be allocated\&. \fIP\fR @@ -1254,14 +1458,12 @@ should be divisible by 10; if it is not, it will be rounded down\&. If running w .sp If the port number is given as auto, which is also the default, -\fBmysql\-test\-run\&.pl\fRwill allocate a number unique to this host\&. The value may also be given with the environment variable +\fBmysql\-test\-run\&.pl\fR will allocate a number unique to this host\&. The value may also be given with the environment variable MTR_PORT_BASE\&. .sp +If both \fB\-\-build\-thread\fR and \fB\-\-port\-base\fR are used, \fB\-\-port\-base\fR -was added in MySQL 5\&.1\&.45 as a more logical alternative to -\fB\-\-build\-thread\fR\&. If both are used, -\fB\-\-port\-base\fR -takes presedence\&. +takes precedence\&. .RE .sp .RS 4 @@ -1291,10 +1493,7 @@ Do not run any tests, but print details about all tests, in the order they would .\" ps-protocol option: mysql-test-run.pl \fB\-\-ps\-protocol\fR .sp -Pass the -\fB\-\-ps\-protocol\fR -option to -\fBmysqltest\fR\&. +Use the binary protocol between client and server\&. .RE .sp .RS 4 @@ -1359,10 +1558,23 @@ number of times\&. .\" report-features option: mysql-test-run.pl \fB\-\-report\-features\fR .sp -Display the output of -SHOW ENGINES -and -SHOW VARIABLES\&. This can be used to verify that binaries are built with all required features\&. +First run a "test" that reports MariaDB features, displaying the output of SHOW ENGINES and SHOW VARIABLES\&. This can be +used to verify that binaries are built with all required features\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +.\" mysql-test-run.pl: report-times option +.\" report-times option: mysql-test-run.pl +\fB\-\-report\-times\fR +.sp +Report how much time has been spent on different phases of test execution\&. .RE .sp .RS 4 @@ -1379,7 +1591,8 @@ SHOW VARIABLES\&. This can be used to verify that binaries are built with all re .sp If a test fails, it is retried up to a maximum of \fIN\fR -runs, but will terminate after 2 failures\&. Default is 3, set to 1 or 0 for no retries\&. This option has no effect unless +runs (default 1)\&. Retries are also limited by the maximum number of failures before stopping, +set with the \fB-\-retry\-failure\fR option\&. This option has no effect unless \fB\-\-force\fR is also used; without it, test execution will terminate after the first failure\&. .sp @@ -1404,7 +1617,8 @@ may fail in total, as each repetition is considered a new test case, which may i .\" retry-failure option: mysql-test-run.pl \fB\-\-retry\-failure=\fR\fB\fIN\fR\fR .sp -Allow a failed and retried test to fail more than the default 2 times before giving it up\&. Setting it to 0 or 1 effectively turns off retries +When using the \fB-\-retry\fR option to retry failed tests, +stop when N failures have occured (default 2)\&. Setting it to 0 or 1 effectively turns off retries\&. .RE .sp .RS 4 @@ -1515,7 +1729,7 @@ with support for SSL connections\&. .\} .\" mysql-test-run.pl: skip-test option .\" skip-test option: mysql-test-run.pl -\fB\-\-skip\-test=\fR\fB\fIregex\fR\fR +\fB\-\-skip\-test=\fR\fB\fIregex\fR\fR|\fR\fB\fIregex\fR\fR .sp Specify a regular expression to be applied to test case names\&. Cases with names that match the expression are skipped\&. tests to skip\&. .sp @@ -1534,6 +1748,21 @@ option for details\&. .sp -1 .IP \(bu 2.3 .\} +.\" mysql-test-run.pl: skip-test-list option +.\" skip-test-list option: mysql-test-run.pl +\fB\-\-skip\-test\-list=\fB\fIFILE\fR +.sp +Skip the tests listed in FILE\&. Each line in the file is an entry and should be formatted as: : +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} \fB\-\-skip\-*\fR .sp \fB\-\-skip\-*\fR @@ -1572,10 +1801,7 @@ to .\" sp-protocol option: mysql-test-run.pl \fB\-\-sp\-protocol\fR .sp -Pass the -\fB\-\-sp\-protocol\fR -option to -\fBmysqltest\fR\&. +Create a stored procedure to execute all queries\&. .RE .sp .RS 4 @@ -1594,7 +1820,7 @@ If \fBmysql\-test\-run\&.pl\fR is started with the \fB\-\-ssl\fR -option, it sets up a secure conection for all test cases\&. In this case, if +option, it sets up a secure connection for all test cases\&. In this case, if \fBmysqld\fR does not support SSL, \fBmysql\-test\-run\&.pl\fR @@ -1610,6 +1836,21 @@ Couldn\'t find support for SSL .sp -1 .IP \(bu 2.3 .\} +.\" mysql-test-run.pl: staging-run option +.\" staging-run option: mysql-test-run.pl +\fB\-\-staging\-run\fR +.sp +Run a limited number of tests (no slow tests)\&. Used for running staging trees with valgrind\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} .\" mysql-test-run.pl: start-and-exit option .\" start-and-exit option: mysql-test-run.pl \fB\-\-start\fR @@ -1646,6 +1887,22 @@ will stop once the server has been started, but will terminate if the server die .sp -1 .IP \(bu 2.3 .\} +.\" mysql-test-run.pl: start-and-exit option +.\" start-and-exit option: mysql-test-run.pl +\fB\-\-start\-and\-exit\fR +.sp +Same +\fB\-\-start\fR, but mysql-test-run terminates and leaves just the server running\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} .\" mysql-test-run.pl: start-dirty option .\" start-dirty option: mysql-test-run.pl \fB\-\-start\-dirty\fR @@ -1679,6 +1936,21 @@ sorts the list of names of the test cases to be run, and then begins with .sp -1 .IP \(bu 2.3 .\} +.\" mysql-test-run.pl: strace option +.\" strace option: mysql-test-run.pl +\fB\-\-strace\fR +.sp +Run the "mysqld" executables using strace. Default options are \fB-f -o var/log/'mysqld-name'.strace\fR\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} .\" mysql-test-run.pl: strace-client option .\" strace-client option: mysql-test-run.pl \fB\-\-strace\-client\fR @@ -1686,7 +1958,42 @@ sorts the list of names of the test cases to be run, and then begins with Create \fBstrace\fR output for -\fBmysqltest\fR\&. +\fBmysqltest\fR, optionally specifying name and path +to the trace program to use\&. +.sp +Example: \&./mysql\-test\-run\&.pl \-\-strace\-client=ktrace +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +.\" mysql-test-run.pl: strace-option option +.\" strace-option option: mysql-test-run.pl +\fB\-\-strace\-option\fR=\fR\fB\fIARGS\fR\fR +.sp +Option to give +\fBstrace\fR, +replaces default option(s)\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +.\" mysql-test-run.pl: stress option +.\" stress option: mysql-test-run.pl +\fB\-\-stress=\fR\fB\fIARGS\fR\fR +.sp +Run stress test, providing options to mysql\-stress\-test\&.pl\&. Options are separated by comma\&. .RE .sp .RS 4 @@ -1699,13 +2006,41 @@ output for .\} .\" mysql-test-run.pl: suite option .\" suite option: mysql-test-run.pl -\fB\-\-suite=\fR\fB\fIsuite_name\fR\fR +\fB\-\-suite[s]=\fR\fB\fIsuite_name...\fR\fR .sp -Run the named test suite\&. The default name is -main -(the regular test suite located in the -mysql\-test -directory)\&. +Comma separated list of suite names to run. The default is: "main-,archive-,binlog-,csv-,federated-,funcs_1-,funcs_2-,handler-,heap-,innodb-,innodb_fts-, +innodb_zip-,maria-,multi_source-,optimizer_unfixed_bugs-,parts-,percona-,perfschema-, +plugins-,roles-,rpl-,sys_vars-,unit-,vcol-"\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +.\" mysql-test-run.pl: stop-file option +.\" stop-file option: mysql-test-run.pl +\fB\-\-stop\-file=\fR\fB\fIfile\fR\fR +.sp +If this file is detected, mysqltest will not start new tests until the file is removed (also MTR_STOP_FILE environment variable)\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +.\" mysql-test-run.pl: stop-keep-alive option +.\" stop-keep-alive option: mysql-test-run.pl +\fB\-\-stop\-keep\-alive=\fR\fB\fIsec\fR\fR +.sp +Works with \fB--stop-file\fR, print messages every \fIsec\fR seconds when mysqltest is waiting to remove the file (for buildbot) (also MTR_STOP_KEEP_ALIVE environment variable)\&. .RE .sp .RS 4 @@ -1720,7 +2055,7 @@ directory)\&. .\" suite-timeout option: mysql-test-run.pl \fB\-\-suite\-timeout=\fR\fB\fIminutes\fR\fR .sp -Specify the maximum test suite runtime\&. +Specify the maximum test suite runtime in minutes\&. The default is 360\&. .RE .sp .RS 4 @@ -1735,7 +2070,7 @@ Specify the maximum test suite runtime\&. .\" testcase-timeout option: mysql-test-run.pl \fB\-\-testcase\-timeout\fR .sp -Specify the maximum test case runtime\&. +Specify the maximum test case runtime in minutes\&. The default is 15\&. .RE .sp .RS 4 @@ -1750,8 +2085,7 @@ Specify the maximum test case runtime\&. .\" timediff option: mysql-test-run.pl \fB\-\-timediff\fR .sp -Adds to each test report for a test case, the total time in sconds and milliseconds passed since the preceding test ended\&. This option can only be used together with -\fB\-\-timestamp\fR, and has no effect without it\&. +Used with \fB\-\-timestamp\fR, also print time passed since the previous test started\&. .RE .sp .RS 4 @@ -1817,7 +2151,22 @@ will be set to the path for this directory, whether it has the default value or .\" user option: mysql-test-run.pl \fB\-\-user=\fR\fB\fIuser_name\fR\fR .sp -The MySQL user name to use when connecting to the server\&. +The MariaDB user name to use when connecting to the server (default root)\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +.\" mysql-test-run.pl: user-args option +.\" user-args option: mysql-test-run.pl +\fB\-\-user\-args\fR +.sp +In combination with \fBstart*\fR and no test name, drops arguments to mysqld except those specified with \fB\-\-mysqld\fR (if any)\&. .RE .sp .RS 4 @@ -1830,16 +2179,16 @@ The MySQL user name to use when connecting to the server\&. .\} .\" mysql-test-run.pl: valgrind option .\" valgrind option: mysql-test-run.pl -\fB\-\-valgrind\fR +\fB\-\-valgrind[\-all]\fR .sp Run \fBmysqltest\fR and \fBmysqld\fR with -\fBvalgrind\fR\&. Thiks and the following +\fBvalgrind\fR\&. This and the following \fB\-\-valgrind\fR -options require that the executables have been build with +options require that the executables have been built with \fBvalgrind\fR support\&. .RE @@ -1874,9 +2223,11 @@ server with .\" valgrind-mysqltest option: mysql-test-run.pl \fB\-\-valgrind\-mysqltest\fR .sp -Run +Run the \fBmysqltest\fR -with +and +\fBmysql_client_test\fR +executables with \fBvalgrind\fR\&. .RE .sp @@ -1892,8 +2243,7 @@ with .\" valgrind-options option: mysql-test-run.pl \fB\-\-valgrind\-option=\fR\fB\fIstr\fR\fR .sp -Extra options to pass to -\fBvalgrind\fR\&. +Option to give \fBvalgrind\fR. Replaces default option(s)\&. Can be specified more then once&. .RE .sp .RS 4 @@ -1908,7 +2258,7 @@ Extra options to pass to .\" valgrind-path option: mysql-test-run.pl \fB\-\-valgrind\-path=\fR\fB\fIpath\fR\fR .sp -Specify the path name to the +Path to the \fBvalgrind\fR executable\&. .RE @@ -1973,10 +2323,7 @@ Write when and why servers are restarted between test cases\&. .\" view-protocol option: mysql-test-run.pl \fB\-\-view\-protocol\fR .sp -Pass the -\fB\-\-view\-protocol\fR -option to -\fBmysqltest\fR\&. +Create a view to execute all non updating queries\&. .RE .sp .RS 4 @@ -1991,9 +2338,9 @@ option to .\" vs-config option: mysql-test-run.pl \fB\-\-vs\-config=\fR\fB\fIconfig_val\fR\fR .sp -Specify the configuration used to build MySQL (for example, -\fB\-\-vs\-config=debug\fR -\fB\-\-vs\-config=release\fR)\&. This option is for Windows only\&. +Visual Studio configuration used to create executables +(default: MTR_VS_CONFIG environment variable) +This option is for Windows only\&. .RE .sp .RS 4 @@ -2012,9 +2359,7 @@ If \fB\-\-start\fR or \fB\-\-start\-dirty\fR -is used, wait for all servers to exit before termination\&. Otherise, it will terminate if one (of several) servers is restarted\&. -.sp -This option was added in MySQL 5\&.1\&.36\&. +is used, wait for all servers to exit before termination\&. Otherwise, it will terminate if one (of several) servers is restarted\&. .RE .sp .RS 4 @@ -2052,7 +2397,7 @@ in their name\&. .SH "COPYRIGHT" .br .PP -Copyright \(co 2007, 2010, Oracle and/or its affiliates +Copyright \(co 2007, 2010, Oracle and/or its affiliates, 2010-2015 MariaDB Foundation .PP This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. .PP @@ -2061,8 +2406,6 @@ This documentation is distributed in the hope that it will be useful, but WITHOU You should have received a copy of the GNU General Public License along with the program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or see http://www.gnu.org/licenses/. .sp .SH "SEE ALSO" -For more information, please refer to the MySQL Reference Manual, -which may already be installed locally and which is also available -online at http://dev.mysql.com/doc/. +For more information, please refer to the MariaDB Knowledge Base, available online at https://mariadb.com/kb/ .SH AUTHOR -Sun Microsystems, Inc. (http://www.mysql.com/). +MariaDB Foundation (http://www.mariadb.org/). diff --git a/man/mysql.1 b/man/mysql.1 index b9430ccae6a..01f417c0d87 100644 --- a/man/mysql.1 +++ b/man/mysql.1 @@ -1,13 +1,6 @@ '\" t -.\" Title: \fBmysql\fR -.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] -.\" Generator: DocBook XSL Stylesheets v1.75.2 -.\" Date: 04/06/2010 -.\" Manual: MySQL Database System -.\" Source: MySQL 5.1 -.\" Language: English .\" -.TH "\FBMYSQL\FR" "1" "04/06/2010" "MySQL 5\&.1" "MySQL Database System" +.TH "\FBMYSQL\FR" "1" "04/08/2015" "MariaDB 10\&.0" "MariaDB Database System" .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- @@ -2985,7 +2978,7 @@ Section\ \&21.9.11, \(lqControlling Automatic Reconnection Behavior\(rq\&. .SH "COPYRIGHT" .br .PP -Copyright 2007-2008 MySQL AB, 2008-2010 Sun Microsystems, Inc. +Copyright 2007-2008 MySQL AB, 2008-2010 Sun Microsystems, Inc., 2010-2015 MariaDB Foundation .PP This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. .PP @@ -3000,8 +2993,6 @@ Bug#25946 \%http://bugs.mysql.com/bug.php?id=25946 .RE .SH "SEE ALSO" -For more information, please refer to the MySQL Reference Manual, -which may already be installed locally and which is also available -online at http://dev.mysql.com/doc/. +For more information, please refer to the MariaDB Knowledge Base, available online at https://mariadb.com/kb/ .SH AUTHOR -Sun Microsystems, Inc. (http://www.mysql.com/). +MariaDB Foundation (http://www.mariadb.org/). diff --git a/man/mysql.server.1 b/man/mysql.server.1 index dc965921f6f..ba206cb985c 100644 --- a/man/mysql.server.1 +++ b/man/mysql.server.1 @@ -1,13 +1,6 @@ '\" t -.\" Title: \fBmysql.server\fR -.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] -.\" Generator: DocBook XSL Stylesheets v1.75.2 -.\" Date: 04/06/2010 -.\" Manual: MySQL Database System -.\" Source: MySQL 5.1 -.\" Language: English .\" -.TH "\FBMYSQL\&.SERVER\FR" "1" "04/06/2010" "MySQL 5\&.1" "MySQL Database System" +.TH "\FBMYSQL\&.SERVER\FR" "1" "04/08/2015" "MariaDB 10\&.0" "MariaDB Database System" .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- @@ -20,35 +13,33 @@ .\" ----------------------------------------------------------------- .\" mysql.server .SH "NAME" -mysql.server \- MySQL server startup script +mysql.server \- MariaDB server startup script .SH "SYNOPSIS" .HP \w'\fBmysql\ {start|stop}\fR\ 'u \fBmysql {start|stop}\fR .SH "DESCRIPTION" .PP -MySQL distributions on Unix include a script named -\fBmysql\&.server\fR\&. It can be used on systems such as Linux and Solaris that use System V\-style run directories to start and stop system services\&. It is also used by the Mac OS X Startup Item for MySQL\&. +MariaDB distributions on Unix include a script named +\fBmysql\&.server\fR\&. It can be used on systems such as Linux and Solaris that use System V\-style run directories to start and stop system services\&. It is also used by the Mac OS X Startup Item for MariaDB\&. .PP \fBmysql\&.server\fR can be found in the support\-files -directory under your MySQL installation directory or in a MySQL source distribution\&. +directory under your MariaDB installation directory or in a MariaDB source distribution\&. .PP If you use the Linux server RPM package (MySQL\-server\-\fIVERSION\fR\&.rpm), the \fBmysql\&.server\fR script will be installed in the /etc/init\&.d directory with the name -mysql\&. You need not install it manually\&. See -Section\ \&2.6.1, \(lqInstalling MySQL from RPM Packages on Linux\(rq, for more information on the Linux RPM packages\&. +mysql\&. You need not install it manually\&. .PP Some vendors provide RPM packages that install a startup script under a different name such as \fBmysqld\fR\&. .PP -If you install MySQL from a source distribution or using a binary distribution format that does not install +If you install MariaDB from a source distribution or using a binary distribution format that does not install \fBmysql\&.server\fR -automatically, you can install it manually\&. Instructions are provided in -Section\ \&2.13.1.2, \(lqStarting and Stopping MySQL Automatically\(rq\&. +automatically, you can install it manually\&. .PP \fBmysql\&.server\fR reads options from the @@ -58,8 +49,7 @@ and sections of option files\&. For backward compatibility, it also reads [mysql_server] sections, although you should rename such sections to -[mysql\&.server] -when using MySQL 5\&.1\&. +[mysql\&.server]&. .PP \fBmysql\&.server\fR supports the following options\&. @@ -76,7 +66,7 @@ supports the following options\&. .\" basedir option: mysql.server \fB\-\-basedir=\fR\fB\fIpath\fR\fR .sp -The path to the MySQL installation directory\&. +The path to the MariaDB installation directory\&. .RE .sp .RS 4 @@ -91,7 +81,7 @@ The path to the MySQL installation directory\&. .\" datadir option: mysql.server \fB\-\-datadir=\fR\fB\fIpath\fR\fR .sp -The path to the MySQL data directory\&. +The path to the MariaDB data directory\&. .RE .sp .RS 4 @@ -106,7 +96,7 @@ The path to the MySQL data directory\&. .\" pid-file option: mysql.server \fB\-\-pid\-file=\fR\fB\fIfile_name\fR\fR .sp -The path name of the file in which the server should write its process ID\&. +The path name of the file in which the server should write its process ID\&. If not provided, the default, "host_name.pid" is used. .RE .sp .RS 4 @@ -123,7 +113,7 @@ The path name of the file in which the server should write its process ID\&. .sp How long in seconds to wait for confirmation of server startup\&. If the server does not start within this time, \fBmysql\&.server\fR -exits with an error\&. The default value is 900\&. A value of 0 means not to wait at all for startup\&. Negative values mean to wait forever (no timeout)\&. This option was added in MySQL 5\&.1\&.17\&. Before that, a value of 900 is always used\&. +exits with an error\&. The default value is 900\&. A value of 0 means not to wait at all for startup\&. Negative values mean to wait forever (no timeout)\&. .RE .sp .RS 4 @@ -176,7 +166,7 @@ The login user name to use for running .SH "COPYRIGHT" .br .PP -Copyright 2007-2008 MySQL AB, 2008-2010 Sun Microsystems, Inc. +Copyright 2007-2008 MySQL AB, 2008-2010 Sun Microsystems, Inc., 2010-2015 MariaDB Foundation .PP This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. .PP @@ -185,8 +175,6 @@ This documentation is distributed in the hope that it will be useful, but WITHOU You should have received a copy of the GNU General Public License along with the program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or see http://www.gnu.org/licenses/. .sp .SH "SEE ALSO" -For more information, please refer to the MySQL Reference Manual, -which may already be installed locally and which is also available -online at http://dev.mysql.com/doc/. +For more information, please refer to the MariaDB Knowledge Base, available online at https://mariadb.com/kb/ .SH AUTHOR -Sun Microsystems, Inc. (http://www.mysql.com/). +MariaDB Foundation (http://www.mariadb.org/). diff --git a/man/mysql_client_test.1 b/man/mysql_client_test.1 index a366092012c..d28945bbbe7 100644 --- a/man/mysql_client_test.1 +++ b/man/mysql_client_test.1 @@ -1,13 +1,6 @@ '\" t -.\" Title: \fBmysql_client_test\fR -.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] -.\" Generator: DocBook XSL Stylesheets v1.75.2 -.\" Date: 03/31/2010 -.\" Manual: MySQL Database System -.\" Source: MySQL -.\" Language: English .\" -.TH "\FBMYSQL_CLIENT_TEST" "1" "03/31/2010" "MySQL" "MySQL Database System" +.TH "\FBMYSQL_CLIENT_TEST" "1" "04/08/2015" "MariaDB 10\&.0" "MariaDB Database System" .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- @@ -33,7 +26,7 @@ mysql_client_test_embedded \- test client API for embedded server .PP The \fBmysql_client_test\fR -program is used for testing aspects of the MySQL client API that cannot be tested using +program is used for testing aspects of the MariaDB client API that cannot be tested using \fBmysqltest\fR and its test language\&. \fBmysql_client_test_embedded\fR @@ -128,7 +121,7 @@ The database to use\&. \fB\-\-debug[=\fR\fB\fIdebug_options\fR\fR\fB]\fR, \fB\-#[\fR\fB\fIdebug_options\fR\fR\fB]\fR .sp -Write a debugging log if MySQL is built with debugging support\&. The default +Write a debugging log if MariaDB is built with debugging support\&. The default \fIdebug_options\fR value is \'d:t:o,/tmp/mysql_client_test\&.trace\'\&. @@ -165,7 +158,7 @@ library\&. \fB\-\-host=\fR\fB\fIhost_name\fR\fR, \fB\-h \fR\fB\fIhost_name\fR\fR .sp -Connect to the MySQL server on the given host\&. +Connect to the MariaDB server on the given host\&. .RE .sp .RS 4 @@ -304,7 +297,7 @@ may optionally behave in a different way than if called manually, for example by \fB\-\-user=\fR\fB\fIuser_name\fR\fR, \fB\-u \fR\fB\fIuser_name\fR\fR .sp -The MySQL user name to use when connecting to the server\&. +The MariaDB user name to use when connecting to the server\&. .RE .sp .RS 4 @@ -326,7 +319,7 @@ mysql\-test/var\&. .SH "COPYRIGHT" .br .PP -Copyright \(co 2007, 2010, Oracle and/or its affiliates +Copyright \(co 2007, 2010, Oracle and/or its affiliates, 2010-2015 MariaDB Foundation .PP This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. .PP @@ -335,8 +328,6 @@ This documentation is distributed in the hope that it will be useful, but WITHOU You should have received a copy of the GNU General Public License along with the program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or see http://www.gnu.org/licenses/. .sp .SH "SEE ALSO" -For more information, please refer to the MySQL Reference Manual, -which may already be installed locally and which is also available -online at http://dev.mysql.com/doc/. +For more information, please refer to the MariaDB Knowledge Base, available online at https://mariadb.com/kb/ .SH AUTHOR -Sun Microsystems, Inc. (http://www.mysql.com/). +MariaDB Foundation (http://www.mariadb.org/). diff --git a/man/mysql_config.1 b/man/mysql_config.1 index 86086e15f45..dd6df086c59 100644 --- a/man/mysql_config.1 +++ b/man/mysql_config.1 @@ -1,13 +1,6 @@ '\" t -.\" Title: \fBmysql_config\fR -.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] -.\" Generator: DocBook XSL Stylesheets v1.75.2 -.\" Date: 04/06/2010 -.\" Manual: MySQL Database System -.\" Source: MySQL 5.1 -.\" Language: English .\" -.TH "\FBMYSQL_CONFIG\FR" "1" "04/06/2010" "MySQL 5\&.1" "MySQL Database System" +.TH "\FBMYSQL_CONFIG\FR" "1" "04/08/2015" "MariaDB 10\&.0" "MariaDB Database System" .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- @@ -27,7 +20,7 @@ mysql_config \- get compile options for compiling clients .SH "DESCRIPTION" .PP \fBmysql_config\fR -provides you with useful information for compiling your MySQL client and connecting it to MySQL\&. +provides you with useful information for compiling your MariaDB client and connecting it to MariaDB\&. .PP \fBmysql_config\fR supports the following options\&. @@ -63,7 +56,7 @@ for more portable options that contain only include paths\&. .\" include option: mysql_config \fB\-\-include\fR .sp -Compiler options to find MySQL include files\&. +Compiler options to find MariaDB include files\&. .RE .sp .RS 4 @@ -81,7 +74,7 @@ Compiler options to find MySQL include files\&. \fB\-\-libmysqld\-libs\fR, \fB\-\-embedded\fR .sp -Libraries and options required to link with the MySQL embedded server\&. +Libraries and options required to link with the MariaDB embedded server\&. .RE .sp .RS 4 @@ -96,7 +89,7 @@ Libraries and options required to link with the MySQL embedded server\&. .\" libs option: mysql_config \fB\-\-libs\fR .sp -Libraries and options required to link with the MySQL client library\&. +Libraries and options required to link with the MariaDB client library\&. .RE .sp .RS 4 @@ -111,7 +104,7 @@ Libraries and options required to link with the MySQL client library\&. .\" libs_r option: mysql_config \fB\-\-libs_r\fR .sp -Libraries and options required to link with the thread\-safe MySQL client library\&. +Libraries and options required to link with the thread\-safe MariaDB client library\&. .RE .sp .RS 4 @@ -126,7 +119,7 @@ Libraries and options required to link with the thread\-safe MySQL client librar .\" plugindir option: mysql_config \fB\-\-plugindir\fR .sp -The default plugin directory path name, defined when configuring MySQL\&. This option was added in MySQL 5\&.1\&.24\&. +The default plugin directory path name, defined when configuring MariaDB\&. .RE .sp .RS 4 @@ -141,7 +134,7 @@ The default plugin directory path name, defined when configuring MySQL\&. This o .\" port option: mysql_config \fB\-\-port\fR .sp -The default TCP/IP port number, defined when configuring MySQL\&. +The default TCP/IP port number, defined when configuring MariaDB\&. .RE .sp .RS 4 @@ -156,7 +149,7 @@ The default TCP/IP port number, defined when configuring MySQL\&. .\" socket option: mysql_config \fB\-\-socket\fR .sp -The default Unix socket file, defined when configuring MySQL\&. +The default Unix socket file, defined when configuring MariaDB\&. .RE .sp .RS 4 @@ -171,7 +164,7 @@ The default Unix socket file, defined when configuring MySQL\&. .\" variable option: mysql_config \fB\-\-variable=VAR\fR .sp -Path to MySQL include, library and plugin directories\&. \fBVAR\fR is one of +Path to MariaDB include, library and plugin directories\&. \fBVAR\fR is one of `pkgincludedir`, `pkglibdir` and `plugindir`, respectively\&. .RE .sp @@ -187,7 +180,7 @@ Path to MySQL include, library and plugin directories\&. \fBVAR\fR is one of .\" version option: mysql_config \fB\-\-version\fR .sp -Version number for the MySQL distribution\&. +Version number for the MariaDB distribution\&. .RE .PP If you invoke @@ -219,7 +212,7 @@ Options: .PP You can use \fBmysql_config\fR -within a command line to include the value that it displays for a particular option\&. For example, to compile a MySQL client program, use +within a command line to include the value that it displays for a particular option\&. For example, to compile a MariaDB client program, use \fBmysql_config\fR as follows: .sp @@ -240,7 +233,7 @@ this way, be sure to invoke it within backtick (\(lq`\(rq) characters\&. That te .SH "COPYRIGHT" .br .PP -Copyright 2007-2008 MySQL AB, 2008-2010 Sun Microsystems, Inc. +Copyright 2007-2008 MySQL AB, 2008-2010 Sun Microsystems, Inc., 2010-2015 MariaDB Foundation .PP This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. .PP @@ -249,8 +242,6 @@ This documentation is distributed in the hope that it will be useful, but WITHOU You should have received a copy of the GNU General Public License along with the program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or see http://www.gnu.org/licenses/. .sp .SH "SEE ALSO" -For more information, please refer to the MySQL Reference Manual, -which may already be installed locally and which is also available -online at http://dev.mysql.com/doc/. +For more information, please refer to the MariaDB Knowledge Base, available online at https://mariadb.com/kb/ .SH AUTHOR -Sun Microsystems, Inc. (http://www.mysql.com/). +MariaDB Foundation (http://www.mariadb.org/). diff --git a/man/mysql_convert_table_format.1 b/man/mysql_convert_table_format.1 index bb4c76aac56..6fc03b59b23 100644 --- a/man/mysql_convert_table_format.1 +++ b/man/mysql_convert_table_format.1 @@ -1,13 +1,6 @@ '\" t -.\" Title: \fBmysql_convert_table_format\fR -.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] -.\" Generator: DocBook XSL Stylesheets v1.75.2 -.\" Date: 04/06/2010 -.\" Manual: MySQL Database System -.\" Source: MySQL 5.1 -.\" Language: English .\" -.TH "\FBMYSQL_CONVERT_TAB" "1" "04/06/2010" "MySQL 5\&.1" "MySQL Database System" +.TH "\FBMYSQL_CONVERT_TAB" "1" "04/08/2015" "MariaDB 10\&.0" "MariaDB Database System" .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- @@ -100,7 +93,7 @@ Continue even if errors occur\&. .\" host option: mysql_convert_table_format \fB\-\-host=\fR\fB\fIhost_name\fR\fR .sp -Connect to the MySQL server on the given host\&. +Connect to the MariaDB server on the given host\&. .RE .sp .RS 4 @@ -115,10 +108,9 @@ Connect to the MySQL server on the given host\&. .\" password option: mysql_convert_table_format \fB\-\-password=\fR\fB\fIpassword\fR\fR .sp -The password to use when connecting to the server\&. Note that the password value is not optional for this option, unlike for other MySQL programs\&. +The password to use when connecting to the server\&. Note that the password value is not optional for this option, unlike for other MariaDB programs\&. .sp -Specifying a password on the command line should be considered insecure\&. See -Section\ \&5.3.2.2, \(lqEnd-User Guidelines for Password Security\(rq\&. You can use an option file to avoid giving the password on the command line\&. +Specifying a password on the command line should be considered insecure\&. You can use an option file to avoid giving the password on the command line\&. .RE .sp .RS 4 @@ -181,7 +173,7 @@ if this option is not given\&. .\" user option: mysql_convert_table_format \fB\-\-user=\fR\fB\fIuser_name\fR\fR .sp -The MySQL user name to use when connecting to the server\&. +The MariaDB user name to use when connecting to the server\&. .RE .sp .RS 4 @@ -216,7 +208,7 @@ Display version information and exit\&. .SH "COPYRIGHT" .br .PP -Copyright 2007-2008 MySQL AB, 2008-2010 Sun Microsystems, Inc. +Copyright 2007-2008 MySQL AB, 2008-2010 Sun Microsystems, Inc., 2010-2015 MariaDB Foundation .PP This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. .PP @@ -225,8 +217,6 @@ This documentation is distributed in the hope that it will be useful, but WITHOU You should have received a copy of the GNU General Public License along with the program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or see http://www.gnu.org/licenses/. .sp .SH "SEE ALSO" -For more information, please refer to the MySQL Reference Manual, -which may already be installed locally and which is also available -online at http://dev.mysql.com/doc/. +For more information, please refer to the MariaDB Knowledge Base, available online at https://mariadb.com/kb/ .SH AUTHOR -Sun Microsystems, Inc. (http://www.mysql.com/). +MariaDB Foundation (http://www.mariadb.org/). diff --git a/man/mysql_find_rows.1 b/man/mysql_find_rows.1 index 50c3e38be32..fd3ea25c502 100644 --- a/man/mysql_find_rows.1 +++ b/man/mysql_find_rows.1 @@ -1,13 +1,6 @@ '\" t -.\" Title: \fBmysql_find_rows\fR -.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] -.\" Generator: DocBook XSL Stylesheets v1.75.2 -.\" Date: 04/06/2010 -.\" Manual: MySQL Database System -.\" Source: MySQL 5.1 -.\" Language: English .\" -.TH "\FBMYSQL_FIND_ROWS\F" "1" "04/06/2010" "MySQL 5\&.1" "MySQL Database System" +.TH "\FBMYSQL_FIND_ROWS\F" "1" "04/08/2015" "MariaDB 10\&.0" "MariaDB Database System" .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- @@ -151,7 +144,7 @@ Start output from this row\&. .SH "COPYRIGHT" .br .PP -Copyright 2007-2008 MySQL AB, 2008-2010 Sun Microsystems, Inc. +Copyright 2007-2008 MySQL AB, 2008-2010 Sun Microsystems, Inc., 2010-2015 MariaDB Foundation .PP This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. .PP @@ -160,8 +153,6 @@ This documentation is distributed in the hope that it will be useful, but WITHOU You should have received a copy of the GNU General Public License along with the program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or see http://www.gnu.org/licenses/. .sp .SH "SEE ALSO" -For more information, please refer to the MySQL Reference Manual, -which may already be installed locally and which is also available -online at http://dev.mysql.com/doc/. +For more information, please refer to the MariaDB Knowledge Base, available online at https://mariadb.com/kb/ .SH AUTHOR -Sun Microsystems, Inc. (http://www.mysql.com/). +MariaDB Foundation (http://www.mariadb.org/). diff --git a/man/mysql_fix_extensions.1 b/man/mysql_fix_extensions.1 index fa66348d24c..f53d103055c 100644 --- a/man/mysql_fix_extensions.1 +++ b/man/mysql_fix_extensions.1 @@ -1,13 +1,6 @@ '\" t -.\" Title: \fBmysql_fix_extensions\fR -.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] -.\" Generator: DocBook XSL Stylesheets v1.75.2 -.\" Date: 04/06/2010 -.\" Manual: MySQL Database System -.\" Source: MySQL 5.1 -.\" Language: English .\" -.TH "\FBMYSQL_FIX_EXTENSI" "1" "04/06/2010" "MySQL 5\&.1" "MySQL Database System" +.TH "\FBMYSQL_FIX_EXTENSI" "1" "04/08/2015" "MariaDB 10\&.0" "MariaDB Database System" .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- @@ -61,7 +54,7 @@ shell> \fBmysql_fix_extensions \fR\fB\fIdata_dir\fR\fR .SH "COPYRIGHT" .br .PP -Copyright 2007-2008 MySQL AB, 2008-2010 Sun Microsystems, Inc. +Copyright 2007-2008 MySQL AB, 2008-2010 Sun Microsystems, Inc., 2010-2015 MariaDB Foundation .PP This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. .PP @@ -70,8 +63,6 @@ This documentation is distributed in the hope that it will be useful, but WITHOU You should have received a copy of the GNU General Public License along with the program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or see http://www.gnu.org/licenses/. .sp .SH "SEE ALSO" -For more information, please refer to the MySQL Reference Manual, -which may already be installed locally and which is also available -online at http://dev.mysql.com/doc/. +For more information, please refer to the MariaDB Knowledge Base, available online at https://mariadb.com/kb/ .SH AUTHOR -Sun Microsystems, Inc. (http://www.mysql.com/). +MariaDB Foundation (http://www.mariadb.org/). diff --git a/man/mysql_install_db.1 b/man/mysql_install_db.1 index ff3b216f6da..fa0c86f6568 100644 --- a/man/mysql_install_db.1 +++ b/man/mysql_install_db.1 @@ -1,13 +1,6 @@ '\" t -.\" Title: \fBmysql_install_db\fR -.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] -.\" Generator: DocBook XSL Stylesheets v1.75.2 -.\" Date: 04/06/2010 -.\" Manual: MySQL Database System -.\" Source: MySQL 5.1 -.\" Language: English .\" -.TH "\FBMYSQL_INSTALL_DB\" "1" "04/06/2010" "MySQL 5\&.1" "MySQL Database System" +.TH "\FBMYSQL_INSTALL_DB\" "1" "04/08/2015" "MariaDB 10\&.0" "MariaDB Database System" .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- @@ -20,14 +13,14 @@ .\" ----------------------------------------------------------------- .\" mysql_install_db .SH "NAME" -mysql_install_db \- initialize MySQL data directory +mysql_install_db \- initialize MariaDB data directory .SH "SYNOPSIS" .HP \w'\fBmysql_install_db\ [\fR\fB\fIoptions\fR\fR\fB]\fR\ 'u \fBmysql_install_db [\fR\fB\fIoptions\fR\fR\fB]\fR .SH "DESCRIPTION" .PP \fBmysql_install_db\fR -initializes the MySQL data directory and creates the system tables that it contains, if they do not exist\&. +initializes the MariaDB data directory and creates the system tables that it contains, if they do not exist\&. .PP To invoke \fBmysql_install_db\fR, use the following syntax: @@ -42,7 +35,7 @@ shell> \fBmysql_install_db [\fR\fB\fIoptions\fR\fR\fB]\fR .RE .\} .PP -Because the MySQL server, +Because the MariaDB server, \fBmysqld\fR, needs to access the data directory when it runs later, you should either run \fBmysql_install_db\fR from the same account that will be used for running @@ -81,7 +74,7 @@ with the and \fB\-\-skip\-grant\-tables\fR options (see -Section\ \&2.3.2, \(lqTypical configure Options\(rq)\&. If MySQL was configured with the +Section\ \&2.3.2, \(lqTypical configure Options\(rq)\&. If MariaDB was configured with the \fB\-\-disable\-grant\-options\fR option, \fB\-\-bootstrap\fR @@ -113,7 +106,88 @@ option file groups\&. .\" basedir option: mysql_install_db \fB\-\-basedir=\fR\fB\fIpath\fR\fR .sp -The path to the MySQL installation directory\&. +The path to the MariaDB installation directory\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +.\" mysql_install_db: builddir option +.\" builddir option: mysql_install_db +\fB\-\-builddir=\fIpath\fR +.sp +If using \fB--srcdir\fR with out-of-directory builds, you will need to set this +to the location of the build directory where built files reside.\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +.\" mysql_install_db: cross-bootstrap option +.\" cross-bootstrap option: mysql_install_db +\fB\-\-cross\-bootstrap\fR +.sp +For internal use. Used when building the MariaDB system tables on a different host than the target.\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +.\" mysql_install_db: datadir option +.\" datadir option: mysql_install_db +.\" mysql_install_db: ldata option +.\" ldata option: mysql_install_db +\fB\-\-datadir=\fR\fB\fIpath\fR\fR, +\fB\-\-ldata=\fR\fB\fIpath\fR\fR +.sp +The path to the MariaDB data directory\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +.\" mysqlcheck: defaults-extra-file option +.\" defaults-extra-file option: mysqlcheck +\fB\-\-defaults\-extra\-file=\fR\fB\fIfilename\fR\fR +.sp +Set \fB\fIfilename\fR\fR as the file to read default options from after the global defaults files has been read\&. +Must be given as first option\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +.\" mysqlcheck: defaults-file option +.\" defaults-file option: mysqlcheck +\fB\-\-defaults\-file=\fR\fB\fIfilename\fR\fR +.sp +Set \fB\fIfilename\fR\fR as the file to read default options from, override global defaults files\&. +Must be given as first option\&. .RE .sp .RS 4 @@ -141,14 +215,42 @@ to run even if DNS does not work\&. In that case, grant table entries that norma .sp -1 .IP \(bu 2.3 .\} -.\" mysql_install_db: datadir option -.\" datadir option: mysql_install_db -.\" mysql_install_db: ldata option -.\" ldata option: mysql_install_db -\fB\-\-datadir=\fR\fB\fIpath\fR\fR, -\fB\-\-ldata=\fR\fB\fIpath\fR\fR +.\" mysqlcheck: help option +.\" help option: mysqlcheck +\fB\-\-help\fR .sp -The path to the MySQL data directory\&. +Display a help message and exit\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +.\" mysqlcheck: no-defaults option +.\" no-defaults option: mysqlcheck +\fB\-\-no\-defaults\fR +.sp +Do not read default options from any option file\&. This must be given as the first argument\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +.\" mysqlcheck: print-defaults option +.\" print-defaults option: mysqlcheck +\fB\-\-print\-defaults\fR +.sp +Print the program argument list and exit\&. +This must be given as the first argument\&. .RE .sp .RS 4 @@ -163,7 +265,7 @@ The path to the MySQL data directory\&. .\" rpm option: mysql_install_db \fB\-\-rpm\fR .sp -For internal use\&. This option is used by RPM files during the MySQL installation process\&. +For internal use\&. This option is used by RPM files during the MariaDB installation process\&. .RE .sp .RS 4 @@ -195,7 +297,7 @@ Use IP addresses rather than host names when creating grant table entries\&. Thi .sp For internal use\&. The directory under which \fBmysql_install_db\fR -looks for support files such as the error message file and the file for populating the help tables\&. This option was added in MySQL 5\&.1\&.14\&. +looks for support files such as the error message file and the file for populating the help tables\&.4\&. .RE .sp .RS 4 @@ -252,7 +354,7 @@ For internal use\&. This option is used for creating Windows distributions\&. .SH "COPYRIGHT" .br .PP -Copyright 2007-2008 MySQL AB, 2008-2010 Sun Microsystems, Inc. +Copyright 2007-2008 MySQL AB, 2008-2010 Sun Microsystems, Inc., 2010-2015 MariaDB Foundation .PP This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. .PP @@ -261,8 +363,6 @@ This documentation is distributed in the hope that it will be useful, but WITHOU You should have received a copy of the GNU General Public License along with the program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or see http://www.gnu.org/licenses/. .sp .SH "SEE ALSO" -For more information, please refer to the MySQL Reference Manual, -which may already be installed locally and which is also available -online at http://dev.mysql.com/doc/. +For more information, please refer to the MariaDB Knowledge Base, available online at https://mariadb.com/kb/ .SH AUTHOR -Sun Microsystems, Inc. (http://www.mysql.com/). +MariaDB Foundation (http://www.mariadb.org/). diff --git a/man/mysql_plugin.1 b/man/mysql_plugin.1 index fe4fd137006..c30cd96362c 100644 --- a/man/mysql_plugin.1 +++ b/man/mysql_plugin.1 @@ -1,13 +1,6 @@ '\" t -.\" Title: \fBmysql_plugin\fR -.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] -.\" Generator: DocBook XSL Stylesheets v1.77.1 -.\" Date: 01/16/2013 -.\" Manual: MySQL Database System -.\" Source: MySQL 5.5 -.\" Language: English .\" -.TH "\FBMYSQL_PLUGIN\FR" "1" "01/16/2013" "MySQL 5\&.5" "MySQL Database System" +.TH "\FBMYSQL_PLUGIN\FR" "1" "04/08/2015" "MariaDB 10\&.0" "MariaDB Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -29,7 +22,7 @@ .\" ----------------------------------------------------------------- .\" mysql_plugin .SH "NAME" -mysql_plugin \- configure MySQL server plugins +mysql_plugin \- configure MariaDB server plugins .SH "SYNOPSIS" .HP \w'\fBmysql_plugin\ [\fR\fB\fIoptions\fR\fR\fB]\ \fR\fB\fIplugin\fR\fR\fB\ {ENABLE|DISABLE}\fR\ 'u \fBmysql_plugin [\fR\fB\fIoptions\fR\fR\fB] \fR\fB\fIplugin\fR\fR\fB {ENABLE|DISABLE}\fR @@ -37,15 +30,13 @@ mysql_plugin \- configure MySQL server plugins .PP The \fBmysql_plugin\fR -utility enables MySQL administrators to manage which plugins a MySQL server loads\&. It provides an alternative to manually specifying the +utility enables MariaDB administrators to manage which plugins a MariaDB server loads\&. It provides an alternative to manually specifying the \fB\-\-plugin\-load\fR option at server startup or using the INSTALL PLUGIN and UNINSTALL PLUGIN statements at runtime\&. -\fBmysql_plugin\fR -is available as of MySQL 5\&.5\&.16\&. .PP Depending on whether \fBmysql_plugin\fR @@ -53,12 +44,11 @@ is invoked to enable or disable plugins, it inserts or deletes rows in the mysql\&.plugin table that serves as a plugin registry\&. (To perform this operation, \fBmysql_plugin\fR -invokes the MySQL server in bootstrap mode\&. This means that the server must not already be running\&.) For normal server startups, the server loads and enables plugins listed in +invokes the MariaDB server in bootstrap mode\&. This means that the server must not already be running\&.) For normal server startups, the server loads and enables plugins listed in mysql\&.plugin automatically\&. For additional control over plugin activation, use \fB\-\-\fR\fB\fIplugin_name\fR\fR -options named for specific plugins, as described in -Section\ \&5.1.8.1, \(lqInstalling and Uninstalling Plugins\(rq\&. +options named for specific plugins\&. .PP Each invocation of \fBmysql_plugin\fR @@ -150,7 +140,7 @@ An error occurs if \fBmysql_plugin\fR cannot find the configuration file or plugin library file, or if \fBmysql_plugin\fR -cannot start the MySQL server\&. +cannot start the MariaDB server\&. .PP \fBmysql_plugin\fR supports the following options, which can be specified on the command line or in the @@ -163,8 +153,7 @@ recognizes the \fB\-\-basedir\fR, \fB\-\-datadir\fR, and \fB\-\-plugin\-dir\fR -options and ignores others\&. For information about option files, see -Section\ \&4.2.3.3, \(lqUsing Option Files\(rq\&. +options and ignores others\&. .PP mysql_plugin Options .sp @@ -268,7 +257,7 @@ server\&. Do not read values from the configuration file\&. This option enables an administrator to skip reading defaults from the configuration file\&. .sp With -\fBmysql_plugin\fR, this option need not be given first on the command line, unlike most other MySQL programs that support +\fBmysql_plugin\fR, this option need not be given first on the command line, unlike most other MariaDB programs that support \fB\-\-no\-defaults\fR\&. .RE .sp @@ -334,7 +323,7 @@ to print the defaults for if they are found in the configuration file\&. If no value for a variable is found, nothing is shown\&. .sp With -\fBmysql_plugin\fR, this option need not be given first on the command line, unlike most other MySQL programs that support +\fBmysql_plugin\fR, this option need not be given first on the command line, unlike most other MariaDB programs that support \fB\-\-print\-defaults\fR\&. .RE .sp @@ -372,7 +361,7 @@ Display version information and exit\&. .SH "COPYRIGHT" .br .PP -Copyright \(co 1997, 2013, Oracle and/or its affiliates. All rights reserved. +Copyright \(co 1997, 2013, Oracle and/or its affiliates. All rights reserved., 2013-2015 MariaDB Foundation .PP This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. .PP @@ -381,8 +370,6 @@ This documentation is distributed in the hope that it will be useful, but WITHOU You should have received a copy of the GNU General Public License along with the program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or see http://www.gnu.org/licenses/. .sp .SH "SEE ALSO" -For more information, please refer to the MySQL Reference Manual, -which may already be installed locally and which is also available -online at http://dev.mysql.com/doc/. +For more information, please refer to the MariaDB Knowledge Base, available online at https://mariadb.com/kb/ .SH AUTHOR -Oracle Corporation (http://dev.mysql.com/). +MariaDB Foundation (http://www.mariadb.org/). diff --git a/man/mysql_secure_installation.1 b/man/mysql_secure_installation.1 index 6345aa18d9f..20a77bc3f1e 100644 --- a/man/mysql_secure_installation.1 +++ b/man/mysql_secure_installation.1 @@ -1,13 +1,6 @@ '\" t -.\" Title: \fBmysql_secure_installation\fR -.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] -.\" Generator: DocBook XSL Stylesheets v1.75.2 -.\" Date: 04/06/2010 -.\" Manual: MySQL Database System -.\" Source: MySQL 5.1 -.\" Language: English .\" -.TH "\FBMYSQL_SECURE_INST" "1" "04/06/2010" "MySQL 5\&.1" "MySQL Database System" +.TH "\FBMYSQL_SECURE_INST" "1" "04/08/2015" "MariaDB 10\&.0" "MariaDB Database System" .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- @@ -20,13 +13,13 @@ .\" ----------------------------------------------------------------- .\" mysql_secure_installation .SH "NAME" -mysql_secure_installation \- improve MySQL installation security +mysql_secure_installation \- improve MariaDB installation security .SH "SYNOPSIS" .HP \w'\fBmysql_secure_installation\fR\ 'u \fBmysql_secure_installation\fR .SH "DESCRIPTION" .PP -This program enables you to improve the security of your MySQL installation in the following ways: +This program enables you to improve the security of your MariaDB installation in the following ways: .sp .RS 4 .ie n \{\ @@ -96,7 +89,7 @@ The script will prompt you to determine which actions to perform\&. .SH "COPYRIGHT" .br .PP -Copyright 2007-2008 MySQL AB, 2008-2010 Sun Microsystems, Inc. +Copyright 2007-2008 MySQL AB, 2008-2010 Sun Microsystems, Inc., 2010-2015 MariaDB Foundation .PP This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. .PP @@ -105,8 +98,6 @@ This documentation is distributed in the hope that it will be useful, but WITHOU You should have received a copy of the GNU General Public License along with the program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or see http://www.gnu.org/licenses/. .sp .SH "SEE ALSO" -For more information, please refer to the MySQL Reference Manual, -which may already be installed locally and which is also available -online at http://dev.mysql.com/doc/. +For more information, please refer to the MariaDB Knowledge Base, available online at https://mariadb.com/kb/ .SH AUTHOR -Sun Microsystems, Inc. (http://www.mysql.com/). +MariaDB Foundation (http://www.mariadb.org/). diff --git a/man/mysql_setpermission.1 b/man/mysql_setpermission.1 index 303d247cc55..fca322ef2e2 100644 --- a/man/mysql_setpermission.1 +++ b/man/mysql_setpermission.1 @@ -1,13 +1,6 @@ '\" t -.\" Title: \fBmysql_setpermission\fR -.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] -.\" Generator: DocBook XSL Stylesheets v1.75.2 -.\" Date: 04/06/2010 -.\" Manual: MySQL Database System -.\" Source: MySQL 5.1 -.\" Language: English .\" -.TH "\FBMYSQL_SETPERMISSI" "1" "04/06/2010" "MySQL 5\&.1" "MySQL Database System" +.TH "\FBMYSQL_SETPERMISSI" "1" "04/08/2015" "MariaDB 10\&.0" "MariaDB Database System" .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- @@ -27,14 +20,13 @@ mysql_setpermission \- interactively set permissions in grant tables .SH "DESCRIPTION" .PP \fBmysql_setpermission\fR -is a Perl script that was originally written and contributed by Luuk de Boer\&. It interactively sets permissions in the MySQL grant tables\&. +is a Perl script that was originally written and contributed by Luuk de Boer\&. It interactively sets permissions in the MariaDB grant tables\&. \fBmysql_setpermission\fR is written in Perl and requires that the DBI and DBD::mysql -Perl modules be installed (see -Section\ \&2.15, \(lqPerl Installation Notes\(rq)\&. +Perl modules be installed\&. .PP Invoke \fBmysql_setpermission\fR @@ -53,9 +45,9 @@ shell> \fBmysql_setpermission [\fR\fB\fIoptions\fR\fR\fB]\fR \fIoptions\fR should be either \fB\-\-help\fR -to display the help message, or options that indicate how to connect to the MySQL server\&. The account used when you connect determines which permissions you have when attempting to modify existing permissions in the grant tables\&. +to display the help message, or options that indicate how to connect to the MariaDB server\&. The account used when you connect determines which permissions you have when attempting to modify existing permissions in the grant tables\&. .PP -\fBmysql_setpermissions\fR +\fBmysql_setpermission\fR also reads options from the [client] and @@ -94,7 +86,7 @@ Display a help message and exit\&. .\" host option: mysql_setpermission \fB\-\-host=\fR\fB\fIhost_name\fR\fR .sp -Connect to the MySQL server on the given host\&. +Connect to the MariaDB server on the given host\&. .RE .sp .RS 4 @@ -109,10 +101,9 @@ Connect to the MySQL server on the given host\&. .\" password option: mysql_setpermission \fB\-\-password=\fR\fB\fIpassword\fR\fR .sp -The password to use when connecting to the server\&. Note that the password value is not optional for this option, unlike for other MySQL programs\&. +The password to use when connecting to the server\&. Note that the password value is not optional for this option, unlike for other MariaDB programs\&. .sp -Specifying a password on the command line should be considered insecure\&. See -Section\ \&5.3.2.2, \(lqEnd-User Guidelines for Password Security\(rq\&. You can use an option file to avoid giving the password on the command line\&. +Specifying a password on the command line should be considered insecure\&. You can use an option file to avoid giving the password on the command line\&. .RE .sp .RS 4 @@ -158,12 +149,12 @@ localhost, the Unix socket file to use\&. .\" user option: mysql_setpermission \fB\-\-user=\fR\fB\fIuser_name\fR\fR .sp -The MySQL user name to use when connecting to the server\&. +The MariaDB user name to use when connecting to the server\&. .RE .SH "COPYRIGHT" .br .PP -Copyright 2007-2008 MySQL AB, 2008-2010 Sun Microsystems, Inc. +Copyright 2007-2008 MySQL AB, 2008-2010 Sun Microsystems, Inc., 2010-2015 MariaDB Foundation .PP This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. .PP @@ -172,8 +163,6 @@ This documentation is distributed in the hope that it will be useful, but WITHOU You should have received a copy of the GNU General Public License along with the program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or see http://www.gnu.org/licenses/. .sp .SH "SEE ALSO" -For more information, please refer to the MySQL Reference Manual, -which may already be installed locally and which is also available -online at http://dev.mysql.com/doc/. +For more information, please refer to the MariaDB Knowledge Base, available online at https://mariadb.com/kb/ .SH AUTHOR -Sun Microsystems, Inc. (http://www.mysql.com/). +MariaDB Foundation (http://www.mariadb.org/). diff --git a/man/mysql_tzinfo_to_sql.1 b/man/mysql_tzinfo_to_sql.1 index 5b85d51acd1..1b002a62ea2 100644 --- a/man/mysql_tzinfo_to_sql.1 +++ b/man/mysql_tzinfo_to_sql.1 @@ -1,13 +1,6 @@ '\" t -.\" Title: \fBmysql_tzinfo_to_sql\fR -.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] -.\" Generator: DocBook XSL Stylesheets v1.75.2 -.\" Date: 04/06/2010 -.\" Manual: MySQL Database System -.\" Source: MySQL 5.1 -.\" Language: English .\" -.TH "\FBMYSQL_TZINFO_TO_S" "1" "04/06/2010" "MySQL 5\&.1" "MySQL Database System" +.TH "\FBMYSQL_TZINFO_TO_S" "1" "04/08/2015" "MariaDB 10\&.0" "MariaDB Database System" .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- @@ -36,8 +29,7 @@ zoneinfo database (the set of files describing time zones)\&. Examples of such systems are Linux, FreeBSD, Solaris, and Mac OS X\&. One likely location for these files is the /usr/share/zoneinfo directory (/usr/share/lib/zoneinfo -on Solaris)\&. If your system does not have a zoneinfo database, you can use the downloadable package described in -Section\ \&9.6, \(lqMySQL Server Time Zone Support\(rq\&. +on Solaris)\&. .PP \fBmysql_tzinfo_to_sql\fR can be invoked several ways: @@ -113,7 +105,7 @@ After running .SH "COPYRIGHT" .br .PP -Copyright 2007-2008 MySQL AB, 2008-2010 Sun Microsystems, Inc. +Copyright 2007-2008 MySQL AB, 2008-2010 Sun Microsystems, Inc., 2010-2015 MariaDB Foundation .PP This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. .PP @@ -122,8 +114,6 @@ This documentation is distributed in the hope that it will be useful, but WITHOU You should have received a copy of the GNU General Public License along with the program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or see http://www.gnu.org/licenses/. .sp .SH "SEE ALSO" -For more information, please refer to the MySQL Reference Manual, -which may already be installed locally and which is also available -online at http://dev.mysql.com/doc/. +For more information, please refer to the MariaDB Knowledge Base, available online at https://mariadb.com/kb/ .SH AUTHOR -Sun Microsystems, Inc. (http://www.mysql.com/). +MariaDB Foundation (http://www.mariadb.org/). diff --git a/man/mysql_upgrade.1 b/man/mysql_upgrade.1 index 6349f927e09..3948a670436 100644 --- a/man/mysql_upgrade.1 +++ b/man/mysql_upgrade.1 @@ -1,13 +1,6 @@ '\" t -.\" Title: \fBmysql_upgrade\fR -.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] -.\" Generator: DocBook XSL Stylesheets v1.75.2 -.\" Date: 04/06/2010 -.\" Manual: MySQL Database System -.\" Source: MySQL 5.1 -.\" Language: English .\" -.TH "\FBMYSQL_UPGRADE\FR" "1" "04/06/2010" "MySQL 5\&.1" "MySQL Database System" +.TH "\FBMYSQL_UPGRADE\FR" "1" "04/08/2015" "MariaDB 10\&.0" "MariaDB Database System" .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- @@ -22,27 +15,23 @@ .\" upgrading MySQL .\" MySQL: upgrading .SH "NAME" -mysql_upgrade \- check tables for MySQL upgrade +mysql_upgrade \- check tables for MariaDB upgrade .SH "SYNOPSIS" .HP \w'\fBmysql_upgrade\ [\fR\fB\fIoptions\fR\fR\fB]\fR\ 'u \fBmysql_upgrade [\fR\fB\fIoptions\fR\fR\fB]\fR .SH "DESCRIPTION" .PP \fBmysql_upgrade\fR -examines all tables in all databases for incompatibilities with the current version of MySQL Server\&. +examines all tables in all databases for incompatibilities with the current version of the MariaDB Server\&. \fBmysql_upgrade\fR also upgrades the system tables so that you can take advantage of new privileges or capabilities that might have been added\&. .PP \fBmysql_upgrade\fR -should be executed each time you upgrade MySQL\&. It supersedes the older -\fBmysql_fix_privilege_tables\fR -script, which should no longer be used\&. +should be executed each time you upgrade MariaDB\&. .PP If a table is found to have a possible incompatibility, \fBmysql_upgrade\fR -performs a table check\&. If any problems are found, a table repair is attempted\&. If the table cannot be repaired, see -Section\ \&2.4.4, \(lqRebuilding or Repairing Tables or Indexes\(rq -for manual table repair strategies\&. +performs a table check\&. If any problems are found, a table repair is attempted\&. .if n \{\ .sp .\} @@ -74,14 +63,9 @@ with administrator privileges\&. You can do this by running a Command Prompt as .ps -1 .br .PP -You should always back up your current MySQL installation +You should always back up your current MariaDB installation \fIbefore\fR -performing an upgrade\&. See -Section\ \&6.2, \(lqDatabase Backup Methods\(rq\&. -.PP -Some upgrade incompatibilities may require special handling before you upgrade your MySQL installation and run -\fBmysql_upgrade\fR\&. See -Section\ \&2.4.1, \(lqUpgrading MySQL\(rq, for instructions on determining whether any such incompatibilities apply to your installation and how to handle them\&. +performing an upgrade\&. .sp .5v .RE .PP @@ -149,8 +133,7 @@ option entails, see the description of the FOR UPGRADE option of the CHECK TABLE -statement (see -Section\ \&12.4.2.3, \(lqCHECK TABLE Syntax\(rq)\&. +statement\&. .RE .sp .RS 4 @@ -168,52 +151,25 @@ that contains SQL statements to upgrade the tables in the mysql database\&. .RE -.sp -.RS 4 -.ie n \{\ -\h'-04'\(bu\h'+03'\c -.\} -.el \{\ -.sp -1 -.IP \(bu 2.3 -.\} -Prior to MySQL 5\&.1\&.31, -\fBmysql_upgrade\fR -does not run the second -\fBmysqlcheck\fR -command, which is necessary to re\-encode database or table names that contain nonalphanumeric characters\&. (They still appear after the upgrade with the -#mysql50# -prefix described in -Section\ \&8.2.3, \(lqMapping of Identifiers to File Names\(rq\&.) If you have such database or table names, execute the second -\fBmysqlcheck\fR -command manually after executing -\fBmysql_upgrade\fR\&. -.RE .PP -All checked and repaired tables are marked with the current MySQL version number\&. This ensures that next time you run +All checked and repaired tables are marked with the current MariaDB version number\&. This ensures that next time you run \fBmysql_upgrade\fR with the same version of the server, it can tell whether there is any need to check or repair the table again\&. .\" mysql_upgrade_info file: mysql_upgrade .\" mysql_upgrade: mysql_upgrade_info file .PP \fBmysql_upgrade\fR -also saves the MySQL version number in a file named +also saves the MariaDB version number in a file named mysql_upgrade_info in the data directory\&. This is used to quickly check whether all tables have been checked for this release so that table\-checking can be skipped\&. To ignore this file and perform the check regardless, use the \fB\-\-force\fR option\&. .PP -If you install MySQL from RPM packages on Linux, you must install the server and client RPMs\&. +If you install MariaDB from RPM packages on Linux, you must install the server and client RPMs\&. \fBmysql_upgrade\fR is included in the server RPM but requires the client RPM because the latter includes -\fBmysqlcheck\fR\&. (See -Section\ \&2.6.1, \(lqInstalling MySQL from RPM Packages on Linux\(rq\&.) +\fBmysqlcheck\fR\&. .PP -In MySQL 5\&.1\&.7, -\fBmysql_upgrade \fR -was added as a shell script and worked only for Unix systems\&. As of MySQL 5\&.1\&.10, -\fBmysql_upgrade\fR -is an executable binary and is available on all systems\&. .PP \fBmysql_upgrade\fR supports the following options, which can be specified on the command line or in the @@ -225,8 +181,7 @@ option file groups\&. Other options are passed to \fB\-\-password[=\fR\fB\fIpassword\fR\fR\fB]\fR option\&. \fBmysql_upgrade\fR -also supports the options for processing option files described at -Section\ \&4.2.3.3.1, \(lqCommand-Line Options that Affect Option-File Handling\(rq\&. +also supports the options for processing option files\&. .sp .RS 4 .ie n \{\ @@ -238,7 +193,8 @@ Section\ \&4.2.3.3.1, \(lqCommand-Line Options that Affect Option-File Handling\ .\} .\" mysql_upgrade: help option .\" help option: mysql_upgrade -\fB\-\-help\fR +\fB\-\-help\fR, +\fB\-?\fR .sp Display a short help message and exit\&. .RE @@ -255,7 +211,22 @@ Display a short help message and exit\&. .\" basedir option: mysql_upgrade \fB\-\-basedir=\fR\fB\fIpath\fR\fR .sp -The path to the MySQL installation directory\&. This option is accepted for backward compatibility but ignored\&. +Old option accepted for backward compatibility but ignored\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +.\" mysql_upgrade: character-sets-dir option +.\" character-sets-dir option: mysql_upgrade +\fB\-\-character\-sets\-dir=\fR\fB\fIpath\fR\fR +.sp +Old option accepted for backward compatibility but ignored\&. .RE .sp .RS 4 @@ -270,7 +241,23 @@ The path to the MySQL installation directory\&. This option is accepted for back .\" datadir option: mysql_upgrade \fB\-\-datadir=\fR\fB\fIpath\fR\fR .sp -The path to the data directory\&. This option is accepted for backward compatibility but ignored\&. +Old option accepted for backward compatibility but ignored\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +.\" mysql_upgrade: debug option +.\" debug option: mysql_upgrade +\fB\-\-debug=\fR\fB\fIpath\fR\fR, +\fB\-# \fIpath\fR\fR +.sp +For debug builds, output debug log\&. .RE .sp .RS 4 @@ -285,7 +272,7 @@ The path to the data directory\&. This option is accepted for backward compatibi .\" debug-check option: mysql_upgrade \fB\-\-debug\-check\fR .sp -Print some debugging information when the program exits\&. This option was added in MySQL 5\&.1\&.21\&. +Print some debugging information when the program exits\&. .RE .sp .RS 4 @@ -301,7 +288,22 @@ Print some debugging information when the program exits\&. This option was added \fB\-\-debug\-info\fR, \fB\-T\fR .sp -Print debugging information and memory and CPU usage statistics when the program exits\&. This option was added in MySQL 5\&.1\&.21\&. +Print debugging information and memory and CPU usage statistics when the program exits\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +.\" mysql_upgrade: default-character-set option +.\" default-character-set option: mysql_upgrade +\fB\-\-default\-character\-set=\fR\fB\fIname\fR\fR +.sp +Old option accepted for backward compatibility but ignored\&. .RE .sp .RS 4 @@ -322,7 +324,256 @@ file and force execution of \fBmysqlcheck\fR even if \fBmysql_upgrade\fR -has already been executed for the current version of MySQL\&. +has already been executed for the current version of MariaDB\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +.\" mysql_upgrade: host option +.\" host option: mysql_upgrade +\fB\-\-host\fR +.sp +Connect to MariaDB on the given host\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +.\" mysql_upgrade: password option +.\" password option: mysql_upgrade +\fB\-\-password[=\fR\fB\fIpassword\fR\fR\fB]\fR, +\fB\-p[\fR\fB\fIpassword\fR\fR\fB]\fR +.sp +The password to use when connecting to the server\&. If you use the short option form (\fB\-p\fR), you +\fIcannot\fR +have a space between the option and the password\&. If you omit the +\fIpassword\fR +value following the +\fB\-\-password\fR +or +\fB\-p\fR +option on the command line, +\fBmysql_upgrade\fR +prompts for one\&. +.sp +Specifying a password on the command line should be considered insecure\&. You can use an option file to avoid giving the password on the command line\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +.\" mysql_upgrade: port option +.\" port option: mysql_upgrade +\fB\-\-port=\fR\fB\fIport_num\fR\fR, +\fB\-P \fR\fB\fIport_num\fR\fR +.sp +The TCP/IP port number to use for the connection\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +.\" mysql_upgrade: protocol option +.\" protocol option: mysql_upgrade +\fB\-\-protocol={TCP|SOCKET|PIPE|MEMORY}\fR +.sp +The connection protocol to use for connecting to the server\&. It is useful when the other connection parameters normally would cause a protocol to be used other than the one you want\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +.\" mysql_upgrade: silent option +.\" silent option: mysql_upgrade +\fB\-\-silent\fR +.sp +Print less information\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +.\" mysql_upgrade: socket option +.\" socket option: mysql_upgrade +\fB\-\-socket=\fR\fB\fIpath\fR\fR, +\fB\-S \fR\fB\fIpath\fR\fR +.sp +For connections to +localhost, the Unix socket file to use, or, on Windows, the name of the named pipe to use\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +.\" mysql_upgrade: SSL options +.\" SSL options: mysql_upgrade +\fB\-\-ssl\fR +.sp +Enable SSL for connection (automatically enabled with other flags). Disable with +\fB\-\-skip-ssl\fR\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +.\" mysql_upgrade: SSL CA option +.\" SSL CA option: mysql_upgrade +\fB\-\-ssl\-ca=\fIname\fR +.sp +CA file in PEM format (check OpenSSL docs, implies +\fB\-\-ssl\fR)\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +.\" mysql_upgrade: SSL CA Path option +.\" SSL CA Path option: mysql_upgrade +\fB\-\-ssl\-capath=\fIname\fR +.sp +CA directory (check OpenSSL docs, implies +\fB\-\-ssl\fR)\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +.\" mysql_upgrade: SSL Cert option +.\" SSL Cert option: mysql_upgrade +\fB\-\-ssl\-cert=\fIname\fR +.sp +X509 cert in PEM format (check OpenSSL docs, implies +\fB\-\-ssl\fR)\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +.\" mysql_upgrade: SSL Cipher option +.\" SSL Cipher option: mysql_upgrade +\fB\-\-ssl\-cipher=\fIname\fR +.sp +SSL cipher to use (check OpenSSL docs, implies +\fB\-\-ssl\fR)\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +.\" mysql_upgrade: SSL Key option +.\" SSL Key option: mysql_upgrade +\fB\-\-ssl\-key=\fIname\fR +.sp +X509 key in PEM format (check OpenSSL docs, implies +\fB\-\-ssl\fR)\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +.\" mysql_upgrade: SSL Crl option +.\" SSL CRL option: mysql_upgrade +\fB\-\-ssl\-crl=\fIname\fR +.sp +Certificate revocation list (check OpenSSL docs, implies +\fB\-\-ssl\fR)\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +.\" mysql_upgrade: SSL Crlpath option +.\" SSL Crlpath option: mysql_upgrade +\fB\-\-ssl\-crlpath=\fIname\fR +.sp +Certificate revocation list path (check OpenSSL docs, implies +\fB\-\-ssl\fR)\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +.\" mysql_upgrade: SSL Verify Server Cert option +.\" SSL Verify Server Cert option: mysql_upgrade +\fB\-\-ssl\-verify\-server\-cert\fR +.sp +Verify server's "Common Name" in its cert against hostname used when connecting. This option is disabled by default\&. .RE .sp .RS 4 @@ -338,7 +589,23 @@ has already been executed for the current version of MySQL\&. \fB\-\-tmpdir=\fR\fB\fIpath\fR\fR, \fB\-t \fR\fB\fIpath\fR\fR .sp -The path name of the directory to use for creating temporary files\&. This option was added in MySQL 5\&.1\&.25\&. +The path name of the directory to use for creating temporary files\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +.\" mysql_upgrade: upgrade-system-tables option +.\" upgrade-system-tables option: mysql_upgrade +\fB\-\-upgrade\-system\-tables\fR\fR, +\fB\-s \fR +.sp +Only upgrade the system tables in the mysql database\&. Tables in other databases are not checked or touched\&. .RE .sp .RS 4 @@ -354,8 +621,7 @@ The path name of the directory to use for creating temporary files\&. This optio \fB\-\-user=\fR\fB\fIuser_name\fR\fR, \fB\-u \fR\fB\fIuser_name\fR\fR .sp -The MySQL user name to use when connecting to the server\&. The default user name is -root\&. +The MariaDB user name to use when connecting to the server and not using the current login\&. .RE .sp .RS 4 @@ -370,7 +636,45 @@ root\&. .\" verbose option: mysql_upgrade \fB\-\-verbose\fR .sp -Verbose mode\&. Print more information about what the program does\&. +Display more output about the process\&. Using it twice will print connection +arguments; using it 3 times will print out all CHECK, RENAME and ALTER TABLE +commands used during the check phase; using it 4 times (added in MariaDB 10.0.14) +will also write out all mysqlcheck commands used\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +.\" mysql_upgrade: version option +.\" version option: mysql_upgrade +\fB\-\-version\fR, +\fB\-V\fR +.sp +Output version information and exit\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +.\" mysql_upgrade: version-check option +.\" version-check option: mysql_upgrade +\fB\-\-version\-check\fR, +\fB\-k\fR +.sp +Run this program only if its 'server version' matches the version +of the server to which it's connecting. Note: the 'server version' +of the program is the version of the MariaDB server with which +it was built/distributed. Defaults to on; use \fB\-\-skip\-version\-check\fR to disable\&. .RE .sp .RS 4 @@ -389,13 +693,11 @@ Cause binary logging to be enabled while \fBmysql_upgrade\fR runs\&. This is the default behavior; to disable binary logging during the upgrade, use the inverse of this option (that is, start the program with \fB\-\-skip\-write\-binlog\fR)\&. -.sp -This option was introduced in MySQL 5\&.1\&.40\&. .RE .SH "COPYRIGHT" .br .PP -Copyright 2007-2008 MySQL AB, 2008-2010 Sun Microsystems, Inc. +Copyright 2007-2008 MySQL AB, 2008-2010 Sun Microsystems, Inc., 2010-2015 MariaDB Foundation .PP This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. .PP @@ -404,8 +706,6 @@ This documentation is distributed in the hope that it will be useful, but WITHOU You should have received a copy of the GNU General Public License along with the program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or see http://www.gnu.org/licenses/. .sp .SH "SEE ALSO" -For more information, please refer to the MySQL Reference Manual, -which may already be installed locally and which is also available -online at http://dev.mysql.com/doc/. +For more information, please refer to the MariaDB Knowledge Base, available online at https://mariadb.com/kb/ .SH AUTHOR -Sun Microsystems, Inc. (http://www.mysql.com/). +MariaDB Foundation (http://www.mariadb.org/). diff --git a/man/mysql_waitpid.1 b/man/mysql_waitpid.1 index b767fd6ad38..88f41d97f2d 100644 --- a/man/mysql_waitpid.1 +++ b/man/mysql_waitpid.1 @@ -1,13 +1,6 @@ '\" t -.\" Title: \fBmysql_waitpid\fR -.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] -.\" Generator: DocBook XSL Stylesheets v1.75.2 -.\" Date: 04/06/2010 -.\" Manual: MySQL Database System -.\" Source: MySQL 5.1 -.\" Language: English .\" -.TH "\FBMYSQL_WAITPID\FR" "1" "04/06/2010" "MySQL 5\&.1" "MySQL Database System" +.TH "\FBMYSQL_WAITPID\FR" "1" "04/08/2015" "MariaDB 10\&.0" "MariaDB Database System" .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- @@ -120,7 +113,7 @@ Display version information and exit\&. .SH "COPYRIGHT" .br .PP -Copyright 2007-2008 MySQL AB, 2008-2010 Sun Microsystems, Inc. +Copyright 2007-2008 MySQL AB, 2008-2010 Sun Microsystems, Inc., 2010-2015 MariaDB Foundation .PP This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. .PP @@ -129,8 +122,6 @@ This documentation is distributed in the hope that it will be useful, but WITHOU You should have received a copy of the GNU General Public License along with the program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or see http://www.gnu.org/licenses/. .sp .SH "SEE ALSO" -For more information, please refer to the MySQL Reference Manual, -which may already be installed locally and which is also available -online at http://dev.mysql.com/doc/. +For more information, please refer to the MariaDB Knowledge Base, available online at https://mariadb.com/kb/ .SH AUTHOR -Sun Microsystems, Inc. (http://www.mysql.com/). +MariaDB Foundation (http://www.mariadb.org/). diff --git a/man/mysql_zap.1 b/man/mysql_zap.1 index f2a261b47a0..186cfeb77d7 100644 --- a/man/mysql_zap.1 +++ b/man/mysql_zap.1 @@ -1,13 +1,6 @@ '\" t -.\" Title: \fBmysql_zap\fR -.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] -.\" Generator: DocBook XSL Stylesheets v1.75.2 -.\" Date: 04/06/2010 -.\" Manual: MySQL Database System -.\" Source: MySQL 5.1 -.\" Language: English .\" -.TH "\FBMYSQL_ZAP\FR" "1" "04/06/2010" "MySQL 5\&.1" "MySQL Database System" +.TH "\FBMYSQL_ZAP\FR" "1" "04/08/2015" "MariaDB 10\&.0" "MariaDB Database System" .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- @@ -116,7 +109,7 @@ Test mode\&. Display information about each process but do not kill it\&. .SH "COPYRIGHT" .br .PP -Copyright 2007-2008 MySQL AB, 2008-2010 Sun Microsystems, Inc. +Copyright 2007-2008 MySQL AB, 2008-2010 Sun Microsystems, Inc., 2010-2015 MariaDB Foundation .PP This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. .PP @@ -125,8 +118,6 @@ This documentation is distributed in the hope that it will be useful, but WITHOU You should have received a copy of the GNU General Public License along with the program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or see http://www.gnu.org/licenses/. .sp .SH "SEE ALSO" -For more information, please refer to the MySQL Reference Manual, -which may already be installed locally and which is also available -online at http://dev.mysql.com/doc/. +For more information, please refer to the MariaDB Knowledge Base, available online at https://mariadb.com/kb/ .SH AUTHOR -Sun Microsystems, Inc. (http://www.mysql.com/). +MariaDB Foundation (http://www.mariadb.org/). diff --git a/man/mysqlaccess.1 b/man/mysqlaccess.1 index 9833b3f5e6a..c8f9b97edea 100644 --- a/man/mysqlaccess.1 +++ b/man/mysqlaccess.1 @@ -1,13 +1,6 @@ '\" t -.\" Title: \fBmysqlaccess\fR -.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] -.\" Generator: DocBook XSL Stylesheets v1.75.2 -.\" Date: 04/06/2010 -.\" Manual: MySQL Database System -.\" Source: MySQL 5.1 -.\" Language: English .\" -.TH "\FBMYSQLACCESS\FR" "1" "04/06/2010" "MySQL 5\&.1" "MySQL Database System" +.TH "\FBMYSQLACCESS\FR" "1" "04/08/2015" "MariaDB 10\&.0" "MariaDB Database System" .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- @@ -27,7 +20,7 @@ mysqlaccess \- client for checking access privileges .SH "DESCRIPTION" .PP \fBmysqlaccess\fR -is a diagnostic tool that Yves Carlier has provided for the MySQL distribution\&. It checks the access privileges for a host name, user name, and database combination\&. Note that +is a diagnostic tool written by Yves Carlier\&. It checks the access privileges for a host name, user name, and database combination\&. Note that \fBmysqlaccess\fR checks access using only the user, @@ -197,9 +190,8 @@ Display some examples that show how to use .\" old_server option: mysqlaccess \fB\-\-old_server\fR .sp -Assume that the server is an old MySQL server (before MySQL 3\&.21) that does not yet know how to handle full -WHERE -clauses\&. +Connect to a very old MySQL server (before MySQL 3\&.21) that does not know how to handle full +WHERE clauses\&. .RE .sp .RS 4 @@ -287,7 +279,7 @@ Display the release notes\&. \fB\-\-rhost=\fR\fB\fIhost_name\fR\fR, \fB\-H \fR\fB\fIhost_name\fR\fR .sp -Connect to the MySQL server on the given host\&. +Connect to the MariaDB server on the given host\&. .RE .sp .RS 4 @@ -396,7 +388,7 @@ The user name to use in the access privileges\&. Display version information and exit\&. .RE .PP -If your MySQL distribution is installed in some nonstandard location, you must change the location where +If your MariaDB distribution is installed in some non\-standard location, you must change the location where \fBmysqlaccess\fR expects to find the \fBmysql\fR @@ -423,7 +415,7 @@ error will occur when you run .SH "COPYRIGHT" .br .PP -Copyright 2007-2008 MySQL AB, 2008-2010 Sun Microsystems, Inc. +Copyright 2007-2008 MySQL AB, 2008-2010 Sun Microsystems, Inc., 2010-2015 MariaDB Foundation .PP This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. .PP @@ -432,8 +424,6 @@ This documentation is distributed in the hope that it will be useful, but WITHOU You should have received a copy of the GNU General Public License along with the program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or see http://www.gnu.org/licenses/. .sp .SH "SEE ALSO" -For more information, please refer to the MySQL Reference Manual, -which may already be installed locally and which is also available -online at http://dev.mysql.com/doc/. +For more information, please refer to the MariaDB Knowledge Base, available online at https://mariadb.com/kb/ .SH AUTHOR -Sun Microsystems, Inc. (http://www.mysql.com/). +MariaDB Foundation (http://www.mariadb.org/). diff --git a/man/mysqladmin.1 b/man/mysqladmin.1 index 25b561ffdce..e2b1753ff9f 100644 --- a/man/mysqladmin.1 +++ b/man/mysqladmin.1 @@ -1,13 +1,6 @@ '\" t -.\" Title: \fBmysqladmin\fR -.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] -.\" Generator: DocBook XSL Stylesheets v1.75.2 -.\" Date: 04/06/2010 -.\" Manual: MySQL Database System -.\" Source: MySQL 5.1 -.\" Language: English .\" -.TH "\FBMYSQLADMIN\FR" "1" "04/06/2010" "MySQL 5\&.1" "MySQL Database System" +.TH "\FBMYSQLADMIN\FR" "1" "04/08/2015" "MariaDB 10\&.0" "MariaDB Database System" .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- @@ -22,7 +15,7 @@ .\" administration: server .\" server administration .SH "NAME" -mysqladmin \- client for administering a MySQL server +mysqladmin \- client for administering a MariaB server .SH "SYNOPSIS" .HP \w'\fBmysqladmin\ [\fR\fB\fIoptions\fR\fR\fB]\ \fR\fB\fIcommand\fR\fR\fB\ [\fR\fB\fIcommand\-arg\fR\fR\fB]\ [\fR\fB\fIcommand\fR\fR\fB\ [\fR\fB\fIcommand\-arg\fR\fR\fB]]\ \&.\&.\&.\fR\ 'u \fBmysqladmin [\fR\fB\fIoptions\fR\fR\fB] \fR\fB\fIcommand\fR\fR\fB [\fR\fB\fIcommand\-arg\fR\fR\fB] [\fR\fB\fIcommand\fR\fR\fB [\fR\fB\fIcommand\-arg\fR\fR\fB]] \&.\&.\&.\fR @@ -74,8 +67,7 @@ debug .sp Tell the server to write debug information to the error log\&. .sp -Beginning with MySQL 5\&.1\&.12, this includes information about the Event Scheduler\&. See -Section\ \&19.4.5, \(lqEvent Scheduler Status\(rq\&. +This also includes information about the Event Scheduler\&. .RE .sp .RS 4 @@ -210,8 +202,7 @@ old\-password \fInew\-password\fR .sp This is like the password -command but stores the password using the old (pre\-4\&.1) password\-hashing format\&. (See -Section\ \&5.3.2.3, \(lqPassword Hashing in MySQL\(rq\&.) +command but stores the password using the old (pre MySQL 4\&.1) password\-hashing format\&. .RE .sp .RS 4 @@ -303,8 +294,7 @@ SHOW PROCESSLIST statement\&. If the \fB\-\-verbose\fR option is given, the output is like that of -SHOW FULL PROCESSLIST\&. (See -Section\ \&12.4.5.31, \(lqSHOW PROCESSLIST Syntax\(rq\&.) +SHOW FULL PROCESSLIST\&. .RE .sp .RS 4 @@ -448,7 +438,7 @@ command result displays the following values: .\" uptime Uptime .sp -The number of seconds the MySQL server has been running\&. +The number of seconds the MariaDB server has been running\&. .RE .sp .RS 4 @@ -492,8 +482,7 @@ Slow queries .sp The number of queries that have taken more than long_query_time -seconds\&. See -Section\ \&5.2.5, \(lqThe Slow Query Log\(rq\&. +seconds\&. .RE .sp .RS 4 @@ -555,7 +544,7 @@ The number of tables that currently are open\&. Memory in use .sp The amount of memory allocated directly by -\fBmysqld\fR\&. This value is displayed only when MySQL has been compiled with +\fBmysqld\fR\&. This value is displayed only when MariaDB has been compiled with \fB\-\-with\-debug=full\fR\&. .RE .sp @@ -571,7 +560,7 @@ The amount of memory allocated directly by Maximum memory used .sp The maximum amount of memory allocated directly by -\fBmysqld\fR\&. This value is displayed only when MySQL has been compiled with +\fBmysqld\fR\&. This value is displayed only when MariaDB has been compiled with \fB\-\-with\-debug=full\fR\&. .RE .PP @@ -591,9 +580,6 @@ supports the following options, which can be specified on the command line or in and [client] option file groups\&. -\fBmysqladmin\fR -also supports the options for processing option files described at -Section\ \&4.2.3.3.1, \(lqCommand-Line Options that Affect Option-File Handling\(rq\&. .sp .RS 4 .ie n \{\ @@ -608,7 +594,7 @@ Section\ \&4.2.3.3.1, \(lqCommand-Line Options that Affect Option-File Handling\ \fB\-\-help\fR, \fB\-?\fR .sp -Display a help message and exit\&. +Display help and exit\&. .RE .sp .RS 4 @@ -623,8 +609,7 @@ Display a help message and exit\&. .\" character-sets-dir option: mysqladmin \fB\-\-character\-sets\-dir=\fR\fB\fIpath\fR\fR .sp -The directory where character sets are installed\&. See -Section\ \&9.5, \(lqCharacter Set Configuration\(rq\&. +The directory where character sets are installed\&. .RE .sp .RS 4 @@ -708,7 +693,7 @@ string is .\" debug-check option: mysqladmin \fB\-\-debug\-check\fR .sp -Print some debugging information when the program exits\&. This option was added in MySQL 5\&.1\&.21\&. +Check memory and open file usage at exit.\&. .RE .sp .RS 4 @@ -723,7 +708,22 @@ Print some debugging information when the program exits\&. This option was added .\" debug-info option: mysqladmin \fB\-\-debug\-info\fR .sp -Print debugging information and memory and CPU usage statistics when the program exits\&. This option was added in MySQL 5\&.1\&.14\&. +Print debugging information and memory and CPU usage statistics when the program exits\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +.\" mysqladmin: default-auth option +.\" default-auth option: mysqladmin +\fB\-\-default\-auth\fR +.sp +Default authentication client-side plugin to use\&. .RE .sp .RS 4 @@ -740,8 +740,7 @@ Print debugging information and memory and CPU usage statistics when the program .sp Use \fIcharset_name\fR -as the default character set\&. See -Section\ \&9.5, \(lqCharacter Set Configuration\(rq\&. +as the default character set\&. .RE .sp .RS 4 @@ -806,7 +805,7 @@ command\&. With multiple commands, continue even if an error occurs\&. \fB\-\-host=\fR\fB\fIhost_name\fR\fR, \fB\-h \fR\fB\fIhost_name\fR\fR .sp -Connect to the MySQL server on the given host\&. +Connect to the MariaDB server on the given host\&. .RE .sp .RS 4 @@ -822,7 +821,7 @@ Connect to the MySQL server on the given host\&. \fB\-\-no\-beep\fR, \fB\-b\fR .sp -Suppress the warning beep that is emitted by default for errors such as a failure to connect to the server\&. This option was added in MySQL 5\&.1\&.17\&. +Suppress the warning beep that is emitted by default for errors such as a failure to connect to the server\&. .RE .sp .RS 4 @@ -865,8 +864,7 @@ option on the command line, \fBmysqladmin\fR prompts for one\&. .sp -Specifying a password on the command line should be considered insecure\&. See -Section\ \&5.3.2.2, \(lqEnd-User Guidelines for Password Security\(rq\&. You can use an option file to avoid giving the password on the command line\&. +Specifying a password on the command line should be considered insecure\&. .RE .sp .RS 4 @@ -898,7 +896,8 @@ On Windows, connect to the server via a named pipe\&. This option applies only i \fB\-\-port=\fR\fB\fIport_num\fR\fR, \fB\-P \fR\fB\fIport_num\fR\fR .sp -The TCP/IP port number to use for the connection\&. +The TCP/IP port number to use for the connection or 0 for default to, +in order of preference, my.cnf, $MYSQL_TCP_PORT, /etc/services, built-in default (3306)\&. .RE .sp .RS 4 @@ -928,8 +927,7 @@ Print the program argument list and exit\&. This must be given as the first argu .\" protocol option: mysqladmin \fB\-\-protocol={TCP|SOCKET|PIPE|MEMORY}\fR .sp -The connection protocol to use for connecting to the server\&. It is useful when the other connection parameters normally would cause a protocol to be used other than the one you want\&. For details on the allowable values, see -Section\ \&4.2.2, \(lqConnecting to the MySQL Server\(rq\&. +The connection protocol to use for connecting to the server\&. It is useful when the other connection parameters normally would cause a protocol to be used other than the one you want\&. .RE .sp .RS 4 @@ -1034,12 +1032,137 @@ localhost, the Unix socket file to use, or, on Windows, the name of the named pi .\} .\" mysqladmin: SSL options .\" SSL options: mysqladmin -\fB\-\-ssl*\fR -.sp -Options that begin with \fB\-\-ssl\fR -specify whether to connect to the server via SSL and indicate where to find SSL keys and certificates\&. See -Section\ \&5.5.6.3, \(lqSSL Command Options\(rq\&. +.sp +Enable SSL for connection (automatically enabled with other flags). Disable with +\fB\-\-skip-ssl\fR\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +.\" mysqladmin: SSL CA option +.\" SSL CA option: mysqladmin +\fB\-\-ssl\-ca=\fIname\fR +.sp +CA file in PEM format (check OpenSSL docs, implies +\fB\-\-ssl\fR)\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +.\" mysqladmin: SSL CA Path option +.\" SSL CA Path option: mysqladmin +\fB\-\-ssl\-capath=\fIname\fR +.sp +CA directory (check OpenSSL docs, implies +\fB\-\-ssl\fR)\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +.\" mysqladmin: SSL Cert option +.\" SSL Cert option: mysqladmin +\fB\-\-ssl\-cert=\fIname\fR +.sp +X509 cert in PEM format (check OpenSSL docs, implies +\fB\-\-ssl\fR)\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +.\" mysqladmin: SSL Cipher option +.\" SSL Cipher option: mysqladmin +\fB\-\-ssl\-cipher=\fIname\fR +.sp +SSL cipher to use (check OpenSSL docs, implies +\fB\-\-ssl\fR)\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +.\" mysqladmin: SSL Key option +.\" SSL Key option: mysqladmin +\fB\-\-ssl\-key=\fIname\fR +.sp +X509 key in PEM format (check OpenSSL docs, implies +\fB\-\-ssl\fR)\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +.\" mysqladmin: SSL Crl option +.\" SSL CRL option: mysqladmin +\fB\-\-ssl\-crl=\fIname\fR +.sp +Certificate revocation list (check OpenSSL docs, implies +\fB\-\-ssl\fR)\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +.\" mysqladmin: SSL Crlpath option +.\" SSL Crlpath option: mysqladmin +\fB\-\-ssl\-crlpath=\fIname\fR +.sp +Certificate revocation list path (check OpenSSL docs, implies +\fB\-\-ssl\fR)\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +.\" mysqladmin: SSL Verify Server Cert option +.\" SSL Verify Server Cert option: mysqladmin +\fB\-\-ssl\-verify\-server\-cert\fR +.sp +Verify server's "Common Name" in its cert against hostname used when connecting. This option is disabled by default\&. .RE .sp .RS 4 @@ -1055,7 +1178,7 @@ Section\ \&5.5.6.3, \(lqSSL Command Options\(rq\&. \fB\-\-user=\fR\fB\fIuser_name\fR\fR, \fB\-u \fR\fB\fIuser_name\fR\fR .sp -The MySQL user name to use when connecting to the server\&. +The MariaDB user name to use when connecting to the server\&. .RE .sp .RS 4 @@ -1127,9 +1250,6 @@ value is given, it indicates the number of times to retry\&. The default is one .PP You can also set the following variables by using \fB\-\-\fR\fB\fIvar_name\fR\fR\fB=\fR\fB\fIvalue\fR\fR -The -\fB\-\-set\-variable\fR -format is deprecated and is removed in MySQL 5\&.5\&. syntax: .sp .RS 4 .ie n \{\ @@ -1163,7 +1283,7 @@ The maximum number of seconds to wait for server shutdown\&. The default value i .SH "COPYRIGHT" .br .PP -Copyright 2007-2008 MySQL AB, 2008-2010 Sun Microsystems, Inc. +Copyright 2007-2008 MySQL AB, 2008-2010 Sun Microsystems, Inc., 2010-2015 MariaDB Foundation .PP This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. .PP @@ -1172,8 +1292,6 @@ This documentation is distributed in the hope that it will be useful, but WITHOU You should have received a copy of the GNU General Public License along with the program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or see http://www.gnu.org/licenses/. .sp .SH "SEE ALSO" -For more information, please refer to the MySQL Reference Manual, -which may already be installed locally and which is also available -online at http://dev.mysql.com/doc/. +For more information, please refer to the MariaDB Knowledge Base, available online at https://mariadb.com/kb/ .SH AUTHOR -Sun Microsystems, Inc. (http://www.mysql.com/). +MariaDB Foundation (http://www.mariadb.org/). diff --git a/man/mysqlbinlog.1 b/man/mysqlbinlog.1 index 5e9bc6c2f43..15c371a9913 100644 --- a/man/mysqlbinlog.1 +++ b/man/mysqlbinlog.1 @@ -1,13 +1,6 @@ '\" t -.\" Title: \fBmysqlbinlog\fR -.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] -.\" Generator: DocBook XSL Stylesheets v1.75.2 -.\" Date: 04/06/2010 -.\" Manual: MySQL Database System -.\" Source: MySQL 5.1 -.\" Language: English .\" -.TH "\FBMYSQLBINLOG\FR" "1" "04/06/2010" "MySQL 5\&.1" "MySQL Database System" +.TH "\FBMYSQLBINLOG\FR" "1" "04/08/2015" "MariaDB 10\&.0" "MariaDB Database System" .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- @@ -32,9 +25,7 @@ that describe modifications to database contents\&. The server writes these file \fBmysqlbinlog\fR utility\&. You can also use \fBmysqlbinlog\fR -to display the contents of relay log files written by a slave server in a replication setup because relay logs have the same format as binary logs\&. The binary log and relay log are discussed further in -Section\ \&5.2.4, \(lqThe Binary Log\(rq, and -Section\ \&16.2.2, \(lqReplication Relay and Status Files\(rq\&. +to display the contents of relay log files written by a slave server in a replication setup because relay logs have the same format as binary logs\&. .PP Invoke \fBmysqlbinlog\fR @@ -64,8 +55,7 @@ shell> \fBmysqlbinlog binlog\&.0000003\fR .\} .PP The output includes events contained in -binlog\&.000003\&. For statement\-based logging, event information includes the SQL statement, the ID of the server on which it was executed, the timestamp when the statement was executed, how much time it took, and so forth\&. For row\-based logging, the event indicates a row change rather than an SQL statement\&. See -Section\ \&16.1.2, \(lqReplication Formats\(rq, for information about logging modes\&. +binlog\&.000003\&. For statement\-based logging, event information includes the SQL statement, the ID of the server on which it was executed, the timestamp when the statement was executed, how much time it took, and so forth\&. For row\-based logging, the event indicates a row change rather than an SQL statement\&. .PP Events are preceded by header comments that provide additional information\&. For example: .sp @@ -102,12 +92,11 @@ indicates the result from executing the event\&. Zero means that no error occurr The output from \fBmysqlbinlog\fR can be re\-executed (for example, by using it as input to -\fBmysql\fR) to redo the statements in the log\&. This is useful for recovery operations after a server crash\&. For other usage examples, see the discussion later in this section and -Section\ \&6.5, \(lqPoint-in-Time (Incremental) Recovery Using the Binary Log\(rq\&. +\fBmysql\fR) to redo the statements in the log\&. This is useful for recovery operations after a server crash\&. For other usage examples, see the discussion later in this section\&. .PP Normally, you use \fBmysqlbinlog\fR -to read binary log files directly and apply them to the local MySQL server\&. It is also possible to read binary logs from a remote server by using the +to read binary log files directly and apply them to the local MariaDB server\&. It is also possible to read binary logs from a remote server by using the \fB\-\-read\-from\-remote\-server\fR option\&. To read remote binary logs, the connection parameter options can be given to indicate how to connect to the server\&. These options are \fB\-\-host\fR, @@ -125,9 +114,6 @@ supports the following options, which can be specified on the command line or in and [client] option file groups\&. -\fBmysqlbinlog\fR -also supports the options for processing option files described at -Section\ \&4.2.3.3.1, \(lqCommand-Line Options that Affect Option-File Handling\(rq\&. .sp .RS 4 .ie n \{\ @@ -211,7 +197,7 @@ displays BINLOG statements whenever possible\&. This is the implied value if the option is given as \fB\-\-base64\-output\fR -without a value\&. +without a value\&. Both ALWAYS and not giving a value are deprecated. .RE .sp .RS 4 @@ -255,17 +241,14 @@ NEVER, it does not exit with an error if a row event is found\&. .RS 4 The \fB\-\-base64\-output\fR -option was introduced in MySQL 5\&.1\&.5, to be given as +can be given as \fB\-\-base64\-output\fR or \fB\-\-skip\-base64\-output\fR (with the sense of AUTO or -NEVER)\&. The option values described in the preceding list may be used as of MySQL 5\&.1\&.24, with the exception of -UNSPEC -and -DECODE\-ROWS, which are available as of MySQL 5\&.1\&.28\&. +NEVER)\&. .sp For examples that show the effect of \fB\-\-base64\-output\fR @@ -274,6 +257,22 @@ and on row event output, see the section called \(lqMYSQLBINLOG ROW EVENT DISPLAY\(rq\&. .RE +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +.\" mysqlbinlog: binlog-row-event-max-size option +.\" binlog-row-event-max-size option: mysqlbinlog +\fB\-\-binlog\-row\-event\-max\-size\=\fR\fB\fIpath\fR\fR +.sp +The directory where character sets are installed\&. +.RE .sp .RS 4 .ie n \{\ @@ -287,8 +286,7 @@ the section called \(lqMYSQLBINLOG ROW EVENT DISPLAY\(rq\&. .\" character-sets-dir option: mysqlbinlog \fB\-\-character\-sets\-dir=\fR\fB\fIpath\fR\fR .sp -The directory where character sets are installed\&. See -Section\ \&9.5, \(lqCharacter Set Configuration\(rq\&. +The directory where character sets are installed\&. .RE .sp .RS 4 @@ -308,7 +306,7 @@ This option causes \fBmysqlbinlog\fR to output entries from the binary log (local log only) that occur while \fIdb_name\fR -is been selected as the default database by +has been selected as the default database by USE\&. .sp The @@ -452,10 +450,11 @@ USE\&. (In particular, no cross\-database updates should be used\&.) .br This option did not work correctly for \fBmysqlbinlog\fR -with row\-based logging prior to MySQL 5\&.1\&.37\&. (\m[blue]\fBBug#42941\fR\m[]\&\s-2\u[1]\d\s+2) +with row\-based logging prior to MySQL 5\&.1\&.37\&. .sp .5v .RE .RE +.RE .sp .RS 4 .ie n \{\ @@ -489,7 +488,7 @@ string is .\" debug-check option: mysqlbinlog \fB\-\-debug\-check\fR .sp -Print some debugging information when the program exits\&. This option was added in MySQL 5\&.1\&.21\&. +Print some debugging information when the program exits\&. .RE .sp .RS 4 @@ -504,7 +503,52 @@ Print some debugging information when the program exits\&. This option was added .\" debug-info option: mysqlbinlog \fB\-\-debug\-info\fR .sp -Print debugging information and memory and CPU usage statistics when the program exits\&. This option was added in MySQL 5\&.1\&.21\&. +Print debugging information and memory and CPU usage statistics when the program exits\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +.\" mysqlbinlog: defaults-extra-file option +.\" defaults-extra-file option: mysqlbinlog +\fB\-\-defaults\-extra\-file=\fR\fB\fIname\fR +.sp +Read this file after the global files are read\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +.\" mysqlbinlog: defaults-file option +.\" defaults-file option: mysqlbinlog +\fB\-\-defaults\-file=\fR\fB\fIname\fR +.sp +Only read default options from the given file\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +.\" mysqlbinlog: default-auth option +.\" default-auth option: mysqlbinlog +\fB\-\-default\-auth=\fR\fB\fIname\fR +.sp +Default authentication client-side plugin to use\&. .RE .sp .RS 4 @@ -522,7 +566,7 @@ Print debugging information and memory and CPU usage statistics when the program .sp Disable binary logging\&. This is useful for avoiding an endless loop if you use the \fB\-\-to\-last\-log\fR -option and are sending the output to the same MySQL server\&. This option also is useful when restoring after a crash to avoid duplication of the statements you have logged\&. +option and are sending the output to the same MariaDB server\&. This option also is useful when restoring after a crash to avoid duplication of the statements you have logged\&. .sp This option requires that you have the SUPER @@ -545,6 +589,21 @@ privilege\&. .sp -1 .IP \(bu 2.3 .\} +.\" mysqlbinlog: force-if-open option +.\" force-if-open option: mysqlbinlog +\fB\-\-force\-if\-open\fR +.sp +Force if binlog was not closed properly. Defaults to on; use \fB--skip-force-if-open\fR to disable\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} .\" mysqlbinlog: force-read option .\" force-read option: mysqlbinlog \fB\-\-force\-read\fR, @@ -571,7 +630,7 @@ stops if it reads such an event\&. \fB\-H\fR .sp Display a hex dump of the log in comments, as described in -the section called \(lqMYSQLBINLOG HEX DUMP FORMAT\(rq\&. The hex output can be helpful for replication debugging\&. This option was added in MySQL 5\&.1\&.2\&. +the section called \(lqMYSQLBINLOG HEX DUMP FORMAT\(rq\&. The hex output can be helpful for replication debugging\&. .RE .sp .RS 4 @@ -587,7 +646,7 @@ the section called \(lqMYSQLBINLOG HEX DUMP FORMAT\(rq\&. The hex output can be \fB\-\-host=\fR\fB\fIhost_name\fR\fR, \fB\-h \fR\fB\fIhost_name\fR\fR .sp -Get the binary log from the MySQL server on the given host\&. +Get the binary log from the MariaDB server on the given host\&. .RE .sp .RS 4 @@ -616,6 +675,21 @@ in the specified directory\&. .sp -1 .IP \(bu 2.3 .\} +.\" mysqlbinlog: no-defaults option +.\" no-defaults option: mysqlbinlog +\fB\-\-no\-defaults\fR +.sp +Don't read default options from any option file\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} .\" mysqlbinlog: offset option .\" offset option: mysqlbinlog \fB\-\-offset=\fR\fB\fIN\fR\fR, @@ -651,8 +725,38 @@ option on the command line, \fBmysqlbinlog\fR prompts for one\&. .sp -Specifying a password on the command line should be considered insecure\&. See -Section\ \&5.3.2.2, \(lqEnd-User Guidelines for Password Security\(rq\&. You can use an option file to avoid giving the password on the command line\&. +Specifying a password on the command line should be considered insecure\&. You +can use an option file to avoid giving the password on the command line\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +.\" mysqlbinlog: plugin-dir option +.\" plugin-dir option: mysqlbinlog +\fB\-\-plugin\-dir=\fIdir_name\fR +.sp +Directory for client-side plugins\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +.\" mysqlbinlog: print-defaults option +.\" print-defaults option: mysqlbinlog +\fB\-\-print\-defaults\fR +.sp +Print the program argument list from all option files and exit\&. .RE .sp .RS 4 @@ -668,26 +772,9 @@ Section\ \&5.3.2.2, \(lqEnd-User Guidelines for Password Security\(rq\&. You can \fB\-\-port=\fR\fB\fIport_num\fR\fR, \fB\-P \fR\fB\fIport_num\fR\fR .sp -The TCP/IP port number to use for connecting to a remote server\&. -.RE -.sp -.RS 4 -.ie n \{\ -\h'-04'\(bu\h'+03'\c -.\} -.el \{\ -.sp -1 -.IP \(bu 2.3 -.\} -.\" mysqlbinlog: position option -.\" position option: mysqlbinlog -\fB\-\-position=\fR\fB\fIN\fR\fR -.sp -Deprecated\&. Use -\fB\-\-start\-position\fR -instead\&. -\fB\-\-position\fR -is removed in MySQL 5\&.5\&. +The TCP/IP port number to use for connecting to a remote server, +or \fB0\fR for default to, in order of preference, \fBmy.cnf\fR, +\fB$MYSQL_TCP_PORT\fR, \fB/etc/services\fR, \fRbuilt-in default (3306)\fR\&. .RE .sp .RS 4 @@ -702,8 +789,7 @@ is removed in MySQL 5\&.5\&. .\" protocol option: mysqlbinlog \fB\-\-protocol={TCP|SOCKET|PIPE|MEMORY}\fR .sp -The connection protocol to use for connecting to the server\&. It is useful when the other connection parameters normally would cause a protocol to be used other than the one you want\&. For details on the allowable values, see -Section\ \&4.2.2, \(lqConnecting to the MySQL Server\(rq\&. +The connection protocol to use for connecting to the server\&. It is useful when the other connection parameters normally would cause a protocol to be used other than the one you want\&. .RE .sp .RS 4 @@ -735,7 +821,7 @@ Sets the open_files_limit variable, which is used to reserve file descriptors fo \fB\-\-read\-from\-remote\-server\fR, \fB\-R\fR .sp -Read the binary log from a MySQL server rather than reading a local log file\&. Any connection parameter options are ignored unless this option is given as well\&. These options are +Read the binary log from a MariaDB server rather than reading a local log file\&. Any connection parameter options are ignored unless this option is given as well\&. These options are \fB\-\-host\fR, \fB\-\-password\fR, \fB\-\-port\fR, @@ -770,11 +856,37 @@ Direct output to the given file\&. .sp -1 .IP \(bu 2.3 .\} +.\" mysqlbinlog: rewrite-db option +.\" rewrite-db option: mysqlbinlog +\fB\-\-rewrite\-db=\fR\fB\fIname\fR\fR, +\fB\-r \fR\fB\fIname\fR\fR +.sp +Updates to a database with a different name than the original. +Example: \fBrewrite-db='from->to'\fR\&. For events that are +binlogged as statements, rewriting the database constitutes changing a +statement's default database from \fIdb1\fB to \fIdb2\fR\&. There is no statement +analysis or rewrite of any kind, that is, if one specifies \fB"db1.tbl"\fR +in the statement explicitly, that occurrence won't be changed to +\fB"db2.tbl"\fR\&. Row-based events are rewritten correctly to use the new +database name\&. Filtering (e.g. with \fB--database=name\fR) happens after +the database rewrites have been performed\&. If you use this option on the +command line and \fB">"\fR has a special meaning to your command interpreter, +quote the value (e.g. \fB--rewrite-db="oldname->newname"\fR\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} .\" mysqlbinlog: server-id option .\" server-id option: mysqlbinlog \fB\-\-server\-id=\fR\fB\fIid\fR\fR .sp -Display only those events created by the server having the given server ID\&. This option is available as of MySQL 5\&.1\&.4\&. +Display only those events created by the server having the given server ID\&. .RE .sp .RS 4 @@ -791,7 +903,7 @@ Display only those events created by the server having the given server ID\&. Th .sp Add a SET NAMES \fIcharset_name\fR -statement to the output to specify the character set to be used for processing log files\&. This option was added in MySQL 5\&.1\&.12\&. +statement to the output to specify the character set to be used for processing log files\&. .RE .sp .RS 4 @@ -807,7 +919,10 @@ statement to the output to specify the character set to be used for processing l \fB\-\-short\-form\fR, \fB\-s\fR .sp -Display only the statements contained in the log, without any extra information\&. +Display only the statements contained in the log, no extra info +and no row-based events\&. This is for testing only, and should +not be used in production systems. If you want to suppress +base64-output, consider using \fB--base64-output=never\fR instead\&. .RE .sp .RS 4 @@ -854,14 +969,13 @@ data types\&. For example: .RS 4 .\} .nf -shell> \fBmysqlbinlog \-\-start\-datetime="2005\-12\-25 11:25:56" binlog\&.000003\fR +shell> \fBmysqlbinlog \-\-start\-datetime="2014\-12\-25 11:25:56" binlog\&.000003\fR .fi .if n \{\ .RE .\} .sp -This option is useful for point\-in\-time recovery\&. See -Section\ \&6.3, \(lqExample Backup and Recovery Strategy\(rq\&. +This option is useful for point\-in\-time recovery\&. .RE .sp .RS 4 @@ -880,8 +994,7 @@ Section\ \&6.3, \(lqExample Backup and Recovery Strategy\(rq\&. Start reading the binary log at the first event having a position equal to or greater than \fIN\fR\&. This option applies to the first log file named on the command line\&. .sp -This option is useful for point\-in\-time recovery\&. See -Section\ \&6.3, \(lqExample Backup and Recovery Strategy\(rq\&. +This option is useful for point\-in\-time recovery\&. .RE .sp .RS 4 @@ -904,8 +1017,7 @@ option for information about the \fIdatetime\fR value\&. .sp -This option is useful for point\-in\-time recovery\&. See -Section\ \&6.3, \(lqExample Backup and Recovery Strategy\(rq\&. +This option is useful for point\-in\-time recovery\&. .RE .sp .RS 4 @@ -923,8 +1035,7 @@ Section\ \&6.3, \(lqExample Backup and Recovery Strategy\(rq\&. Stop reading the binary log at the first event having a position equal to or greater than \fIN\fR\&. This option applies to the last log file named on the command line\&. .sp -This option is useful for point\-in\-time recovery\&. See -Section\ \&6.3, \(lqExample Backup and Recovery Strategy\(rq\&. +This option is useful for point\-in\-time recovery\&. .RE .sp .RS 4 @@ -940,7 +1051,7 @@ Section\ \&6.3, \(lqExample Backup and Recovery Strategy\(rq\&. \fB\-\-to\-last\-log\fR, \fB\-t\fR .sp -Do not stop at the end of the requested binary log from a MySQL server, but rather continue printing until the end of the last binary log\&. If you send the output to the same MySQL server, this may lead to an endless loop\&. This option requires +Do not stop at the end of the requested binary log from a MariaDB server, but rather continue printing until the end of the last binary log\&. If you send the output to the same MariaDB server, this may lead to an endless loop, so this option requires \fB\-\-read\-from\-remote\-server\fR\&. .RE .sp @@ -957,7 +1068,7 @@ Do not stop at the end of the requested binary log from a MySQL server, but rath \fB\-\-user=\fR\fB\fIuser_name\fR\fR, \fB\-u \fR\fB\fIuser_name\fR\fR .sp -The MySQL user name to use when connecting to a remote server\&. +The MariaDB username to use when connecting to a remote server\&. .RE .sp .RS 4 @@ -973,7 +1084,7 @@ The MySQL user name to use when connecting to a remote server\&. \fB\-\-verbose\fR, \fB\-v\fR .sp -Reconstruct row events and display them as commented SQL statements\&. If this option is given twice, the output includes comments to indicate column data types and some metadata\&. This option was added in MySQL 5\&.1\&.28\&. +Reconstruct row events and display them as commented SQL statements\&. If this option is given twice, the output includes comments to indicate column data types and some metadata\&. .sp For examples that show the effect of \fB\-\-base64\-output\fR @@ -1021,8 +1132,8 @@ You can pipe the output of \fBmysqlbinlog\fR into the \fBmysql\fR -client to execute the events contained in the binary log\&. This technique is used to recover from a crash when you have an old backup (see -Section\ \&6.5, \(lqPoint-in-Time (Incremental) Recovery Using the Binary Log\(rq)\&. For example: +client to execute the events contained in the binary log\&. This technique is used to recover from a crash when you have an old +backup\&. For example: .sp .if n \{\ .RS 4 @@ -1073,7 +1184,7 @@ option, it displays only those events with an offset in the binary log greater t option (to be able to say, for example, \(lqroll forward my databases to how they were today at 10:30 a\&.m\&.\(rq)\&. .PP -If you have more than one binary log to execute on the MySQL server, the safe method is to process them all using a single connection to the server\&. Here is an example that demonstrates what may be +If you have more than one binary log to execute on the MariaDB server, the safe method is to process them all using a single connection to the server\&. Here is an example that demonstrates what may be \fIunsafe\fR: .sp .if n \{\ @@ -1145,8 +1256,7 @@ LOAD DATA LOCAL INFILE statements (that is, it adds LOCAL), both the client and the server that you use to process the statements must be configured with the LOCAL -capability enabled\&. See -Section\ \&5.3.5, \(lqSecurity Issues with LOAD DATA LOCAL\(rq\&. +capability enabled\&. .if n \{\ .sp .\} @@ -1591,7 +1701,7 @@ type codes\&. The \fB\-\-base64\-output=DECODE\-ROWS\fR and \fB\-\-verbose\fR -options may be used to affect row event output\&. These options are available as of MySQL 5\&.1\&.28\&. +options may be used to affect row event output\&. .PP Suppose that the server is using row\-based binary logging and that you execute the following sequence of statements: .sp @@ -1952,7 +2062,7 @@ option can be used to prevent this header from being written\&. .SH "COPYRIGHT" .br .PP -Copyright 2007-2008 MySQL AB, 2008-2010 Sun Microsystems, Inc. +Copyright 2007-2008 MySQL AB, 2008-2010 Sun Microsystems, Inc., 2010-2015 MariaDB Foundation .PP This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. .PP @@ -1967,8 +2077,6 @@ Bug#42941 \%http://bugs.mysql.com/bug.php?id=42941 .RE .SH "SEE ALSO" -For more information, please refer to the MySQL Reference Manual, -which may already be installed locally and which is also available -online at http://dev.mysql.com/doc/. +For more information, please refer to the MariaDB Knowledge Base, available online at https://mariadb.com/kb/ .SH AUTHOR -Sun Microsystems, Inc. (http://www.mysql.com/). +MariaDB Foundation (http://www.mariadb.org/). diff --git a/man/mysqlbug.1 b/man/mysqlbug.1 index 32829a073dc..fc22162ebe9 100644 --- a/man/mysqlbug.1 +++ b/man/mysqlbug.1 @@ -1,13 +1,6 @@ '\" t -.\" Title: \fBmysqlbug\fR -.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] -.\" Generator: DocBook XSL Stylesheets v1.75.2 -.\" Date: 04/06/2010 -.\" Manual: MySQL Database System -.\" Source: MySQL 5.1 -.\" Language: English .\" -.TH "\FBMYSQLBUG\FR" "1" "04/06/2010" "MySQL 5\&.1" "MySQL Database System" +.TH "\FBMYSQLBUG\FR" "1" "04/08/2015" "MariaDB 10\&.0" "MariaDB Database System" .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- @@ -26,10 +19,12 @@ mysqlbug \- generate bug report \fBmysqlbug\fR .SH "DESCRIPTION" .PP -This program enables you to generate a bug report and send it to Oracle Corporation\&. It is a shell script and runs on Unix\&. +To report MariaDB bugs, see https://mariadb.com/kb/en/mariadb/reporting-bugs/ - the mysqlbug program has now been deprecated by Oracle, and was never useful for MariaDB. + +Originally, the program enabled you to generate a bug report and send it to Oracle Corporation\&. It is a shell script and runs on Unix\&. .PP -The normal way to report bugs is to visit -\m[blue]\fB\%http://bugs.mysql.com/\fR\m[], which is the address for our bugs database\&. This database is public and can be browsed and searched by anyone\&. If you log in to the system, you can enter new reports\&. If you have no Web access, you can generate a bug report by using the +The normal way to report MySQL bugs is to visit +\m[blue]\fB\%http://bugs.mysql.com/\fR\m[], which is the address for MySQL's bugs database\&. This database is public and can be browsed and searched by anyone\&. If you log in to the system, you can enter new reports\&. If you have no Web access, you can generate a bug report by using the \fBmysqlbug\fR script\&. .PP @@ -62,7 +57,7 @@ will send the report by email\&. .SH "COPYRIGHT" .br .PP -Copyright 2007-2008 MySQL AB, 2008-2010 Sun Microsystems, Inc. +Copyright 2007-2008 MySQL AB, 2008-2010 Sun Microsystems, Inc., 2010-2015 MariaDB Foundation .PP This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. .PP @@ -71,8 +66,6 @@ This documentation is distributed in the hope that it will be useful, but WITHOU You should have received a copy of the GNU General Public License along with the program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or see http://www.gnu.org/licenses/. .sp .SH "SEE ALSO" -For more information, please refer to the MySQL Reference Manual, -which may already be installed locally and which is also available -online at http://dev.mysql.com/doc/. +For more information, please refer to the MariaDB Knowledge Base, available online at https://mariadb.com/kb/ .SH AUTHOR -Sun Microsystems, Inc. (http://www.mysql.com/). +MariaDB Foundation (http://www.mariadb.org/). diff --git a/man/mysqlcheck.1 b/man/mysqlcheck.1 index 11e968db18c..c175483347c 100644 --- a/man/mysqlcheck.1 +++ b/man/mysqlcheck.1 @@ -1,13 +1,6 @@ '\" t -.\" Title: \fBmysqlcheck\fR -.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] -.\" Generator: DocBook XSL Stylesheets v1.75.2 -.\" Date: 04/06/2010 -.\" Manual: MySQL Database System -.\" Source: MySQL 5.1 -.\" Language: English .\" -.TH "\FBMYSQLCHECK\FR" "1" "04/06/2010" "MySQL 5\&.1" "MySQL Database System" +.TH "\FBMYSQLCHECK\FR" "1" "04/08/2015" "MariaDB 10\&.0" "MariaDB Database System" .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- @@ -36,12 +29,7 @@ client performs table maintenance: It checks, repairs, optimizes, or analyzes ta .PP Each table is locked and therefore unavailable to other sessions while it is being processed, although for check operations, the table is locked with a READ -lock only (see -Section\ \&12.3.5, \(lqLOCK TABLES and UNLOCK TABLES Syntax\(rq, for more information about -READ -and -WRITE -locks)\&. Table maintenance operations can be time\-consuming, particularly for large tables\&. If you use the +lock only\&. Table maintenance operations can be time\-consuming, particularly for large tables\&. If you use the \fB\-\-databases\fR or \fB\-\-all\-databases\fR @@ -71,8 +59,7 @@ CHECK TABLE, REPAIR TABLE, ANALYZE TABLE, and OPTIMIZE TABLE -in a convenient way for the user\&. It determines which statements to use for the operation you want to perform, and then sends the statements to the server to be executed\&. For details about which storage engines each statement works with, see the descriptions for those statements in -Section\ \&12.4.2, \(lqTable Maintenance Statements\(rq\&. +in a convenient way for the user\&. It determines which statements to use for the operation you want to perform, and then sends the statements to the server to be executed\&. .PP The MyISAM @@ -100,8 +87,7 @@ note : The storage engine for the table doesn\'t support check .PP If \fBmysqlcheck\fR -is unable to repair a table, see -Section\ \&2.4.4, \(lqRebuilding or Repairing Tables or Indexes\(rq +is unable to repair a table, see the MariaDB Knowledge Base for manual table repair strategies\&. This will be the case, for example, for InnoDB tables, which can be checked with @@ -110,7 +96,7 @@ REPAIR TABLE\&. .PP The use of \fBmysqlcheck\fR -with partitioned tables is not supported before MySQL 5\&.1\&.27\&. +with partitioned tables is not supported\&. .if n \{\ .sp .\} @@ -193,9 +179,6 @@ supports the following options, which can be specified on the command line or in and [client] option file groups\&. -\fBmysqlcheck\fR -also supports the options for processing option files described at -Section\ \&4.2.3.3.1, \(lqCommand-Line Options that Affect Option-File Handling\(rq\&. .sp .RS 4 .ie n \{\ @@ -290,8 +273,7 @@ If a checked table is corrupted, automatically fix it\&. Any necessary repairs a .\" character-sets-dir option: mysqlcheck \fB\-\-character\-sets\-dir=\fR\fB\fIpath\fR\fR .sp -The directory where character sets are installed\&. See -Section\ \&9.5, \(lqCharacter Set Configuration\(rq\&. +The directory where character sets are installed\&. .RE .sp .RS 4 @@ -348,8 +330,6 @@ option to check tables for incompatibilities with the current version of the ser and \fB\-\-fix\-table\-names\fR options\&. -\fB\-\-check\-upgrade\fR -was added in MySQL 5\&.1\&.7\&. .RE .sp .RS 4 @@ -417,7 +397,7 @@ string is .\" debug-check option: mysqlcheck \fB\-\-debug\-check\fR .sp -Print some debugging information when the program exits\&. This option was added in MySQL 5\&.1\&.21\&. +Print some debugging information when the program exits\&. .RE .sp .RS 4 @@ -432,7 +412,22 @@ Print some debugging information when the program exits\&. This option was added .\" debug-info option: mysqlcheck \fB\-\-debug\-info\fR .sp -Print debugging information and memory and CPU usage statistics when the program exits\&. This option was added in MySQL 5\&.1\&.14\&. +Print debugging information and memory and CPU usage statistics when the program exits\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +.\" mysqlcheck: default-auth option +.\" default-auth option: mysqlcheck +\fB\-\-default\-auth=\fR\fB\fIname\fR\fR +.sp +Default authentication client-side plugin to use\&. .RE .sp .RS 4 @@ -449,8 +444,7 @@ Print debugging information and memory and CPU usage statistics when the program .sp Use \fIcharset_name\fR -as the default character set\&. See -Section\ \&9.5, \(lqCharacter Set Configuration\(rq\&. +as the default character set\&. .RE .sp .RS 4 @@ -500,7 +494,8 @@ Must be given as first option\&. .sp If you are using this option to check tables, it ensures that they are 100% consistent but takes a long time\&. .sp -If you are using this option to repair tables, it runs an extended repair that may not only take a long time to execute, but may produce a lot of garbage rows also! +If you are using this option to repair tables, it will force using the old, slow, repair with keycache method, +instead of the much faster repair by sorting. .RE .sp .RS 4 @@ -531,7 +526,7 @@ Check only tables that have not been closed properly\&. .\" fix-db-names option: mysqlcheck \fB\-\-fix\-db\-names\fR .sp -Convert database names to 5\&.1 format\&. Only database names that contain special characters are affected\&. This option was added in MySQL 5\&.1\&.7\&. +Convert database names to the format used since MySQL 5\&.1\&. Only database names that contain special characters are affected\&. .RE .sp .RS 4 @@ -546,7 +541,23 @@ Convert database names to 5\&.1 format\&. Only database names that contain speci .\" fix-table-names option: mysqlcheck \fB\-\-fix\-table\-names\fR .sp -Convert table names to 5\&.1 format\&. Only table names that contain special characters are affected\&. This option was added in MySQL 5\&.1\&.7\&. As of MySQL 5\&.1\&.23, this option also applies to views\&. +Convert table names (including views) to the format used since MySQL 5\&.1\&. Only table names that contain special characters are affected\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +.\" mysqlcheck: flush option +.\" flush option: mysqlcheck +\fB\-\-flush\fR, +.sp +Flush each table after check. This is useful if you don't +want to have the checked tables take up space in the caches after the check\&. .RE .sp .RS 4 @@ -578,7 +589,7 @@ Continue even if an SQL error occurs\&. \fB\-\-host=\fR\fB\fIhost_name\fR\fR, \fB\-h \fR\fB\fIhost_name\fR\fR .sp -Connect to the MySQL server on the given host\&. +Connect to the MariaDB server on the given host\&. .RE .sp .RS 4 @@ -655,8 +666,7 @@ option on the command line, \fBmysqlcheck\fR prompts for one\&. .sp -Specifying a password on the command line should be considered insecure\&. See -Section\ \&5.3.2.2, \(lqEnd-User Guidelines for Password Security\(rq\&. You can use an option file to avoid giving the password on the command line\&. +Specifying a password on the command line should be considered insecure\&. You can use an option file to avoid giving the password on the command line\&. .RE .sp .RS 4 @@ -683,6 +693,21 @@ On Windows, connect to the server via a named pipe\&. This option applies only i .sp -1 .IP \(bu 2.3 .\} +.\" mysqlcheck: plugin-dir option +.\" plugin-dir option: mysqlcheck +\fB\-\-plugin\-dir=\fR\fB\fIname\fR\fR +.sp + Directory for client-side plugins\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} .\" mysqlcheck: port option .\" port option: mysqlcheck \fB\-\-port=\fR\fB\fIport_num\fR\fR, @@ -699,12 +724,12 @@ The TCP/IP port number to use for the connection\&. .sp -1 .IP \(bu 2.3 .\} -.\" mysqlcheck: protocol option -.\" protocol option: mysqlcheck -\fB\-\-protocol={TCP|SOCKET|PIPE|MEMORY}\fR +.\" mysqlcheck: print-defaults option +.\" print-defaults option: mysqlcheck +\fB\-\-print\-defaults\fR .sp -The connection protocol to use for connecting to the server\&. It is useful when the other connection parameters normally would cause a protocol to be used other than the one you want\&. For details on the allowable values, see -Section\ \&4.2.2, \(lqConnecting to the MySQL Server\(rq\&. +Print the program argument list and exit\&. +This must be given as the first argument\&. .RE .sp .RS 4 @@ -715,12 +740,41 @@ Section\ \&4.2.2, \(lqConnecting to the MySQL Server\(rq\&. .sp -1 .IP \(bu 2.3 .\} -.\" mysqlcheck: print-defaults option -.\" print-defaults option: mysqlcheck -\fB\-\-print\-defaults\fR +.\" mysqlcheck: process-tables option +.\" process-tables option: mysqlcheck +\fB\-\-process\-tables\fR .sp -Print the program argument list and exit\&. -This must be given as the first argument\&. +Perform the requested operation on tables. Defaults to on; use \fB--skip-process-tables\fR to disable\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +.\" mysqlcheck: process-views option +.\" process-views option: mysqlcheck +\fB\-\-process\-views=\fB\fIval\fR +.sp +Perform the requested operation (only CHECK VIEW or REPAIR VIEW). Possible values are NO, YES (correct the checksum, if necessary, add the mariadb-version field), UPGRADE_FROM_MYSQL (same as YES and toggle the algorithm MERGE<->TEMPTABLE\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +.\" mysqlcheck: protocol option +.\" protocol option: mysqlcheck +\fB\-\-protocol={TCP|SOCKET|PIPE|MEMORY}\fR +.sp +The connection protocol to use for connecting to the server\&. It is useful when the other connection parameters normally would cause a protocol to be used other than the one you want\&. .RE .sp .RS 4 @@ -781,6 +835,22 @@ Silent mode\&. Print only error messages\&. .sp -1 .IP \(bu 2.3 .\} +.\" mysqlcheck: skip-database option +.\" skip-database option: mysqlcheck +\fB\-\-skip\-database=\fB\fIdb_name\fR +\fB\-s\fR +.sp +Don't process the database (case-sensitive) specified as argument\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} .\" mysqlcheck: socket option .\" socket option: mysqlcheck \fB\-\-socket=\fR\fB\fIpath\fR\fR, @@ -798,14 +868,139 @@ localhost, the Unix socket file to use, or, on Windows, the name of the named pi .sp -1 .IP \(bu 2.3 .\} -.\" mysqlcheck: SSL options -.\" SSL options: mysqlcheck -\fB\-\-ssl*\fR -.sp -Options that begin with +.\" mysqladmin: SSL options +.\" SSL options: mysqladmin \fB\-\-ssl\fR -specify whether to connect to the server via SSL and indicate where to find SSL keys and certificates\&. See -Section\ \&5.5.6.3, \(lqSSL Command Options\(rq\&. +.sp +Enable SSL for connection (automatically enabled with other flags). Disable with +\fB\-\-skip-ssl\fR\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +.\" mysqladmin: SSL CA option +.\" SSL CA option: mysqladmin +\fB\-\-ssl\-ca=\fIname\fR +.sp +CA file in PEM format (check OpenSSL docs, implies +\fB\-\-ssl\fR)\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +.\" mysqladmin: SSL CA Path option +.\" SSL CA Path option: mysqladmin +\fB\-\-ssl\-capath=\fIname\fR +.sp +CA directory (check OpenSSL docs, implies +\fB\-\-ssl\fR)\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +.\" mysqladmin: SSL Cert option +.\" SSL Cert option: mysqladmin +\fB\-\-ssl\-cert=\fIname\fR +.sp +X509 cert in PEM format (check OpenSSL docs, implies +\fB\-\-ssl\fR)\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +.\" mysqladmin: SSL Cipher option +.\" SSL Cipher option: mysqladmin +\fB\-\-ssl\-cipher=\fIname\fR +.sp +SSL cipher to use (check OpenSSL docs, implies +\fB\-\-ssl\fR)\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +.\" mysqladmin: SSL Key option +.\" SSL Key option: mysqladmin +\fB\-\-ssl\-key=\fIname\fR +.sp +X509 key in PEM format (check OpenSSL docs, implies +\fB\-\-ssl\fR)\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +.\" mysqladmin: SSL Crl option +.\" SSL CRL option: mysqladmin +\fB\-\-ssl\-crl=\fIname\fR +.sp +Certificate revocation list (check OpenSSL docs, implies +\fB\-\-ssl\fR)\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +.\" mysqladmin: SSL Crlpath option +.\" SSL Crlpath option: mysqladmin +\fB\-\-ssl\-crlpath=\fIname\fR +.sp +Certificate revocation list path (check OpenSSL docs, implies +\fB\-\-ssl\fR)\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +.\" mysqladmin: SSL Verify Server Cert option +.\" SSL Verify Server Cert option: mysqladmin +\fB\-\-ssl\-verify\-server\-cert\fR +.sp +Verify server's "Common Name" in its cert against hostname used when connecting. This option is disabled by default\&. .RE .sp .RS 4 @@ -861,7 +1056,7 @@ header is corrupted\&. \fB\-\-user=\fR\fB\fIuser_name\fR\fR, \fB\-u \fR\fB\fIuser_name\fR\fR .sp -The MySQL user name to use when connecting to the server\&. +The MariaDB user name to use when connecting to the server\&. .RE .sp .RS 4 @@ -878,6 +1073,13 @@ The MySQL user name to use when connecting to the server\&. \fB\-v\fR .sp Verbose mode\&. Print information about the various stages of program operation\&. +Using one \fB--verbose\fR option will give you more information about what mysqlcheck is +doing\&. +.sp +Using two \fB--verbose\fR options will also give you connection information\&. +.sp +Using it 3 times will print out all CHECK, RENAME and ALTER TABLE during +the check phase\&. .RE .sp .RS 4 @@ -920,12 +1122,12 @@ to cause NO_WRITE_TO_BINLOG to be added to the statements so that they are not logged\&. Use the \fB\-\-skip\-write\-binlog\fR -when these statements should not be sent to replication slaves or run when using the binary logs for recovery from backup\&. This option was added in MySQL 5\&.1\&.18\&. +when these statements should not be sent to replication slaves or run when using the binary logs for recovery from backup\&. .RE .SH "COPYRIGHT" .br .PP -Copyright 2007-2008 MySQL AB, 2008-2010 Sun Microsystems, Inc. +Copyright 2007-2008 MySQL AB, 2008-2010 Sun Microsystems, Inc., 2010-2015 MariaDB Foundation .PP This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. .PP @@ -934,8 +1136,6 @@ This documentation is distributed in the hope that it will be useful, but WITHOU You should have received a copy of the GNU General Public License along with the program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or see http://www.gnu.org/licenses/. .sp .SH "SEE ALSO" -For more information, please refer to the MySQL Reference Manual, -which may already be installed locally and which is also available -online at http://dev.mysql.com/doc/. +For more information, please refer to the MariaDB Knowledge Base, available online at https://mariadb.com/kb/ .SH AUTHOR -Sun Microsystems, Inc. (http://www.mysql.com/). +MariaDB Foundation (http://www.mariadb.org/). diff --git a/man/mysqld.8 b/man/mysqld.8 index d3f5954d5e4..5f63015cf4d 100644 --- a/man/mysqld.8 +++ b/man/mysqld.8 @@ -1,13 +1,6 @@ '\" t -.\" Title: \fBmysqld\fR -.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] -.\" Generator: DocBook XSL Stylesheets v1.75.2 -.\" Date: 04/06/2010 -.\" Manual: MySQL Database System -.\" Source: MySQL 5.1 -.\" Language: English .\" -.TH "\FBMYSQLD\FR" "8" "04/06/2010" "MySQL 5\&.1" "MySQL Database System" +.TH "\FBMYSQLD\FR" "8" "04/08/2015" "MariaDB 10\&.0" "MariaDB Database System" .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- @@ -53,7 +46,7 @@ Chapter\ \&2, Installing and Upgrading MySQL\&. .SH "COPYRIGHT" .br .PP -Copyright 2007-2008 MySQL AB, 2008-2010 Sun Microsystems, Inc. +Copyright 2007-2008 MySQL AB, 2008-2010 Sun Microsystems, Inc., 2010-2015 MariaDB Foundation .PP This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. .PP @@ -62,8 +55,6 @@ This documentation is distributed in the hope that it will be useful, but WITHOU You should have received a copy of the GNU General Public License along with the program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or see http://www.gnu.org/licenses/. .sp .SH "SEE ALSO" -For more information, please refer to the MySQL Reference Manual, -which may already be installed locally and which is also available -online at http://dev.mysql.com/doc/. +For more information, please refer to the MariaDB Knowledge Base, available online at https://mariadb.com/kb/ .SH AUTHOR -Sun Microsystems, Inc. (http://www.mysql.com/). +MariaDB Foundation (http://www.mariadb.org/). diff --git a/man/mysqld_multi.1 b/man/mysqld_multi.1 index 07ffa2fd6b4..0476e7e0af6 100644 --- a/man/mysqld_multi.1 +++ b/man/mysqld_multi.1 @@ -1,13 +1,6 @@ '\" t -.\" Title: \fBmysqld_multi\fR -.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] -.\" Generator: DocBook XSL Stylesheets v1.75.2 -.\" Date: 04/06/2010 -.\" Manual: MySQL Database System -.\" Source: MySQL 5.1 -.\" Language: English .\" -.TH "\FBMYSQLD_MULTI\FR" "1" "04/06/2010" "MySQL 5\&.1" "MySQL Database System" +.TH "\FBMYSQLD_MULTI\FR" "1" "04/08/2015" "MariaDB 10\&.0" "MariaDB Database System" .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- @@ -728,7 +721,7 @@ Section\ \&4.2.3.3, \(lqUsing Option Files\(rq\&. .SH "COPYRIGHT" .br .PP -Copyright 2007-2008 MySQL AB, 2008-2010 Sun Microsystems, Inc. +Copyright 2007-2008 MySQL AB, 2008-2010 Sun Microsystems, Inc., 2010-2015 MariaDB Foundation .PP This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. .PP @@ -737,8 +730,6 @@ This documentation is distributed in the hope that it will be useful, but WITHOU You should have received a copy of the GNU General Public License along with the program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or see http://www.gnu.org/licenses/. .sp .SH "SEE ALSO" -For more information, please refer to the MySQL Reference Manual, -which may already be installed locally and which is also available -online at http://dev.mysql.com/doc/. +For more information, please refer to the MariaDB Knowledge Base, available online at https://mariadb.com/kb/ .SH AUTHOR -Sun Microsystems, Inc. (http://www.mysql.com/). +MariaDB Foundation (http://www.mariadb.org/). diff --git a/man/mysqld_safe.1 b/man/mysqld_safe.1 index 25848aecb9c..08ea7ed54e9 100644 --- a/man/mysqld_safe.1 +++ b/man/mysqld_safe.1 @@ -1,13 +1,6 @@ '\" t -.\" Title: \fBmysqld_safe\fR -.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] -.\" Generator: DocBook XSL Stylesheets v1.75.2 -.\" Date: 04/06/2010 -.\" Manual: MySQL Database System -.\" Source: MySQL 5.1 -.\" Language: English .\" -.TH "\FBMYSQLD_SAFE\FR" "1" "04/06/2010" "MySQL 5\&.1" "MySQL Database System" +.TH "\FBMYSQLD_SAFE\FR" "1" "04/08/2015" "MariaDB 10\&.0" "MariaDB Database System" .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- @@ -31,34 +24,10 @@ mysqld_safe \- MySQL server startup script \fBmysqld_safe\fR is the recommended way to start a \fBmysqld\fR -server on Unix and NetWare\&. +server on Unix\&. \fBmysqld_safe\fR -adds some safety features such as restarting the server when an error occurs and logging runtime information to an error log file\&. Descriptions of error logging and NetWare\-specific behaviors are given later in this section\&. -.if n \{\ +adds some safety features such as restarting the server when an error occurs and logging runtime information to an error log file\&. Descriptions of error logging is given later in this section\&. .sp -.\} -.RS 4 -.it 1 an-trap -.nr an-no-space-flag 1 -.nr an-break-flag 1 -.br -.ps +1 -\fBNote\fR -.ps -1 -.br -.PP -In MySQL 5\&.1\&.20 (only), the default error logging behavior with -\fBmysqld_safe\fR -is to write errors to -syslog -on systems that support the -\fBlogger\fR -program\&. This differs from the default behavior of writing an error log file for other versions\&. -.PP -\fBIn 5\&.1\&.20, logging to \fR\fBsyslog\fR\fB may fail to operate correctly in some cases; if so, use \fR\fB\fB\-\-skip\-syslog\fR\fR\fB to use the default log file or \fR\fB\fB\-\-log\-error=\fR\fB\fIfile_name\fR\fR\fR\fB to specify a log file name explicitly\&.\fR -.sp .5v -.RE -.PP \fBmysqld_safe\fR tries to start an executable named \fBmysqld\fR\&. To override the default behavior and specify explicitly the name of the server you want to run, specify a @@ -75,8 +44,7 @@ should look for the server\&. Many of the options to \fBmysqld_safe\fR are the same as the options to -\fBmysqld\fR\&. See -Section\ \&5.1.2, \(lqServer Command Options\(rq\&. +\fBmysqld\fR\&. .PP Options unknown to \fBmysqld_safe\fR @@ -84,8 +52,7 @@ are passed to \fBmysqld\fR if they are specified on the command line, but ignored if they are specified in the [mysqld_safe] or [mariadb_safe] -groups of an option file\&. See -Section\ \&4.2.3.3, \(lqUsing Option Files\(rq\&. +groups of an option file\&. .PP \fBmysqld_safe\fR reads all options from the @@ -117,11 +84,10 @@ also reads [safe_mysqld] sections, although you should rename such sections to [mysqld_safe] -in MySQL 5\&.1 installations\&. +in current installations\&. .PP \fBmysqld_safe\fR -supports the options in the following list\&. It also reads option files and supports the options for processing them described at -Section\ \&4.2.3.3.1, \(lqCommand-Line Options that Affect Option-File Handling\(rq\&. +supports the options in the following list\&. It also reads option files and supports the options for processing them. .sp .RS 4 .ie n \{\ @@ -150,7 +116,7 @@ Display a help message and exit\&. .\" basedir option: mysqld_safe \fB\-\-basedir=\fR\fB\fIpath\fR\fR .sp -The path to the MySQL installation directory\&. +The path to the MariaDB installation directory\&. .RE .sp .RS 4 @@ -263,7 +229,7 @@ Section\ \&5.2.2, \(lqThe Error Log\(rq\&. .sp The name of the server program (in the ledir -directory) that you want to start\&. This option is needed if you use the MySQL binary distribution but have the data directory outside of the binary distribution\&. If +directory) that you want to start\&. This option is needed if you use the MariaDB binary distribution but have the data directory outside of the binary distribution\&. If \fBmysqld_safe\fR cannot find the server, use the \fB\-\-ledir\fR @@ -444,7 +410,7 @@ on systems that support the program\&. \-\-skip\-syslog suppresses the use of -syslog; messages are written to an error log file\&. These options were added in MySQL 5\&.1\&.20\&. +syslog; messages are written to an error log file\&. .RE .sp .RS 4 @@ -808,7 +774,7 @@ file in the data directory\&. .SH "COPYRIGHT" .br .PP -Copyright 2007-2008 MySQL AB, 2008-2010 Sun Microsystems, Inc. +Copyright 2007-2008 MySQL AB, 2008-2010 Sun Microsystems, Inc., 2010-2015 MariaDB Foundation .PP This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. .PP @@ -817,8 +783,6 @@ This documentation is distributed in the hope that it will be useful, but WITHOU You should have received a copy of the GNU General Public License along with the program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or see http://www.gnu.org/licenses/. .sp .SH "SEE ALSO" -For more information, please refer to the MySQL Reference Manual, -which may already be installed locally and which is also available -online at http://dev.mysql.com/doc/. +For more information, please refer to the MariaDB Knowledge Base, available online at https://mariadb.com/kb/ .SH AUTHOR -Sun Microsystems, Inc. (http://www.mysql.com/). +MariaDB Foundation (http://www.mariadb.org/). diff --git a/man/mysqldump.1 b/man/mysqldump.1 index fdca51f091a..da2e4fa02c5 100644 --- a/man/mysqldump.1 +++ b/man/mysqldump.1 @@ -1,13 +1,6 @@ '\" t -.\" Title: \fBmysqldump\fR -.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] -.\" Generator: DocBook XSL Stylesheets v1.75.2 -.\" Date: 04/06/2010 -.\" Manual: MySQL Database System -.\" Source: MySQL 5.1 -.\" Language: English .\" -.TH "\FBMYSQLDUMP\FR" "1" "04/06/2010" "MySQL 5\&.1" "MySQL Database System" +.TH "\FBMYSQLDUMP\FR" "1" "04/08/2015" "MariaDB 10\&.0" "MariaDB Database System" .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- @@ -32,7 +25,7 @@ mysqldump \- a database backup program .PP The \fBmysqldump\fR -client is a backup program originally written by Igor Romanenko\&. It can be used to dump a database or a collection of databases for backup or transfer to another SQL server (not necessarily a MySQL server)\&. The dump typically contains SQL statements to create the table, populate it, or both\&. However, +client is a backup program originally written by Igor Romanenko\&. It can be used to dump a database or a collection of databases for backup or transfer to another SQL server (not necessarily a MariaDB server)\&. The dump typically contains SQL statements to create the table, populate it, or both\&. However, \fBmysqldump\fR can also be used to generate files in CSV, other delimited text, or XML format\&. .PP @@ -68,18 +61,11 @@ option, entire databases are dumped\&. .PP \fBmysqldump\fR does not dump the -INFORMATION_SCHEMA -database by default\&. As of MySQL 5\&.1\&.38, -\fBmysqldump\fR -dumps -INFORMATION_SCHEMA -if you name it explicitly on the command line, although currently you must also use the +INFORMATION_SCHEMA or performance_schema +databases by default\&. To dump these, +name them explicitly on the command line, although you must also use the \fB\-\-skip\-lock\-tables\fR -option\&. Before 5\&.1\&.38, -\fBmysqldump\fR -silently ignores -INFORMATION_SCHEMA -even if you name it explicitly on the command line\&. +option\&. .PP To see a list of the options your version of \fBmysqldump\fR @@ -207,22 +193,6 @@ or option\&. Use \fB\-\-skip\-opt\fR instead\&. -.if n \{\ -.sp -.\} -.RS 4 -.it 1 an-trap -.nr an-no-space-flag 1 -.nr an-break-flag 1 -.br -.ps +1 -\fBNote\fR -.ps -1 -.br -.PP -\fBmysqldump\fR -from MySQL 5\&.1\&.21 cannot be used to create dumps from MySQL server 5\&.1\&.20 and older\&. This issue is fixed in MySQL 5\&.1\&.22\&. (\m[blue]\fBBug#30123\fR\m[]\&\s-2\u[1]\d\s+2) -.sp .5v .RE .PP \fBmysqldump\fR @@ -232,8 +202,7 @@ and [client] option file groups\&. \fBmysqldump\fR -also supports the options for processing option files described at -Section\ \&4.2.3.3.1, \(lqCommand-Line Options that Affect Option-File Handling\(rq\&. +also supports the options for processing option file\&. .sp .RS 4 .ie n \{\ @@ -311,8 +280,7 @@ Surround each table dump with LOCK TABLES and UNLOCK TABLES -statements\&. This results in faster inserts when the dump file is reloaded\&. See -Section\ \&7.2.21, \(lqSpeed of INSERT Statements\(rq\&. +statements\&. This results in faster inserts when the dump file is reloaded\&. .RE .sp .RS 4 @@ -351,7 +319,6 @@ NDBCLUSTER table\&. This information is not otherwise included in the output from \fBmysqldump\fR\&. This option is currently relevant only to MySQL Cluster tables\&. .sp -This option was added in MySQL 5\&.1\&.6\&. .RE .sp .RS 4 @@ -377,12 +344,26 @@ Allow creation of column names that are keywords\&. This works by prefixing each .sp -1 .IP \(bu 2.3 .\} +.\" mysqldump: apply-slave-statements option +.\" apply-slave-statements option: mysqldump +\fB\-\-apply\-slave\-statements\fR +.sp +Adds 'STOP SLAVE' prior to 'CHANGE MASTER' and 'START SLAVE' to bottom of dump\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} .\" mysqldump: character-sets-dir option .\" character-sets-dir option: mysqldump \fB\-\-character\-sets\-dir=\fR\fB\fIpath\fR\fR .sp -The directory where character sets are installed\&. See -Section\ \&9.5, \(lqCharacter Set Configuration\(rq\&. +The directory where character sets are installed\&. .RE .sp .RS 4 @@ -421,24 +402,6 @@ Produce more compact output\&. This option enables the \fB\-\-skip\-disable\-keys\fR, and \fB\-\-skip\-set\-charset\fR options\&. -.if n \{\ -.sp -.\} -.RS 4 -.it 1 an-trap -.nr an-no-space-flag 1 -.nr an-break-flag 1 -.br -.ps +1 -\fBNote\fR -.ps -1 -.br -Prior to MySQL 5\&.1\&.21, this option did not create valid SQL if the database dump contained views\&. The recreation of views requires the creation and removal of temporary tables and this option suppressed the removal of those temporary tables\&. As a workaround, use -\fB\-\-compact\fR -with the -\fB\-\-add\-drop\-table\fR -option and then manually adjust the dump file\&. -.sp .5v .RE .RE .sp @@ -467,14 +430,12 @@ db2, maxdb, no_key_options, no_table_options, or -no_field_options\&. To use several values, separate them by commas\&. These values have the same meaning as the corresponding options for setting the server SQL mode\&. See -Section\ \&5.1.8, \(lqServer SQL Modes\(rq\&. +no_field_options\&. To use several values, separate them by commas\&. These values have the same meaning as the corresponding options for setting the server SQL mode\&. .sp This option does not guarantee compatibility with other servers\&. It only enables those SQL mode values that are currently available for making dump output more compatible\&. For example, \fB\-\-compatible=oracle\fR does not map data types to Oracle types or use Oracle comment syntax\&. .sp -\fIThis option requires a server version of 4\&.1\&.0 or higher\fR\&. With older servers, it does nothing\&. .RE .sp .RS 4 @@ -524,9 +485,9 @@ Compress all information sent between the client and the server if both support \fB\-\-create\-options\fR, \fB\-a\fR .sp -Include all MySQL\-specific table options in the +Include all MariaDB\-specific table options in the CREATE TABLE -statements\&. +statements\&. Use \fB\-\-skip-create-options\fR to disable. .RE .sp .RS 4 @@ -583,7 +544,7 @@ string is .\" debug-check option: mysqldump \fB\-\-debug\-check\fR .sp -Print some debugging information when the program exits\&. This option was added in MySQL 5\&.1\&.21\&. +Print some debugging information when the program exits\&. .RE .sp .RS 4 @@ -598,7 +559,22 @@ Print some debugging information when the program exits\&. This option was added .\" debug-info option: mysqldump \fB\-\-debug\-info\fR .sp -Print debugging information and memory and CPU usage statistics when the program exits\&. This option was added in MySQL 5\&.1\&.14\&. +Print debugging information and memory and CPU usage statistics when the program exits\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +.\" mysqldump: default-auth option +.\" default-auth option: mysqldump +\fB\-\-default\-auth\fR +.sp +Default authentication client-side plugin to use\&. .RE .sp .RS 4 @@ -615,16 +591,11 @@ Print debugging information and memory and CPU usage statistics when the program .sp Use \fIcharset_name\fR -as the default character set\&. See -Section\ \&9.5, \(lqCharacter Set Configuration\(rq\&. If no character set is specified, +as the default character set\&. If no character set is specified, \fBmysqldump\fR uses -utf8, and earlier versions use -latin1\&. +utf8\&. .sp -Prior to MySQL 5\&.1\&.38, this option has no effect for output data files produced by using the -\fB\-\-tab\fR -option\&. See the description for that option\&. .RE .sp .RS 4 @@ -667,6 +638,21 @@ Must be given as first option\&. .sp -1 .IP \(bu 2.3 .\} +.\" my_print_defaults: defaults-group-suffix option +.\" defaults-group-suffix option: my_print_defaults +\fB\-\-defaults\-group\-suffix=\fR\fB\fIstr\fR\fR, +.sp +Also read groups with a suffix of \fIstr\fR\&. For example, since mysqldump normally reads the [client] and [mysqldump] groups, \-\-defaults\-group\-suffix=x would cause it to also read the groups [mysqldump_x] and [client_x]\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} .\" mysqldump: delayed-insert option .\" delayed-insert option: mysqldump \fB\-\-delayed\-insert\fR @@ -756,7 +742,7 @@ control whether the date is added to the comment\&. The default is \fB\-\-dump\-date\fR (include the date in the comment)\&. \fB\-\-skip\-dump\-date\fR -suppresses date printing\&. This option was added in MySQL 5\&.1\&.23\&. +suppresses date printing\& .RE .sp .RS 4 @@ -772,7 +758,7 @@ suppresses date printing\&. This option was added in MySQL 5\&.1\&.23\&. \fB\-\-events\fR, \fB\-E\fR .sp -Include Event Scheduler events for the dumped databases in the output\&. This option was added in MySQL 5\&.1\&.8\&. +Include Event Scheduler events for the dumped databases in the output\&. .RE .sp .RS 4 @@ -821,8 +807,7 @@ These options are used with the option and have the same meaning as the corresponding FIELDS clauses for -LOAD DATA INFILE\&. See -Section\ \&12.2.6, \(lqLOAD DATA INFILE Syntax\(rq\&. +LOAD DATA INFILE\&. .RE .sp .RS 4 @@ -837,11 +822,9 @@ Section\ \&12.2.6, \(lqLOAD DATA INFILE Syntax\(rq\&. .\" first-slave option: mysqldump \fB\-\-first\-slave\fR .sp -Deprecated\&. Use +Removed in MariaDB 5.5\&. Use \fB\-\-lock\-all\-tables\fR instead\&. -\fB\-\-first\-slave\fR -is removed in MySQL 5\&.5\&. .RE .sp .RS 4 @@ -857,7 +840,7 @@ is removed in MySQL 5\&.5\&. \fB\-\-flush\-logs\fR, \fB\-F\fR .sp -Flush the MySQL server log files before starting the dump\&. This option requires the +Flush the MariaDB server log files before starting the dump\&. This option requires the RELOAD privilege\&. If you use this option in combination with the \fB\-\-all\-databases\fR @@ -893,7 +876,7 @@ database\&. This option should be used any time the dump contains the mysql database and any other database that depends on the data in the mysql -database for proper restoration\&. This option was added in MySQL 5\&.1\&.12\&. +database for proper restoration\&. .RE .sp .RS 4 @@ -930,13 +913,11 @@ prints the error message, but it also writes an SQL comment containing the view .sp -1 .IP \(bu 2.3 .\} -.\" mysqldump: host option -.\" host option: mysqldump -\fB\-\-host=\fR\fB\fIhost_name\fR\fR, -\fB\-h \fR\fB\fIhost_name\fR\fR +.\" mysqldump: gtid option +.\" gtid option: mysqldump +\fB\-\-gtid\fR .sp -Dump data from the MySQL server on the given host\&. The default host is -localhost\&. +Available from MariaDB 10.0.13, and is used together with \fB\-\-master\-data\fR and \fB\-\-dump\-slave\fR to more conveniently set up a new GTID slave\&. It causes those options to output SQL statements that configure the slave to use the global transaction ID to connect to the master instead of old-style filename/offset positions\&. The old-style positions are still included in comments when \fB\-\-gtid\fR is used; likewise the GTID position is included in comments even if \fB\-\-gtid\fR is not used\&. .RE .sp .RS 4 @@ -970,6 +951,23 @@ BIT\&. .sp -1 .IP \(bu 2.3 .\} +.\" mysqldump: host option +.\" host option: mysqldump +\fB\-\-host=\fR\fB\fIhost_name\fR\fR, +\fB\-h \fR\fB\fIhost_name\fR\fR +.sp +Dump data from the MariaDB server on the given host\&. The default host is +localhost\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} .\" mysqldump: ignore-table option .\" ignore-table option: mysqldump \fB\-\-ignore\-table=\fR\fB\fIdb_name\&.tbl_name\fR\fR @@ -985,6 +983,22 @@ Do not dump the given table, which must be specified using both the database and .sp -1 .IP \(bu 2.3 .\} +.\" mysqldump: include-master-host-port option +.\" include-master-host-port option: mysqldump +\fB\-\-include\-master\-host\-port\fR +.sp +Add the MASTER_HOST and MASTER_PORT options for the CHANGE MASTER TO statement when using +the \fB--dump-slave\fR option for a slave dump\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} .\" mysqldump: insert-ignore option .\" insert-ignore option: mysqldump \fB\-\-insert\-ignore\fR @@ -1013,8 +1027,7 @@ This option is used with the option and has the same meaning as the corresponding LINES clause for -LOAD DATA INFILE\&. See -Section\ \&12.2.6, \(lqLOAD DATA INFILE Syntax\(rq\&. +LOAD DATA INFILE\&. .RE .sp .RS 4 @@ -1063,6 +1076,8 @@ because it does not need to lock the tables at all\&. Because \fB\-\-lock\-tables\fR locks tables for each database separately, this option does not guarantee that the tables in the dump file are logically consistent between databases\&. Tables in different databases may be dumped in completely different states\&. +.sp +Use \fB--skip-lock-tables\fR to disable\&. .RE .sp .RS 4 @@ -1077,7 +1092,7 @@ locks tables for each database separately, this option does not guarantee that t .\" log-error option: mysqldump \fB\-\-log\-error=\fR\fB\fIfile_name\fR\fR .sp -Log warnings and errors by appending them to the named file\&. The default is to do no logging\&. This option was added in MySQL 5\&.1\&.18\&. +Log warnings and errors by appending them to the named file\&. The default is to do no logging\&. .RE .sp .RS 4 @@ -1110,8 +1125,7 @@ option automatically turns off \fB\-\-lock\-tables\fR\&. It also turns on \fB\-\-lock\-all\-tables\fR, unless \fB\-\-single\-transaction\fR -also is specified, in which case, a global read lock is acquired only for a short time at the beginning of the dump (see the description for -\fB\-\-single\-transaction\fR)\&. In all cases, any action on logs happens at the exact moment of the dump\&. +also is specified\&. In all cases, any action on logs happens at the exact moment of the dump\&. .sp It is also possible to set up a slave by dumping an existing slave of the master\&. To do this, use the following procedure on the existing slave: .sp @@ -1410,7 +1424,7 @@ This option is shorthand\&. It is the same as specifying \fB\-\-extended\-insert\fR \fB\-\-lock\-tables\fR \fB\-\-quick\fR -\fB\-\-set\-charset\fR\&. It should give you a fast dump operation and produce a dump file that can be reloaded into a MySQL server quickly\&. +\fB\-\-set\-charset\fR\&. It should give you a fast dump operation and produce a dump file that can be reloaded into a MariaDB server quickly\&. .sp \fIThe \fR\fI\fB\-\-opt\fR\fR\fI option is enabled by default\&. Use \fR\fI\fB\-\-skip\-opt\fR\fR\fI to disable it\&.\fR See the discussion at the beginning of this section for information about selectively enabling or disabling a subset of the options affected by @@ -1461,8 +1475,7 @@ option on the command line, \fBmysqldump\fR prompts for one\&. .sp -Specifying a password on the command line should be considered insecure\&. See -Section\ \&5.3.2.2, \(lqEnd-User Guidelines for Password Security\(rq\&. You can use an option file to avoid giving the password on the command line\&. +Specifying a password on the command line should be considered insecure\&. You can use an option file to avoid giving the password on the command line\&. .RE .sp .RS 4 @@ -1489,6 +1502,21 @@ On Windows, connect to the server via a named pipe\&. This option applies only i .sp -1 .IP \(bu 2.3 .\} +.\" mysqldump: plugin-dir option +.\" plugin-dir option: mysqldump +\fB\-\-plugin\-dir\fR +.sp +Directory for client-side plugins\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} .\" mysqldump: port option .\" port option: mysqldump \fB\-\-port=\fR\fB\fIport_num\fR\fR, @@ -1509,8 +1537,7 @@ The TCP/IP port number to use for the connection\&. .\" protocol option: mysqldump \fB\-\-protocol={TCP|SOCKET|PIPE|MEMORY}\fR .sp -The connection protocol to use for connecting to the server\&. It is useful when the other connection parameters normally would cause a protocol to be used other than the one you want\&. For details on the allowable values, see -Section\ \&4.2.2, \(lqConnecting to the MySQL Server\(rq\&. +The connection protocol to use for connecting to the server\&. It is useful when the other connection parameters normally would cause a protocol to be used other than the one you want\&. .RE .sp .RS 4 @@ -1543,7 +1570,7 @@ to retrieve rows for a table from the server a row at a time rather than retriev .\" print-defaults option: mysqldump \fB\-\-print\-defaults\fR .sp -Print the program argument list and exit\&. This must begiven as the first argument\&. +Print the program argument list and exit\&. This must be given as the first argument\&. .RE .sp .RS 4 @@ -1588,7 +1615,7 @@ Write REPLACE statements rather than INSERT -statements\&. This option was added in MySQL 5\&.1\&.3\&. +statements\&. .RE .sp .RS 4 @@ -1639,15 +1666,10 @@ statements to re\-create the routines\&. However, these statements do not includ If you require routines to be re\-created with their original timestamp attributes, do not use \fB\-\-routines\fR\&. Instead, dump and reload the contents of the mysql\&.proc -table directly, using a MySQL account that has appropriate privileges for the +table directly, using a MariaDB account that has appropriate privileges for the mysql database\&. .sp -This option was added in MySQL 5\&.1\&.2\&. Before that, stored routines are not dumped\&. Routine -DEFINER -values are not dumped until MySQL 5\&.1\&.8\&. This means that before 5\&.1\&.8, when routines are reloaded, they will be created with the definer set to the reloading user\&. If you require routines to be re\-created with their original definer, dump and load the contents of the -mysql\&.proc -table directly as described earlier\&. .RE .sp .RS 4 @@ -1718,14 +1740,6 @@ option are mutually exclusive because LOCK TABLES causes any pending transactions to be committed implicitly\&. .sp -This option is not supported for MySQL Cluster tables; the results cannot be guaranteed to be consistent due to the fact that the -NDBCLUSTER -storage engine supports only the -READ_COMMITTED -transaction isolation level\&. You should always use -NDB -backup and restore instead\&. -.sp To dump large tables, you should combine the \fB\-\-single\-transaction\fR option with @@ -1740,11 +1754,45 @@ option with .sp -1 .IP \(bu 2.3 .\} +.\" mysqldump: skip-add-drop-table option +.\" skip-add-drop-table option: mysqldump +\fB\-\-skip\-add\-drop\-table\fR +.sp +Disable the +\fB\-\-add\-drop\-table\fR +option\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +.\" mysqldump: skip-add-locks option +.\" skip-add-locks option: mysqldump +\fB\-\-skip\-add\-locks\fR +.sp +Disable the +\fB\-\-add\-locks\fR +option\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} .\" mysqldump: skip-comments option .\" skip-comments option: mysqldump \fB\-\-skip\-comments\fR .sp -See the description for the +Disable the \fB\-\-comments\fR option\&. .RE @@ -1757,11 +1805,62 @@ option\&. .sp -1 .IP \(bu 2.3 .\} +.\" mysqldump: skip-compact option +.\" skip-compact option: mysqldump +\fB\-\-skip\-compact\fR +.sp +Disable the +\fB\-\-compact\fR +option\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +.\" mysqldump: skip-disable-keys option +.\" skip-disable-keys option: mysqldump +\fB\-\-skip\-disable\-keys\fR +.sp +Disable the +\fB\-\-disable\-keys\fR +option\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +.\" mysqldump: skip-extended-insert option +.\" skip-extended-insert option: mysqldump +\fB\-\-skip\-extended\-insert\fR +.sp +Disable the +\fB\-\-extended\-insert\fR +option\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} .\" mysqldump: skip-opt option .\" skip-opt option: mysqldump \fB\-\-skip\-opt\fR .sp -See the description for the +Disable the \fB\-\-opt\fR option\&. .RE @@ -1774,6 +1873,91 @@ option\&. .sp -1 .IP \(bu 2.3 .\} +.\" mysqldump: skip-quick option +.\" skip-quick option: mysqldump +\fB\-\-skip\-quick\fR +.sp +Disable the +\fB\-\-quick\fR +option\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +.\" mysqldump: skip-quote-names option +.\" skip-quote-names option: mysqldump +\fB\-\-skip\-quote\-names\fR +.sp +Disable the +\fB\-\-quote\-names\fR +option\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +.\" mysqldump: skip-set-charset option +.\" skip-set-charset option: mysqldump +\fB\-\-skip\-set\-charset\fR +.sp +Disable the +\fB\-\-set\-charset\fR +option\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +.\" mysqldump: skip-triggers option +.\" skip-triggers option: mysqldump +\fB\-\-skip\-triggers\fR +.sp +Disable the +\fB\-\-triggers\fR +option\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +.\" mysqldump: skip-tz-utc option +.\" skip-tz-utc option: mysqldump +\fB\-\-skip\-tz\-utc\fR +.sp +Disable the +\fB\-\-tz\-utc\fR +option\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} .\" mysqldump: socket option .\" socket option: mysqldump \fB\-\-socket=\fR\fB\fIpath\fR\fR, @@ -1791,14 +1975,139 @@ localhost, the Unix socket file to use, or, on Windows, the name of the named pi .sp -1 .IP \(bu 2.3 .\} -.\" mysqldump: SSL options -.\" SSL options: mysqldump -\fB\-\-ssl*\fR -.sp -Options that begin with +.\" mysqladmin: SSL options +.\" SSL options: mysqladmin \fB\-\-ssl\fR -specify whether to connect to the server via SSL and indicate where to find SSL keys and certificates\&. See -Section\ \&5.5.6.3, \(lqSSL Command Options\(rq\&. +.sp +Enable SSL for connection (automatically enabled with other flags). Disable with +\fB\-\-skip-ssl\fR\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +.\" mysqladmin: SSL CA option +.\" SSL CA option: mysqladmin +\fB\-\-ssl\-ca=\fIname\fR +.sp +CA file in PEM format (check OpenSSL docs, implies +\fB\-\-ssl\fR)\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +.\" mysqladmin: SSL CA Path option +.\" SSL CA Path option: mysqladmin +\fB\-\-ssl\-capath=\fIname\fR +.sp +CA directory (check OpenSSL docs, implies +\fB\-\-ssl\fR)\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +.\" mysqladmin: SSL Cert option +.\" SSL Cert option: mysqladmin +\fB\-\-ssl\-cert=\fIname\fR +.sp +X509 cert in PEM format (check OpenSSL docs, implies +\fB\-\-ssl\fR)\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +.\" mysqladmin: SSL Cipher option +.\" SSL Cipher option: mysqladmin +\fB\-\-ssl\-cipher=\fIname\fR +.sp +SSL cipher to use (check OpenSSL docs, implies +\fB\-\-ssl\fR)\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +.\" mysqladmin: SSL Key option +.\" SSL Key option: mysqladmin +\fB\-\-ssl\-key=\fIname\fR +.sp +X509 key in PEM format (check OpenSSL docs, implies +\fB\-\-ssl\fR)\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +.\" mysqladmin: SSL Crl option +.\" SSL CRL option: mysqladmin +\fB\-\-ssl\-crl=\fIname\fR +.sp +Certificate revocation list (check OpenSSL docs, implies +\fB\-\-ssl\fR)\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +.\" mysqladmin: SSL Crlpath option +.\" SSL Crlpath option: mysqladmin +\fB\-\-ssl\-crlpath=\fIname\fR +.sp +Certificate revocation list path (check OpenSSL docs, implies +\fB\-\-ssl\fR)\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +.\" mysqladmin: SSL Verify Server Cert option +.\" SSL Verify Server Cert option: mysqladmin +\fB\-\-ssl\-verify\-server\-cert\fR +.sp +Verify server's "Common Name" in its cert against hostname used when connecting. This option is disabled by default\&. .RE .sp .RS 4 @@ -1852,11 +2161,9 @@ and \fB\-\-lines\-terminated\-by\fR options\&. .sp -As of MySQL 5\&.1\&.38, column values are converted to the character set specified by the +Column values are converted to the character set specified by the \fB\-\-default\-character\-set\fR -option\&. Prior to 5\&.1\&.38 or if no such option is present, values are dumped using the -binary -character set\&. In effect, there is no character set conversion\&. If a table contains columns in several character sets, the output data file will as well and you may not be able to reload the file correctly\&. +option\&. .RE .sp .RS 4 @@ -1921,7 +2228,7 @@ columns are dumped and reloaded in the time zones local to the source and destin also protects against changes due to daylight saving time\&. \fB\-\-tz\-utc\fR is enabled by default\&. To disable it, use -\fB\-\-skip\-tz\-utc\fR\&. This option was added in MySQL 5\&.1\&.2\&. +\fB\-\-skip\-tz\-utc\fR\&. .RE .sp .RS 4 @@ -1937,7 +2244,7 @@ is enabled by default\&. To disable it, use \fB\-\-user=\fR\fB\fIuser_name\fR\fR, \fB\-u \fR\fB\fIuser_name\fR\fR .sp -The MySQL user name to use when connecting to the server\&. +The MariaDB user name to use when connecting to the server\&. .RE .sp .RS 4 @@ -2050,14 +2357,14 @@ T}:T{ T} .TE .sp 1 -Beginning with MySQL 5\&.1\&.12, the output from the +The output from the \fBmysql\fR client when run using the \fB\-\-xml\fR option also follows the preceding rules\&. (See the section called \(lqMYSQL OPTIONS\(rq\&.) .sp -Beginning with MySQL 5\&.1\&.18, XML output from +XML output from \fBmysqldump\fR includes the XML namespace, as shown here: .sp @@ -2148,7 +2455,7 @@ creates rows up to net_buffer_length length\&. If you increase this variable, you should also ensure that the net_buffer_length -variable in the MySQL server is at least this large\&. +variable in the MariaDB server is at least this large\&. .RE .PP A common use of @@ -2190,7 +2497,7 @@ shell> \fBmysql \-e "source \fR\fB\fI/path\-to\-backup/backup\-file\&.sql\fR\fR\ .\} .PP \fBmysqldump\fR -is also very useful for populating databases by copying data from one MySQL server to another: +is also very useful for populating databases by copying data from one MariaDB server to another: .sp .if n \{\ .RS 4 @@ -2247,12 +2554,11 @@ shell> \fBmysqldump \-\-all\-databases \-\-single\-transaction > all_databases\& This backup acquires a global read lock on all tables (using FLUSH TABLES WITH READ LOCK) at the beginning of the dump\&. As soon as this lock has been acquired, the binary log coordinates are read and the lock is released\&. If long updating statements are running when the FLUSH -statement is issued, the MySQL server may get stalled until those statements finish\&. After that, the dump becomes lock free and does not disturb reads and writes on the tables\&. If the update statements that the MySQL server receives are short (in terms of execution time), the initial lock period should not be noticeable, even with many updates\&. +statement is issued, the MariaDB server may get stalled until those statements finish\&. After that, the dump becomes lock free and does not disturb reads and writes on the tables\&. If the update statements that the MariaDB server receives are short (in terms of execution time), the initial lock period should not be noticeable, even with many updates\&. .PP For point\-in\-time recovery (also known as \(lqroll\-forward,\(rq -when you need to restore an old backup and replay the changes that happened since that backup), it is often useful to rotate the binary log (see -Section\ \&5.2.4, \(lqThe Binary Log\(rq) or at least know the binary log coordinates to which the dump corresponds: +when you need to restore an old backup and replay the changes that happened since that backup), it is often useful to rotate the binary log or at least know the binary log coordinates to which the dump corresponds: .sp .if n \{\ .RS 4 @@ -2285,19 +2591,15 @@ options can be used simultaneously, which provides a convenient way to make an o InnoDB storage engine\&. .PP -For more information on making backups, see -Section\ \&6.2, \(lqDatabase Backup Methods\(rq, and -Section\ \&6.3, \(lqExample Backup and Recovery Strategy\(rq\&. .\" mysqldump: views .\" mysqldump: problems .\" mysqldump: workarounds .PP -If you encounter problems backing up views, please read the section that covers restrictions on views which describes a workaround for backing up views when this fails due to insufficient privileges\&. See -Section\ \&D.4, \(lqRestrictions on Views\(rq\&. +If you encounter problems backing up views, please read the section that covers restrictions on views which describes a workaround for backing up views when this fails due to insufficient privileges\&. .SH "COPYRIGHT" .br .PP -Copyright 2007-2008 MySQL AB, 2008-2010 Sun Microsystems, Inc. +Copyright 2007-2008 MySQL AB, 2008-2010 Sun Microsystems, Inc., 2010-2015 MariaDB Foundation .PP This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. .PP @@ -2312,8 +2614,6 @@ Bug#30123 \%http://bugs.mysql.com/bug.php?id=30123 .RE .SH "SEE ALSO" -For more information, please refer to the MySQL Reference Manual, -which may already be installed locally and which is also available -online at http://dev.mysql.com/doc/. +For more information, please refer to the MariaDB Knowledge Base, available online at https://mariadb.com/kb/ .SH AUTHOR -Sun Microsystems, Inc. (http://www.mysql.com/). +MariaDB Foundation (http://www.mariadb.org/). diff --git a/man/mysqldumpslow.1 b/man/mysqldumpslow.1 index d0d48f81747..bd1f5189112 100644 --- a/man/mysqldumpslow.1 +++ b/man/mysqldumpslow.1 @@ -1,13 +1,6 @@ '\" t -.\" Title: \fBmysqldumpslow\fR -.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] -.\" Generator: DocBook XSL Stylesheets v1.75.2 -.\" Date: 04/06/2010 -.\" Manual: MySQL Database System -.\" Source: MySQL 5.1 -.\" Language: English .\" -.TH "\FBMYSQLDUMPSLOW\FR" "1" "04/06/2010" "MySQL 5\&.1" "MySQL Database System" +.TH "\FBMYSQLDUMPSLOW\FR" "1" "04/08/2015" "MariaDB 10\&.0" "MariaDB Database System" .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- @@ -26,10 +19,9 @@ mysqldumpslow \- Summarize slow query log files \fBmysqldumpslow [\fR\fBoptions\fR\fB] [\fR\fB\fIlog_file\fR\fR\fB \&.\&.\&.]\fR .SH "DESCRIPTION" .PP -The MySQL slow query log contains information about queries that take a long time to execute (see -Section\ \&5.2.5, \(lqThe Slow Query Log\(rq)\&. +The MariaDB slow query log contains information about queries that take a long time to execute\&. \fBmysqldumpslow\fR -parses MySQL slow query log files and prints a summary of their contents\&. +parses MariaDB slow query log files and prints a summary of their contents\&. .PP Normally, \fBmysqldumpslow\fR @@ -132,9 +124,9 @@ Consider only queries that match the (\fBgrep\fR\-style) pattern\&. .\} \fB\-h \fR\fB\fIhost_name\fR\fR .sp -Host name of MySQL server for +Host name of MariaDB server for *\-slow\&.log -file name\&. The value can contain a wildcare\&. The default is +file name\&. The value can contain a wildcard\&. The default is * (match all)\&. .RE @@ -309,7 +301,7 @@ Count: 3 Time=2\&.13s (6s) Lock=0\&.00s (0s) Rows=0\&.0 (0), root[root]@local .SH "COPYRIGHT" .br .PP -Copyright 2007-2008 MySQL AB, 2008-2010 Sun Microsystems, Inc. +Copyright 2007-2008 MySQL AB, 2008-2010 Sun Microsystems, Inc., 2010-2015 MariaDB Foundation .PP This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. .PP @@ -318,8 +310,6 @@ This documentation is distributed in the hope that it will be useful, but WITHOU You should have received a copy of the GNU General Public License along with the program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or see http://www.gnu.org/licenses/. .sp .SH "SEE ALSO" -For more information, please refer to the MySQL Reference Manual, -which may already be installed locally and which is also available -online at http://dev.mysql.com/doc/. +For more information, please refer to the MariaDB Knowledge Base, available online at https://mariadb.com/kb/ .SH AUTHOR -Sun Microsystems, Inc. (http://www.mysql.com/). +MariaDB Foundation (http://www.mariadb.org/). diff --git a/man/mysqlhotcopy.1 b/man/mysqlhotcopy.1 index 73305ad02f6..ca560d3d643 100644 --- a/man/mysqlhotcopy.1 +++ b/man/mysqlhotcopy.1 @@ -1,13 +1,6 @@ '\" t -.\" Title: \fBmysqlhotcopy\fR -.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] -.\" Generator: DocBook XSL Stylesheets v1.75.2 -.\" Date: 04/06/2010 -.\" Manual: MySQL Database System -.\" Source: MySQL 5.1 -.\" Language: English .\" -.TH "\FBMYSQLHOTCOPY\FR" "1" "04/06/2010" "MySQL 5\&.1" "MySQL Database System" +.TH "\FBMYSQLHOTCOPY\FR" "1" "04/08/2015" "MariaDB 10\&.0" "MariaDB Database System" .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- @@ -319,15 +312,29 @@ tables in the backup\&. This makes the backup smaller and faster\&. The indexes .sp -1 .IP \(bu 2.3 .\} +.\" mysqlhotcopy: old-server option +.\" old-server option: mysqlhotcopy +\fB\-\-old\-server\fR +.sp +Connect to old MySQL-server (before v5.5) which doesn't have FLUSH TABLES WITH READ LOCK fully implemented.\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} .\" mysqlhotcopy: password option .\" password option: mysqlhotcopy \fB\-\-password=\fR\fB\fIpassword\fR\fR, \fB\-p\fR\fB\fIpassword\fR\fR .sp -The password to use when connecting to the server\&. The password value is not optional for this option, unlike for other MySQL programs\&. +The password to use when connecting to the server\&. The password value is not optional for this option, unlike for other MariaDB programs\&. .sp -Specifying a password on the command line should be considered insecure\&. See -Section\ \&5.3.2.2, \(lqEnd-User Guidelines for Password Security\(rq\&. You can use an option file to avoid giving the password on the command line\&. +Specifying a password on the command line should be considered insecure\&. You can use an option file to avoid giving the password on the command line\&. .RE .sp .RS 4 @@ -488,7 +495,7 @@ The temporary directory\&. The default is \fB\-\-user=\fR\fB\fIuser_name\fR\fR, \fB\-u \fR\fB\fIuser_name\fR\fR .sp -The MySQL user name to use when connecting to the server\&. +The MariaDB user name to use when connecting to the server\&. .RE .PP Use @@ -513,7 +520,7 @@ shell> \fBperldoc mysqlhotcopy\fR .SH "COPYRIGHT" .br .PP -Copyright 2007-2008 MySQL AB, 2008-2010 Sun Microsystems, Inc. +Copyright 2007-2008 MySQL AB, 2008-2010 Sun Microsystems, Inc., 2010-2015 MariaDB Foundation .PP This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. .PP @@ -522,8 +529,6 @@ This documentation is distributed in the hope that it will be useful, but WITHOU You should have received a copy of the GNU General Public License along with the program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or see http://www.gnu.org/licenses/. .sp .SH "SEE ALSO" -For more information, please refer to the MySQL Reference Manual, -which may already be installed locally and which is also available -online at http://dev.mysql.com/doc/. +For more information, please refer to the MariaDB Knowledge Base, available online at https://mariadb.com/kb/ .SH AUTHOR -Sun Microsystems, Inc. (http://www.mysql.com/). +MariaDB Foundation (http://www.mariadb.org/). diff --git a/man/mysqlimport.1 b/man/mysqlimport.1 index 6cd494a617c..8624e71dc3e 100644 --- a/man/mysqlimport.1 +++ b/man/mysqlimport.1 @@ -1,13 +1,6 @@ '\" t -.\" Title: \fBmysqlimport\fR -.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] -.\" Generator: DocBook XSL Stylesheets v1.75.2 -.\" Date: 04/06/2010 -.\" Manual: MySQL Database System -.\" Source: MySQL 5.1 -.\" Language: English .\" -.TH "\FBMYSQLIMPORT\FR" "1" "04/06/2010" "MySQL 5\&.1" "MySQL Database System" +.TH "\FBMYSQLIMPORT\FR" "1" "04/08/2015" "MariaDB 10\&.0" "MariaDB Database System" .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- @@ -38,8 +31,7 @@ SQL statement\&. Most options to \fBmysqlimport\fR correspond directly to clauses of LOAD DATA INFILE -syntax\&. See -Section\ \&12.2.6, \(lqLOAD DATA INFILE Syntax\(rq\&. +syntax\&. .PP Invoke \fBmysqlimport\fR @@ -64,9 +56,6 @@ patient all would be imported into a table named patient\&. .PP -For additional information about -\fBmysqldump\fR, see -Section\ \&6.4, \(lqUsing mysqldump for Backups\(rq\&. .PP \fBmysqldump\fR supports the following options, which can be specified on the command line or in the @@ -75,8 +64,7 @@ and [client] option file groups\&. \fBmysqldump\fR -also supports the options for processing option files described at -Section\ \&4.2.3.3.1, \(lqCommand-Line Options that Affect Option-File Handling\(rq\&. +also supports the options for processing option files\&. .sp .RS 4 .ie n \{\ @@ -106,8 +94,7 @@ Display a help message and exit\&. .\" character-sets-dir option: mysqlimport \fB\-\-character\-sets\-dir=\fR\fB\fIpath\fR\fR .sp -The directory where character sets are installed\&. See -Section\ \&9.5, \(lqCharacter Set Configuration\(rq\&. +The directory where character sets are installed\&. .RE .sp .RS 4 @@ -174,7 +161,7 @@ string is .\" debug-check option: mysqlimport \fB\-\-debug\-check\fR .sp -Print some debugging information when the program exits\&. This option was added in MySQL 5\&.1\&.21\&. +Print some debugging information when the program exits\&. .RE .sp .RS 4 @@ -189,7 +176,22 @@ Print some debugging information when the program exits\&. This option was added .\" debug-info option: mysqlimport \fB\-\-debug\-info\fR .sp -Print debugging information and memory and CPU usage statistics when the program exits\&. This option was added in MySQL 5\&.1\&.14\&. +Print debugging information and memory and CPU usage statistics when the program exits\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +.\" mysqlimport: default-auth option +.\" default-auth option: mysqlimport +\fB\-\-default\-auth=\fIplugin_name\fR +.sp +Default authentication client-side plugin to use\&. .RE .sp .RS 4 @@ -206,8 +208,7 @@ Print debugging information and memory and CPU usage statistics when the program .sp Use \fIcharset_name\fR -as the default character set\&. See -Section\ \&9.5, \(lqCharacter Set Configuration\(rq\&. +as the default character set\&. .RE .sp .RS 4 @@ -280,8 +281,7 @@ Empty the table before importing the text file\&. \fB\-\-fields\-escaped\-by=\&.\&.\&.\fR .sp These options have the same meaning as the corresponding clauses for -LOAD DATA INFILE\&. See -Section\ \&12.2.6, \(lqLOAD DATA INFILE Syntax\(rq\&. +LOAD DATA INFILE\&. .RE .sp .RS 4 @@ -316,7 +316,7 @@ exits if a table does not exist\&. \fB\-\-host=\fR\fB\fIhost_name\fR\fR, \fB\-h \fR\fB\fIhost_name\fR\fR .sp -Import data to the MySQL server on the given host\&. The default host is +Import data to the MariaDB server on the given host\&. The default host is localhost\&. .RE .sp @@ -369,8 +369,7 @@ lines of the data file\&. .sp This option has the same meaning as the corresponding clause for LOAD DATA INFILE\&. For example, to import Windows files that have lines terminated with carriage return/linefeed pairs, use -\fB\-\-lines\-terminated\-by="\er\en"\fR\&. (You might have to double the backslashes, depending on the escaping conventions of your command interpreter\&.) See -Section\ \&12.2.6, \(lqLOAD DATA INFILE Syntax\(rq\&. +\fB\-\-lines\-terminated\-by="\er\en"\fR\&. (You might have to double the backslashes, depending on the escaping conventions of your command interpreter\&.)\&. .RE .sp .RS 4 @@ -468,8 +467,7 @@ option on the command line, \fBmysqlimport\fR prompts for one\&. .sp -Specifying a password on the command line should be considered insecure\&. See -Section\ \&5.3.2.2, \(lqEnd-User Guidelines for Password Security\(rq\&. You can use an option file to avoid giving the password on the command line\&. +Specifying a password on the command line should be considered insecure\&. You can use an option file to avoid giving the password on the command line\&. .RE .sp .RS 4 @@ -496,6 +494,21 @@ On Windows, connect to the server via a named pipe\&. This option applies only i .sp -1 .IP \(bu 2.3 .\} +.\" mysqlimport: plugin-dir option +.\" plugin-dir option: mysqlimport +\fB\-\-plugin\-dir=\fR\fB\fIname\fR\fR +.sp + Directory for client-side plugins\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} .\" mysqlimport: port option .\" port option: mysqlimport \fB\-\-port=\fR\fB\fIport_num\fR\fR, @@ -516,8 +529,7 @@ The TCP/IP port number to use for the connection\&. .\" protocol option: mysqlimport \fB\-\-protocol={TCP|SOCKET|PIPE|MEMORY}\fR .sp -The connection protocol to use for connecting to the server\&. It is useful when the other connection parameters normally would cause a protocol to be used other than the one you want\&. For details on the allowable values, see -Section\ \&4.2.2, \(lqConnecting to the MySQL Server\(rq\&. +The connection protocol to use for connecting to the server\&. It is useful when the other connection parameters normally would cause a protocol to be used other than the one you want\&. .RE .sp .RS 4 @@ -599,14 +611,139 @@ localhost, the Unix socket file to use, or, on Windows, the name of the named pi .sp -1 .IP \(bu 2.3 .\} -.\" mysqlimport: SSL options -.\" SSL options: mysqlimport -\fB\-\-ssl*\fR -.sp -Options that begin with +.\" mysqladmin: SSL options +.\" SSL options: mysqladmin \fB\-\-ssl\fR -specify whether to connect to the server via SSL and indicate where to find SSL keys and certificates\&. See -Section\ \&5.5.6.3, \(lqSSL Command Options\(rq\&. +.sp +Enable SSL for connection (automatically enabled with other flags). Disable with +\fB\-\-skip-ssl\fR\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +.\" mysqladmin: SSL CA option +.\" SSL CA option: mysqladmin +\fB\-\-ssl\-ca=\fIname\fR +.sp +CA file in PEM format (check OpenSSL docs, implies +\fB\-\-ssl\fR)\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +.\" mysqladmin: SSL CA Path option +.\" SSL CA Path option: mysqladmin +\fB\-\-ssl\-capath=\fIname\fR +.sp +CA directory (check OpenSSL docs, implies +\fB\-\-ssl\fR)\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +.\" mysqladmin: SSL Cert option +.\" SSL Cert option: mysqladmin +\fB\-\-ssl\-cert=\fIname\fR +.sp +X509 cert in PEM format (check OpenSSL docs, implies +\fB\-\-ssl\fR)\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +.\" mysqladmin: SSL Cipher option +.\" SSL Cipher option: mysqladmin +\fB\-\-ssl\-cipher=\fIname\fR +.sp +SSL cipher to use (check OpenSSL docs, implies +\fB\-\-ssl\fR)\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +.\" mysqladmin: SSL Key option +.\" SSL Key option: mysqladmin +\fB\-\-ssl\-key=\fIname\fR +.sp +X509 key in PEM format (check OpenSSL docs, implies +\fB\-\-ssl\fR)\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +.\" mysqladmin: SSL Crl option +.\" SSL CRL option: mysqladmin +\fB\-\-ssl\-crl=\fIname\fR +.sp +Certificate revocation list (check OpenSSL docs, implies +\fB\-\-ssl\fR)\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +.\" mysqladmin: SSL Crlpath option +.\" SSL Crlpath option: mysqladmin +\fB\-\-ssl\-crlpath=\fIname\fR +.sp +Certificate revocation list path (check OpenSSL docs, implies +\fB\-\-ssl\fR)\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +.\" mysqladmin: SSL Verify Server Cert option +.\" SSL Verify Server Cert option: mysqladmin +\fB\-\-ssl\-verify\-server\-cert\fR +.sp +Verify server's "Common Name" in its cert against hostname used when connecting. This option is disabled by default\&. .RE .sp .RS 4 @@ -622,7 +759,7 @@ Section\ \&5.5.6.3, \(lqSSL Command Options\(rq\&. \fB\-\-user=\fR\fB\fIuser_name\fR\fR, \fB\-u \fR\fB\fIuser_name\fR\fR .sp -The MySQL user name to use when connecting to the server\&. +The MariaDB user name to use when connecting to the server\&. .RE .sp .RS 4 @@ -639,7 +776,7 @@ The MySQL user name to use when connecting to the server\&. .sp Load files in parallel using \fIN\fR -threads\&. This option was added in MySQL 5\&.1\&.7\&. +threads\&. .RE .sp .RS 4 @@ -710,7 +847,7 @@ shell> \fBmysql \-e \'SELECT * FROM imptest\' test\fR .SH "COPYRIGHT" .br .PP -Copyright 2007-2008 MySQL AB, 2008-2010 Sun Microsystems, Inc. +Copyright 2007-2008 MySQL AB, 2008-2010 Sun Microsystems, Inc., 2010-2015 MariaDB Foundation .PP This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. .PP @@ -719,8 +856,6 @@ This documentation is distributed in the hope that it will be useful, but WITHOU You should have received a copy of the GNU General Public License along with the program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or see http://www.gnu.org/licenses/. .sp .SH "SEE ALSO" -For more information, please refer to the MySQL Reference Manual, -which may already be installed locally and which is also available -online at http://dev.mysql.com/doc/. +For more information, please refer to the MariaDB Knowledge Base, available online at https://mariadb.com/kb/ .SH AUTHOR -Sun Microsystems, Inc. (http://www.mysql.com/). +MariaDB Foundation (http://www.mariadb.org/). diff --git a/man/mysqlshow.1 b/man/mysqlshow.1 index b8c6fa6a620..3981748044f 100644 --- a/man/mysqlshow.1 +++ b/man/mysqlshow.1 @@ -1,13 +1,6 @@ '\" t -.\" Title: \fBmysqlshow\fR -.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] -.\" Generator: DocBook XSL Stylesheets v1.75.2 -.\" Date: 04/06/2010 -.\" Manual: MySQL Database System -.\" Source: MySQL 5.1 -.\" Language: English .\" -.TH "\FBMYSQLSHOW\FR" "1" "04/06/2010" "MySQL 5\&.1" "MySQL Database System" +.TH "\FBMYSQLSHOW\FR" "1" "04/08/2015" "MariaDB 10\&.0" "MariaDB Database System" .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- @@ -38,8 +31,7 @@ client can be used to quickly see which databases exist, their tables, or a tabl \fBmysqlshow\fR provides a command\-line interface to several SQL SHOW -statements\&. See -Section\ \&12.4.5, \(lqSHOW Syntax\(rq\&. The same information can be obtained by using those statements directly\&. For example, you can issue them from the +statements\&. The same information can be obtained by using those statements directly\&. For example, you can issue them from the \fBmysql\fR client program\&. .PP @@ -118,8 +110,7 @@ and [client] option file groups\&. \fBmysqlshow\fR -also supports the options for processing option files described at -Section\ \&4.2.3.3.1, \(lqCommand-Line Options that Affect Option-File Handling\(rq\&. +also supports the options for processing option files described. .sp .RS 4 .ie n \{\ @@ -148,10 +139,9 @@ Display a help message and exit\&. .\" mysqlshow: character-sets-dir option .\" character-sets-dir option: mysqlshow \fB\-\-character\-sets\-dir=\fR\fB\fIpath\fR\fR, -\fB\-c\fR +\fB\-c\fR \fIpath\fR\fR .sp -The directory where character sets are installed\&. See -Section\ \&9.5, \(lqCharacter Set Configuration\(rq\&. +The directory where character sets are installed\&. .RE .sp .RS 4 @@ -218,7 +208,7 @@ string is .\" debug-check option: mysqlshow \fB\-\-debug\-check\fR .sp -Print some debugging information when the program exits\&. This option was added in MySQL 5\&.1\&.21\&. +Print some debugging information when the program exits\&. .RE .sp .RS 4 @@ -233,7 +223,22 @@ Print some debugging information when the program exits\&. This option was added .\" debug-info option: mysqlshow \fB\-\-debug\-info\fR .sp -Print debugging information and memory and CPU usage statistics when the program exits\&. This option was added in MySQL 5\&.1\&.14\&. +Print debugging information and memory and CPU usage statistics when the program exits\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +.\" mysqlshow: default-auth option +.\" default-auth option: mysqlshow +\fB\-\-default\-auth=\fR\fB\fIname\fR +.sp +Default authentication client-side plugin to use\&. .RE .sp .RS 4 @@ -250,8 +255,7 @@ Print debugging information and memory and CPU usage statistics when the program .sp Use \fIcharset_name\fR -as the default character set\&. See -Section\ \&9.5, \(lqCharacter Set Configuration\(rq\&. +as the default character set\&. .RE .sp .RS 4 @@ -294,12 +298,27 @@ Must be given as first option\&. .sp -1 .IP \(bu 2.3 .\} +.\" mysqlshow_defaults: defaults-group-suffix option +.\" defaults-group-suffix option: mysqlshow +\fB\-\-defaults\-group\-suffix=\fR\fB\fIsuffix\fR\fR +.sp +In addition to the groups named on the command line, read groups that have the given suffix\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} .\" mysqlshow: host option .\" host option: mysqlshow \fB\-\-host=\fR\fB\fIhost_name\fR\fR, \fB\-h \fR\fB\fIhost_name\fR\fR .sp -Connect to the MySQL server on the given host\&. +Connect to the MariaDB server on the given host\&. .RE .sp .RS 4 @@ -359,8 +378,7 @@ option on the command line, \fBmysqlshow\fR prompts for one\&. .sp -Specifying a password on the command line should be considered insecure\&. See -Section\ \&5.3.2.2, \(lqEnd-User Guidelines for Password Security\(rq\&. You can use an option file to avoid giving the password on the command line\&. +Specifying a password on the command line should be considered insecure\&. You can use an option file to avoid giving the password on the command line\&. .RE .sp .RS 4 @@ -387,6 +405,21 @@ On Windows, connect to the server via a named pipe\&. This option applies only i .sp -1 .IP \(bu 2.3 .\} +.\" mysqlshow: plugin-dir option +.\" plugin-dir option: mysqlshow +\fB\-\-plugin\-dir=\fIdir_name\fR +.sp +Directory for client-side plugins\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} .\" mysqlshow: port option .\" port option: mysqlshow \fB\-\-port=\fR\fB\fIport_num\fR\fR, @@ -407,8 +440,7 @@ The TCP/IP port number to use for the connection\&. .\" protocol option: mysqlshow \fB\-\-protocol={TCP|SOCKET|PIPE|MEMORY}\fR .sp -The connection protocol to use for connecting to the server\&. It is useful when the other connection parameters normally would cause a protocol to be used other than the one you want\&. For details on the allowable values, see -Section\ \&4.2.2, \(lqConnecting to the MySQL Server\(rq\&. +The connection protocol to use for connecting to the server\&. It is useful when the other connection parameters normally would cause a protocol to be used other than the one you want\&. .RE .sp .RS 4 @@ -474,12 +506,137 @@ localhost, the Unix socket file to use, or, on Windows, the name of the named pi .\} .\" mysqlshow: SSL options .\" SSL options: mysqlshow -\fB\-\-ssl*\fR -.sp -Options that begin with \fB\-\-ssl\fR -specify whether to connect to the server via SSL and indicate where to find SSL keys and certificates\&. See -Section\ \&5.5.6.3, \(lqSSL Command Options\(rq\&. +.sp +Enable SSL for connection (automatically enabled with other flags). Disable with +\fB\-\-skip-ssl\fR\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +.\" mysqlshow: SSL CA option +.\" SSL CA option: mysqlshow +\fB\-\-ssl\-ca=\fIname\fR +.sp +CA file in PEM format (check OpenSSL docs, implies +\fB\-\-ssl\fR)\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +.\" mysqlshow: SSL CA Path option +.\" SSL CA Path option: mysqlshow +\fB\-\-ssl\-capath=\fIname\fR +.sp +CA directory (check OpenSSL docs, implies +\fB\-\-ssl\fR)\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +.\" mysqlshow: SSL Cert option +.\" SSL Cert option: mysqlshow +\fB\-\-ssl\-cert=\fIname\fR +.sp +X509 cert in PEM format (check OpenSSL docs, implies +\fB\-\-ssl\fR)\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +.\" mysqlshow: SSL Cipher option +.\" SSL Cipher option: mysqlshow +\fB\-\-ssl\-cipher=\fIname\fR +.sp +SSL cipher to use (check OpenSSL docs, implies +\fB\-\-ssl\fR)\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +.\" mysqlshow: SSL Key option +.\" SSL Key option: mysqlshow +\fB\-\-ssl\-key=\fIname\fR +.sp +X509 key in PEM format (check OpenSSL docs, implies +\fB\-\-ssl\fR)\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +.\" mysqlshow: SSL Crl option +.\" SSL CRL option: mysqlshow +\fB\-\-ssl\-crl=\fIname\fR +.sp +Certificate revocation list (check OpenSSL docs, implies +\fB\-\-ssl\fR)\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +.\" mysqlshow: SSL Crlpath option +.\" SSL Crlpath option: mysqlshow +\fB\-\-ssl\-crlpath=\fIname\fR +.sp +Certificate revocation list path (check OpenSSL docs, implies +\fB\-\-ssl\fR)\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +.\" mysqlshow: SSL Verify Server Cert option +.\" SSL Verify Server Cert option: mysqlshow +\fB\-\-ssl\-verify\-server\-cert\fR +.sp +Verify server's "Common Name" in its cert against hostname used when connecting. This option is disabled by default\&. .RE .sp .RS 4 @@ -511,7 +668,7 @@ Display extra information about each table\&. \fB\-\-user=\fR\fB\fIuser_name\fR\fR, \fB\-u \fR\fB\fIuser_name\fR\fR .sp -The MySQL user name to use when connecting to the server\&. +The MariaDB user name to use when connecting to the server\&. .RE .sp .RS 4 @@ -548,7 +705,7 @@ Display version information and exit\&. .SH "COPYRIGHT" .br .PP -Copyright 2007-2008 MySQL AB, 2008-2010 Sun Microsystems, Inc. +Copyright 2007-2008 MySQL AB, 2008-2010 Sun Microsystems, Inc., 2010-2015 MariaDB Foundation .PP This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. .PP @@ -557,8 +714,6 @@ This documentation is distributed in the hope that it will be useful, but WITHOU You should have received a copy of the GNU General Public License along with the program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or see http://www.gnu.org/licenses/. .sp .SH "SEE ALSO" -For more information, please refer to the MySQL Reference Manual, -which may already be installed locally and which is also available -online at http://dev.mysql.com/doc/. +For more information, please refer to the MariaDB Knowledge Base, available online at https://mariadb.com/kb/ .SH AUTHOR -Sun Microsystems, Inc. (http://www.mysql.com/). +MariaDB Foundation (http://www.mariadb.org/). diff --git a/man/mysqlslap.1 b/man/mysqlslap.1 index e795be397a2..f2ba65e0f03 100644 --- a/man/mysqlslap.1 +++ b/man/mysqlslap.1 @@ -1,13 +1,6 @@ '\" t -.\" Title: \fBmysqlslap\fR -.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] -.\" Generator: DocBook XSL Stylesheets v1.75.2 -.\" Date: 04/06/2010 -.\" Manual: MySQL Database System -.\" Source: MySQL 5.1 -.\" Language: English .\" -.TH "\FBMYSQLSLAP\FR" "1" "04/06/2010" "MySQL 5\&.1" "MySQL Database System" +.TH "\FBMYSQLSLAP\FR" "1" "04/08/2015" "MariaDB 10\&.0" "MariaDB Database System" .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- @@ -28,9 +21,7 @@ mysqlslap \- load emulation client .SH "DESCRIPTION" .PP \fBmysqlslap\fR -is a diagnostic program designed to emulate client load for a MySQL server and to report the timing of each stage\&. It works as if multiple clients are accessing the server\&. -\fBmysqlslap\fR -is available as of MySQL 5\&.1\&.4\&. +is a diagnostic program designed to emulate client load for a MariaDB server and to report the timing of each stage\&. It works as if multiple clients are accessing the server\&. .PP Invoke \fBmysqlslap\fR @@ -157,8 +148,7 @@ and [client] option file groups\&. \fBmysqlslap\fR -also supports the options for processing option files described at -Section\ \&4.2.3.3.1, \(lqCommand-Line Options that Affect Option-File Handling\(rq\&. +also supports the options for processing option files\&. .sp .RS 4 .ie n \{\ @@ -206,7 +196,7 @@ Generate SQL statements automatically when they are not supplied in files or via .sp Add an AUTO_INCREMENT -column to automatically generated tables\&. This option was added in MySQL 5\&.1\&.18\&. +column to automatically generated tables\&. .RE .sp .RS 4 @@ -221,7 +211,7 @@ column to automatically generated tables\&. This option was added in MySQL 5\&.1 .\" auto-generate-sql-execute-number option: mysqlslap \fB\-\-auto\-generate\-sql\-execute\-number=\fR\fB\fIN\fR\fR .sp -Specify how many queries to generate automatically\&. This option was added in MySQL 5\&.1\&.18\&. +Specify how many queries to generate automatically\&. .RE .sp .RS 4 @@ -236,7 +226,7 @@ Specify how many queries to generate automatically\&. This option was added in M .\" auto-generate-sql-guid-primary option: mysqlslap \fB\-\-auto\-generate\-sql\-guid\-primary\fR .sp -Add a GUID\-based primary key to automatically generated tables\&. This option was added in MySQL 5\&.1\&.18\&. +Add a GUID\-based primary key to automatically generated tables\&. .RE .sp .RS 4 @@ -262,7 +252,7 @@ update (update primary keys), or mixed (half inserts, half scanning selects)\&. The default is -mixed\&. This option was added in MySQL 5\&.1\&.16\&. +mixed\&. .RE .sp .RS 4 @@ -277,7 +267,7 @@ mixed\&. This option was added in MySQL 5\&.1\&.16\&. .\" auto-generate-sql-secondary-indexes option: mysqlslap \fB\-\-auto\-generate\-sql\-secondary\-indexes=\fR\fB\fIN\fR\fR .sp -Specify how many secondary indexes to add to automatically generated tables\&. By default, none are added\&. This option was added in MySQL 5\&.1\&.18\&. +Specify how many secondary indexes to add to automatically generated tables\&. By default, none are added\&. .RE .sp .RS 4 @@ -294,7 +284,7 @@ Specify how many secondary indexes to add to automatically generated tables\&. B .sp How many different queries to generate for automatic tests\&. For example, if you run a key -test that performs 1000 selects, you can use this option with a value of 1000 to run 1000 unique queries, or with a value of 50 to perform 50 different selects\&. The default is 10\&. This option was added in MySQL 5\&.1\&.18\&. +test that performs 1000 selects, you can use this option with a value of 1000 to run 1000 unique queries, or with a value of 50 to perform 50 different selects\&. The default is 10\&. .RE .sp .RS 4 @@ -310,7 +300,7 @@ test that performs 1000 selects, you can use this option with a value of 1000 to \fB\-\-auto\-generate\-sql\-unique\-write\-number=\fR\fB\fIN\fR\fR .sp How many different queries to generate for -\fB\-\-auto\-generate\-sql\-write\-number\fR\&. The default is 10\&. This option was added in MySQL 5\&.1\&.18\&. +\fB\-\-auto\-generate\-sql\-write\-number\fR\&. The default is 10\&. .RE .sp .RS 4 @@ -325,7 +315,7 @@ How many different queries to generate for .\" auto-generate-sql-write-number option: mysqlslap \fB\-\-auto\-generate\-sql\-write\-number=\fR\fB\fIN\fR\fR .sp -How many row inserts to perform on each thread\&. The default is 100\&. This option was added in MySQL 5\&.1\&.16\&. +How many row inserts to perform on each thread\&. The default is 100\&. .RE .sp .RS 4 @@ -340,7 +330,7 @@ How many row inserts to perform on each thread\&. The default is 100\&. This opt .\" commit option: mysqlslap \fB\-\-commit=\fR\fB\fIN\fR\fR .sp -How many statements to execute before committing\&. The default is 0 (no commits are done)\&. This option was added in MySQL 5\&.1\&.21\&. +How many statements to execute before committing\&. The default is 0 (no commits are done)\&. .RE .sp .RS 4 @@ -404,7 +394,7 @@ The file or string containing the statement to use for creating the table\&. .\" create-schema option: mysqlslap \fB\-\-create\-schema=\fR\fB\fIvalue\fR\fR .sp -The schema in which to run the tests\&. This option was added in MySQL 5\&.1\&.5\&. +The schema in which to run the tests\&. .RE .sp .RS 4 @@ -419,7 +409,7 @@ The schema in which to run the tests\&. This option was added in MySQL 5\&.1\&.5 .\" csv option: mysqlslap \fB\-\-csv[=\fR\fB\fIfile_name\fR\fR\fB]\fR .sp -Generate output in comma\-separated values format\&. The output goes to the named file, or to the standard output if no file is given\&. This option was added in MySQL 5\&.1\&.5\&. +Generate output in comma\-separated values format\&. The output goes to the named file, or to the standard output if no file is given\&. .RE .sp .RS 4 @@ -454,7 +444,7 @@ string is .\" debug-check option: mysqlslap \fB\-\-debug\-check\fR .sp -Print some debugging information when the program exits\&. This option was added in MySQL 5\&.1\&.21\&. +Print some debugging information when the program exits\&. .RE .sp .RS 4 @@ -470,7 +460,22 @@ Print some debugging information when the program exits\&. This option was added \fB\-\-debug\-info\fR, \fB\-T\fR .sp -Print debugging information and memory and CPU usage statistics when the program exits\&. This option was added in MySQL 5\&.1\&.21\&. +Print debugging information and memory and CPU usage statistics when the program exits\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +.\" mysqlslap: default-auth option +.\" default-auth option: mysqlslap +\fB\-\-default\-auth=\fR\fB\fIname\fR +.sp +Default authentication client-side plugin to use\&. .RE .sp .RS 4 @@ -535,7 +540,7 @@ The delimiter to use in SQL statements supplied in files or via command options\ .sp Detach (close and reopen) each connection after each \fIN\fR -statements\&. The default is 0 (connections are not detached)\&. This option was added in MySQL 5\&.1\&.21\&. +statements\&. The default is 0 (connections are not detached)\&. .RE .sp .RS 4 @@ -551,7 +556,9 @@ statements\&. The default is 0 (connections are not detached)\&. This option was \fB\-\-engine=\fR\fB\fIengine_name\fR\fR, \fB\-e \fR\fB\fIengine_name\fR\fR .sp -The storage engine to use for creating tables\&. +Comma separated list of storage engines to use for creating the table\&. The test is run for +each engine\&. You can also specify an option for an engine after a colon, for example +\fBmemory:max_row=2300\fR\&. .RE .sp .RS 4 @@ -567,7 +574,7 @@ The storage engine to use for creating tables\&. \fB\-\-host=\fR\fB\fIhost_name\fR\fR, \fB\-h \fR\fB\fIhost_name\fR\fR .sp -Connect to the MySQL server on the given host\&. +Connect to the MariaDB server on the given host\&. .RE .sp .RS 4 @@ -582,7 +589,7 @@ Connect to the MySQL server on the given host\&. .\" init-command option: mysqlslap \fB\-\-init\-command=str\fR .sp -SQL Command to execute when connecting to MySQL server\&. Will automatically be re\-executed when reconnecting\&. +SQL Command to execute when connecting to MariaDB server\&. Will automatically be re\-executed when reconnecting\&. .RE .sp .RS 4 @@ -609,21 +616,6 @@ The number of times to run the tests\&. .sp -1 .IP \(bu 2.3 .\} -.\" mysqlslap: lock-directory option -.\" lock-directory option: mysqlslap -\fB\-\-lock\-directory=\fR\fB\fIpath\fR\fR -.sp -The directory to use for storing locks\&. This option was added in MySQL 5\&.1\&.5 and removed in 5\&.1\&.18\&. -.RE -.sp -.RS 4 -.ie n \{\ -\h'-04'\(bu\h'+03'\c -.\} -.el \{\ -.sp -1 -.IP \(bu 2.3 -.\} .\" mysqlslap: no-defaults option .\" no-defaults option: mysqlslap \fB\-\-no\-defaults\fR @@ -644,7 +636,7 @@ first argument\&. .\" no-drop option: mysqlslap \fB\-\-no\-drop\fR .sp -Do not drop the schema after the test\&. +Do not drop any schema created during the test after the test is complete\&. .RE .sp .RS 4 @@ -715,8 +707,6 @@ shell> \fBmysqlslap \-\-delimiter=";" \-\-number\-of\-queries=10\fR .if n \{\ .RE .\} -.sp -This option was added in MySQL 5\&.1\&.5\&. .RE .sp .RS 4 @@ -733,7 +723,7 @@ This option was added in MySQL 5\&.1\&.5\&. .sp Do not connect to databases\&. \fBmysqlslap\fR -only prints what it would have done\&. This option was added in MySQL 5\&.1\&.5\&. +only prints what it would have done\&. .RE .sp .RS 4 @@ -761,8 +751,7 @@ option on the command line, \fBmysqlslap\fR prompts for one\&. .sp -Specifying a password on the command line should be considered insecure\&. See -Section\ \&5.3.2.2, \(lqEnd-User Guidelines for Password Security\(rq\&. You can use an option file to avoid giving the password on the command line\&. +Specifying a password on the command line should be considered insecure\&. You can use an option file to avoid giving the password on the command line\&. .RE .sp .RS 4 @@ -789,6 +778,21 @@ On Windows, connect to the server via a named pipe\&. This option applies only i .sp -1 .IP \(bu 2.3 .\} +.\" mysqlslap: plugin-dir option +.\" plugin-dir option: mysqlslap +\fB\-\-plugin\-dir=\fIdir_name\fR +.sp +Directory for client-side plugins\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} .\" mysqlslap: port option .\" port option: mysqlslap \fB\-\-port=\fR\fB\fIport_num\fR\fR, @@ -809,7 +813,7 @@ The TCP/IP port number to use for the connection\&. .\" post-query option: mysqlslap \fB\-\-post\-query=\fR\fB\fIvalue\fR\fR .sp -The file or string containing the statement to execute after the tests have completed\&. This execution is not counted for timing purposes\&. This option was added in MySQL 5\&.1\&.18\&. +The file or string containing the statement to execute after the tests have completed\&. This execution is not counted for timing purposes\&. .RE .sp .RS 4 @@ -820,11 +824,45 @@ The file or string containing the statement to execute after the tests have comp .sp -1 .IP \(bu 2.3 .\} -.\" mysqlslap: shared-memory-base-name option -.\" shared-memory-base-name option: mysqlslap -\fB\-\-shared\-memory\-base\-name=\fR\fB\fIname\fR\fR +.\" mysqlslap: post-system option +.\" post-system option: mysqlslap +\fB\-\-post\-system=\fR\fB\fIstr\fR\fR .sp -On Windows, the shared\-memory name to use, for connections made via shared memory to a local server\&. This option applies only if the server supports shared\-memory connections\&. +The string to execute via +system() +after the tests have completed\&. This execution is not counted for timing purposes\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +.\" mysqlslap: pre-query option +.\" pre-query option: mysqlslap +\fB\-\-pre\-query=\fR\fB\fIvalue\fR\fR +.sp +The file or string containing the statement to execute before running the tests\&. This execution is not counted for timing purposes\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +.\" mysqlslap: pre-system option +.\" pre-system option: mysqlslap +\fB\-\-pre\-system=\fR\fB\fIstr\fR\fR +.sp +The string to execute via +system() +before running the tests\&. This execution is not counted for timing purposes\&. .RE .sp .RS 4 @@ -851,82 +889,11 @@ This must be given as the first argument\&. .sp -1 .IP \(bu 2.3 .\} -.\" mysqlslap: post-system option -.\" post-system option: mysqlslap -\fB\-\-post\-system=\fR\fB\fIstr\fR\fR -.sp -The string to execute via -system() -after the tests have completed\&. This execution is not counted for timing purposes\&. This option was added in MySQL 5\&.1\&.21\&. -.RE -.sp -.RS 4 -.ie n \{\ -\h'-04'\(bu\h'+03'\c -.\} -.el \{\ -.sp -1 -.IP \(bu 2.3 -.\} -.\" mysqlslap: pre-query option -.\" pre-query option: mysqlslap -\fB\-\-pre\-query=\fR\fB\fIvalue\fR\fR -.sp -The file or string containing the statement to execute before running the tests\&. This execution is not counted for timing purposes\&. This option was added in MySQL 5\&.1\&.18\&. -.RE -.sp -.RS 4 -.ie n \{\ -\h'-04'\(bu\h'+03'\c -.\} -.el \{\ -.sp -1 -.IP \(bu 2.3 -.\} -.\" mysqlslap: pre-system option -.\" pre-system option: mysqlslap -\fB\-\-pre\-system=\fR\fB\fIstr\fR\fR -.sp -The string to execute via -system() -before running the tests\&. This execution is not counted for timing purposes\&. This option was added in MySQL 5\&.1\&.21\&. -.RE -.sp -.RS 4 -.ie n \{\ -\h'-04'\(bu\h'+03'\c -.\} -.el \{\ -.sp -1 -.IP \(bu 2.3 -.\} -.\" mysqlslap: preserve-schema option -.\" preserve-schema option: mysqlslap -\fB\-\-preserve\-schema\fR -.sp -Preserve the schema from the -\fBmysqlslap\fR -run\&. The -\fB\-\-auto\-generate\-sql\fR -and -\fB\-\-create\fR -options disable this option\&. This option was added in MySQL 5\&.1\&.5 and removed in MySQL 5\&.1\&.23\&. -.RE -.sp -.RS 4 -.ie n \{\ -\h'-04'\(bu\h'+03'\c -.\} -.el \{\ -.sp -1 -.IP \(bu 2.3 -.\} .\" mysqlslap: protocol option .\" protocol option: mysqlslap \fB\-\-protocol={TCP|SOCKET|PIPE|MEMORY}\fR .sp -The connection protocol to use for connecting to the server\&. It is useful when the other connection parameters normally would cause a protocol to be used other than the one you want\&. For details on the allowable values, see -Section\ \&4.2.2, \(lqConnecting to the MySQL Server\(rq\&. +The connection protocol to use for connecting to the server\&. It is useful when the other connection parameters normally would cause a protocol to be used other than the one you want\&. .RE .sp .RS 4 @@ -955,12 +922,11 @@ statement to use for retrieving data\&. .sp -1 .IP \(bu 2.3 .\} -.\" mysqlslap: silent option -.\" silent option: mysqlslap -\fB\-\-silent\fR, -\fB\-s\fR +.\" mysqlslap: shared-memory-base-name option +.\" shared-memory-base-name option: mysqlslap +\fB\-\-shared\-memory\-base\-name=\fR\fB\fIname\fR\fR .sp -Silent mode\&. No output\&. +On Windows, the shared\-memory name to use, for connections made via shared memory to a local server\&. This option applies only if the server supports shared\-memory connections\&. .RE .sp .RS 4 @@ -971,15 +937,12 @@ Silent mode\&. No output\&. .sp -1 .IP \(bu 2.3 .\} -.\" mysqlslap: slave option -.\" slave option: mysqlslap -\fB\-\-slave\fR +.\" mysqlslap: silent option +.\" silent option: mysqlslap +\fB\-\-silent\fR, +\fB\-s\fR .sp -Follow master locks for other -\fBmysqlslap\fR -clients\&. Use this option if you are trying to synchronize around one master server with -\fB\-\-lock\-directory\fR -plus NFS\&. This option was added in MySQL 5\&.1\&.5 and removed in 5\&.1\&.18\&. +Silent mode\&. No output\&. .RE .sp .RS 4 @@ -1007,14 +970,12 @@ localhost, the Unix socket file to use, or, on Windows, the name of the named pi .sp -1 .IP \(bu 2.3 .\} -.\" mysqlslap: SSL options -.\" SSL options: mysqlslap -\fB\-\-ssl*\fR -.sp -Options that begin with +.\" mysqlshow: SSL options +.\" SSL options: mysqlshow \fB\-\-ssl\fR -specify whether to connect to the server via SSL and indicate where to find SSL keys and certificates\&. See -Section\ \&5.5.6.3, \(lqSSL Command Options\(rq\&. +.sp +Enable SSL for connection (automatically enabled with other flags). Disable with +\fB\-\-skip-ssl\fR\&. .RE .sp .RS 4 @@ -1025,17 +986,123 @@ Section\ \&5.5.6.3, \(lqSSL Command Options\(rq\&. .sp -1 .IP \(bu 2.3 .\} -.\" mysqlslap: use-threads option -.\" use-threads option: mysqlslap -\fB\-\-use\-threads\fR +.\" mysqlshow: SSL CA option +.\" SSL CA option: mysqlshow +\fB\-\-ssl\-ca=\fIname\fR .sp -On Unix, the default is to use -fork() -calls and this option causes -\fBpthread\fR -calls to be used instead\&. (On Windows, the default is to use -pthread -calls and the option has no effect\&.) This option was added in MySQL 5\&.1\&.6 and removed in 5\&.1\&.18\&. +CA file in PEM format (check OpenSSL docs, implies +\fB\-\-ssl\fR)\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +.\" mysqlshow: SSL CA Path option +.\" SSL CA Path option: mysqlshow +\fB\-\-ssl\-capath=\fIname\fR +.sp +CA directory (check OpenSSL docs, implies +\fB\-\-ssl\fR)\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +.\" mysqlshow: SSL Cert option +.\" SSL Cert option: mysqlshow +\fB\-\-ssl\-cert=\fIname\fR +.sp +X509 cert in PEM format (check OpenSSL docs, implies +\fB\-\-ssl\fR)\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +.\" mysqlshow: SSL Cipher option +.\" SSL Cipher option: mysqlshow +\fB\-\-ssl\-cipher=\fIname\fR +.sp +SSL cipher to use (check OpenSSL docs, implies +\fB\-\-ssl\fR)\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +.\" mysqlshow: SSL Key option +.\" SSL Key option: mysqlshow +\fB\-\-ssl\-key=\fIname\fR +.sp +X509 key in PEM format (check OpenSSL docs, implies +\fB\-\-ssl\fR)\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +.\" mysqlshow: SSL Crl option +.\" SSL CRL option: mysqlshow +\fB\-\-ssl\-crl=\fIname\fR +.sp +Certificate revocation list (check OpenSSL docs, implies +\fB\-\-ssl\fR)\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +.\" mysqlshow: SSL Crlpath option +.\" SSL Crlpath option: mysqlshow +\fB\-\-ssl\-crlpath=\fIname\fR +.sp +Certificate revocation list path (check OpenSSL docs, implies +\fB\-\-ssl\fR)\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +.\" mysqlshow: SSL Verify Server Cert option +.\" SSL Verify Server Cert option: mysqlshow +\fB\-\-ssl\-verify\-server\-cert\fR +.sp +Verify server's "Common Name" in its cert against hostname used when connecting. This option is disabled by default\&. .RE .sp .RS 4 @@ -1051,7 +1118,7 @@ calls and the option has no effect\&.) This option was added in MySQL 5\&.1\&.6 \fB\-\-user=\fR\fB\fIuser_name\fR\fR, \fB\-u \fR\fB\fIuser_name\fR\fR .sp -The MySQL user name to use when connecting to the server\&. +The MariaDB user name to use when connecting to the server\&. .RE .sp .RS 4 @@ -1088,7 +1155,7 @@ Display version information and exit\&. .SH "COPYRIGHT" .br .PP -Copyright 2007-2008 MySQL AB, 2008-2010 Sun Microsystems, Inc. +Copyright 2007-2008 MySQL AB, 2008-2010 Sun Microsystems, Inc., 2010-2015 MariaDB Foundation .PP This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. .PP @@ -1097,8 +1164,6 @@ This documentation is distributed in the hope that it will be useful, but WITHOU You should have received a copy of the GNU General Public License along with the program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or see http://www.gnu.org/licenses/. .sp .SH "SEE ALSO" -For more information, please refer to the MySQL Reference Manual, -which may already be installed locally and which is also available -online at http://dev.mysql.com/doc/. +For more information, please refer to the MariaDB Knowledge Base, available online at https://mariadb.com/kb/ .SH AUTHOR -Sun Microsystems, Inc. (http://www.mysql.com/). +MariaDB Foundation (http://www.mariadb.org/). diff --git a/man/mysqltest.1 b/man/mysqltest.1 index c68d851cbfc..80c3852b9a9 100644 --- a/man/mysqltest.1 +++ b/man/mysqltest.1 @@ -1,13 +1,6 @@ '\" t -.\" Title: \fBmysqltest\fR -.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] -.\" Generator: DocBook XSL Stylesheets v1.75.2 -.\" Date: 03/31/2010 -.\" Manual: MySQL Database System -.\" Source: MySQL -.\" Language: English .\" -.TH "\FBMYSQLTEST\FR" "1" "03/31/2010" "MySQL" "MySQL Database System" +.TH "\FBMYSQLTEST\FR" "1" "04/08/2015" "MariaDB 10\&.0" "MariaDB Database System" .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- @@ -33,7 +26,7 @@ mysqltest_embedded \- program to run embedded test cases .PP The \fBmysqltest\fR -program runs a test case against a MySQL server and optionally compares the output with a result file\&. This program reads input written in a special test language\&. Typically, you invoke +program runs a test case against a MariaDB server and optionally compares the output with a result file\&. This program reads input written in a special test language\&. Typically, you invoke \fBmysqltest\fR via \fBmysql\-test\-run\&.pl\fR @@ -55,7 +48,7 @@ Features of .sp -1 .IP \(bu 2.3 .\} -Can send SQL statements to MySQL servers for execution +Can send SQL statements to MariaDB servers for execution .RE .sp .RS 4 @@ -101,7 +94,7 @@ servers and switch between connections .sp -1 .IP \(bu 2.3 .\} -Can connect to an embedded server (libmysqld), if MySQL is compiled with support for +Can connect to an embedded server (libmysqld), if MariaDB is compiled with support for libmysqld\&. (In this case, the executable is named \fBmysqltest_embedded\fR rather than @@ -206,7 +199,40 @@ Compress all information sent between the client and the server if both support .sp -1 .IP \(bu 2.3 .\} -.\" mysqltest: currsor-protocol option +.\" mysqltest: connect-timeout option +.\" connect-timeout option: mysqltest +\fB\-\-connect\-timeout=\fInum\fR +.sp +This can be used to set the MYSQL_OPT_CONNECT_TIMEOUT parameter of mysql_options to change the number of seconds before an unsuccessful connection attempt times out\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +.\" mysqltest: continue-on-error option +.\" continue-on-error option: mysqltest +\fB\-\-continue\-on\-error\fR +.sp +Continue test even if we got an error\&. This is mostly +useful when testing a storage engine to see what from a +test file it can execute, or to find all syntax errors in +a newly created big test file\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +.\" mysqltest: cursor-protocol option .\" cursor-protocol option: mysqltest \fB\-\-cursor\-protocol\fR .sp @@ -242,7 +268,7 @@ The default database to use\&. \fB\-\-debug[=\fR\fB\fIdebug_options\fR\fR\fB]\fR, \fB\-#[\fR\fB\fIdebug_options\fR\fR\fB]\fR .sp -Write a debugging log if MySQL is built with debugging support\&. The default +Write a debugging log if MariaDB is built with debugging support\&. The default \fIdebug_options\fR value is \'d:t:S:i:O,/tmp/mysqltest\&.trace\'\&. @@ -291,27 +317,7 @@ Print debugging information and memory and CPU usage statistics when the program \fB\-\-host=\fR\fB\fIhost_name\fR\fR, \fB\-h \fR\fB\fIhost_name\fR\fR .sp -Connect to the MySQL server on the given host\&. -.RE -.sp -.RS 4 -.ie n \{\ -\h'-04'\(bu\h'+03'\c -.\} -.el \{\ -.sp -1 -.IP \(bu 2.3 -.\} -.\" mysqltest: include option -.\" include option: mysqltest -\fB\-\-include=\fR\fB\fIfile_name\fR\fR, -\fB\-i \fR\fB\fIfile_name\fR\fR -.sp -Include the contents of the given file before processing the contents of the test file\&. The included file should have the same format as other -\fBmysqltest\fR -test files\&. This option has the same effect as putting a -\-\-source \fIfile_name\fR -command as the first line of the test file\&. +Connect to the MariaDB server on the given host\&. .RE .sp .RS 4 @@ -373,8 +379,6 @@ The maximum number of connection attempts when connecting to server\&. \fB\-\-max\-connections=\fR\fB\fInum\fR\fR .sp The maximum number of simultaneous server connections per client (that is, per test)\&. If not set, the maximum is 128\&. Minimum allowed limit is 8, maximum is 5120\&. -.sp -This option is available from MySQL 5\&.1\&.45\&. .RE .sp .RS 4 @@ -400,6 +404,36 @@ Do not read default options from any option files\&. If used, this must be the f .sp -1 .IP \(bu 2.3 .\} +.\" mysqltest: non-blocking-api option +.\" non-blocking-api option: mysqltest +\fB\-\-non\-blocking\-api\fR +.sp +Use the non-blocking client API for communication\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +.\" mysqltest: overlay-dir option +.\" overlay-dir option: mysqltest +\fB\-\-overlay\-dir=\fIdir_name\fR +.sp +Overlay directory\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} .\" mysqltest: password option .\" password option: mysqltest \fB\-\-password[=\fR\fB\fIpassword\fR\fR\fB]\fR, @@ -424,12 +458,62 @@ option on the command line, you are prompted for one\&. .sp -1 .IP \(bu 2.3 .\} +.\" mysqltest: plugin-dir option +.\" plugin-dir option: mysqltest +\fB\-\-plugin\-dir=\fIdir_name\fR +.sp +Directory for client-side plugins\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} .\" mysqltest: port option .\" port option: mysqltest \fB\-\-port=\fR\fB\fIport_num\fR\fR, \fB\-P \fR\fB\fIport_num\fR\fR .sp -The TCP/IP port number to use for the connection\&. +The TCP/IP port number to use for the connection or 0 for default to, in order of preference, +my.cnf, $MYSQL_TCP_PORT, /etc/services, built-in default (3306)\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +.\" mysqltest: prologue option +.\" prologue option: mysqltest +\fB\-\-prologue=\fR\fB\fIname\fR\fR +.sp +Include the contents of the given file before processing the contents of the test file\&. The included file should have the same format as other +\fBmysqltest\fR +test files\&. This option has the same effect as putting a +\-\-source \fIfile_name\fR +command as the first line of the test file\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +.\" mysqltest: protocol option +.\" protocol option: mysqltest +\fB\-\-protocol={TCP|SOCKET|PIPE|MEMORY}\fR +.sp +The connection protocol to use for connecting to the server\&. It is useful when the other connection parameters normally would cause a protocol to be used other than the one you want\&. .RE .sp .RS 4 @@ -578,6 +662,21 @@ updates the given file by writing the actual test results to it\&. .sp -1 .IP \(bu 2.3 .\} +.\" mysqltest: result-format-version option +.\" result-format-version option: mysqltest +\fB\-\-result\-format\-version=\fI#\fR +.sp +Version of the result file format to use\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} .\" mysqltest: server-arg option .\" server-arg option: mysqltest \fB\-\-server\-arg=\fR\fB\fIvalue\fR\fR, @@ -629,21 +728,6 @@ Suppress all normal output\&. .sp -1 .IP \(bu 2.3 .\} -.\" mysqltest: skip-safemalloc option -.\" skip-safemalloc option: mysqltest -\fB\-\-skip\-safemalloc\fR -.sp -Do not use memory allocation checking\&. -.RE -.sp -.RS 4 -.ie n \{\ -\h'-04'\(bu\h'+03'\c -.\} -.el \{\ -.sp -1 -.IP \(bu 2.3 -.\} .\" mysqltest: sleep option .\" sleep option: mysqltest \fB\-\-sleep=\fR\fB\fInum\fR\fR, @@ -657,8 +741,7 @@ seconds\&. This option does not affect real_sleep commands\&. .sp -As of MySQL 5\&.0\&.23, an option value of 0 can be used, which effectively disables -sleep +An option value of 0 can be used, which effectively disables sleep commands in the test case\&. .RE .sp @@ -705,6 +788,164 @@ creates and invokes a stored procedure that executes the statement rather than e .sp -1 .IP \(bu 2.3 .\} +.\" mysqltest: SSL options +.\" SSL options: mysqltest +\fB\-\-ssl\fR +.sp +Enable SSL for connection (automatically enabled with other flags). Disable with +\fB\-\-skip-ssl\fR\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +.\" mysqltest: SSL CA option +.\" SSL CA option: mysqltest +\fB\-\-ssl\-ca=\fIname\fR +.sp +CA file in PEM format (check OpenSSL docs, implies +\fB\-\-ssl\fR)\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +.\" mysqltest: SSL CA Path option +.\" SSL CA Path option: mysqltest +\fB\-\-ssl\-capath=\fIname\fR +.sp +CA directory (check OpenSSL docs, implies +\fB\-\-ssl\fR)\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +.\" mysqltest: SSL Cert option +.\" SSL Cert option: mysqltest +\fB\-\-ssl\-cert=\fIname\fR +.sp +X509 cert in PEM format (check OpenSSL docs, implies +\fB\-\-ssl\fR)\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +.\" mysqltest: SSL Cipher option +.\" SSL Cipher option: mysqltest +\fB\-\-ssl\-cipher=\fIname\fR +.sp +SSL cipher to use (check OpenSSL docs, implies +\fB\-\-ssl\fR)\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +.\" mysqltest: SSL Key option +.\" SSL Key option: mysqltest +\fB\-\-ssl\-key=\fIname\fR +.sp +X509 key in PEM format (check OpenSSL docs, implies +\fB\-\-ssl\fR)\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +.\" mysqltest: SSL Crl option +.\" SSL CRL option: mysqltest +\fB\-\-ssl\-crl=\fIname\fR +.sp +Certificate revocation list (check OpenSSL docs, implies +\fB\-\-ssl\fR)\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +.\" mysqltest: SSL Crlpath option +.\" SSL Crlpath option: mysqltest +\fB\-\-ssl\-crlpath=\fIname\fR +.sp +Certificate revocation list path (check OpenSSL docs, implies +\fB\-\-ssl\fR)\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +.\" mysqltest: SSL Verify Server Cert option +.\" SSL Verify Server Cert option: mysqltest +\fB\-\-ssl\-verify\-server\-cert\fR +.sp +Verify server's "Common Name" in its cert against hostname used when connecting. This option is disabled by default\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +.\" mysqltest: suite-dir option +.\" suite-dir option: mysqltest +\fB\-\-suite\-dir=\fIdir_name\fR +.sp +Suite directory\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} .\" mysqltest: tail-lines option .\" tail-lines option: mysqltest \fB\-\-tail\-lines=\fR\fB\fInn\fR\fR @@ -741,7 +982,7 @@ Read test input from this file\&. The default is to read from the standard input \fB\-\-timer\-file=\fR\fB\fIfile_name\fR\fR, \fB\-m \fR\fB\fIfile_name\fR\fR .sp -If given, the number of millisecond spent running the test will be written to this file\&. This is used by +If given, the number of microseconds spent running the test will be written to this file\&. This is used by \fBmysql\-test\-run\&.pl\fR for its reporting\&. .RE @@ -775,7 +1016,7 @@ The temporary directory where socket files are created\&. \fB\-\-user=\fR\fB\fIuser_name\fR\fR, \fB\-u \fR\fB\fIuser_name\fR\fR .sp -The MySQL user name to use when connecting to the server\&. +The MariaDB user name to use when connecting to the server\&. .RE .sp .RS 4 @@ -824,12 +1065,12 @@ Display version information and exit\&. .sp Every SELECT -statement is wrapped inside a view\&. This option was added in MySQL 5\&.0\&.19\&. +statement is wrapped inside a view\&. .RE .SH "COPYRIGHT" .br .PP -Copyright \(co 2007, 2010, Oracle and/or its affiliates +Copyright \(co 2007, 2010, Oracle and/or its affiliates, 2010-2015 MariaDB Foundation .PP This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. .PP @@ -838,8 +1079,6 @@ This documentation is distributed in the hope that it will be useful, but WITHOU You should have received a copy of the GNU General Public License along with the program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or see http://www.gnu.org/licenses/. .sp .SH "SEE ALSO" -For more information, please refer to the MySQL Reference Manual, -which may already be installed locally and which is also available -online at http://dev.mysql.com/doc/. +For more information, please refer to the MariaDB Knowledge Base, available online at https://mariadb.com/kb/ .SH AUTHOR -Sun Microsystems, Inc. (http://www.mysql.com/). +MariaDB Foundation (http://www.mariadb.org/). diff --git a/man/ndbd.8 b/man/ndbd.8 index c3c28d7491b..c3e2b3ffbad 100644 --- a/man/ndbd.8 +++ b/man/ndbd.8 @@ -1,13 +1,6 @@ '\" t -.\" Title: \fBndbd\fR -.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] -.\" Generator: DocBook XSL Stylesheets v1.75.2 -.\" Date: 04/06/2010 -.\" Manual: MySQL Database System -.\" Source: MySQL 5.1 -.\" Language: English .\" -.TH "\FBNDBD\FR" "8" "04/06/2010" "MySQL 5\&.1" "MySQL Database System" +.TH "\FBNDBD\FR" "8" "04/08/2015" "MariaDB 10\&.0" "MariaDB Database System" .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- @@ -787,7 +780,7 @@ Section\ \&17.1.5, \(lqKnown Limitations of MySQL Cluster\(rq\&. .SH "COPYRIGHT" .br .PP -Copyright 2007-2008 MySQL AB, 2008-2010 Sun Microsystems, Inc. +Copyright 2007-2008 MySQL AB, 2008-2010 Sun Microsystems, Inc., 2010-2015 MariaDB Foundation .PP This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. .PP @@ -812,8 +805,6 @@ ndbd Error Messages \%http://dev.mysql.com/doc/ndbapi/en/ndbd-error-messages.html .RE .SH "SEE ALSO" -For more information, please refer to the MySQL Reference Manual, -which may already be installed locally and which is also available -online at http://dev.mysql.com/doc/. +For more information, please refer to the MariaDB Knowledge Base, available online at https://mariadb.com/kb/ .SH AUTHOR -Sun Microsystems, Inc. (http://www.mysql.com/). +MariaDB Foundation (http://www.mariadb.org/). diff --git a/man/ndbd_redo_log_reader.1 b/man/ndbd_redo_log_reader.1 index f6a2326cab4..8c194722675 100644 --- a/man/ndbd_redo_log_reader.1 +++ b/man/ndbd_redo_log_reader.1 @@ -1,13 +1,6 @@ '\" t -.\" Title: \fBndbd_redo_log_reader\fR -.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] -.\" Generator: DocBook XSL Stylesheets v1.75.2 -.\" Date: 04/06/2010 -.\" Manual: MySQL Database System -.\" Source: MySQL 5.1 -.\" Language: English .\" -.TH "\FBNDBD_REDO_LOG_REA" "1" "04/06/2010" "MySQL 5\&.1" "MySQL Database System" +.TH "\FBNDBD_REDO_LOG_REA" "1" "04/08/2015" "MariaDB 10\&.0" "MariaDB Database System" .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- @@ -154,7 +147,7 @@ must be run on a cluster data node, since it accesses the data node file system .SH "COPYRIGHT" .br .PP -Copyright 2007-2008 MySQL AB, 2008-2010 Sun Microsystems, Inc. +Copyright 2007-2008 MySQL AB, 2008-2010 Sun Microsystems, Inc., 2010-2015 MariaDB Foundation .PP This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. .PP @@ -169,8 +162,6 @@ Cluster Data Node FileSystemDir Files \%http://dev.mysql.com/doc/ndbapi/en/ndb-internals-ndbd-filesystemdir-files.html .RE .SH "SEE ALSO" -For more information, please refer to the MySQL Reference Manual, -which may already be installed locally and which is also available -online at http://dev.mysql.com/doc/. +For more information, please refer to the MariaDB Knowledge Base, available online at https://mariadb.com/kb/ .SH AUTHOR -Sun Microsystems, Inc. (http://www.mysql.com/). +MariaDB Foundation (http://www.mariadb.org/). diff --git a/man/ndbmtd.8 b/man/ndbmtd.8 index baadd4eaee2..704ce7adff0 100644 --- a/man/ndbmtd.8 +++ b/man/ndbmtd.8 @@ -1,13 +1,6 @@ '\" t -.\" Title: \fBndbmtd\fR -.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] -.\" Generator: DocBook XSL Stylesheets v1.75.2 -.\" Date: 04/06/2010 -.\" Manual: MySQL Database System -.\" Source: MySQL 5.1 -.\" Language: English .\" -.TH "\FBNDBMTD\FR" "8" "04/06/2010" "MySQL 5\&.1" "MySQL Database System" +.TH "\FBNDBMTD\FR" "8" "04/08/2015" "MariaDB 10\&.0" "MariaDB Database System" .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- @@ -356,7 +349,7 @@ concurrently on different data nodes in the same MySQL Cluster\&. However, such .SH "COPYRIGHT" .br .PP -Copyright 2007-2008 MySQL AB, 2008-2010 Sun Microsystems, Inc. +Copyright 2007-2008 MySQL AB, 2008-2010 Sun Microsystems, Inc., 2010-2015 MariaDB Foundation .PP This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. .PP @@ -381,8 +374,6 @@ ndbd Error Messages \%http://dev.mysql.com/doc/ndbapi/en/ndbd-error-messages.html .RE .SH "SEE ALSO" -For more information, please refer to the MySQL Reference Manual, -which may already be installed locally and which is also available -online at http://dev.mysql.com/doc/. +For more information, please refer to the MariaDB Knowledge Base, available online at https://mariadb.com/kb/ .SH AUTHOR -Sun Microsystems, Inc. (http://www.mysql.com/). +MariaDB Foundation (http://www.mariadb.org/). diff --git a/man/perror.1 b/man/perror.1 index a37cec6a518..f6971872b34 100644 --- a/man/perror.1 +++ b/man/perror.1 @@ -1,13 +1,6 @@ '\" t -.\" Title: \fBperror\fR -.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] -.\" Generator: DocBook XSL Stylesheets v1.75.2 -.\" Date: 04/06/2010 -.\" Manual: MySQL Database System -.\" Source: MySQL 5.1 -.\" Language: English .\" -.TH "\FBPERROR\FR" "1" "04/06/2010" "MySQL 5\&.1" "MySQL Database System" +.TH "\FBPERROR\FR" "1" "04/08/2015" "MariaDB 10\&.0" "MariaDB Database System" .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- @@ -29,7 +22,7 @@ perror \- explain error codes \fBperror [\fR\fB\fIoptions\fR\fR\fB] \fR\fB\fIerrorcode\fR\fR\fB \&.\&.\&.\fR .SH "DESCRIPTION" .PP -For most system errors, MySQL displays, in addition to an internal text message, the system error code in one of the following styles: +For most system errors, MariaDB displays, in addition to an internal text message, the system error code in one of the following styles: .sp .if n \{\ .RS 4 @@ -181,7 +174,7 @@ Display version information and exit\&. .SH "COPYRIGHT" .br .PP -Copyright 2007-2008 MySQL AB, 2008-2010 Sun Microsystems, Inc. +Copyright 2007-2008 MySQL AB, 2008-2010 Sun Microsystems, Inc., 2010-2015 MariaDB Foundation .PP This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. .PP @@ -190,8 +183,6 @@ This documentation is distributed in the hope that it will be useful, but WITHOU You should have received a copy of the GNU General Public License along with the program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or see http://www.gnu.org/licenses/. .sp .SH "SEE ALSO" -For more information, please refer to the MySQL Reference Manual, -which may already be installed locally and which is also available -online at http://dev.mysql.com/doc/. +For more information, please refer to the MariaDB Knowledge Base, available online at https://mariadb.com/kb/ .SH AUTHOR -Sun Microsystems, Inc. (http://www.mysql.com/). +MariaDB Foundation (http://www.mariadb.org/). diff --git a/man/replace.1 b/man/replace.1 index 453600fb5a1..993335e6701 100644 --- a/man/replace.1 +++ b/man/replace.1 @@ -1,13 +1,6 @@ '\" t -.\" Title: \fBreplace\fR -.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] -.\" Generator: DocBook XSL Stylesheets v1.75.2 -.\" Date: 04/06/2010 -.\" Manual: MySQL Database System -.\" Source: MySQL 5.1 -.\" Language: English .\" -.TH "\FBREPLACE\FR" "1" "04/06/2010" "MySQL 5\&.1" "MySQL Database System" +.TH "\FBREPLACE\FR" "1" "04/08/2015" "MariaDB 10\&.0" "MariaDB Database System" .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- @@ -160,7 +153,7 @@ Display version information and exit\&. .SH "COPYRIGHT" .br .PP -Copyright 2007-2008 MySQL AB, 2008-2010 Sun Microsystems, Inc. +Copyright 2007-2008 MySQL AB, 2008-2010 Sun Microsystems, Inc., 2010-2015 MariaDB Foundation .PP This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. .PP @@ -169,8 +162,6 @@ This documentation is distributed in the hope that it will be useful, but WITHOU You should have received a copy of the GNU General Public License along with the program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or see http://www.gnu.org/licenses/. .sp .SH "SEE ALSO" -For more information, please refer to the MySQL Reference Manual, -which may already be installed locally and which is also available -online at http://dev.mysql.com/doc/. +For more information, please refer to the MariaDB Knowledge Base, available online at https://mariadb.com/kb/ .SH AUTHOR -Sun Microsystems, Inc. (http://www.mysql.com/). +MariaDB Foundation (http://www.mariadb.org/). diff --git a/man/resolve_stack_dump.1 b/man/resolve_stack_dump.1 index 956cd12b2da..549107143f4 100644 --- a/man/resolve_stack_dump.1 +++ b/man/resolve_stack_dump.1 @@ -1,13 +1,6 @@ '\" t -.\" Title: \fBresolve_stack_dump\fR -.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] -.\" Generator: DocBook XSL Stylesheets v1.75.2 -.\" Date: 04/06/2010 -.\" Manual: MySQL Database System -.\" Source: MySQL 5.1 -.\" Language: English .\" -.TH "\FBRESOLVE_STACK_DUM" "1" "04/06/2010" "MySQL 5\&.1" "MySQL Database System" +.TH "\FBRESOLVE_STACK_DUM" "1" "04/08/2015" "MariaDB 10\&.0" "MariaDB Database System" .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- @@ -117,7 +110,7 @@ Display version information and exit\&. .SH "COPYRIGHT" .br .PP -Copyright 2007-2008 MySQL AB, 2008-2010 Sun Microsystems, Inc. +Copyright 2007-2008 MySQL AB, 2008-2010 Sun Microsystems, Inc., 2010-2015 MariaDB Foundation .PP This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. .PP @@ -126,8 +119,6 @@ This documentation is distributed in the hope that it will be useful, but WITHOU You should have received a copy of the GNU General Public License along with the program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or see http://www.gnu.org/licenses/. .sp .SH "SEE ALSO" -For more information, please refer to the MySQL Reference Manual, -which may already be installed locally and which is also available -online at http://dev.mysql.com/doc/. +For more information, please refer to the MariaDB Knowledge Base, available online at https://mariadb.com/kb/ .SH AUTHOR -Sun Microsystems, Inc. (http://www.mysql.com/). +MariaDB Foundation (http://www.mariadb.org/). diff --git a/man/resolveip.1 b/man/resolveip.1 index 1b35e6b4cff..97584afc686 100644 --- a/man/resolveip.1 +++ b/man/resolveip.1 @@ -1,13 +1,6 @@ '\" t -.\" Title: \fBresolveip\fR -.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] -.\" Generator: DocBook XSL Stylesheets v1.75.2 -.\" Date: 04/06/2010 -.\" Manual: MySQL Database System -.\" Source: MySQL 5.1 -.\" Language: English .\" -.TH "\FBRESOLVEIP\FR" "1" "04/06/2010" "MySQL 5\&.1" "MySQL Database System" +.TH "\FBRESOLVEIP\FR" "1" "04/08/2015" "MariaDB 10\&.0" "MariaDB Database System" .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- @@ -99,7 +92,7 @@ Display version information and exit\&. .SH "COPYRIGHT" .br .PP -Copyright 2007-2008 MySQL AB, 2008-2010 Sun Microsystems, Inc. +Copyright 2007-2008 MySQL AB, 2008-2010 Sun Microsystems, Inc., 2010-2015 MariaDB Foundation .PP This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. .PP @@ -108,8 +101,6 @@ This documentation is distributed in the hope that it will be useful, but WITHOU You should have received a copy of the GNU General Public License along with the program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or see http://www.gnu.org/licenses/. .sp .SH "SEE ALSO" -For more information, please refer to the MySQL Reference Manual, -which may already be installed locally and which is also available -online at http://dev.mysql.com/doc/. +For more information, please refer to the MariaDB Knowledge Base, available online at https://mariadb.com/kb/ .SH AUTHOR -Sun Microsystems, Inc. (http://www.mysql.com/). +MariaDB Foundation (http://www.mariadb.org/). From ed195b28f711abb3752cbde95b04b34684a3d70e Mon Sep 17 00:00:00 2001 From: iangilfillan Date: Thu, 10 Sep 2015 20:12:50 +0200 Subject: [PATCH 75/85] MDEV-7680: mysqld_safe and mysql_multi man pages --- man/mysqld_multi.1 | 140 ++++++++++++--------------------------------- man/mysqld_safe.1 | 140 ++++++++++++++++++++++++++++++++++++++------- 2 files changed, 154 insertions(+), 126 deletions(-) diff --git a/man/mysqld_multi.1 b/man/mysqld_multi.1 index 0476e7e0af6..3f540944c61 100644 --- a/man/mysqld_multi.1 +++ b/man/mysqld_multi.1 @@ -16,7 +16,7 @@ .\" scripts .\" multi mysqld .SH "NAME" -mysqld_multi \- manage multiple MySQL servers +mysqld_multi \- manage multiple MariaDB servers .SH "SYNOPSIS" .HP \w'\fBmysqld_multi\ [\fR\fB\fIoptions\fR\fR\fB]\ {start|stop|report}\ [\fR\fB\fIGNR\fR\fR\fB[,\fR\fB\fIGNR\fR\fR\fB]\ \&.\&.\&.]\fR\ 'u \fBmysqld_multi [\fR\fB\fIoptions\fR\fR\fB] {start|stop|report} [\fR\fB\fIGNR\fR\fR\fB[,\fR\fB\fIGNR\fR\fR\fB] \&.\&.\&.]\fR @@ -25,8 +25,7 @@ mysqld_multi \- manage multiple MySQL servers \fBmysqld_multi\fR is designed to manage several \fBmysqld\fR -processes that listen for connections on different Unix socket files and TCP/IP ports\&. It can start or stop servers, or report their current status\&. The MySQL Instance Manager is an alternative means of managing multiple servers (see -\fBmysqlmanager\fR(8))\&. +processes that listen for connections on different Unix socket files and TCP/IP ports\&. It can start or stop servers, or report their current status\&. .PP \fBmysqld_multi\fR searches for groups named @@ -43,9 +42,7 @@ can be any positive integer\&. This number is referred to in the following discu to specify which servers you want to start, stop, or obtain a status report for\&. Options listed in these groups are the same that you would use in the [mysqld] group used for starting -\fBmysqld\fR\&. (See, for example, -Section\ \&2.13.1.2, \(lqStarting and Stopping MySQL Automatically\(rq\&.) However, when using multiple servers, it is necessary that each one use its own value for options such as the Unix socket file and TCP/IP port number\&. For more information on which options must be unique per server in a multiple\-server environment, see -Section\ \&5.6, \(lqRunning Multiple MySQL Servers on the Same Machine\(rq\&. +\fBmysqld\fR\&. However, when using multiple servers, it is necessary that each one use its own value for options such as the Unix socket file and TCP/IP port number\&. .PP To invoke \fBmysqld_multi\fR, use the following syntax: @@ -129,7 +126,6 @@ shell> \fBmysqld_multi \-\-example\fR .RE .\} .PP -As of MySQL 5\&.1\&.18, \fBmysqld_multi\fR searches for option files as follows: .sp @@ -176,16 +172,6 @@ Otherwise, option files in the standard list of locations are read, including an option, if one is given\&. (If the option is given multiple times, the last value is used\&.) .RE .PP -Before MySQL 5\&.1\&.18, the preceding options are not recognized\&. Files in the standard locations are read, and any file named by the -\fB\-\-config\-file=\fR\fB\fIfile_name\fR\fR -option, if one is given\&. A file named by -\fB\-\-config\-file\fR -is read only for -[mysqld\fIN\fR] -option groups, not the -[mysqld_multi] -group\&. -.PP Option files read are searched for [mysqld_multi] and @@ -200,7 +186,7 @@ groups can be used for options passed to specific \fBmysqld\fR instances\&. .PP -As of MySQL 5\&.1\&.35, the +The [mysqld] or [mysqld_safe] @@ -213,11 +199,7 @@ option to use a different configuration file for that instance, in which case th [mysqld] or [mysqld_safe] -groups from that file will be used for that instance\&. Before MySQL 5\&.1\&.35, some versions of -\fBmysqld_multi\fR -pass the -\fB\-\-no\-defaults\fR -options to instances, so these techniques are inapplicable\&. +groups from that file will be used for that instance\&. .PP \fBmysqld_multi\fR supports the following options\&. @@ -245,38 +227,6 @@ Display a help message and exit\&. .sp -1 .IP \(bu 2.3 .\} -.\" mysqld_multi: config-file option -.\" config-file option: mysqld_multi -\fB\-\-config\-file=\fR\fB\fIfile_name\fR\fR -.sp -As of MySQL 5\&.1\&.18, this option is deprecated\&. If given, it is treated the same way as -\fB\-\-defaults\-extra\-file\fR, described earlier\&. -\fB\-\-config\-file\fR -is removed in MySQL 5\&.5\&. -.sp -Before MySQL 5\&.1\&.18, this option specifies the name of an extra option file\&. It affects where -\fBmysqld_multi\fR -looks for -[mysqld\fIN\fR] -option groups\&. Without this option, all options are read from the usual -my\&.cnf -file\&. The option does not affect where -\fBmysqld_multi\fR -reads its own options, which are always taken from the -[mysqld_multi] -group in the usual -my\&.cnf -file\&. -.RE -.sp -.RS 4 -.ie n \{\ -\h'-04'\(bu\h'+03'\c -.\} -.el \{\ -.sp -1 -.IP \(bu 2.3 -.\} .\" mysqld_multi: example option .\" example option: mysqld_multi \fB\-\-example\fR @@ -387,8 +337,8 @@ rather than to the log file\&. By default, output goes to the log file\&. .\" password option: mysqld_multi \fB\-\-password=\fR\fB\fIpassword\fR\fR .sp -The password of the MySQL account to use when invoking -\fBmysqladmin\fR\&. Note that the password value is not optional for this option, unlike for other MySQL programs\&. +The password of the MariaDB account to use when invoking +\fBmysqladmin\fR\&. Note that the password value is not optional for this option, unlike for other MariaDB programs\&. .RE .sp .RS 4 @@ -418,11 +368,10 @@ Silent mode; disable warnings\&. .\" tcp-ip option: mysqld_multi \fB\-\-tcp\-ip\fR .sp -Connect to each MySQL server via the TCP/IP port instead of the Unix socket file\&. (If a socket file is missing, the server might still be running, but accessible only via the TCP/IP port\&.) By default, connections are made using the Unix socket file\&. This option affects -stop -and -report -operations\&. +Connect to the MariaDB server(s) via the TCP/IP port instead of the UNIX socket\&. This affects stopping +and reporting. If a socket file is missing, the server may still be running, but can be accessed only +via the TCP/IP port\&. By default connecting is done via the UNIX socket\&. This option affects +stop and report operations\&. .RE .sp .RS 4 @@ -437,7 +386,7 @@ operations\&. .\" user option: mysqld_multi \fB\-\-user=\fR\fB\fIuser_name\fR\fR .sp -The user name of the MySQL account to use when invoking +The user name of the MariaDB account to use when invoking \fBmysqladmin\fR\&. .RE .sp @@ -496,40 +445,7 @@ servers with the same data directory\&. Use separate data directories, unless yo \fIknow\fR what you are doing\&. Starting multiple servers with the same data directory does \fInot\fR -give you extra performance in a threaded system\&. See -Section\ \&5.6, \(lqRunning Multiple MySQL Servers on the Same Machine\(rq\&. -.RE -.sp -.RS 4 -.ie n \{\ -\h'-04'\(bu\h'+03'\c -.\} -.el \{\ -.sp -1 -.IP \(bu 2.3 -.\} -.if n \{\ -.sp -.\} -.RS 4 -.it 1 an-trap -.nr an-no-space-flag 1 -.nr an-break-flag 1 -.br -.ps +1 -\fBImportant\fR -.ps -1 -.br -Make sure that the data directory for each server is fully accessible to the Unix account that the specific -\fBmysqld\fR -process is started as\&. -\fIDo not\fR -use the Unix -\fIroot\fR -account for this, unless you -\fIknow\fR -what you are doing\&. See -Section\ \&5.3.6, \(lqHow to Run MySQL as a Normal User\(rq\&. +give you extra performance in a threaded system\&. .sp .5v .RE .RE @@ -542,7 +458,28 @@ Section\ \&5.3.6, \(lqHow to Run MySQL as a Normal User\(rq\&. .sp -1 .IP \(bu 2.3 .\} -Make sure that the MySQL account used for stopping the +\fBImportant\fR: Make sure that the data directory for each server is fully accessible to the Unix account that the specific +\fBmysqld\fR +process is started as\&. +\fIDo not\fR +use the Unix +\fIroot\fR +account for this, unless you +\fIknow\fR +what you are doing\&. +.sp .5v +.RE +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +Make sure that the MariaDB account used for stopping the \fBmysqld\fR servers (with the \fBmysqladmin\fR @@ -565,10 +502,7 @@ mysql> \fBGRANT SHUTDOWN ON *\&.*\fR .RE .\} .sp -See -Section\ \&5.4, \(lqThe MySQL Access Privilege System\(rq\&. You have to do this for each -\fBmysqld\fR -server\&. Change the connection parameters appropriately when connecting to each one\&. Note that the host name part of the account name must allow you to connect as +Change the connection parameters appropriately when connecting to each one\&. Note that the host name part of the account name must allow you to connect as multi_admin from the host where you want to run \fBmysqld_multi\fR\&. @@ -716,8 +650,6 @@ user = jani .RE .\} .PP -See -Section\ \&4.2.3.3, \(lqUsing Option Files\(rq\&. .SH "COPYRIGHT" .br .PP diff --git a/man/mysqld_safe.1 b/man/mysqld_safe.1 index 08ea7ed54e9..fe89c4e2aad 100644 --- a/man/mysqld_safe.1 +++ b/man/mysqld_safe.1 @@ -15,7 +15,7 @@ .\" tools: mysqld_safe .\" scripts .SH "NAME" -mysqld_safe \- MySQL server startup script +mysqld_safe \- MariaDB server startup script .SH "SYNOPSIS" .HP \w'\fBmysqld_safe\ \fR\fB\fIoptions\fR\fR\ 'u \fBmysqld_safe \fR\fB\fIoptions\fR\fR @@ -145,6 +145,21 @@ should be able to create\&. The option value is passed to .sp -1 .IP \(bu 2.3 .\} +.\" mysqld_safe: crash-script option +.\" crash-script option: mysqld_safe +\fB\-\-crash\-script=\fR\fB\fIfile\fR\fR +.sp +Script to call in the event of mysqld crashing\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} .\" mysqld_safe: datadir option .\" datadir option: mysqld_safe \fB\-\-datadir=\fR\fB\fIpath\fR\fR @@ -190,6 +205,21 @@ The name of an option file to be read instead of the usual option files\&. This .sp -1 .IP \(bu 2.3 .\} +.\" mysqld_safe: flush-caches option +.\" flush-caches option: mysqld_safe +\fB\-\-flush\-caches\fR +.sp +Flush and purge buffers/caches before starting the server\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} .\" mysqld_safe: ledir option .\" ledir option: mysqld_safe \fB\-\-ledir=\fR\fB\fIpath\fR\fR @@ -211,8 +241,22 @@ cannot find the server, use this option to indicate the path name to the directo .\" log-error option: mysqld_safe \fB\-\-log\-error=\fR\fB\fIfile_name\fR\fR .sp -Write the error log to the given file\&. See -Section\ \&5.2.2, \(lqThe Error Log\(rq\&. +Write the error log to the given file\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +.\" mysqld_safe: malloc-lib option +.\" malloc-lib option: mysqld_safe +\fB\-\-malloc\-lib=\fR\fB\fIlib\fR\fR +.sp +Preload shared library lib if available\&. .RE .sp .RS 4 @@ -294,6 +338,21 @@ program to set the server\'s scheduling priority to the given value\&. .sp -1 .IP \(bu 2.3 .\} +.\" mysqld_safe: no-auto-restart option +.\" no-auto-restart option: mysqld_safe +\fB\-\-no\-auto\-restart\fR +.sp +Exit after starting mysqld\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} .\" mysqld_safe: no-defaults option .\" no-defaults option: mysqld_safe \fB\-\-no\-defaults\fR @@ -309,6 +368,36 @@ Do not read any option files\&. This must be the first option on the command lin .sp -1 .IP \(bu 2.3 .\} +.\" mysqld_safe: no-watch option +.\" no-watch option: mysqld_safe +\fB\-\-no\-auto\-restart\fR +.sp +Exit after starting mysqld\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +.\" mysqld_safe: numa-interleave option +.\" numa-interleave option: mysqld_safe +\fB\-\-numa\-interleave\fR +.sp +Run mysqld with its memory interleaved on all NUMA nodes\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} .\" mysqld_safe: open-files-limit option .\" open-files-limit option: mysqld_safe \fB\-\-open\-files\-limit=\fR\fB\fIcount\fR\fR @@ -346,6 +435,21 @@ The path name of the process ID file\&. .sp -1 .IP \(bu 2.3 .\} +.\" mysqld_safe: plugin-dir option +.\" plugin-dir option: mysqld_safe +\fB\-\-plugin\-dir=\fIdir_name\fR +.sp +Directory for client-side plugins\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} .\" mysqld_safe: port option .\" port option: mysqld_safe \fB\-\-port=\fR\fB\fIport_num\fR\fR @@ -437,7 +541,7 @@ mysqld, respectively\&. To specify a suffix for the tag, use \fB\-\-syslog\-tag=\fR\fB\fItag\fR\fR, which modifies the tags to be mysqld_safe\-\fItag\fR and -mysqld\-\fItag\fR\&. This option was added in MySQL 5\&.1\&.21\&. +mysqld\-\fItag\fR\&. .RE .sp .RS 4 @@ -475,7 +579,7 @@ server as the user having the name \fIuser_name\fR or the numeric user ID \fIuser_id\fR\&. (\(lqUser\(rq -in this context refers to a system login account, not a MySQL user listed in the grant tables\&.) +in this context refers to a system login account, not a MariaDB user listed in the grant tables\&.) .RE .PP If you execute @@ -510,8 +614,7 @@ mysql> \fBmysqld_safe \-\-defaults\-file=\fR\fB\fIfile_name\fR\fR\fB \-\-port=\f .PP The \fBmysqld_safe\fR -script is written so that it normally can start a server that was installed from either a source or a binary distribution of MySQL, even though these types of distributions typically install the server in slightly different locations\&. (See -Section\ \&2.1.5, \(lqInstallation Layouts\(rq\&.) +script is written so that it normally can start a server that was installed from either a source or a binary distribution of MariaDB, even though these types of distributions typically install the server in slightly different locations\&. \fBmysqld_safe\fR expects one of the following conditions to be true: .sp @@ -537,7 +640,7 @@ and var directories\&. This condition should be met if you execute \fBmysqld_safe\fR -from your MySQL installation directory (for example, +from your MariaDB installation directory (for example, /usr/local/mysql for a binary distribution)\&. .RE @@ -555,14 +658,14 @@ If the server and databases cannot be found relative to the working directory, attempts to locate them by absolute path names\&. Typical locations are /usr/local/libexec and -/usr/local/var\&. The actual locations are determined from the values configured into the distribution at the time it was built\&. They should be correct if MySQL is installed in the location specified at configuration time\&. +/usr/local/var\&. The actual locations are determined from the values configured into the distribution at the time it was built\&. They should be correct if MariaDB is installed in the location specified at configuration time\&. .RE .PP Because \fBmysqld_safe\fR -tries to find the server and databases relative to its own working directory, you can install a binary distribution of MySQL anywhere, as long as you run +tries to find the server and databases relative to its own working directory, you can install a binary distribution of MariaDB anywhere, as long as you run \fBmysqld_safe\fR -from the MySQL installation directory: +from the MariaDB installation directory: .sp .if n \{\ .RS 4 @@ -577,7 +680,7 @@ shell> \fBbin/mysqld_safe &\fR .PP If \fBmysqld_safe\fR -fails, even when invoked from the MySQL installation directory, you can specify the +fails, even when invoked from the MariaDB installation directory, you can specify the \fB\-\-ledir\fR and \fB\-\-datadir\fR @@ -592,7 +695,7 @@ arranges for error (and notice) messages from itself and from \fBmysqld\fR to go to the same destination\&. .PP -As of MySQL 5\&.1\&.20, there are several +There are several \fBmysqld_safe\fR options for controlling the destination of these messages: .sp @@ -652,9 +755,6 @@ If none of these options is given, the default is .ps -1 .br .PP -In MySQL 5\&.1\&.20 -\fIonly\fR, the default is -\fB\-\-syslog\fR\&. This differs from logging behavior for other versions of MySQL, for which the default is to write messages to the default error log file\&. .sp .5v .RE .PP @@ -673,10 +773,6 @@ or the error log file) and stdout\&. Errors go to the logging destination and stderr\&. .PP -Before MySQL 5\&.1\&.20, error logging is controlled only with the -\fB\-\-log\-error\fR -option\&. If it is given, messages go to the named error file\&. Otherwise, messages go to the default error file\&. -.PP Normally, you should not edit the \fBmysqld_safe\fR script\&. Instead, configure @@ -689,7 +785,7 @@ option file\&. In rare cases, it might be necessary to edit \fBmysqld_safe\fR to get it to start the server properly\&. However, if you do this, your modified version of \fBmysqld_safe\fR -might be overwritten if you upgrade MySQL in the future, so you should make a copy of your edited version that you can reinstall\&. +might be overwritten if you upgrade MariaDB in the future, so you should make a copy of your edited version that you can reinstall\&. .PP On NetWare, \fBmysqld_safe\fR @@ -727,7 +823,7 @@ tables\&. .sp -1 .IP " 3." 4.2 .\} -Provides a screen presence for the MySQL server\&. +Provides a screen presence for the MariaDB server\&. .RE .sp .RS 4 From 99142abe6999a106c688378b4d3dd8f38b3b5dcb Mon Sep 17 00:00:00 2001 From: iangilfillan Date: Thu, 17 Sep 2015 14:34:03 +0200 Subject: [PATCH 76/85] mysql and mysqldhow man pages --- man/mysql.1 | 480 ++++++++++++++++++++++++++++++------------------ man/mysqlshow.1 | 2 +- 2 files changed, 298 insertions(+), 184 deletions(-) diff --git a/man/mysql.1 b/man/mysql.1 index 01f417c0d87..48ab6c7cd95 100644 --- a/man/mysql.1 +++ b/man/mysql.1 @@ -18,7 +18,7 @@ .\" SQL scripts .\" batch SQL files .SH "NAME" -mysql \- the MySQL command\-line tool +mysql \- the MariaDB command\-line tool .SH "SYNOPSIS" .HP \w'\fBmysql\ [\fR\fB\fIoptions\fR\fR\fB]\ \fR\fB\fIdb_name\fR\fR\ 'u \fBmysql [\fR\fB\fIoptions\fR\fR\fB] \fR\fB\fIdb_name\fR\fR @@ -27,7 +27,7 @@ mysql \- the MySQL command\-line tool \fBmysql\fR is a simple SQL shell (with GNU readline -capabilities)\&. It supports interactive and noninteractive use\&. When used interactively, query results are presented in an ASCII\-table format\&. When used noninteractively (for example, as a filter), the result is presented in tab\-separated format\&. The output format can be changed using command options\&. +capabilities)\&. It supports interactive and non\-interactive use\&. When used interactively, query results are presented in an ASCII\-table format\&. When used non\-interactively (for example, as a filter), the result is presented in tab\-separated format\&. The output format can be changed using command options\&. .PP If you have problems due to insufficient memory for large result sets, use the \fB\-\-quick\fR @@ -70,13 +70,11 @@ Then type an SQL statement, end it with \eG and press Enter\&. .PP -As of MySQL 5\&.1\&.10, typing Control\-C causes +Typing Control\-C causes \fBmysql\fR to attempt to kill the current statement\&. If this cannot be done, or Control\-C is typed again before the statement is killed, \fBmysql\fR -exits\&. Previously, Control\-C caused -\fBmysql\fR -to exit in all cases\&. +exits\&. .PP You can execute SQL statements in a script file (batch file) like this: .sp @@ -97,13 +95,10 @@ shell> \fBmysql \fR\fB\fIdb_name\fR\fR\fB < \fR\fB\fIscript\&.sql\fR\fR\fB > \fR .PP \fBmysql\fR supports the following options, which can be specified on the command line or in the -[mysql] -and -[client] +[mysql], [client], [client-server] or [client-mariadb] option file groups\&. \fBmysql\fR -also supports the options for processing option files described at -Section\ \&4.2.3.3.1, \(lqCommand-Line Options that Affect Option-File Handling\(rq\&. +also supports the options for processing option files\&. .sp .RS 4 .ie n \{\ @@ -130,12 +125,27 @@ Display a help message and exit\&. .sp -1 .IP \(bu 2.3 .\} +.\" mysql: abort-source-on-error option +.\" abort-source-on-error: mysql +\fB\-\-abort\-source\-on\-error\fR +.sp +Abort 'source filename' operations in case of errors\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} .\" mysql: auto-rehash option .\" auto-rehash option: mysql \fB\-\-auto\-rehash\fR .sp Enable automatic rehashing\&. This option is on by default, which enables database, table, and column name completion\&. Use -\fB\-\-disable\-auto\-rehash\fR +\fB\-\-disable\-auto\-rehash\fR, \fB\-\-no\-auto\-rehash\fR, or \fB\-\-skip\-auto\-rehash\fR to disable rehashing\&. That causes \fBmysql\fR to start faster, but you must issue the @@ -155,6 +165,21 @@ completes it\&. Otherwise, you can press Tab again to see the possible names tha .sp -1 .IP \(bu 2.3 .\} +.\" mysql: auto-vertical-output option +.\" auto-vertical-output option: mysql +\fB\-\-auto\-vertical\-output\fR +.sp +Automatically switch to vertical output mode if the result is wider than the terminal width\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} .\" mysql: batch option .\" batch option: mysql \fB\-\-batch\fR, @@ -177,12 +202,26 @@ option\&. .sp -1 .IP \(bu 2.3 .\} +.\" mysql: binary-mode option +.\" binary-mode option: mysql +\fB\-\-binary\-mode\fR +.sp +By default, ASCII '\e0' is disallowed and '\er\en' is translated to '\en'\&. This switch turns off both features, and also turns off parsing of all client commands except \eC and DELIMITER, in non-interactive mode (for input piped to mysql or loaded using the 'source' command)\&. This is necessary when processing output from mysqlbinlog that may contain blobs\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} .\" mysql: character-sets-dir option .\" character-sets-dir option: mysql \fB\-\-character\-sets\-dir=\fR\fB\fIpath\fR\fR .sp -The directory where character sets are installed\&. See -Section\ \&9.5, \(lqCharacter Set Configuration\(rq\&. +The directory where character sets are installed\&. .RE .sp .RS 4 @@ -213,10 +252,7 @@ Write column names in results\&. \fB\-\-column\-type\-info\fR, \fB\-m\fR .sp -Display result set metadata\&. This option was added in MySQL 5\&.1\&.14\&. (Before that, use -\fB\-\-debug\-info\fR\&.) The -\fB\-m\fR -short option was added in MySQL 5\&.1\&.21\&. +Display result set metadata\&. .RE .sp .RS 4 @@ -232,7 +268,7 @@ short option was added in MySQL 5\&.1\&.21\&. \fB\-\-comments\fR, \fB\-c\fR .sp -Whether to preserve comments in statements sent to the server\&. The default is \-\-skip\-comments (discard comments), enable with \-\-comments (preserve comments)\&. This option was added in MySQL 5\&.1\&.23\&. +Whether to preserve comments in statements sent to the server\&. The default is \-\-skip\-comments (discard comments), enable with \-\-comments (preserve comments)\&. .RE .sp .RS 4 @@ -279,7 +315,7 @@ Set the number of seconds before connection timeout\&. (Default value is 0\&.) \fB\-\-database=\fR\fB\fIdb_name\fR\fR, \fB\-D \fR\fB\fIdb_name\fR\fR .sp -The database to use\&. This is useful primarily in an option file\&. +The database to use\&. .RE .sp .RS 4 @@ -314,7 +350,7 @@ string is .\" debug-check option: mysql \fB\-\-debug\-check\fR .sp -Print some debugging information when the program exits\&. This option was added in MySQL 5\&.1\&.21\&. +Print some debugging information when the program exits\&. .RE .sp .RS 4 @@ -330,9 +366,22 @@ Print some debugging information when the program exits\&. This option was added \fB\-\-debug\-info\fR, \fB\-T\fR .sp -Before MySQL 5\&.1\&.14, this option prints debugging information and memory and CPU usage statistics when the program exits, and also causes display of result set metadata during execution\&. As of MySQL 5\&.1\&.14, use -\fB\-\-column\-type\-info\fR -to display result set metadata\&. +Prints debugging information and memory and CPU usage statistics when the program exits\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +.\" mysql: default-auth option +.\" default-auth option: mysql +\fB\-\-default\-auth=\fR\fB\fIname\fR +.sp +Default authentication client-side plugin to use\&. .RE .sp .RS 4 @@ -355,12 +404,25 @@ A common issue that can occur when the operating system uses utf8 or another multi\-byte character set is that output from the \fBmysql\fR -client is formatted incorrectly, due to the fact that the MySQL client uses the +client is formatted incorrectly, due to the fact that the MariaDB client uses the latin1 character set by default\&. You can usually fix such issues by using this option to force the client to use the system character set instead\&. +.RE .sp -See -Section\ \&9.5, \(lqCharacter Set Configuration\(rq, for more information\&. +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +.\" mysql: defaults-extra-file option +.\" defaults-extra-file option: mysql +\fB\-\-defaults-extra-file=\fR\fB\fIfilename\fR\fR +.sp +Set \fB\fIfilename\fR\fR as the file to read default options from after the global defaults files has been read\&. +Must be given as first option\&. .RE .sp .RS 4 @@ -386,12 +448,11 @@ Set \fB\fIfilename\fR\fR as the file to read default options from, override glob .sp -1 .IP \(bu 2.3 .\} -.\" mysql: defaults-extra-file option -.\" defaults-extra-file option: mysql -\fB\-\-defaults-extra-file=\fR\fB\fIfilename\fR\fR +.\" mysql: defaults-group-suffix option +.\" defaults-group-suffix option: mysql +\fB\-\-defaults\-group\-suffix=\fR\fB\fIsuffix\fR\fR .sp -Set \fB\fIfilename\fR\fR as the file to read default options from after the global defaults files has been read\&. -Must be given as first option\&. +In addition to the groups named on the command line, read groups that have the given suffix\&. .RE .sp .RS 4 @@ -444,9 +505,8 @@ the section called \(lqMYSQL COMMANDS\(rq\&. \fB\-\-execute=\fR\fB\fIstatement\fR\fR, \fB\-e \fR\fB\fIstatement\fR\fR .sp -Execute the statement and quit\&. The default output format is like that produced with -\fB\-\-batch\fR\&. See -Section\ \&4.2.3.1, \(lqUsing Options on the Command Line\(rq, for some examples\&. +Execute the statement and quit\&. Disables \fB\-\-force\fR and history file\&. The default output format is like that produced with +\fB\-\-batch\fR\&. .RE .sp .RS 4 @@ -462,7 +522,7 @@ Section\ \&4.2.3.1, \(lqUsing Options on the Command Line\(rq, for some examples \fB\-\-force\fR, \fB\-f\fR .sp -Continue even if an SQL error occurs\&. +Continue even if an SQL error occurs\&. Sets \fB\-\-abort\-source\-on-error\fR to 0\&. .RE .sp .RS 4 @@ -478,7 +538,7 @@ Continue even if an SQL error occurs\&. \fB\-\-host=\fR\fB\fIhost_name\fR\fR, \fB\-h \fR\fB\fIhost_name\fR\fR .sp -Connect to the MySQL server on the given host\&. +Connect to the MariaDB server on the given host\&. .RE .sp .RS 4 @@ -510,10 +570,22 @@ Produce HTML output\&. \fB\-\-ignore\-spaces\fR, \fB\-i\fR .sp -Ignore spaces after function names\&. The effect of this is described in the discussion for the -IGNORE_SPACE -SQL mode (see -Section\ \&5.1.8, \(lqServer SQL Modes\(rq)\&. +Ignore spaces after function names\&. Allows one to have spaces (including tab characters and new line characters) between function name and '('\&. The drawback is that this causes built in functions to become reserved words\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +.\" mysql: init-command option +.\" init-command option: mysql +\fB\-\-init\-command=\fR\fB\fIstr\fR\fR\fR +.sp +SQL Command to execute when connecting to the MariaDB server\&. Will automatically be re-executed when reconnecting\&. .RE .sp .RS 4 @@ -570,7 +642,7 @@ has no effect if the server does not also support it\&. .\" max-allowed-packet option: mysql \fB\-\-max\-allowed\-packet=\fR\fB\fInum\fR\fR .sp -Set the maximum packet length to send to or receive from the server\&. (Default value is 16MB\&.) +Set the maximum packet length to send to or receive from the server\&. (Default value is 16MB, largest 1GB\&.) .RE .sp .RS 4 @@ -611,7 +683,7 @@ and both are recognized\&. Use \fB\-\-skip\-named\-commands\fR to disable named commands\&. See -the section called \(lqMYSQL COMMANDS\(rq\&. +the section called \(lqMYSQL COMMANDS\(rq\&. Disabled by default\&. .RE .sp .RS 4 @@ -688,72 +760,12 @@ Do not read default options from any option file\&. This must be given as the fi .sp -1 .IP \(bu 2.3 .\} -.\" mysql: no-named-commands option -.\" no-named-commands option: mysql -\fB\-\-no\-named\-commands\fR, -\fB\-g\fR -.sp -Deprecated, use -\fB\-\-disable\-named\-commands\fR -instead\&. -\fB\-\-no\-named\-commands\fR -is removed in MySQL 5\&.5\&. -.RE -.sp -.RS 4 -.ie n \{\ -\h'-04'\(bu\h'+03'\c -.\} -.el \{\ -.sp -1 -.IP \(bu 2.3 -.\} -.\" mysql: no-pager option -.\" no-pager option: mysql -\fB\-\-no\-pager\fR -.sp -Deprecated form of -\fB\-\-skip\-pager\fR\&. See the -\fB\-\-pager\fR -option\&. -\fB\-\-no\-pager\fR -is removed in MySQL 5\&.5\&. -.RE -.sp -.RS 4 -.ie n \{\ -\h'-04'\(bu\h'+03'\c -.\} -.el \{\ -.sp -1 -.IP \(bu 2.3 -.\} -.\" mysql: no-tee option -.\" no-tee option: mysql -\fB\-\-no\-tee\fR -.sp -Deprecated form of -\fB\-\-skip\-tee\fR\&. See the -\fB\-\-tee\fR -option\&. -\fB\-\-no\-tee\fR -is removed in MySQL 5\&.5\&. -.RE -.sp -.RS 4 -.ie n \{\ -\h'-04'\(bu\h'+03'\c -.\} -.el \{\ -.sp -1 -.IP \(bu 2.3 -.\} .\" mysql: one-database option .\" one-database option: mysql \fB\-\-one\-database\fR, \fB\-o\fR .sp -Ignore statements except those for the default database named on the command line\&. This is useful for skipping updates to other databases in the binary log\&. +Ignore statements except those those that occur while the default database is the one named on the command line\&. This filtering is limited, and based only on USE statements\&. This is useful for skipping updates to other databases in the binary log\&. .RE .sp .RS 4 @@ -803,8 +815,7 @@ option on the command line, \fBmysql\fR prompts for one\&. .sp -Specifying a password on the command line should be considered insecure\&. See -Section\ \&5.3.2.2, \(lqEnd-User Guidelines for Password Security\(rq\&. You can use an option file to avoid giving the password on the command line\&. +Specifying a password on the command line should be considered insecure\&. You can use an option file to avoid giving the password on the command line\&. .RE .sp .RS 4 @@ -831,12 +842,27 @@ On Windows, connect to the server via a named pipe\&. This option applies only i .sp -1 .IP \(bu 2.3 .\} +.\" mysql: plugin-dir option +.\" plugin-dir option: mysql +\fB\-\-plugin\-dir=\fIdir_name\fR +.sp +Directory for client-side plugins\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} .\" mysql: port option .\" port option: mysql \fB\-\-port=\fR\fB\fIport_num\fR\fR, \fB\-P \fR\fB\fIport_num\fR\fR .sp -The TCP/IP port number to use for the connection\&. +The TCP/IP port number to use for the connection or 0 for default to, in order of preference, my.cnf, $MYSQL_TCP_PORT, /etc/services, built-in default (3306)\&. .RE .sp .RS 4 @@ -862,12 +888,26 @@ Print the program argument list and exit\&. This must be given as the first argu .sp -1 .IP \(bu 2.3 .\} +.\" mysql: progress-reports option +.\" progress-reports option: mysql +\fB\-\-progress\-reports\fR +.sp +Get progress reports for long running commands (such as ALTER TABLE)\&. (Defaults to on; use \fB\-\-skip\-progress\-reports\fR to disable\&.) +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} .\" mysql: prompt option .\" prompt option: mysql \fB\-\-prompt=\fR\fB\fIformat_str\fR\fR .sp -Set the prompt to the specified format\&. The default is -mysql>\&. The special sequences that the prompt can contain are described in +Set the prompt to the specified format\&. The special sequences that the prompt can contain are described in the section called \(lqMYSQL COMMANDS\(rq\&. .RE .sp @@ -883,8 +923,7 @@ the section called \(lqMYSQL COMMANDS\(rq\&. .\" protocol option: mysql \fB\-\-protocol={TCP|SOCKET|PIPE|MEMORY}\fR .sp -The connection protocol to use for connecting to the server\&. It is useful when the other connection parameters normally would cause a protocol to be used other than the one you want\&. For details on the allowable values, see -Section\ \&4.2.2, \(lqConnecting to the MySQL Server\(rq\&. +The connection protocol to use for connecting to the server\&. It is useful when the other connection parameters normally would cause a protocol to be used other than the one you want\&. .RE .sp .RS 4 @@ -972,8 +1011,8 @@ CHAR(92) .\" reconnect option: mysql \fB\-\-reconnect\fR .sp -If the connection to the server is lost, automatically try to reconnect\&. A single reconnect attempt is made each time the connection is lost\&. To suppress reconnection behavior, use -\fB\-\-skip\-reconnect\fR\&. +If the connection to the server is lost, automatically try to reconnect\&. A single reconnect attempt is made each time the connection is lost\&. Enabled by default, to disable use +\fB\-\-skip\-reconnect\fR or \fB\-\-disable\-reconnect\fR\&. .RE .sp .RS 4 @@ -1173,12 +1212,137 @@ localhost, the Unix socket file to use, or, on Windows, the name of the named pi .\} .\" mysql: SSL options .\" SSL options: mysql -\fB\-\-ssl*\fR -.sp -Options that begin with \fB\-\-ssl\fR -specify whether to connect to the server via SSL and indicate where to find SSL keys and certificates\&. See -Section\ \&5.5.6.3, \(lqSSL Command Options\(rq\&. +.sp +Enable SSL for connection (automatically enabled with other flags). Disable with +\fB\-\-skip-ssl\fR\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +.\" mysql: SSL CA option +.\" SSL CA option: mysql +\fB\-\-ssl\-ca=\fIname\fR +.sp +CA file in PEM format (check OpenSSL docs, implies +\fB\-\-ssl\fR)\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +.\" mysql: SSL CA Path option +.\" SSL CA Path option: mysql +\fB\-\-ssl\-capath=\fIname\fR +.sp +CA directory (check OpenSSL docs, implies +\fB\-\-ssl\fR)\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +.\" mysql: SSL Cert option +.\" SSL Cert option: mysql +\fB\-\-ssl\-cert=\fIname\fR +.sp +X509 cert in PEM format (check OpenSSL docs, implies +\fB\-\-ssl\fR)\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +.\" mysql: SSL Cipher option +.\" SSL Cipher option: mysql +\fB\-\-ssl\-cipher=\fIname\fR +.sp +SSL cipher to use (check OpenSSL docs, implies +\fB\-\-ssl\fR)\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +.\" mysql: SSL Key option +.\" SSL Key option: mysql +\fB\-\-ssl\-key=\fIname\fR +.sp +X509 key in PEM format (check OpenSSL docs, implies +\fB\-\-ssl\fR)\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +.\" mysql: SSL Crl option +.\" SSL CRL option: mysql +\fB\-\-ssl\-crl=\fIname\fR +.sp +Certificate revocation list (check OpenSSL docs, implies +\fB\-\-ssl\fR)\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +.\" mysql: SSL Crlpath option +.\" SSL Crlpath option: mysql +\fB\-\-ssl\-crlpath=\fIname\fR +.sp +Certificate revocation list path (check OpenSSL docs, implies +\fB\-\-ssl\fR)\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +.\" mysql: SSL Verify Server Cert option +.\" SSL Verify Server Cert option: mysql +\fB\-\-ssl\-verify\-server\-cert\fR +.sp +Verify server's "Common Name" in its cert against hostname used when connecting. This option is disabled by default\&. .RE .sp .RS 4 @@ -1242,7 +1406,7 @@ Flush the buffer after each query\&. \fB\-\-user=\fR\fB\fIuser_name\fR\fR, \fB\-u \fR\fB\fIuser_name\fR\fR .sp -The MySQL user name to use when connecting to the server\&. +The MariaDB user name to use when connecting to the server\&. .RE .sp .RS 4 @@ -1326,36 +1490,7 @@ If the connection cannot be established, wait and retry instead of aborting\&. \fB\-X\fR .sp Produce XML output\&. -.if n \{\ -.sp -.\} -.RS 4 -.it 1 an-trap -.nr an-no-space-flag 1 -.nr an-break-flag 1 -.br -.ps +1 -\fBNote\fR -.ps -1 -.br -Prior to MySQL 5\&.1\&.12, there was no differentiation in the output when using this option between columns containing the -NULL -value and columns containing the string literal -\'NULL\'; both were represented as -.sp .5v -.RE -.sp -.if n \{\ -.RS 4 -.\} -.nf -NULL -.fi -.if n \{\ -.RE -.\} -.sp -Beginning with MySQL 5\&.1\&.12, the output when +The output when \fB\-\-xml\fR is used with \fBmysql\fR @@ -1364,7 +1499,7 @@ matches that of \fBmysqldump\fR(1) for details\&. .sp -Beginning with MySQL 5\&.1\&.18, the XML output also uses an XML namespace, as shown here: +The XML output also uses an XML namespace, as shown here: .sp .if n \{\ .RS 4 @@ -1391,18 +1526,10 @@ shell> \fBmysql \-\-xml \-uroot \-e "SHOW VARIABLES LIKE \'version%\'"\fR .fi -.if n \{\ -.RE -.\} -.sp -(See -\m[blue]\fBBug#25946\fR\m[]\&\s-2\u[1]\d\s+2\&.) .RE .PP You can also set the following variables by using -\fB\-\-\fR\fB\fIvar_name\fR\fR\fB=\fR\fB\fIvalue\fR\fR\&. The -\fB\-\-set\-variable\fR -format is deprecated and is removed in MySQL 5\&.5\&. +\fB\-\-\fR\fB\fIvar_name\fR\fR\fB=\fR\fB\fIvalue\fR\fR\&. .sp .RS 4 .ie n \{\ @@ -1497,8 +1624,7 @@ environment variable\&. .PP The \&.mysql_history -should be protected with a restrictive access mode because sensitive information might be written to it, such as the text of SQL statements that contain passwords\&. See -Section\ \&5.3.2.2, \(lqEnd-User Guidelines for Password Security\(rq\&. +should be protected with a restrictive access mode because sensitive information might be written to it, such as the text of SQL statements that contain passwords\&. .PP If you do not want to maintain a history file, first remove \&.mysql_history @@ -1625,7 +1751,7 @@ If you provide an argument to the help command, \fBmysql\fR -uses it as a search string to access server\-side help from the contents of the MySQL Reference Manual\&. For more information, see +uses it as a search string to access server\-side help\&. For more information, see the section called \(lqMYSQL SERVER-SIDE HELP\(rq\&. .RE .sp @@ -1646,7 +1772,7 @@ Change the default character set and issue a SET NAMES statement\&. This enables the character set to remain synchronized on the client and server if \fBmysql\fR -is run with auto\-reconnect enabled (which is not recommended), because the specified character set is used for reconnects\&. This command was added in MySQL 5\&.1\&.7\&. +is run with auto\-reconnect enabled (which is not recommended), because the specified character set is used for reconnects\&. .RE .sp .RS 4 @@ -1698,16 +1824,14 @@ Change the string that \fBmysql\fR interprets as the separator between SQL statements\&. The default is the semicolon character (\(lq;\(rq)\&. .sp -The delimiter can be specified as an unquoted or quoted argument\&. Quoting can be done with either single quote (\') or douple quote (") characters\&. To include a quote within a quoted string, either quote the string with the other quote character or escape the quote with a backslash (\(lq\e\(rq) character\&. Backslash should be avoided outside of quoted strings because it is the escape character for MySQL\&. For an unquoted argument, the delmiter is read up to the first space or end of line\&. For a quoted argument, the delimiter is read up to the matching quote on the line\&. +The delimiter can be specified as an unquoted or quoted argument\&. Quoting can be done with either single quote (\') or douple quote (") characters\&. To include a quote within a quoted string, either quote the string with the other quote character or escape the quote with a backslash (\(lq\e\(rq) character\&. Backslash should be avoided outside of quoted strings because it is the escape character for MariaDB\&. For an unquoted argument, the delmiter is read up to the first space or end of line\&. For a quoted argument, the delimiter is read up to the matching quote on the line\&. .sp When the delimiter recognized by \fBmysql\fR is set to something other than the default of \(lq;\(rq, instances of that character are sent to the server without interpretation\&. However, the server itself still interprets \(lq;\(rq -as a statement delimiter and processes statements accordingly\&. This behavior on the server side comes into play for multiple\-statement execution (see -Section\ \&21.9.12, \(lqC API Support for Multiple Statement Execution\(rq), and for parsing the body of stored procedures and functions, triggers, and events (see -Section\ \&19.1, \(lqDefining Stored Programs\(rq)\&. +as a statement delimiter and processes statements accordingly\&. This behavior on the server side comes into play for multiple\-statement execution, and for parsing the body of stored procedures and functions, triggers, and events\&. .RE .sp .RS 4 @@ -2498,7 +2622,7 @@ You can set the prompt option in the [mysql] -group of any MySQL option file, such as +group of any MariaDB option file, such as /etc/my\&.cnf or the \&.my\&.cnf @@ -2517,8 +2641,7 @@ prompt=(\e\eu@\e\eh) [\e\ed]>\e\e_ .sp In this example, note that the backslashes are doubled\&. If you set the prompt using the prompt -option in an option file, it is advisable to double the backslashes when using the special prompt options\&. There is some overlap in the set of allowable prompt options and the set of special escape sequences that are recognized in option files\&. (The rules for escape sequences in option files are listed in -Section\ \&4.2.3.3, \(lqUsing Option Files\(rq\&.) The overlap may cause you problems if you use single backslashes\&. For example, +option in an option file, it is advisable to double the backslashes when using the special prompt options\&. There is some overlap in the set of allowable prompt options and the set of special escape sequences that are recognized in option files\&. The overlap may cause you problems if you use single backslashes\&. For example, \es is interpreted as a space rather than as the current seconds value\&. The following example shows how to define a prompt within an option file to include the current time in HH:MM:SS> @@ -2581,10 +2704,9 @@ If you provide an argument to the help command, \fBmysql\fR -uses it as a search string to access server\-side help from the contents of the MySQL Reference Manual\&. The proper operation of this command requires that the help tables in the +uses it as a search string to access server\-side help\&. The proper operation of this command requires that the help tables in the mysql -database be initialized with help topic information (see -Section\ \&5.1.9, \(lqServer-Side Help\(rq)\&. +database be initialized with help topic information. .PP If there is no match for the search string, the search fails: .sp @@ -2775,17 +2897,14 @@ with the \fB\-\-verbose\fR option, which causes each statement to be displayed before the result that it produces\&. .PP -As of MySQL 5\&.1\&.23, \fBmysql\fR -ignores Unicode byte order mark (BOM) characters at the beginning of input files\&. Previously, it read them and sent them to the server, resulting in a syntax error\&. Presence of a BOM does not cause +ignores Unicode byte order mark (BOM) characters at the beginning of input files\&. Presence of a BOM does not cause \fBmysql\fR to change its default character set\&. To do that, invoke \fBmysql\fR with an option such as \fB\-\-default\-character\-set=utf8\fR\&. .PP -For more information about batch mode, see -Section\ \&3.5, \(lqUsing mysql in Batch Mode\(rq\&. .SH "MYSQL TIPS" .PP This section describes some techniques that can help you use @@ -2839,7 +2958,7 @@ When you use the \fB\-\-safe\-updates\fR option, \fBmysql\fR -issues the following statement when it connects to the MySQL server: +issues the following statement when it connects to the MariaDB server: .sp .if n \{\ .RS 4 @@ -2851,9 +2970,6 @@ SET sql_safe_updates=1, sql_select_limit=1000, sql_max_join_size=1000000; .RE .\} .PP -See -Section\ \&5.1.5, \(lqSession System Variables\(rq\&. -.PP The SET statement has the following effects: @@ -2973,8 +3089,6 @@ client with the \fB\-\-skip\-reconnect\fR option\&. .PP -For more information about auto\-reconnect and its effect on state information when a reconnection occurs, see -Section\ \&21.9.11, \(lqControlling Automatic Reconnection Behavior\(rq\&. .SH "COPYRIGHT" .br .PP diff --git a/man/mysqlshow.1 b/man/mysqlshow.1 index 3981748044f..3eaa8df7c49 100644 --- a/man/mysqlshow.1 +++ b/man/mysqlshow.1 @@ -298,7 +298,7 @@ Must be given as first option\&. .sp -1 .IP \(bu 2.3 .\} -.\" mysqlshow_defaults: defaults-group-suffix option +.\" mysqlshow: defaults-group-suffix option .\" defaults-group-suffix option: mysqlshow \fB\-\-defaults\-group\-suffix=\fR\fB\fIsuffix\fR\fR .sp From 2a9bcc60861dba2dff69af6371164f2f8765f352 Mon Sep 17 00:00:00 2001 From: iangilfillan Date: Thu, 17 Sep 2015 14:45:28 +0200 Subject: [PATCH 77/85] MDEV-7680: mysqld man page --- man/mysqld.8 | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/man/mysqld.8 b/man/mysqld.8 index 5f63015cf4d..f9632e020ea 100644 --- a/man/mysqld.8 +++ b/man/mysqld.8 @@ -11,18 +11,18 @@ .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- -.\" mysqld: MySQL server -.\" MySQL server: mysqld +.\" mysqld: MariaDB server +.\" MariaDB server: mysqld .SH "NAME" -mysqld \- the MySQL server +mysqld \- the MariaDB server .SH "SYNOPSIS" .HP \w'\fBmysqld\ [\fR\fB\fIoptions\fR\fR\fB]\fR\ 'u \fBmysqld [\fR\fB\fIoptions\fR\fR\fB]\fR .SH "DESCRIPTION" .PP -\fBmysqld\fR, also known as MySQL Server, is the main program that does most of the work in a MySQL installation\&. MySQL Server manages access to the MySQL data directory that contains databases and tables\&. The data directory is also the default location for other information such as log files and status files\&. +\fBmysqld\fR, also known as MariaDB Server, is the main program that does most of the work in a MariaDB installation\&. MariaDB Server manages access to the MariaDB data directory that contains databases and tables\&. The data directory is also the default location for other information such as log files and status files\&. .PP -When MySQL server starts, it listens for network connections from client programs and manages access to databases on behalf of those clients\&. +When MariaDB server starts, it listens for network connections from client programs and manages access to databases on behalf of those clients\&. .PP The \fBmysqld\fR @@ -38,11 +38,10 @@ shell> \fBmysqld \-\-verbose \-\-help\fR .RE .\} .PP -MySQL Server also has a set of system variables that affect its operation as it runs\&. System variables can be set at server startup, and many of them can be changed at runtime to effect dynamic server reconfiguration\&. MySQL Server also has a set of status variables that provide information about its operation\&. You can monitor these status variables to access runtime performance characteristics\&. +MariaDB Server also has a set of system variables that affect its operation as it runs\&. System variables can be set at server startup, and many of them can be changed at runtime to effect dynamic server reconfiguration\&. MariaDB Server also has a set of status variables that provide information about its operation\&. You can monitor these status variables to access runtime performance characteristics\&. .PP -For a full description of MySQL Server command options, system variables, and status variables, see -Section\ \&5.1, \(lqThe MySQL Server\(rq\&. For information about installing MySQL and setting up the initial configuration, see -Chapter\ \&2, Installing and Upgrading MySQL\&. +For a full description of MariaDB Server command options, system variables, and status variables, see +the MariaDB Knowledge Base\&. .SH "COPYRIGHT" .br .PP From 0ea42333d37d3eda13e8756dba9c34778f5da47d Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Fri, 18 Sep 2015 18:27:54 +0200 Subject: [PATCH 78/85] remove --default-myisam from mtr it was never doing anything anyway --- man/mysql-test-run.pl.1 | 16 ---------------- mysql-test/mysql-test-run.pl | 5 ----- 2 files changed, 21 deletions(-) diff --git a/man/mysql-test-run.pl.1 b/man/mysql-test-run.pl.1 index 91d82084606..495c0c50338 100644 --- a/man/mysql-test-run.pl.1 +++ b/man/mysql-test-run.pl.1 @@ -803,22 +803,6 @@ does not fail if Debug Sync is not compiled in\&. .sp -1 .IP \(bu 2.3 .\} -.\" mysql-test-run.pl: default-myisam option -.\" default-myisam option: mysql-test-run.pl -\fB\-\-default\-myisam\fR -.sp -Set default storage engine to MyISAM for non-innodb tests\&. This is -needed after switching default storage engine to InnoDB\&. -.RE -.sp -.RS 4 -.ie n \{\ -\h'-04'\(bu\h'+03'\c -.\} -.el \{\ -.sp -1 -.IP \(bu 2.3 -.\} .\" mysql-test-run.pl: defaults-file option .\" defaults-file option: mysql-test-run.pl \fB\-\-defaults\-file=\fR\fB\fIfile_name\fR\fR diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index d902f8645eb..8b4a48f60c1 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -1083,7 +1083,6 @@ sub print_global_resfile { resfile_global("shutdown-timeout", $opt_shutdown_timeout ? 1 : 0); resfile_global("warnings", $opt_warnings ? 1 : 0); resfile_global("max-connections", $opt_max_connections); -# resfile_global("default-myisam", $opt_default_myisam ? 1 : 0); resfile_global("product", "MySQL"); # Somewhat hacky code to convert numeric version back to dot notation my $v1= int($mysql_version_id / 10000); @@ -1244,7 +1243,6 @@ sub command_line_setup { 'stop-file=s' => \$opt_stop_file, 'stop-keep-alive=i' => \$opt_stop_keep_alive, 'max-connections=i' => \$opt_max_connections, - 'default-myisam!' => \&collect_option, 'report-times' => \$opt_report_times, 'result-file' => \$opt_resfile, 'stress=s' => \$opt_stress, @@ -6638,9 +6636,6 @@ Misc options timediff With --timestamp, also print time passed since *previous* test started max-connections=N Max number of open connection to server in mysqltest - default-myisam Set default storage engine to MyISAM for non-innodb - tests. This is needed after switching default storage - engine to InnoDB. report-times Report how much time has been spent on different phases of test execution. stress=ARGS Run stress test, providing options to From bff1af983ad7b0bed6c3973e4d13297df5fe2791 Mon Sep 17 00:00:00 2001 From: Pavel Ivanov Date: Thu, 16 Jul 2015 15:50:26 -0700 Subject: [PATCH 79/85] Clarify the log message about master_info and relay_info files. Just "Master" could be understood as the master IP or hostname and thus can cause confusion to db admins. "Master connection name" clearly states that the log line contains connection name in the (possibly) multi-master setup. --- sql/sql_repl.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sql/sql_repl.cc b/sql/sql_repl.cc index d6a4819172d..69fb2150764 100644 --- a/sql/sql_repl.cc +++ b/sql/sql_repl.cc @@ -3322,7 +3322,8 @@ bool change_master(THD* thd, Master_info* mi, bool *master_info_added) *master_info_added= true; } if (global_system_variables.log_warnings > 1) - sql_print_information("Master: '%.*s' Master_info_file: '%s' " + sql_print_information("Master connection name: '%.*s' " + "Master_info_file: '%s' " "Relay_info_file: '%s'", (int) mi->connection_name.length, mi->connection_name.str, From 16c4b3c68b06653592a9500050ad977a38f4ebae Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Fri, 9 Oct 2015 16:43:59 +0200 Subject: [PATCH 80/85] fixes for buildbot: * OSX (mysqlimport freeing unallocated memory) * Windows (didn't compile MSI) * fulltest2 (innodb crashes in --embedded --big) --- client/mysqlimport.c | 7 ++++++- mysql-test/disabled.def | 3 +-- storage/xtradb/include/row0purge.h | 1 + storage/xtradb/row/row0purge.c | 1 + win/packaging/ca/CustomAction.cpp | 2 ++ 5 files changed, 11 insertions(+), 3 deletions(-) diff --git a/client/mysqlimport.c b/client/mysqlimport.c index 1f047fdf4b3..a22774bc684 100644 --- a/client/mysqlimport.c +++ b/client/mysqlimport.c @@ -36,7 +36,7 @@ /* Global Thread counter */ -uint counter; +uint counter= 0; pthread_mutex_t counter_mutex; pthread_cond_t count_threshhold; @@ -482,6 +482,11 @@ static void safe_exit(int error, MYSQL *mysql) { if (error && ignore_errors) return; + + /* in multi-threaded mode protect from concurrent safe_exit's */ + if (counter) + pthread_mutex_lock(&counter_mutex); + if (mysql) mysql_close(mysql); diff --git a/mysql-test/disabled.def b/mysql-test/disabled.def index 6dc3066e374..310890605ff 100644 --- a/mysql-test/disabled.def +++ b/mysql-test/disabled.def @@ -11,9 +11,8 @@ ############################################################################## tablespace : disabled in MariaDB (no TABLESPACE table attribute) events_time_zone : Test is not predictable as it depends on precise timing. -lowercase_table3 : Bug#11762269 2010-06-30 alik main.lowercase_table3 on Mac OSX read_many_rows_innodb : Bug#11748886 2010-11-15 mattiasj report already exists -archive-big : Bug#11817185 2011-03-10 Anitha Disabled since this leads to timeout on Solaris Sparc log_tables-big : Bug#11756699 2010-11-15 mattiasj report already exists mysql_embedded : Bug#12561297 2011-05-14 Anitha Dependent on PB2 changes - eventum#41836 file_contents : MDEV-6526 these files are not installed anymore +lowercase_fs_on : lower_case_table_names=0 is not an error until 10.1 diff --git a/storage/xtradb/include/row0purge.h b/storage/xtradb/include/row0purge.h index 9a638c80493..64353bc8434 100644 --- a/storage/xtradb/include/row0purge.h +++ b/storage/xtradb/include/row0purge.h @@ -118,6 +118,7 @@ references to the clustered index record - one via the ref member, and the other via the persistent cursor. These two references must match each other if the found_clust flag is set. @return true if the persistent cursor is consistent with the ref member.*/ +UNIV_INTERN ibool row_purge_validate_pcur(purge_node_t* node); #endif /* UNIV_DEBUG */ diff --git a/storage/xtradb/row/row0purge.c b/storage/xtradb/row/row0purge.c index 9018582f5d6..1e87016bc5e 100644 --- a/storage/xtradb/row/row0purge.c +++ b/storage/xtradb/row/row0purge.c @@ -826,6 +826,7 @@ other via the persistent cursor. These two references must match each other if the found_clust flag is set. @return true if the stored copy of persistent cursor is consistent with the ref member.*/ +UNIV_INTERN ibool row_purge_validate_pcur( purge_node_t* node) diff --git a/win/packaging/ca/CustomAction.cpp b/win/packaging/ca/CustomAction.cpp index 17bfca1debb..3cb8520b65d 100644 --- a/win/packaging/ca/CustomAction.cpp +++ b/win/packaging/ca/CustomAction.cpp @@ -17,6 +17,8 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #define UNICODE #endif +#undef NOMINMAX + #include #include #include From 6a821d78a6a33aaf81909ab2858d13f95dbe2708 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Fri, 9 Oct 2015 17:20:49 +0200 Subject: [PATCH 81/85] 5.6.26-74.0 --- storage/xtradb/api/api0api.cc | 12 +- storage/xtradb/btr/btr0cur.cc | 8 ++ storage/xtradb/buf/buf0flu.cc | 29 ++--- storage/xtradb/dict/dict0dict.cc | 65 ---------- storage/xtradb/dict/dict0stats_bg.cc | 8 ++ storage/xtradb/fil/fil0fil.cc | 9 +- storage/xtradb/handler/ha_innodb.cc | 64 +++++++++- storage/xtradb/handler/handler0alter.cc | 156 ++++++++++++++---------- storage/xtradb/ibuf/ibuf0ibuf.cc | 4 +- storage/xtradb/include/buf0flu.h | 5 +- storage/xtradb/include/dict0dict.h | 27 +--- storage/xtradb/include/dict0dict.ic | 2 +- storage/xtradb/include/fts0fts.h | 2 +- storage/xtradb/include/row0purge.h | 12 +- storage/xtradb/include/univ.i | 2 +- storage/xtradb/log/log0log.cc | 3 + storage/xtradb/os/os0file.cc | 18 +++ storage/xtradb/row/row0import.cc | 107 +++++++--------- storage/xtradb/row/row0ins.cc | 71 ++++++++--- storage/xtradb/row/row0purge.cc | 79 ++++++++++-- storage/xtradb/row/row0sel.cc | 2 +- storage/xtradb/srv/srv0srv.cc | 3 +- storage/xtradb/srv/srv0start.cc | 27 ++-- 23 files changed, 412 insertions(+), 303 deletions(-) diff --git a/storage/xtradb/api/api0api.cc b/storage/xtradb/api/api0api.cc index ad8a29d7439..07eecdc46d0 100644 --- a/storage/xtradb/api/api0api.cc +++ b/storage/xtradb/api/api0api.cc @@ -245,7 +245,7 @@ ib_open_table_by_id( dict_mutex_enter_for_mysql(); } - table = dict_table_open_on_id(table_id, FALSE, DICT_TABLE_OP_NORMAL); + table = dict_table_open_on_id(table_id, TRUE, DICT_TABLE_OP_NORMAL); if (table != NULL && table->ibd_file_missing) { table = NULL; @@ -2104,6 +2104,10 @@ ib_cursor_moveto( n_fields = dict_index_get_n_ordering_defined_by_user(prebuilt->index); + if (n_fields > dtuple_get_n_fields(tuple->ptr)) { + n_fields = dtuple_get_n_fields(tuple->ptr); + } + dtuple_set_n_fields(search_tuple, n_fields); dtuple_set_n_fields_cmp(search_tuple, n_fields); @@ -3741,14 +3745,14 @@ ib_table_truncate( if (trunc_err == DB_SUCCESS) { ut_a(ib_trx_state(ib_trx) == static_cast( TRX_STATE_NOT_STARTED)); - - err = ib_trx_release(ib_trx); - ut_a(err == DB_SUCCESS); } else { err = ib_trx_rollback(ib_trx); ut_a(err == DB_SUCCESS); } + err = ib_trx_release(ib_trx); + ut_a(err == DB_SUCCESS); + /* Set the memcached_sync_count back. */ if (table != NULL && memcached_sync != 0) { dict_mutex_enter_for_mysql(); diff --git a/storage/xtradb/btr/btr0cur.cc b/storage/xtradb/btr/btr0cur.cc index 406eccff4c3..c68d54c818c 100644 --- a/storage/xtradb/btr/btr0cur.cc +++ b/storage/xtradb/btr/btr0cur.cc @@ -4129,6 +4129,14 @@ btr_estimate_number_of_different_key_vals( page = btr_cur_get_page(&cursor); SRV_CORRUPT_TABLE_CHECK(page, goto exit_loop;); + DBUG_EXECUTE_IF("ib_corrupt_page_while_stats_calc", + page = NULL;); + + SRV_CORRUPT_TABLE_CHECK(page, + { + mtr_commit(&mtr); + goto exit_loop; + }); rec = page_rec_get_next(page_get_infimum_rec(page)); diff --git a/storage/xtradb/buf/buf0flu.cc b/storage/xtradb/buf/buf0flu.cc index 9bca902c4c7..d9893fc49b8 100644 --- a/storage/xtradb/buf/buf0flu.cc +++ b/storage/xtradb/buf/buf0flu.cc @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (c) 1995, 2013, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 1995, 2015, 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 the Free Software @@ -936,12 +936,12 @@ buf_flush_write_block_low( break; case BUF_BLOCK_ZIP_DIRTY: frame = bpage->zip.data; - mach_write_to_8(frame + FIL_PAGE_LSN, bpage->newest_modification); - memset(frame + FIL_PAGE_FILE_FLUSH_LSN, 0, 8); ut_a(page_zip_verify_checksum(frame, zip_size)); + + memset(frame + FIL_PAGE_FILE_FLUSH_LSN, 0, 8); break; case BUF_BLOCK_FILE_PAGE: frame = bpage->zip.data; @@ -2209,10 +2209,9 @@ Clears up tail of the LRU lists: * Put replaceable pages at the tail of LRU to the free list * Flush dirty pages at the tail of LRU to the disk The depth to which we scan each buffer pool is controlled by dynamic -config parameter innodb_LRU_scan_depth. -@return total pages flushed */ +config parameter innodb_LRU_scan_depth. */ UNIV_INTERN -ulint +void buf_flush_LRU_tail(void) /*====================*/ { @@ -2314,8 +2313,6 @@ buf_flush_LRU_tail(void) MONITOR_LRU_BATCH_PAGES, total_flushed); } - - return(total_flushed); } /*********************************************************************//** @@ -2725,7 +2722,8 @@ DECLARE_THREAD(buf_flush_page_cleaner_thread)( } /* Flush pages from flush_list if required */ - n_flushed += page_cleaner_flush_pages_if_needed(); + n_flushed = page_cleaner_flush_pages_if_needed(); + } else { n_flushed = page_cleaner_do_flush_batch( PCT_IO(100), @@ -2850,8 +2848,6 @@ DECLARE_THREAD(buf_flush_lru_manager_thread)( while (srv_shutdown_state == SRV_SHUTDOWN_NONE || srv_shutdown_state == SRV_SHUTDOWN_CLEANUP) { - ulint n_flushed_lru; - srv_current_thread_priority = srv_cleaner_thread_priority; page_cleaner_sleep_if_needed(next_loop_time); @@ -2860,16 +2856,7 @@ DECLARE_THREAD(buf_flush_lru_manager_thread)( next_loop_time = ut_time_ms() + lru_sleep_time; - n_flushed_lru = buf_flush_LRU_tail(); - - if (n_flushed_lru) { - - MONITOR_INC_VALUE_CUMULATIVE( - MONITOR_FLUSH_BACKGROUND_TOTAL_PAGE, - MONITOR_FLUSH_BACKGROUND_COUNT, - MONITOR_FLUSH_BACKGROUND_PAGES, - n_flushed_lru); - } + buf_flush_LRU_tail(); } buf_lru_manager_is_active = false; diff --git a/storage/xtradb/dict/dict0dict.cc b/storage/xtradb/dict/dict0dict.cc index fbf9bd22e20..65dfd20d6c9 100644 --- a/storage/xtradb/dict/dict0dict.cc +++ b/storage/xtradb/dict/dict0dict.cc @@ -3237,71 +3237,6 @@ dict_table_is_referenced_by_foreign_key( return(!table->referenced_set.empty()); } -/*********************************************************************//** -Check if the index is referenced by a foreign key, if TRUE return foreign -else return NULL -@return pointer to foreign key struct if index is defined for foreign -key, otherwise NULL */ -UNIV_INTERN -dict_foreign_t* -dict_table_get_referenced_constraint( -/*=================================*/ - dict_table_t* table, /*!< in: InnoDB table */ - dict_index_t* index) /*!< in: InnoDB index */ -{ - dict_foreign_t* foreign; - - ut_ad(index != NULL); - ut_ad(table != NULL); - - for (dict_foreign_set::iterator it = table->referenced_set.begin(); - it != table->referenced_set.end(); - ++it) { - - foreign = *it; - - if (foreign->referenced_index == index) { - - return(foreign); - } - } - - return(NULL); -} - -/*********************************************************************//** -Checks if a index is defined for a foreign key constraint. Index is a part -of a foreign key constraint if the index is referenced by foreign key -or index is a foreign key index. -@return pointer to foreign key struct if index is defined for foreign -key, otherwise NULL */ -UNIV_INTERN -dict_foreign_t* -dict_table_get_foreign_constraint( -/*==============================*/ - dict_table_t* table, /*!< in: InnoDB table */ - dict_index_t* index) /*!< in: InnoDB index */ -{ - dict_foreign_t* foreign; - - ut_ad(index != NULL); - ut_ad(table != NULL); - - for (dict_foreign_set::iterator it = table->foreign_set.begin(); - it != table->foreign_set.end(); - ++it) { - - foreign = *it; - - if (foreign->foreign_index == index) { - - return(foreign); - } - } - - return(NULL); -} - /**********************************************************************//** Removes a foreign constraint struct from the dictionary cache. */ UNIV_INTERN diff --git a/storage/xtradb/dict/dict0stats_bg.cc b/storage/xtradb/dict/dict0stats_bg.cc index 9e1f75a13a9..a5e0e2cf044 100644 --- a/storage/xtradb/dict/dict0stats_bg.cc +++ b/storage/xtradb/dict/dict0stats_bg.cc @@ -352,6 +352,14 @@ DECLARE_THREAD(dict_stats_thread)( break; } +#if defined UNIV_DEBUG || defined UNIV_IBUF_DEBUG + if (srv_ibuf_disable_background_merge) { + usleep(100000); + os_event_reset(dict_stats_event); + continue; + } +#endif + dict_stats_process_entry_from_recalc_pool(); os_event_reset(dict_stats_event); diff --git a/storage/xtradb/fil/fil0fil.cc b/storage/xtradb/fil/fil0fil.cc index 1a23d844522..8c27affc4ac 100644 --- a/storage/xtradb/fil/fil0fil.cc +++ b/storage/xtradb/fil/fil0fil.cc @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (c) 1995, 2014, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 1995, 2015, 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 the Free Software @@ -5630,9 +5630,10 @@ _fil_io( space = fil_space_get_by_id(space_id); - /* If we are deleting a tablespace we don't allow any read - operations on that. However, we do allow write operations. */ - if (space == 0 || (type == OS_FILE_READ && space->stop_new_ops)) { + /* If we are deleting a tablespace we don't allow async read operations + on that. However, we do allow write and sync read operations */ + if (space == 0 + || (type == OS_FILE_READ && !sync && space->stop_new_ops)) { mutex_exit(&fil_system->mutex); ib_logf(IB_LOG_LEVEL_ERROR, diff --git a/storage/xtradb/handler/ha_innodb.cc b/storage/xtradb/handler/ha_innodb.cc index 7e723e1f8f4..be47416d45f 100644 --- a/storage/xtradb/handler/ha_innodb.cc +++ b/storage/xtradb/handler/ha_innodb.cc @@ -1134,6 +1134,15 @@ innobase_end( handlerton* hton, /* in: Innodb handlerton */ ha_panic_function type); +/*****************************************************************//** +Stores the current binlog coordinates in the trx system header. */ +static +int +innobase_store_binlog_info( +/*=======================*/ + handlerton* hton, /*!< in: InnoDB handlerton */ + THD* thd); /*!< in: MySQL thread handle */ + /*****************************************************************//** Creates an InnoDB transaction struct for the thd if it does not yet have one. Starts a new InnoDB transaction if a transaction is not yet started. And @@ -3197,6 +3206,9 @@ innobase_init( innobase_hton->clone_consistent_snapshot = innobase_start_trx_and_clone_read_view; + innobase_hton->store_binlog_info = + innobase_store_binlog_info; + innobase_hton->flush_logs = innobase_flush_logs; innobase_hton->show_status = innobase_show_status; innobase_hton->flags = HTON_SUPPORTS_EXTENDED_KEYS | @@ -3897,6 +3909,35 @@ innobase_commit_low( } } +/*****************************************************************//** +Stores the current binlog coordinates in the trx system header. */ +static +int +innobase_store_binlog_info( +/*=======================*/ + handlerton* hton, /*!< in: InnoDB handlerton */ + THD* thd) /*!< in: MySQL thread handle */ +{ + const char* file_name; + unsigned long long pos; + mtr_t mtr; + + DBUG_ENTER("innobase_store_binlog_info"); + + thd_binlog_pos(thd, &file_name, &pos); + + mtr_start(&mtr); + + trx_sys_update_mysql_binlog_offset(file_name, pos, + TRX_SYS_MYSQL_LOG_INFO, &mtr); + + mtr_commit(&mtr); + + innobase_flush_logs(hton); + + DBUG_RETURN(0); +} + /*****************************************************************//** Creates an InnoDB transaction struct for the thd if it does not yet have one. Starts a new InnoDB transaction if a transaction is not yet started. And @@ -9240,7 +9281,8 @@ create_table_def( /* MySQL does the name length check. But we do additional check on the name length here */ - if (strlen(table_name) > MAX_FULL_NAME_LEN) { + const size_t table_name_len = strlen(table_name); + if (table_name_len > MAX_FULL_NAME_LEN) { push_warning_printf( thd, Sql_condition::WARN_LEVEL_WARN, ER_TABLE_NAME, @@ -9249,6 +9291,15 @@ create_table_def( DBUG_RETURN(ER_TABLE_NAME); } + if (table_name[table_name_len - 1] == '/') { + push_warning_printf( + thd, Sql_condition::WARN_LEVEL_WARN, + ER_TABLE_NAME, + "InnoDB: Table name is empty"); + + DBUG_RETURN(ER_WRONG_TABLE_NAME); + } + n_cols = form->s->fields; /* Check whether there already exists a FTS_DOC_ID column */ @@ -10566,6 +10617,10 @@ ha_innobase::discard_or_import_tablespace( DBUG_RETURN(HA_ERR_TABLE_READONLY); } + if (UNIV_UNLIKELY(prebuilt->trx->fake_changes)) { + DBUG_RETURN(HA_ERR_WRONG_COMMAND); + } + dict_table = prebuilt->table; if (dict_table->space == TRX_SYS_SPACE) { @@ -12239,8 +12294,8 @@ ha_innobase::check( thd_set_kill_status(user_thd); } - if (UNIV_UNLIKELY(share->ib_table->is_corrupt)) { - return(HA_ADMIN_CORRUPT); + if (UNIV_UNLIKELY(prebuilt->table && prebuilt->table->corrupted)) { + DBUG_RETURN(HA_ADMIN_CORRUPT); } DBUG_RETURN(is_ok ? HA_ADMIN_OK : HA_ADMIN_CORRUPT); @@ -14720,6 +14775,9 @@ innodb_log_archive_update( void* var_ptr, const void* save) { + if (srv_read_only_mode) + return; + my_bool in_val = *static_cast(save); if (in_val) { diff --git a/storage/xtradb/handler/handler0alter.cc b/storage/xtradb/handler/handler0alter.cc index ad81b0ce938..65a01f1cbab 100644 --- a/storage/xtradb/handler/handler0alter.cc +++ b/storage/xtradb/handler/handler0alter.cc @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (c) 2005, 2014, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 2005, 2015, 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 the Free Software @@ -28,6 +28,7 @@ Smart ALTER TABLE #include #include #include +#include #include "dict0crea.h" #include "dict0dict.h" @@ -465,12 +466,9 @@ ha_innobase::check_if_supported_inplace_alter( } else if (((ha_alter_info->handler_flags & Alter_inplace_info::ADD_PK_INDEX) || innobase_need_rebuild(ha_alter_info)) - && (innobase_fulltext_exist(altered_table) - || (prebuilt->table->flags2 - & DICT_TF2_FTS_HAS_DOC_ID))) { + && (innobase_fulltext_exist(altered_table))) { /* Refuse to rebuild the table online, if - fulltext indexes are to survive the rebuild, - or if the table contains a hidden FTS_DOC_ID column. */ + fulltext indexes are to survive the rebuild. */ online = false; /* If the table already contains fulltext indexes, refuse to rebuild the table natively altogether. */ @@ -828,10 +826,8 @@ innobase_get_foreign_key_info( char* tbl_namep = NULL; ulint db_name_len = 0; ulint tbl_name_len = 0; -#ifdef __WIN__ char db_name[MAX_DATABASE_NAME_LEN]; char tbl_name[MAX_TABLE_NAME_LEN]; -#endif fk_key = static_cast(key); @@ -884,24 +880,29 @@ innobase_get_foreign_key_info( add_fk[num_fk] = dict_mem_foreign_create(); #ifndef __WIN__ - tbl_namep = fk_key->ref_table.str; - tbl_name_len = fk_key->ref_table.length; - db_namep = fk_key->ref_db.str; - db_name_len = fk_key->ref_db.length; + if(fk_key->ref_db.str) { + tablename_to_filename(fk_key->ref_db.str, db_name, + MAX_DATABASE_NAME_LEN); + db_namep = db_name; + db_name_len = strlen(db_name); + } + if (fk_key->ref_table.str) { + tablename_to_filename(fk_key->ref_table.str, tbl_name, + MAX_TABLE_NAME_LEN); + tbl_namep = tbl_name; + tbl_name_len = strlen(tbl_name); + } #else ut_ad(fk_key->ref_table.str); - - memcpy(tbl_name, fk_key->ref_table.str, - fk_key->ref_table.length); - tbl_name[fk_key->ref_table.length] = 0; + tablename_to_filename(fk_key->ref_table.str, tbl_name, + MAX_TABLE_NAME_LEN); innobase_casedn_str(tbl_name); tbl_name_len = strlen(tbl_name); tbl_namep = &tbl_name[0]; if (fk_key->ref_db.str != NULL) { - memcpy(db_name, fk_key->ref_db.str, - fk_key->ref_db.length); - db_name[fk_key->ref_db.length] = 0; + tablename_to_filename(fk_key->ref_db.str, db_name, + MAX_DATABASE_NAME_LEN); innobase_casedn_str(db_name); db_name_len = strlen(db_name); db_namep = &db_name[0]; @@ -3209,58 +3210,72 @@ innobase_check_foreign_key_index( ulint n_drop_fk) /*!< in: Number of foreign keys to drop */ { - dict_foreign_t* foreign; + ut_ad(index != NULL); + ut_ad(indexed_table != NULL); - /* Check if the index is referenced. */ - foreign = dict_table_get_referenced_constraint(indexed_table, index); + const dict_foreign_set* fks = &indexed_table->referenced_set; - ut_ad(!foreign || indexed_table - == foreign->referenced_table); + /* Check for all FK references from other tables to the index. */ + for (dict_foreign_set::const_iterator it = fks->begin(); + it != fks->end(); ++it) { - if (foreign - && !dict_foreign_find_index( - indexed_table, col_names, - foreign->referenced_col_names, - foreign->n_fields, index, - /*check_charsets=*/TRUE, - /*check_null=*/FALSE) - && !innobase_find_equiv_index( - foreign->referenced_col_names, - foreign->n_fields, - ha_alter_info->key_info_buffer, - ha_alter_info->index_add_buffer, - ha_alter_info->index_add_count) - ) { - trx->error_info = index; - return(true); + dict_foreign_t* foreign = *it; + if (foreign->referenced_index != index) { + continue; + } + ut_ad(indexed_table == foreign->referenced_table); + + if (NULL == dict_foreign_find_index( + indexed_table, col_names, + foreign->referenced_col_names, + foreign->n_fields, index, + /*check_charsets=*/TRUE, + /*check_null=*/FALSE) + && NULL == innobase_find_equiv_index( + foreign->referenced_col_names, + foreign->n_fields, + ha_alter_info->key_info_buffer, + ha_alter_info->index_add_buffer, + ha_alter_info->index_add_count)) { + + /* Index cannot be dropped. */ + trx->error_info = index; + return(true); + } } - /* Check if this index references some - other table */ - foreign = dict_table_get_foreign_constraint( - indexed_table, index); + fks = &indexed_table->foreign_set; - ut_ad(!foreign || indexed_table - == foreign->foreign_table); + /* Check for all FK references in current table using the index. */ + for (dict_foreign_set::const_iterator it = fks->begin(); + it != fks->end(); ++it) { - if (foreign - && !innobase_dropping_foreign( - foreign, drop_fk, n_drop_fk) - && !dict_foreign_find_index( - indexed_table, col_names, - foreign->foreign_col_names, - foreign->n_fields, index, - /*check_charsets=*/TRUE, - /*check_null=*/FALSE) - && !innobase_find_equiv_index( - foreign->foreign_col_names, - foreign->n_fields, - ha_alter_info->key_info_buffer, - ha_alter_info->index_add_buffer, - ha_alter_info->index_add_count) - ) { - trx->error_info = index; - return(true); + dict_foreign_t* foreign = *it; + if (foreign->foreign_index != index) { + continue; + } + + ut_ad(indexed_table == foreign->foreign_table); + + if (!innobase_dropping_foreign( + foreign, drop_fk, n_drop_fk) + && NULL == dict_foreign_find_index( + indexed_table, col_names, + foreign->foreign_col_names, + foreign->n_fields, index, + /*check_charsets=*/TRUE, + /*check_null=*/FALSE) + && NULL == innobase_find_equiv_index( + foreign->foreign_col_names, + foreign->n_fields, + ha_alter_info->key_info_buffer, + ha_alter_info->index_add_buffer, + ha_alter_info->index_add_count)) { + + /* Index cannot be dropped. */ + trx->error_info = index; + return(true); + } } return(false); @@ -3483,6 +3498,19 @@ check_if_ok_to_rename: if (index->type & DICT_FTS) { DBUG_ASSERT(index->type == DICT_FTS || (index->type & DICT_CORRUPT)); + + /* We need to drop any corrupted fts indexes + before we add a new fts index. */ + if (add_fts_idx && index->type & DICT_CORRUPT) { + ib_errf(user_thd, IB_LOG_LEVEL_ERROR, + ER_INNODB_INDEX_CORRUPT, + "Fulltext index '%s' is corrupt. " + "you should drop this index first.", + index->name); + + goto err_exit_no_heap; + } + continue; } diff --git a/storage/xtradb/ibuf/ibuf0ibuf.cc b/storage/xtradb/ibuf/ibuf0ibuf.cc index 0695aa69652..17d9854c30d 100644 --- a/storage/xtradb/ibuf/ibuf0ibuf.cc +++ b/storage/xtradb/ibuf/ibuf0ibuf.cc @@ -2734,7 +2734,9 @@ ibuf_merge_space( &pages[0], &spaces[0], &versions[0], n_pages, &mtr); - ++sum_sizes; + if (*n_pages > 0) { + ++sum_sizes; + } } ibuf_mtr_commit(&mtr); diff --git a/storage/xtradb/include/buf0flu.h b/storage/xtradb/include/buf0flu.h index 56b0c314b5c..b73037dfab1 100644 --- a/storage/xtradb/include/buf0flu.h +++ b/storage/xtradb/include/buf0flu.h @@ -202,10 +202,9 @@ Clears up tail of the LRU lists: * Put replaceable pages at the tail of LRU to the free list * Flush dirty pages at the tail of LRU to the disk The depth to which we scan each buffer pool is controlled by dynamic -config parameter innodb_LRU_scan_depth. -@return total pages flushed */ +config parameter innodb_LRU_scan_depth. */ UNIV_INTERN -ulint +void buf_flush_LRU_tail(void); /*====================*/ /*********************************************************************//** diff --git a/storage/xtradb/include/dict0dict.h b/storage/xtradb/include/dict0dict.h index a52de9de11a..78abbcc5398 100644 --- a/storage/xtradb/include/dict0dict.h +++ b/storage/xtradb/include/dict0dict.h @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (c) 1996, 2014, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 1996, 2015, Oracle and/or its affiliates. All Rights Reserved. Copyright (c) 2012, Facebook Inc. This program is free software; you can redistribute it and/or modify it under @@ -430,18 +430,6 @@ dict_foreign_add_to_cache( /*!< in: error to be ignored */ __attribute__((nonnull(1), warn_unused_result)); /*********************************************************************//** -Check if the index is referenced by a foreign key, if TRUE return the -matching instance NULL otherwise. -@return pointer to foreign key struct if index is defined for foreign -key, otherwise NULL */ -UNIV_INTERN -dict_foreign_t* -dict_table_get_referenced_constraint( -/*=================================*/ - dict_table_t* table, /*!< in: InnoDB table */ - dict_index_t* index) /*!< in: InnoDB index */ - __attribute__((nonnull, warn_unused_result)); -/*********************************************************************//** Checks if a table is referenced by foreign keys. @return TRUE if table is referenced by a foreign key */ UNIV_INTERN @@ -476,19 +464,6 @@ dict_str_starts_with_keyword( const char* keyword) /*!< in: keyword to look for */ __attribute__((nonnull, warn_unused_result)); /*********************************************************************//** -Checks if a index is defined for a foreign key constraint. Index is a part -of a foreign key constraint if the index is referenced by foreign key -or index is a foreign key index -@return pointer to foreign key struct if index is defined for foreign -key, otherwise NULL */ -UNIV_INTERN -dict_foreign_t* -dict_table_get_foreign_constraint( -/*==============================*/ - dict_table_t* table, /*!< in: InnoDB table */ - dict_index_t* index) /*!< in: InnoDB index */ - __attribute__((nonnull, warn_unused_result)); -/*********************************************************************//** Scans a table create SQL string and adds to the data dictionary the foreign key constraints declared in the string. This function should be called after the indexes for a table have been created. diff --git a/storage/xtradb/include/dict0dict.ic b/storage/xtradb/include/dict0dict.ic index 6bfd7f6cdae..753f10aba86 100644 --- a/storage/xtradb/include/dict0dict.ic +++ b/storage/xtradb/include/dict0dict.ic @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (c) 1996, 2012, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 1996, 2015, 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 the Free Software diff --git a/storage/xtradb/include/fts0fts.h b/storage/xtradb/include/fts0fts.h index a2996ecacc8..d54ed281d9a 100644 --- a/storage/xtradb/include/fts0fts.h +++ b/storage/xtradb/include/fts0fts.h @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (c) 2011, 2013, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 2011, 2015, 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 the Free Software diff --git a/storage/xtradb/include/row0purge.h b/storage/xtradb/include/row0purge.h index 93dcf9cf49b..888289a6c79 100644 --- a/storage/xtradb/include/row0purge.h +++ b/storage/xtradb/include/row0purge.h @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (c) 1997, 2012, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 1997, 2015, 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 the Free Software @@ -119,6 +119,16 @@ struct purge_node_t{ clustered index record */ ibool done; /* Debug flag */ +#ifdef UNIV_DEBUG + /***********************************************************//** + Validate the persisent cursor. The purge node has two references + to the clustered index record - one via the ref member, and the + other via the persistent cursor. These two references must match + each other if the found_clust flag is set. + @return true if the persistent cursor is consistent with + the ref member.*/ + bool validate_pcur(); +#endif }; #ifndef UNIV_NONINL diff --git a/storage/xtradb/include/univ.i b/storage/xtradb/include/univ.i index 48adc36e9da..96570854a24 100644 --- a/storage/xtradb/include/univ.i +++ b/storage/xtradb/include/univ.i @@ -47,7 +47,7 @@ Created 1/20/1994 Heikki Tuuri #define INNODB_VERSION_BUGFIX MYSQL_VERSION_PATCH #ifndef PERCONA_INNODB_VERSION -#define PERCONA_INNODB_VERSION 73.1 +#define PERCONA_INNODB_VERSION 74.0 #endif /* Enable UNIV_LOG_ARCHIVE in XtraDB */ diff --git a/storage/xtradb/log/log0log.cc b/storage/xtradb/log/log0log.cc index 3cabc487eb5..8815e0ff9df 100644 --- a/storage/xtradb/log/log0log.cc +++ b/storage/xtradb/log/log0log.cc @@ -3225,6 +3225,7 @@ ulint log_archive_noarchivelog(void) /*==========================*/ { + ut_ad(!srv_read_only_mode); loop: mutex_enter(&(log_sys->mutex)); @@ -3257,6 +3258,8 @@ ulint log_archive_archivelog(void) /*========================*/ { + ut_ad(!srv_read_only_mode); + mutex_enter(&(log_sys->mutex)); if (log_sys->archiving_state == LOG_ARCH_OFF) { diff --git a/storage/xtradb/os/os0file.cc b/storage/xtradb/os/os0file.cc index dae50b5e00b..5976d79faff 100644 --- a/storage/xtradb/os/os0file.cc +++ b/storage/xtradb/os/os0file.cc @@ -1391,6 +1391,7 @@ os_file_create_simple_no_error_handling_func( *success = (file != INVALID_HANDLE_VALUE); #else /* __WIN__ */ int create_flag; + const char* mode_str = NULL; ut_a(name); @@ -1399,6 +1400,8 @@ os_file_create_simple_no_error_handling_func( if (create_mode == OS_FILE_OPEN) { + mode_str = "OPEN"; + if (access_type == OS_FILE_READ_ONLY) { create_flag = O_RDONLY; @@ -1417,10 +1420,14 @@ os_file_create_simple_no_error_handling_func( } else if (srv_read_only_mode) { + mode_str = "OPEN"; + create_flag = O_RDONLY; } else if (create_mode == OS_FILE_CREATE) { + mode_str = "CREATE"; + create_flag = O_RDWR | O_CREAT | O_EXCL; } else { @@ -1435,6 +1442,17 @@ os_file_create_simple_no_error_handling_func( *success = file == -1 ? FALSE : TRUE; + /* This function is always called for data files, we should disable + OS caching (O_DIRECT) here as we do in os_file_create_func(), so + we open the same file in the same mode, see man page of open(2). */ + if (!srv_read_only_mode + && *success + && (srv_unix_file_flush_method == SRV_UNIX_O_DIRECT + || srv_unix_file_flush_method == SRV_UNIX_O_DIRECT_NO_FSYNC)) { + + os_file_set_nocache(file, name, mode_str); + } + #ifdef USE_FILE_LOCK if (!srv_read_only_mode && *success diff --git a/storage/xtradb/row/row0import.cc b/storage/xtradb/row/row0import.cc index b753574158a..acf6be7d8d8 100644 --- a/storage/xtradb/row/row0import.cc +++ b/storage/xtradb/row/row0import.cc @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (c) 2012, 2013, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 2012, 2015, 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 the Free Software @@ -138,14 +138,6 @@ struct row_import { @return ULINT_UNDEFINED if not found. */ ulint find_col(const char* name) const UNIV_NOTHROW; - /** - Find the index field entry in in the cfg indexes fields. - @name - of the index to look for - @return instance if found else 0. */ - const dict_field_t* find_field( - const row_index_t* cfg_index, - const char* name) const UNIV_NOTHROW; - /** Get the number of rows for which purge failed during the convert phase. @param name - index name @@ -1140,30 +1132,6 @@ row_import::find_col( return(ULINT_UNDEFINED); } -/** -Find the index field entry in in the cfg indexes fields. -@name - of the index to look for -@return instance if found else 0. */ -const dict_field_t* -row_import::find_field( - const row_index_t* cfg_index, - const char* name) const UNIV_NOTHROW -{ - const dict_field_t* field = cfg_index->m_fields; - - for (ulint i = 0; i < cfg_index->m_n_fields; ++i, ++field) { - const char* field_name; - - field_name = reinterpret_cast(field->name); - - if (strcmp(field_name, name) == 0) { - return(field); - } - } - - return(0); -} - /** Check if the index schema that was read from the .cfg file matches the in memory index definition. @@ -1187,51 +1155,60 @@ row_import::match_index_columns( return(DB_ERROR); } + if (cfg_index->m_n_fields != index->n_fields) { + + ib_errf(thd, IB_LOG_LEVEL_ERROR, + ER_TABLE_SCHEMA_MISMATCH, + "Index field count %lu doesn't match" + " tablespace metadata file value %lu", + (ulong) index->n_fields, + (ulong) cfg_index->m_n_fields); + + return(DB_ERROR); + } + cfg_index->m_srv_index = index; const dict_field_t* field = index->fields; + const dict_field_t* cfg_field = cfg_index->m_fields; - for (ulint i = 0; i < index->n_fields; ++i, ++field) { + for (ulint i = 0; i < index->n_fields; ++i, ++field, ++cfg_field) { - const dict_field_t* cfg_field; - - cfg_field = find_field(cfg_index, field->name); - - if (cfg_field == 0) { + if (strcmp(field->name, cfg_field->name) != 0) { ib_errf(thd, IB_LOG_LEVEL_ERROR, ER_TABLE_SCHEMA_MISMATCH, - "Index %s field %s not found in tablespace " - "meta-data file.", - index->name, field->name); + "Index field name %s doesn't match" + " tablespace metadata field name %s" + " for field position %lu", + field->name, cfg_field->name, (ulong) i); err = DB_ERROR; - } else { + } - if (cfg_field->prefix_len != field->prefix_len) { - ib_errf(thd, IB_LOG_LEVEL_ERROR, - ER_TABLE_SCHEMA_MISMATCH, - "Index %s field %s prefix len %lu " - "doesn't match meta-data file value " - "%lu", - index->name, field->name, - (ulong) field->prefix_len, - (ulong) cfg_field->prefix_len); + if (cfg_field->prefix_len != field->prefix_len) { + ib_errf(thd, IB_LOG_LEVEL_ERROR, + ER_TABLE_SCHEMA_MISMATCH, + "Index %s field %s prefix len %lu" + " doesn't match metadata file value" + " %lu", + index->name, field->name, + (ulong) field->prefix_len, + (ulong) cfg_field->prefix_len); - err = DB_ERROR; - } + err = DB_ERROR; + } - if (cfg_field->fixed_len != field->fixed_len) { - ib_errf(thd, IB_LOG_LEVEL_ERROR, - ER_TABLE_SCHEMA_MISMATCH, - "Index %s field %s fixed len %lu " - "doesn't match meta-data file value " - "%lu", - index->name, field->name, - (ulong) field->fixed_len, - (ulong) cfg_field->fixed_len); + if (cfg_field->fixed_len != field->fixed_len) { + ib_errf(thd, IB_LOG_LEVEL_ERROR, + ER_TABLE_SCHEMA_MISMATCH, + "Index %s field %s fixed len %lu" + " doesn't match metadata file value" + " %lu", + index->name, field->name, + (ulong) field->fixed_len, + (ulong) cfg_field->fixed_len); - err = DB_ERROR; - } + err = DB_ERROR; } } diff --git a/storage/xtradb/row/row0ins.cc b/storage/xtradb/row/row0ins.cc index f3dd548d044..6f41f0c6d11 100644 --- a/storage/xtradb/row/row0ins.cc +++ b/storage/xtradb/row/row0ins.cc @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (c) 1996, 2014, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 1996, 2015, 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 the Free Software @@ -2327,24 +2327,34 @@ row_ins_clust_index_entry_low( big_rec_t* big_rec = NULL; mtr_t mtr; mem_heap_t* offsets_heap = NULL; + ulint search_mode; ut_ad(dict_index_is_clust(index)); ut_ad(!dict_index_is_unique(index) || n_uniq == dict_index_get_n_unique(index)); ut_ad(!n_uniq || n_uniq == dict_index_get_n_unique(index)); + /* If running with fake_changes mode on then switch from modify to + search so that code takes only s-latch and not x-latch. + For dry-run (fake-changes) s-latch is acceptable. Taking x-latch will + make it more restrictive and will block real changes/workflow. */ + if (UNIV_UNLIKELY(thr_get_trx(thr)->fake_changes)) { + search_mode = (mode & BTR_MODIFY_TREE) + ? BTR_SEARCH_TREE : BTR_SEARCH_LEAF; + } else { + search_mode = mode; + } + mtr_start(&mtr); if (mode == BTR_MODIFY_LEAF && dict_index_is_online_ddl(index)) { - if (UNIV_UNLIKELY(thr_get_trx(thr)->fake_changes)) { - mode = BTR_SEARCH_LEAF | BTR_ALREADY_S_LATCHED; - } else { - mode = BTR_MODIFY_LEAF | BTR_ALREADY_S_LATCHED; - } + + /* We really don't need to OR mode but will leave it for + code consistency. */ + mode |= BTR_ALREADY_S_LATCHED; + search_mode |= BTR_ALREADY_S_LATCHED; + mtr_s_lock(dict_index_get_lock(index), &mtr); - } else if (UNIV_UNLIKELY(thr_get_trx(thr)->fake_changes)) { - mode = (mode & BTR_MODIFY_TREE) - ? BTR_SEARCH_TREE : BTR_SEARCH_LEAF; } cursor.thr = thr; @@ -2353,7 +2363,7 @@ row_ins_clust_index_entry_low( the function will return in both low_match and up_match of the cursor sensible values */ - btr_cur_search_to_nth_level(index, 0, entry, PAGE_CUR_LE, mode, + btr_cur_search_to_nth_level(index, 0, entry, PAGE_CUR_LE, search_mode, &cursor, 0, __FILE__, __LINE__, &mtr); #ifdef UNIV_DEBUG @@ -2624,7 +2634,7 @@ row_ins_sec_index_entry_low( que_thr_t* thr) /*!< in: query thread */ { btr_cur_t cursor; - ulint search_mode = mode | BTR_INSERT; + ulint search_mode; dberr_t err = DB_SUCCESS; ulint n_unique; mtr_t mtr; @@ -2637,6 +2647,18 @@ row_ins_sec_index_entry_low( ut_ad(thr_get_trx(thr)->id); mtr_start(&mtr); + /* If running with fake_changes mode on then avoid using insert buffer + and also switch from modify to search so that code takes only s-latch + and not x-latch. For dry-run (fake-changes) s-latch is acceptable. + Taking x-latch will make it more restrictive and will block real + changes/workflow. */ + if (UNIV_UNLIKELY(thr_get_trx(thr)->fake_changes)) { + search_mode = (mode & BTR_MODIFY_TREE) + ? BTR_SEARCH_TREE : BTR_SEARCH_LEAF; + } else { + search_mode = mode | BTR_INSERT; + } + /* Ensure that we acquire index->lock when inserting into an index with index->online_status == ONLINE_INDEX_COMPLETE, but could still be subject to rollback_inplace_alter_table(). @@ -2644,11 +2666,24 @@ row_ins_sec_index_entry_low( The memory object cannot be freed as long as we have an open reference to the table, or index->table->n_ref_count > 0. */ const bool check = *index->name == TEMP_INDEX_PREFIX; + if (check) { + DEBUG_SYNC_C("row_ins_sec_index_enter"); - if (mode == BTR_MODIFY_LEAF) { + + /* mode = MODIFY_LEAF is synonymous to search_mode = SEARCH_LEAF + search_mode = SEARCH_TREE suggest operation in fake_change mode + so continue to s-latch in this mode too. */ + + if (mode == BTR_MODIFY_LEAF || search_mode == BTR_SEARCH_TREE) { + + ut_ad((search_mode == BTR_SEARCH_TREE + && thr_get_trx(thr)->fake_changes) + || mode == BTR_MODIFY_LEAF); + search_mode |= BTR_ALREADY_S_LATCHED; mtr_s_lock(dict_index_get_lock(index), &mtr); + } else { mtr_x_lock(dict_index_get_lock(index), &mtr); } @@ -2659,14 +2694,13 @@ row_ins_sec_index_entry_low( } } - /* Note that we use PAGE_CUR_LE as the search mode, because then - the function will return in both low_match and up_match of the - cursor sensible values */ - if (!thr_get_trx(thr)->check_unique_secondary) { search_mode |= BTR_IGNORE_SEC_UNIQUE; } + /* Note that we use PAGE_CUR_LE as the search mode, because then + the function will return in both low_match and up_match of the + cursor sensible values */ btr_cur_search_to_nth_level(index, 0, entry, PAGE_CUR_LE, search_mode, &cursor, 0, __FILE__, __LINE__, &mtr); @@ -2746,10 +2780,7 @@ row_ins_sec_index_entry_low( btr_cur_search_to_nth_level( index, 0, entry, PAGE_CUR_LE, - UNIV_UNLIKELY(thr_get_trx(thr)->fake_changes) - ? BTR_SEARCH_LEAF - : (btr_latch_mode) - (search_mode & ~(BTR_INSERT | BTR_IGNORE_SEC_UNIQUE)), + search_mode & ~(BTR_INSERT | BTR_IGNORE_SEC_UNIQUE), &cursor, 0, __FILE__, __LINE__, &mtr); } diff --git a/storage/xtradb/row/row0purge.cc b/storage/xtradb/row/row0purge.cc index 8212a7b43e0..b26ba971a95 100644 --- a/storage/xtradb/row/row0purge.cc +++ b/storage/xtradb/row/row0purge.cc @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (c) 1997, 2013, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 1997, 2015, 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 the Free Software @@ -84,7 +84,7 @@ row_purge_node_create( /***********************************************************//** Repositions the pcur in the purge node on the clustered index record, -if found. +if found. If the record is not found, close pcur. @return TRUE if the record was found */ static ibool @@ -95,11 +95,10 @@ row_purge_reposition_pcur( mtr_t* mtr) /*!< in: mtr */ { if (node->found_clust) { - ibool found; + ut_ad(node->validate_pcur()); - found = btr_pcur_restore_position(mode, &node->pcur, mtr); + node->found_clust = btr_pcur_restore_position(mode, &node->pcur, mtr); - return(found); } else { node->found_clust = row_search_on_row_ref( &node->pcur, mode, node->table, node->ref, mtr); @@ -109,6 +108,11 @@ row_purge_reposition_pcur( } } + /* Close the current cursor if we fail to position it correctly. */ + if (!node->found_clust) { + btr_pcur_close(&node->pcur); + } + return(node->found_clust); } @@ -182,7 +186,12 @@ func_exit: mem_heap_free(heap); } - btr_pcur_commit_specify_mtr(&node->pcur, &mtr); + /* Persistent cursor is closed if reposition fails. */ + if (node->found_clust) { + btr_pcur_commit_specify_mtr(&node->pcur, &mtr); + } else { + mtr_commit(&mtr); + } return(success); } @@ -251,7 +260,12 @@ row_purge_poss_sec( btr_pcur_get_rec(&node->pcur), &mtr, index, entry); - btr_pcur_commit_specify_mtr(&node->pcur, &mtr); + /* Persistent cursor is closed if reposition fails. */ + if (node->found_clust) { + btr_pcur_commit_specify_mtr(&node->pcur, &mtr); + } else { + mtr_commit(&mtr); + } return(can_delete); } @@ -831,6 +845,8 @@ row_purge_record_func( dict_index_t* clust_index; bool purged = true; + ut_ad(!node->found_clust); + clust_index = dict_table_get_first_index(node->table); node->index = dict_table_get_next_index(clust_index); @@ -986,3 +1002,52 @@ row_purge_step( return(thr); } + +#ifdef UNIV_DEBUG +/***********************************************************//** +Validate the persisent cursor. The purge node has two references +to the clustered index record - one via the ref member, and the +other via the persistent cursor. These two references must match +each other if the found_clust flag is set. +@return true if the stored copy of persistent cursor is consistent +with the ref member.*/ +bool +purge_node_t::validate_pcur() +{ + if (!found_clust) { + return(true); + } + + if (index == NULL) { + return(true); + } + + if (index->type == DICT_FTS) { + return(true); + } + + if (pcur.old_stored != BTR_PCUR_OLD_STORED) { + return(true); + } + + dict_index_t* clust_index = pcur.btr_cur.index; + + ulint* offsets = rec_get_offsets( + pcur.old_rec, clust_index, NULL, pcur.old_n_fields, &heap); + + /* Here we are comparing the purge ref record and the stored initial + part in persistent cursor. Both cases we store n_uniq fields of the + cluster index and so it is fine to do the comparison. We note this + dependency here as pcur and ref belong to different modules. */ + int st = cmp_dtuple_rec(ref, pcur.old_rec, offsets); + + if (st != 0) { + fprintf(stderr, "Purge node pcur validation failed\n"); + dtuple_print(stderr, ref); + rec_print(stderr, pcur.old_rec, clust_index); + return(false); + } + + return(true); +} +#endif /* UNIV_DEBUG */ diff --git a/storage/xtradb/row/row0sel.cc b/storage/xtradb/row/row0sel.cc index 7ed45ccd06d..388668afb47 100644 --- a/storage/xtradb/row/row0sel.cc +++ b/storage/xtradb/row/row0sel.cc @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (c) 1997, 2013, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 1997, 2015, Oracle and/or its affiliates. All Rights Reserved. Copyright (c) 2008, Google Inc. Portions of this file contain modifications contributed and copyrighted by diff --git a/storage/xtradb/srv/srv0srv.cc b/storage/xtradb/srv/srv0srv.cc index 6343c85a59f..d10a566b061 100644 --- a/storage/xtradb/srv/srv0srv.cc +++ b/storage/xtradb/srv/srv0srv.cc @@ -2141,8 +2141,7 @@ rescan_idle: mutex_enter(&trx_sys->mutex); trx = UT_LIST_GET_FIRST(trx_sys->mysql_trx_list); while (trx) { - if (!trx_state_eq(trx, TRX_STATE_NOT_STARTED) - && trx_state_eq(trx, TRX_STATE_ACTIVE) + if (trx->state == TRX_STATE_ACTIVE && trx->mysql_thd && innobase_thd_is_idle(trx->mysql_thd)) { ib_int64_t start_time = innobase_thd_get_start_time(trx->mysql_thd); diff --git a/storage/xtradb/srv/srv0start.cc b/storage/xtradb/srv/srv0start.cc index dd49f4cd651..545034f1dca 100644 --- a/storage/xtradb/srv/srv0start.cc +++ b/storage/xtradb/srv/srv0start.cc @@ -2650,24 +2650,25 @@ files_checked: } #ifdef UNIV_LOG_ARCHIVE - /* Archiving is always off under MySQL */ - if (!srv_log_archive_on) { - ut_a(DB_SUCCESS == log_archive_noarchivelog()); - } else { - bool start_archive; + if (!srv_read_only_mode) { + if (!srv_log_archive_on) { + ut_a(DB_SUCCESS == log_archive_noarchivelog()); + } else { + bool start_archive; - mutex_enter(&(log_sys->mutex)); + mutex_enter(&(log_sys->mutex)); - start_archive = FALSE; + start_archive = false; - if (log_sys->archiving_state == LOG_ARCH_OFF) { - start_archive = TRUE; - } + if (log_sys->archiving_state == LOG_ARCH_OFF) { + start_archive = true; + } - mutex_exit(&(log_sys->mutex)); + mutex_exit(&(log_sys->mutex)); - if (start_archive) { - ut_a(DB_SUCCESS == log_archive_archivelog()); + if (start_archive) { + ut_a(DB_SUCCESS == log_archive_archivelog()); + } } } #endif /* UNIV_LOG_ARCHIVE */ From 86ff4da14dc53659e88ee8cd66412045dcb26e31 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Fri, 9 Oct 2015 17:21:46 +0200 Subject: [PATCH 82/85] 5.6.27 --- storage/innobase/CMakeLists.txt | 21 ++- storage/innobase/btr/btr0cur.cc | 34 +++-- storage/innobase/buf/buf0buf.cc | 47 +++++++ storage/innobase/dict/dict0dict.cc | 58 ++++++-- storage/innobase/handler/ha_innodb.cc | 30 +++- storage/innobase/handler/handler0alter.cc | 2 +- storage/innobase/include/dict0dict.h | 28 ++++ storage/innobase/include/ibuf0ibuf.ic | 5 +- storage/innobase/include/os0sync.h | 161 ++++++++++++++++++---- storage/innobase/include/srv0srv.h | 7 +- storage/innobase/include/sync0sync.h | 11 +- storage/innobase/include/sync0sync.ic | 25 +--- storage/innobase/lock/lock0lock.cc | 7 +- storage/innobase/log/log0log.cc | 8 +- storage/innobase/row/row0ins.cc | 2 + storage/innobase/srv/srv0srv.cc | 28 ++-- storage/innobase/srv/srv0start.cc | 5 +- storage/innobase/trx/trx0sys.cc | 22 +-- 18 files changed, 388 insertions(+), 113 deletions(-) diff --git a/storage/innobase/CMakeLists.txt b/storage/innobase/CMakeLists.txt index eeb53f96c9f..2e939899d24 100644 --- a/storage/innobase/CMakeLists.txt +++ b/storage/innobase/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (c) 2006, 2011, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2006, 2015, 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 @@ -29,6 +29,9 @@ IF(UNIX) ADD_DEFINITIONS(-DLINUX_NATIVE_AIO=1) LINK_LIBRARIES(aio) ENDIF() + IF(HAVE_LIBNUMA) + LINK_LIBRARIES(numa) + ENDIF() ELSEIF(CMAKE_SYSTEM_NAME MATCHES "HP*") ADD_DEFINITIONS("-DUNIV_HPUX") ELSEIF(CMAKE_SYSTEM_NAME STREQUAL "AIX") @@ -145,6 +148,18 @@ IF(NOT CMAKE_CROSSCOMPILING) }" HAVE_IB_GCC_ATOMIC_THREAD_FENCE ) + CHECK_C_SOURCE_RUNS( + "#include + int main() + { + unsigned char c; + + __atomic_test_and_set(&c, __ATOMIC_ACQUIRE); + __atomic_clear(&c, __ATOMIC_RELEASE); + return(0); + }" + HAVE_IB_GCC_ATOMIC_TEST_AND_SET + ) ENDIF() IF(HAVE_IB_GCC_ATOMIC_BUILTINS) @@ -167,6 +182,10 @@ IF(HAVE_IB_GCC_ATOMIC_THREAD_FENCE) ADD_DEFINITIONS(-DHAVE_IB_GCC_ATOMIC_THREAD_FENCE=1) ENDIF() +IF(HAVE_IB_GCC_ATOMIC_TEST_AND_SET) + ADD_DEFINITIONS(-DHAVE_IB_GCC_ATOMIC_TEST_AND_SET=1) +ENDIF() + # either define HAVE_IB_ATOMIC_PTHREAD_T_GCC or not IF(NOT CMAKE_CROSSCOMPILING) CHECK_C_SOURCE_RUNS( diff --git a/storage/innobase/btr/btr0cur.cc b/storage/innobase/btr/btr0cur.cc index 1611fb6394c..ad323531da6 100644 --- a/storage/innobase/btr/btr0cur.cc +++ b/storage/innobase/btr/btr0cur.cc @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (c) 1994, 2014, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 1994, 2015, Oracle and/or its affiliates. All Rights Reserved. Copyright (c) 2008, Google Inc. Copyright (c) 2012, Facebook Inc. @@ -2117,6 +2117,7 @@ btr_cur_optimistic_update( ulint max_size; ulint new_rec_size; ulint old_rec_size; + ulint max_ins_size = 0; dtuple_t* new_entry; roll_ptr_t roll_ptr; ulint i; @@ -2245,6 +2246,10 @@ any_extern: : (old_rec_size + page_get_max_insert_size_after_reorganize(page, 1)); + if (!page_zip) { + max_ins_size = page_get_max_insert_size_after_reorganize(page, 1); + } + if (!(((max_size >= BTR_CUR_PAGE_REORGANIZE_LIMIT) && (max_size >= new_rec_size)) || (page_get_n_recs(page) <= 1))) { @@ -2304,12 +2309,15 @@ any_extern: ut_ad(err == DB_SUCCESS); func_exit: - if (page_zip - && !(flags & BTR_KEEP_IBUF_BITMAP) + if (!(flags & BTR_KEEP_IBUF_BITMAP) && !dict_index_is_clust(index) && page_is_leaf(page)) { - /* Update the free bits in the insert buffer. */ - ibuf_update_free_bits_zip(block, mtr); + + if (page_zip) { + ibuf_update_free_bits_zip(block, mtr); + } else { + ibuf_update_free_bits_low(block, max_ins_size, mtr); + } } return(err); @@ -2444,6 +2452,7 @@ btr_cur_pessimistic_update( ibool was_first; ulint n_reserved = 0; ulint n_ext; + ulint max_ins_size = 0; *offsets = NULL; *big_rec = NULL; @@ -2622,6 +2631,10 @@ make_external: } } + if (!page_zip) { + max_ins_size = page_get_max_insert_size_after_reorganize(page, 1); + } + /* Store state of explicit locks on rec on the page infimum record, before deleting rec. The page infimum acts as a dummy carrier of the locks, taking care also of lock releases, before we can move the locks @@ -2667,13 +2680,18 @@ make_external: rec_offs_make_valid( page_cursor->rec, index, *offsets); } - } else if (page_zip && - !dict_index_is_clust(index) + } else if (!dict_index_is_clust(index) && page_is_leaf(page)) { + /* Update the free bits in the insert buffer. This is the same block which was skipped by BTR_KEEP_IBUF_BITMAP. */ - ibuf_update_free_bits_zip(block, mtr); + if (page_zip) { + ibuf_update_free_bits_zip(block, mtr); + } else { + ibuf_update_free_bits_low(block, max_ins_size, + mtr); + } } err = DB_SUCCESS; diff --git a/storage/innobase/buf/buf0buf.cc b/storage/innobase/buf/buf0buf.cc index 311e3326f2b..85e44294e60 100644 --- a/storage/innobase/buf/buf0buf.cc +++ b/storage/innobase/buf/buf0buf.cc @@ -53,6 +53,10 @@ Created 11/5/1995 Heikki Tuuri #include "page0zip.h" #include "srv0mon.h" #include "buf0checksum.h" +#ifdef HAVE_LIBNUMA +#include +#include +#endif // HAVE_LIBNUMA /* IMPLEMENTATION OF THE BUFFER POOL @@ -1112,6 +1116,22 @@ buf_chunk_init( return(NULL); } +#ifdef HAVE_LIBNUMA + if (srv_numa_interleave) { + int st = mbind(chunk->mem, chunk->mem_size, + MPOL_INTERLEAVE, + numa_all_nodes_ptr->maskp, + numa_all_nodes_ptr->size, + MPOL_MF_MOVE); + if (st != 0) { + ib_logf(IB_LOG_LEVEL_WARN, + "Failed to set NUMA memory policy of buffer" + " pool page frames to MPOL_INTERLEAVE" + " (error: %s).", strerror(errno)); + } + } +#endif // HAVE_LIBNUMA + /* Allocate the block descriptors from the start of the memory block. */ chunk->blocks = (buf_block_t*) chunk->mem; @@ -1442,6 +1462,21 @@ buf_pool_init( ut_ad(n_instances <= MAX_BUFFER_POOLS); ut_ad(n_instances == srv_buf_pool_instances); +#ifdef HAVE_LIBNUMA + if (srv_numa_interleave) { + ib_logf(IB_LOG_LEVEL_INFO, + "Setting NUMA memory policy to MPOL_INTERLEAVE"); + if (set_mempolicy(MPOL_INTERLEAVE, + numa_all_nodes_ptr->maskp, + numa_all_nodes_ptr->size) != 0) { + ib_logf(IB_LOG_LEVEL_WARN, + "Failed to set NUMA memory policy to" + " MPOL_INTERLEAVE (error: %s).", + strerror(errno)); + } + } +#endif // HAVE_LIBNUMA + buf_pool_ptr = (buf_pool_t*) mem_zalloc( n_instances * sizeof *buf_pool_ptr); @@ -1462,6 +1497,18 @@ buf_pool_init( btr_search_sys_create(buf_pool_get_curr_size() / sizeof(void*) / 64); +#ifdef HAVE_LIBNUMA + if (srv_numa_interleave) { + ib_logf(IB_LOG_LEVEL_INFO, + "Setting NUMA memory policy to MPOL_DEFAULT"); + if (set_mempolicy(MPOL_DEFAULT, NULL, 0) != 0) { + ib_logf(IB_LOG_LEVEL_WARN, + "Failed to set NUMA memory policy to" + " MPOL_DEFAULT (error: %s).", strerror(errno)); + } + } +#endif // HAVE_LIBNUMA + return(DB_SUCCESS); } diff --git a/storage/innobase/dict/dict0dict.cc b/storage/innobase/dict/dict0dict.cc index 78b4cc77945..e530ec9e97a 100644 --- a/storage/innobase/dict/dict0dict.cc +++ b/storage/innobase/dict/dict0dict.cc @@ -207,14 +207,6 @@ dict_index_remove_from_cache_low( dict_index_t* index, /*!< in, own: index */ ibool lru_evict); /*!< in: TRUE if page being evicted to make room in the table LRU list */ -/**********************************************************************//** -Removes a table object from the dictionary cache. */ -static -void -dict_table_remove_from_cache_low( -/*=============================*/ - dict_table_t* table, /*!< in, own: table */ - ibool lru_evict); /*!< in: TRUE if evicting from LRU */ #ifdef UNIV_DEBUG /**********************************************************************//** Validate the dictionary table LRU list. @@ -748,6 +740,45 @@ dict_table_get_all_fts_indexes( return(ib_vector_size(indexes)); } +/** Store autoinc value when the table is evicted. +@param[in] table table evicted */ +UNIV_INTERN +void +dict_table_autoinc_store( + const dict_table_t* table) +{ + ut_ad(mutex_own(&dict_sys->mutex)); + + if (table->autoinc != 0) { + ut_ad(dict_sys->autoinc_map->find(table->id) + == dict_sys->autoinc_map->end()); + + dict_sys->autoinc_map->insert( + std::pair( + table->id, table->autoinc)); + } +} + +/** Restore autoinc value when the table is loaded. +@param[in] table table loaded */ +UNIV_INTERN +void +dict_table_autoinc_restore( + dict_table_t* table) +{ + ut_ad(mutex_own(&dict_sys->mutex)); + + autoinc_map_t::iterator it; + it = dict_sys->autoinc_map->find(table->id); + + if (it != dict_sys->autoinc_map->end()) { + table->autoinc = it->second; + ut_ad(table->autoinc != 0); + + dict_sys->autoinc_map->erase(it); + } +} + /********************************************************************//** Reads the next autoinc value (== autoinc counter value), 0 if not yet initialized. @@ -1041,6 +1072,8 @@ dict_init(void) mutex_create(dict_foreign_err_mutex_key, &dict_foreign_err_mutex, SYNC_NO_ORDER_CHECK); } + + dict_sys->autoinc_map = new autoinc_map_t(); } /**********************************************************************//** @@ -1288,6 +1321,8 @@ dict_table_add_to_cache( UT_LIST_ADD_FIRST(table_LRU, dict_sys->table_non_LRU, table); } + dict_table_autoinc_restore(table); + ut_ad(dict_lru_validate()); dict_sys->size += mem_heap_get_size(table->heap) @@ -1978,7 +2013,6 @@ dict_table_change_id_in_cache( /**********************************************************************//** Removes a table object from the dictionary cache. */ -static void dict_table_remove_from_cache_low( /*=============================*/ @@ -2040,6 +2074,10 @@ dict_table_remove_from_cache_low( ut_ad(dict_lru_validate()); + if (lru_evict) { + dict_table_autoinc_store(table); + } + if (lru_evict && table->drop_aborted) { /* Do as dict_table_try_drop_aborted() does. */ @@ -6330,6 +6368,8 @@ dict_close(void) mutex_free(&dict_foreign_err_mutex); } + delete dict_sys->autoinc_map; + mem_free(dict_sys); dict_sys = NULL; } diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc index d3a81e36bca..22d51a439e1 100644 --- a/storage/innobase/handler/ha_innodb.cc +++ b/storage/innobase/handler/ha_innodb.cc @@ -6495,7 +6495,7 @@ ha_innobase::write_row( DBUG_ENTER("ha_innobase::write_row"); - if (srv_read_only_mode) { + if (high_level_read_only) { ib_senderrf(ha_thd(), IB_LOG_LEVEL_WARN, ER_READ_ONLY_MODE); DBUG_RETURN(HA_ERR_TABLE_READONLY); } else if (prebuilt->trx != trx) { @@ -7039,7 +7039,7 @@ ha_innobase::update_row( ut_a(prebuilt->trx == trx); - if (srv_read_only_mode) { + if (high_level_read_only) { ib_senderrf(ha_thd(), IB_LOG_LEVEL_WARN, ER_READ_ONLY_MODE); DBUG_RETURN(HA_ERR_TABLE_READONLY); } else if (!trx_is_started(trx)) { @@ -7171,7 +7171,7 @@ ha_innobase::delete_row( ut_a(prebuilt->trx == trx); - if (srv_read_only_mode) { + if (high_level_read_only) { ib_senderrf(ha_thd(), IB_LOG_LEVEL_WARN, ER_READ_ONLY_MODE); DBUG_RETURN(HA_ERR_TABLE_READONLY); } else if (!trx_is_started(trx)) { @@ -9499,7 +9499,7 @@ ha_innobase::create( if (form->s->fields > REC_MAX_N_USER_FIELDS) { DBUG_RETURN(HA_ERR_TOO_MANY_FIELDS); - } else if (srv_read_only_mode) { + } else if (high_level_read_only) { DBUG_RETURN(HA_ERR_INNODB_READ_ONLY); } @@ -9829,7 +9829,7 @@ ha_innobase::discard_or_import_tablespace( ut_a(prebuilt->trx->magic_n == TRX_MAGIC_N); ut_a(prebuilt->trx == thd_to_trx(ha_thd())); - if (srv_read_only_mode) { + if (high_level_read_only) { DBUG_RETURN(HA_ERR_TABLE_READONLY); } @@ -9923,7 +9923,7 @@ ha_innobase::truncate() DBUG_ENTER("ha_innobase::truncate"); - if (srv_read_only_mode) { + if (high_level_read_only) { DBUG_RETURN(HA_ERR_TABLE_READONLY); } @@ -10274,7 +10274,7 @@ ha_innobase::rename_table( DBUG_ENTER("ha_innobase::rename_table"); - if (srv_read_only_mode) { + if (high_level_read_only) { ib_senderrf(thd, IB_LOG_LEVEL_WARN, ER_READ_ONLY_MODE); DBUG_RETURN(HA_ERR_TABLE_READONLY); } @@ -14288,6 +14288,12 @@ innodb_internal_table_validate( } dict_table_close(user_table, FALSE, TRUE); + + DBUG_EXECUTE_IF("innodb_evict_autoinc_table", + mutex_enter(&dict_sys->mutex); + dict_table_remove_from_cache_low(user_table, TRUE); + mutex_exit(&dict_sys->mutex); + ); } return(ret); @@ -16301,6 +16307,13 @@ static MYSQL_SYSVAR_BOOL(use_native_aio, srv_use_native_aio, "Use native AIO if supported on this platform.", NULL, NULL, TRUE); +#ifdef HAVE_LIBNUMA +static MYSQL_SYSVAR_BOOL(numa_interleave, srv_numa_interleave, + PLUGIN_VAR_NOCMDARG | PLUGIN_VAR_READONLY, + "Use NUMA interleave memory policy to allocate InnoDB buffer pool.", + NULL, NULL, FALSE); +#endif // HAVE_LIBNUMA + static MYSQL_SYSVAR_BOOL(api_enable_binlog, ib_binlog_enabled, PLUGIN_VAR_NOCMDARG | PLUGIN_VAR_READONLY, "Enable binlog for applications direct access InnoDB through InnoDB APIs", @@ -16579,6 +16592,9 @@ static struct st_mysql_sys_var* innobase_system_variables[]= { MYSQL_SYSVAR(version), MYSQL_SYSVAR(use_sys_malloc), MYSQL_SYSVAR(use_native_aio), +#ifdef HAVE_LIBNUMA + MYSQL_SYSVAR(numa_interleave), +#endif // HAVE_LIBNUMA MYSQL_SYSVAR(change_buffering), MYSQL_SYSVAR(change_buffer_max_size), #if defined UNIV_DEBUG || defined UNIV_IBUF_DEBUG diff --git a/storage/innobase/handler/handler0alter.cc b/storage/innobase/handler/handler0alter.cc index 96cabae3f0d..2354f5537cb 100644 --- a/storage/innobase/handler/handler0alter.cc +++ b/storage/innobase/handler/handler0alter.cc @@ -234,7 +234,7 @@ ha_innobase::check_if_supported_inplace_alter( { DBUG_ENTER("check_if_supported_inplace_alter"); - if (srv_read_only_mode) { + if (high_level_read_only) { ha_alter_info->unsupported_reason = innobase_get_err_msg(ER_READ_ONLY_MODE); DBUG_RETURN(HA_ALTER_INPLACE_NOT_SUPPORTED); diff --git a/storage/innobase/include/dict0dict.h b/storage/innobase/include/dict0dict.h index d770449e851..dea4a9a2a50 100644 --- a/storage/innobase/include/dict0dict.h +++ b/storage/innobase/include/dict0dict.h @@ -309,6 +309,21 @@ dict_table_autoinc_initialize( dict_table_t* table, /*!< in/out: table */ ib_uint64_t value) /*!< in: next value to assign to a row */ __attribute__((nonnull)); + +/** Store autoinc value when the table is evicted. +@param[in] table table evicted */ +UNIV_INTERN +void +dict_table_autoinc_store( + const dict_table_t* table); + +/** Restore autoinc value when the table is loaded. +@param[in] table table loaded */ +UNIV_INTERN +void +dict_table_autoinc_restore( + dict_table_t* table); + /********************************************************************//** Reads the next autoinc value (== autoinc counter value), 0 if not yet initialized. @@ -368,6 +383,15 @@ dict_table_remove_from_cache( dict_table_t* table) /*!< in, own: table */ __attribute__((nonnull)); /**********************************************************************//** +Removes a table object from the dictionary cache. */ +UNIV_INTERN +void +dict_table_remove_from_cache_low( +/*=============================*/ + dict_table_t* table, /*!< in, own: table */ + ibool lru_evict); /*!< in: TRUE if table being evicted + to make room in the table LRU list */ +/**********************************************************************//** Renames a table object. @return TRUE if success */ UNIV_INTERN @@ -1543,6 +1567,8 @@ extern dict_sys_t* dict_sys; /** the data dictionary rw-latch protecting dict_sys */ extern rw_lock_t dict_operation_lock; +typedef std::map autoinc_map_t; + /* Dictionary system struct */ struct dict_sys_t{ ib_mutex_t mutex; /*!< mutex protecting the data @@ -1577,6 +1603,8 @@ struct dict_sys_t{ UT_LIST_BASE_NODE_T(dict_table_t) table_non_LRU; /*!< List of tables that can't be evicted from the cache */ + autoinc_map_t* autoinc_map; /*!< Map to store table id and autoinc + when table is evicted */ }; #endif /* !UNIV_HOTBACKUP */ diff --git a/storage/innobase/include/ibuf0ibuf.ic b/storage/innobase/include/ibuf0ibuf.ic index 21747fdceac..a5df9f7b6b4 100644 --- a/storage/innobase/include/ibuf0ibuf.ic +++ b/storage/innobase/include/ibuf0ibuf.ic @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (c) 1997, 2013, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 1997, 2015, 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 the Free Software @@ -128,7 +128,8 @@ ibuf_should_try( && ibuf->max_size != 0 && !dict_index_is_clust(index) && index->table->quiesce == QUIESCE_NONE - && (ignore_sec_unique || !dict_index_is_unique(index))); + && (ignore_sec_unique || !dict_index_is_unique(index)) + && srv_force_recovery < SRV_FORCE_NO_IBUF_MERGE); } /******************************************************************//** diff --git a/storage/innobase/include/os0sync.h b/storage/innobase/include/os0sync.h index 57b29fff663..9329a0effb4 100644 --- a/storage/innobase/include/os0sync.h +++ b/storage/innobase/include/os0sync.h @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (c) 1995, 2014, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 1995, 2015, Oracle and/or its affiliates. All Rights Reserved. Copyright (c) 2008, Google Inc. Portions of this file contain modifications contributed and copyrighted by @@ -38,6 +38,26 @@ Created 9/6/1995 Heikki Tuuri #include "ut0lst.h" #include "sync0types.h" +#if defined __i386__ || defined __x86_64__ || defined _M_IX86 \ + || defined _M_X64 || defined __WIN__ + +#define IB_STRONG_MEMORY_MODEL + +#endif /* __i386__ || __x86_64__ || _M_IX86 || _M_X64 || __WIN__ */ + +#ifdef HAVE_WINDOWS_ATOMICS +typedef LONG lock_word_t; /*!< On Windows, InterlockedExchange operates + on LONG variable */ +#elif defined(HAVE_ATOMIC_BUILTINS) && !defined(HAVE_ATOMIC_BUILTINS_BYTE) +typedef ulint lock_word_t; +#else + +#define IB_LOCK_WORD_IS_BYTE + +typedef byte lock_word_t; + +#endif /* HAVE_WINDOWS_ATOMICS */ + #ifdef __WIN__ /** Native event (slow)*/ typedef HANDLE os_native_event_t; @@ -429,14 +449,61 @@ amount to decrement. */ # define os_atomic_decrement_uint64(ptr, amount) \ os_atomic_decrement(ptr, amount) -/**********************************************************//** -Returns the old value of *ptr, atomically sets *ptr to new_val */ +# if defined(HAVE_IB_GCC_ATOMIC_TEST_AND_SET) -# define os_atomic_test_and_set_byte(ptr, new_val) \ - __sync_lock_test_and_set(ptr, (byte) new_val) +/** Do an atomic test-and-set. +@param[in,out] ptr Memory location to set to non-zero +@return the previous value */ +inline +lock_word_t +os_atomic_test_and_set(volatile lock_word_t* ptr) +{ + return(__atomic_test_and_set(ptr, __ATOMIC_ACQUIRE)); +} -# define os_atomic_test_and_set_ulint(ptr, new_val) \ - __sync_lock_test_and_set(ptr, new_val) +/** Do an atomic clear. +@param[in,out] ptr Memory location to set to zero */ +inline +void +os_atomic_clear(volatile lock_word_t* ptr) +{ + __atomic_clear(ptr, __ATOMIC_RELEASE); +} + +# elif defined(IB_STRONG_MEMORY_MODEL) + +/** Do an atomic test and set. +@param[in,out] ptr Memory location to set to non-zero +@return the previous value */ +inline +lock_word_t +os_atomic_test_and_set(volatile lock_word_t* ptr) +{ + return(__sync_lock_test_and_set(ptr, 1)); +} + +/** Do an atomic release. + +In theory __sync_lock_release should be used to release the lock. +Unfortunately, it does not work properly alone. The workaround is +that more conservative __sync_lock_test_and_set is used instead. + +Performance regression was observed at some conditions for Intel +architecture. Disable release barrier on Intel architecture for now. +@param[in,out] ptr Memory location to write to +@return the previous value */ +inline +lock_word_t +os_atomic_clear(volatile lock_word_t* ptr) +{ + return(__sync_lock_test_and_set(ptr, 0)); +} + +# else + +# error "Unsupported platform" + +# endif /* HAVE_IB_GCC_ATOMIC_TEST_AND_SET */ #elif defined(HAVE_IB_SOLARIS_ATOMICS) @@ -511,14 +578,51 @@ amount to decrement. */ # define os_atomic_decrement_uint64(ptr, amount) \ os_atomic_increment_uint64(ptr, -(amount)) -/**********************************************************//** -Returns the old value of *ptr, atomically sets *ptr to new_val */ +# ifdef IB_LOCK_WORD_IS_BYTE -# define os_atomic_test_and_set_byte(ptr, new_val) \ - atomic_swap_uchar(ptr, new_val) +/** Do an atomic xchg and set to non-zero. +@param[in,out] ptr Memory location to set to non-zero +@return the previous value */ +inline +lock_word_t +os_atomic_test_and_set(volatile lock_word_t* ptr) +{ + return(atomic_swap_uchar(ptr, 1)); +} -# define os_atomic_test_and_set_ulint(ptr, new_val) \ - atomic_swap_ulong(ptr, new_val) +/** Do an atomic xchg and set to zero. +@param[in,out] ptr Memory location to set to zero +@return the previous value */ +inline +lock_word_t +os_atomic_clear(volatile lock_word_t* ptr) +{ + return(atomic_swap_uchar(ptr, 0)); +} + +# else + +/** Do an atomic xchg and set to non-zero. +@param[in,out] ptr Memory location to set to non-zero +@return the previous value */ +inline +lock_word_t +os_atomic_test_and_set(volatile lock_word_t* ptr) +{ + return(atomic_swap_ulong(ptr, 1)); +} + +/** Do an atomic xchg and set to zero. +@param[in,out] ptr Memory location to set to zero +@return the previous value */ +inline +lock_word_t +os_atomic_clear(volatile lock_word_t* ptr) +{ + return(atomic_swap_ulong(ptr, 0)); +} + +# endif /* IB_LOCK_WORD_IS_BYTE */ #elif defined(HAVE_WINDOWS_ATOMICS) @@ -633,16 +737,27 @@ amount to decrement. There is no atomic substract function on Windows */ (ib_int64_t*) ptr, \ -(ib_int64_t) amount) - amount)) -/**********************************************************//** -Returns the old value of *ptr, atomically sets *ptr to new_val. -InterlockedExchange() operates on LONG, and the LONG will be -clobbered */ +/** Do an atomic test and set. +InterlockedExchange() operates on LONG, and the LONG will be clobbered +@param[in,out] ptr Memory location to set to non-zero +@return the previous value */ +inline +lock_word_t +os_atomic_test_and_set(volatile lock_word_t* ptr) +{ + return(InterlockedExchange(ptr, 1)); +} -# define os_atomic_test_and_set_byte(ptr, new_val) \ - ((byte) InterlockedExchange(ptr, new_val)) - -# define os_atomic_test_and_set_ulong(ptr, new_val) \ - InterlockedExchange(ptr, new_val) +/** Do an atomic release. +InterlockedExchange() operates on LONG, and the LONG will be clobbered +@param[in,out] ptr Memory location to set to zero +@return the previous value */ +inline +lock_word_t +os_atomic_clear(volatile lock_word_t* ptr) +{ + return(InterlockedExchange(ptr, 0)); +} #else # define IB_ATOMICS_STARTUP_MSG \ @@ -692,7 +807,7 @@ for synchronization */ } while (0); /** barrier definitions for memory ordering */ -#if defined __i386__ || defined __x86_64__ || defined _M_IX86 || defined _M_X64 || defined __WIN__ +#ifdef IB_STRONG_MEMORY_MODEL /* Performance regression was observed at some conditions for Intel architecture. Disable memory barrier for Intel architecture for now. */ # define os_rmb diff --git a/storage/innobase/include/srv0srv.h b/storage/innobase/include/srv0srv.h index 7a6c9f93e3d..6e2f76af30d 100644 --- a/storage/innobase/include/srv0srv.h +++ b/storage/innobase/include/srv0srv.h @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (c) 1995, 2013, Oracle and/or its affiliates. All rights reserved. +Copyright (c) 1995, 2015, Oracle and/or its affiliates. All rights reserved. Copyright (c) 2008, 2009, Google Inc. Copyright (c) 2009, Percona Inc. @@ -187,6 +187,9 @@ extern char* srv_arch_dir; recovery and open all tables in RO mode instead of RW mode. We don't sync the max trx id to disk either. */ extern my_bool srv_read_only_mode; +/** Set if InnoDB operates in read-only mode or innodb-force-recovery +is greater than SRV_FORCE_NO_TRX_UNDO. */ +extern my_bool high_level_read_only; /** store to its own file each table created by an user; data dictionary tables are in the system tablespace 0 */ extern my_bool srv_file_per_table; @@ -217,6 +220,7 @@ OS (provided we compiled Innobase with it in), otherwise we will use simulated aio we build below with threads. Currently we support native aio on windows and linux */ extern my_bool srv_use_native_aio; +extern my_bool srv_numa_interleave; #ifdef __WIN__ extern ibool srv_use_native_conditions; #endif /* __WIN__ */ @@ -875,6 +879,7 @@ struct srv_slot_t{ #else /* !UNIV_HOTBACKUP */ # define srv_use_adaptive_hash_indexes FALSE # define srv_use_native_aio FALSE +# define srv_numa_interleave FALSE # define srv_force_recovery 0UL # define srv_set_io_thread_op_info(t,info) ((void) 0) # define srv_reset_io_thread_op_info() ((void) 0) diff --git a/storage/innobase/include/sync0sync.h b/storage/innobase/include/sync0sync.h index 82fb353a41b..d6f8d8f5e4c 100644 --- a/storage/innobase/include/sync0sync.h +++ b/storage/innobase/include/sync0sync.h @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (c) 1995, 2012, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 1995, 2015, Oracle and/or its affiliates. All Rights Reserved. Copyright (c) 2008, Google Inc. Copyright (c) 2012, Facebook Inc. @@ -46,15 +46,6 @@ Created 9/5/1995 Heikki Tuuri extern "C" my_bool timed_mutexes; #endif /* UNIV_DEBUG && !UNIV_HOTBACKUP */ -#ifdef HAVE_WINDOWS_ATOMICS -typedef LONG lock_word_t; /*!< On Windows, InterlockedExchange operates - on LONG variable */ -#elif defined(HAVE_ATOMIC_BUILTINS) && !defined(HAVE_ATOMIC_BUILTINS_BYTE) -typedef ulint lock_word_t; -#else -typedef byte lock_word_t; -#endif - #if defined UNIV_PFS_MUTEX || defined UNIV_PFS_RWLOCK /* By default, buffer mutexes and rwlocks will be excluded from diff --git a/storage/innobase/include/sync0sync.ic b/storage/innobase/include/sync0sync.ic index 616e53d4aac..9a062db71a8 100644 --- a/storage/innobase/include/sync0sync.ic +++ b/storage/innobase/include/sync0sync.ic @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (c) 1995, 2009, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 1995, 2015, Oracle and/or its affiliates. All Rights Reserved. Copyright (c) 2008, Google Inc. Portions of this file contain modifications contributed and copyrighted by @@ -74,17 +74,13 @@ Performs an atomic test-and-set instruction to the lock_word field of a mutex. @return the previous value of lock_word: 0 or 1 */ UNIV_INLINE -byte +lock_word_t ib_mutex_test_and_set( -/*===============*/ +/*==================*/ ib_mutex_t* mutex) /*!< in: mutex */ { #if defined(HAVE_ATOMIC_BUILTINS) -# if defined(HAVE_ATOMIC_BUILTINS_BYTE) - return(os_atomic_test_and_set_byte(&mutex->lock_word, 1)); -# else - return(os_atomic_test_and_set_ulint(&mutex->lock_word, 1)); -# endif + return(os_atomic_test_and_set(&mutex->lock_word)); #else ibool ret; @@ -100,7 +96,7 @@ ib_mutex_test_and_set( } return((byte) ret); -#endif +#endif /* HAVE_ATOMIC_BUILTINS */ } /******************************************************************//** @@ -113,19 +109,12 @@ mutex_reset_lock_word( ib_mutex_t* mutex) /*!< in: mutex */ { #if defined(HAVE_ATOMIC_BUILTINS) - /* In theory __sync_lock_release should be used to release the lock. - Unfortunately, it does not work properly alone. The workaround is - that more conservative __sync_lock_test_and_set is used instead. */ -# if defined(HAVE_ATOMIC_BUILTINS_BYTE) - os_atomic_test_and_set_byte(&mutex->lock_word, 0); -# else - os_atomic_test_and_set_ulint(&mutex->lock_word, 0); -# endif + os_atomic_clear(&mutex->lock_word); #else mutex->lock_word = 0; os_fast_mutex_unlock(&(mutex->os_fast_mutex)); -#endif +#endif /* HAVE_ATOMIC_BUILTINS */ } /******************************************************************//** diff --git a/storage/innobase/lock/lock0lock.cc b/storage/innobase/lock/lock0lock.cc index 9d047c4cc3b..b5e4df316ad 100644 --- a/storage/innobase/lock/lock0lock.cc +++ b/storage/innobase/lock/lock0lock.cc @@ -2634,8 +2634,8 @@ lock_rec_inherit_to_gap( /* If srv_locks_unsafe_for_binlog is TRUE or session is using READ COMMITTED isolation level, we do not want locks set by an UPDATE or a DELETE to be inherited as gap type locks. But we - DO want S-locks set by a consistency constraint to be inherited also - then. */ + DO want S-locks/X-locks(taken for replace) set by a consistency + constraint to be inherited also then */ for (lock = lock_rec_get_first(block, heap_no); lock != NULL; @@ -2645,7 +2645,8 @@ lock_rec_inherit_to_gap( && !((srv_locks_unsafe_for_binlog || lock->trx->isolation_level <= TRX_ISO_READ_COMMITTED) - && lock_get_mode(lock) == LOCK_X)) { + && lock_get_mode(lock) == + (lock->trx->duplicates ? LOCK_S : LOCK_X))) { lock_rec_add_to_queue( LOCK_REC | LOCK_GAP | lock_get_mode(lock), diff --git a/storage/innobase/log/log0log.cc b/storage/innobase/log/log0log.cc index d0e0453849e..3ff4a9d7d1e 100644 --- a/storage/innobase/log/log0log.cc +++ b/storage/innobase/log/log0log.cc @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (c) 1995, 2014, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 1995, 2015, Oracle and/or its affiliates. All Rights Reserved. Copyright (c) 2009, Google Inc. Portions of this file contain modifications contributed and copyrighted by @@ -3406,11 +3406,7 @@ loop: lsn = log_sys->lsn; - ut_ad(srv_force_recovery != SRV_FORCE_NO_LOG_REDO - || lsn == log_sys->last_checkpoint_lsn + LOG_BLOCK_HDR_SIZE); - - if ((srv_force_recovery != SRV_FORCE_NO_LOG_REDO - && lsn != log_sys->last_checkpoint_lsn) + if (lsn != log_sys->last_checkpoint_lsn #ifdef UNIV_LOG_ARCHIVE || (srv_log_archive_on && lsn != log_sys->archived_lsn + LOG_BLOCK_HDR_SIZE) diff --git a/storage/innobase/row/row0ins.cc b/storage/innobase/row/row0ins.cc index 9370f8cef34..f0f7e5fcdf0 100644 --- a/storage/innobase/row/row0ins.cc +++ b/storage/innobase/row/row0ins.cc @@ -2709,6 +2709,8 @@ row_ins_sec_index_entry_low( goto func_exit; } + DEBUG_SYNC_C("row_ins_sec_index_entry_dup_locks_created"); + /* We did not find a duplicate and we have now locked with s-locks the necessary records to prevent any insertion of a duplicate by another diff --git a/storage/innobase/srv/srv0srv.cc b/storage/innobase/srv/srv0srv.cc index f4ea8895d2f..ad35307c8b2 100644 --- a/storage/innobase/srv/srv0srv.cc +++ b/storage/innobase/srv/srv0srv.cc @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (c) 1995, 2014, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 1995, 2015, Oracle and/or its affiliates. All Rights Reserved. Copyright (c) 2008, 2009 Google Inc. Copyright (c) 2009, Percona Inc. @@ -126,6 +126,9 @@ UNIV_INTERN ulint srv_file_format = 0; UNIV_FORMAT_MAX + 1 means no checking ie. FALSE. The default is to set it to the highest format we support. */ UNIV_INTERN ulint srv_max_file_format_at_startup = UNIV_FORMAT_MAX; +/** Set if InnoDB operates in read-only mode or innodb-force-recovery +is greater than SRV_FORCE_NO_TRX_UNDO. */ +UNIV_INTERN my_bool high_level_read_only; #if UNIV_FORMAT_A # error "UNIV_FORMAT_A must be 0!" @@ -144,6 +147,7 @@ OS (provided we compiled Innobase with it in), otherwise we will use simulated aio we build below with threads. Currently we support native aio on windows and linux */ UNIV_INTERN my_bool srv_use_native_aio = TRUE; +UNIV_INTERN my_bool srv_numa_interleave = FALSE; #ifdef __WIN__ /* Windows native condition variables. We use runtime loading / function @@ -2581,13 +2585,8 @@ srv_do_purge( } n_pages_purged = trx_purge( - n_use_threads, srv_purge_batch_size, false); - - if (!(count++ % TRX_SYS_N_RSEGS)) { - /* Force a truncate of the history list. */ - n_pages_purged += trx_purge( - 1, srv_purge_batch_size, true); - } + n_use_threads, srv_purge_batch_size, + (++count % TRX_SYS_N_RSEGS) == 0); *n_total_purged += n_pages_purged; @@ -2780,8 +2779,17 @@ DECLARE_THREAD(srv_purge_coordinator_thread)( n_pages_purged = trx_purge(1, srv_purge_batch_size, false); } - /* Force a truncate of the history list. */ - n_pages_purged = trx_purge(1, srv_purge_batch_size, true); + /* This trx_purge is called to remove any undo records (added by + background threads) after completion of the above loop. When + srv_fast_shutdown != 0, a large batch size can cause significant + delay in shutdown ,so reducing the batch size to magic number 20 + (which was default in 5.5), which we hope will be sufficient to + remove all the undo records */ + const uint temp_batch_size = 20; + + n_pages_purged = trx_purge(1, srv_purge_batch_size <= temp_batch_size + ? srv_purge_batch_size : temp_batch_size, + true); ut_a(n_pages_purged == 0 || srv_fast_shutdown != 0); /* The task queue should always be empty, independent of fast diff --git a/storage/innobase/srv/srv0start.cc b/storage/innobase/srv/srv0start.cc index d888d13d863..8a9afd561a9 100644 --- a/storage/innobase/srv/srv0start.cc +++ b/storage/innobase/srv/srv0start.cc @@ -1545,9 +1545,8 @@ innobase_start_or_create_for_mysql(void) char* logfile0 = NULL; size_t dirnamelen; - if (srv_force_recovery > SRV_FORCE_NO_TRX_UNDO) { - srv_read_only_mode = true; - } + high_level_read_only = srv_read_only_mode + || srv_force_recovery > SRV_FORCE_NO_TRX_UNDO; if (srv_read_only_mode) { ib_logf(IB_LOG_LEVEL_INFO, "Started in read only mode"); diff --git a/storage/innobase/trx/trx0sys.cc b/storage/innobase/trx/trx0sys.cc index 5eb3cef46c1..e5f03f4b96a 100644 --- a/storage/innobase/trx/trx0sys.cc +++ b/storage/innobase/trx/trx0sys.cc @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (c) 1996, 2013, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 1996, 2015, 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 the Free Software @@ -29,7 +29,10 @@ Created 3/26/1996 Heikki Tuuri #include "trx0sys.ic" #endif -#ifndef UNIV_HOTBACKUP +#ifdef UNIV_HOTBACKUP +#include "fsp0types.h" + +#else /* !UNIV_HOTBACKUP */ #include "fsp0fsp.h" #include "mtr0log.h" #include "mtr0log.h" @@ -1115,18 +1118,15 @@ trx_sys_read_pertable_file_format_id( /* get the file format from the page */ ptr = page + 54; flags = mach_read_from_4(ptr); - if (flags == 0) { - /* file format is Antelope */ - *format_id = 0; - return(TRUE); - } else if (flags & 1) { - /* tablespace flags are ok */ - *format_id = (flags / 32) % 128; - return(TRUE); - } else { + + if (!fsp_flags_is_valid(flags) { /* bad tablespace flags */ return(FALSE); } + + *format_id = FSP_FLAGS_GET_POST_ANTELOPE(flags); + + return(TRUE); } From 1b41eed5d178182e7d9070450178188ca1e47265 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Fri, 9 Oct 2015 17:22:53 +0200 Subject: [PATCH 83/85] 5.6.27 --- mysql-test/suite/perfschema/r/misc.result | 15 +++++++ .../suite/perfschema/r/query_cache.result | 4 +- mysql-test/suite/perfschema/t/misc.test | 20 ++++++++++ .../suite/perfschema/t/query_cache.test | 2 + storage/perfschema/pfs.cc | 1 + storage/perfschema/pfs_timer.cc | 40 ++++++++++++++++++- 6 files changed, 78 insertions(+), 4 deletions(-) diff --git a/mysql-test/suite/perfschema/r/misc.result b/mysql-test/suite/perfschema/r/misc.result index fd8f93c129f..24cf4cc749a 100644 --- a/mysql-test/suite/perfschema/r/misc.result +++ b/mysql-test/suite/perfschema/r/misc.result @@ -92,3 +92,18 @@ object_schema object_name index_name count_fetch count_insert count_update count test t_60905 i 2 0 0 1 test t_60905 NULL 5 5 0 1 DROP TABLE t_60905; +use test; +truncate performance_schema.events_statements_history; +truncate performance_schema.events_statements_history_long; +select * from t1; +ERROR 42S02: Table 'test.t1' doesn't exist + +select mysql_errno, returned_sqlstate, message_text, errors, warnings +from performance_schema.events_statements_history where errors > 0; +mysql_errno returned_sqlstate message_text errors warnings +1146 42S02 Table 'test.t1' doesn't exist 1 0 + +select mysql_errno, returned_sqlstate, message_text, errors, warnings from +performance_schema.events_statements_history_long where errors > 0; +mysql_errno returned_sqlstate message_text errors warnings +1146 42S02 Table 'test.t1' doesn't exist 1 0 diff --git a/mysql-test/suite/perfschema/r/query_cache.result b/mysql-test/suite/perfschema/r/query_cache.result index 8786cd055ca..837c2573a72 100644 --- a/mysql-test/suite/perfschema/r/query_cache.result +++ b/mysql-test/suite/perfschema/r/query_cache.result @@ -38,7 +38,7 @@ spins NULL select * from performance_schema.setup_timers where name='wait'; NAME TIMER_NAME -wait CYCLE +wait {CYCLE_OR_NANOSECOND} show status like "Qcache_queries_in_cache"; Variable_name Value Qcache_queries_in_cache 1 @@ -53,7 +53,7 @@ spins NULL select * from performance_schema.setup_timers where name='wait'; NAME TIMER_NAME -wait CYCLE +wait {CYCLE_OR_NANOSECOND} show status like "Qcache_queries_in_cache"; Variable_name Value Qcache_queries_in_cache 1 diff --git a/mysql-test/suite/perfschema/t/misc.test b/mysql-test/suite/perfschema/t/misc.test index b7e714a6271..d6c302c29bf 100644 --- a/mysql-test/suite/perfschema/t/misc.test +++ b/mysql-test/suite/perfschema/t/misc.test @@ -168,3 +168,23 @@ SELECT object_schema, DROP TABLE t_60905; + +# +# Bug#11929832 - EVENTS_STATEMENTS_HISTORY HAS ERRORS=0 WHEN THERE ARE ERRORS +# +# Verify that SQL errors are properly counted. + +use test; +truncate performance_schema.events_statements_history; +truncate performance_schema.events_statements_history_long; + +--error ER_NO_SUCH_TABLE +select * from t1; + +--echo +select mysql_errno, returned_sqlstate, message_text, errors, warnings + from performance_schema.events_statements_history where errors > 0; + +--echo +select mysql_errno, returned_sqlstate, message_text, errors, warnings from + performance_schema.events_statements_history_long where errors > 0; diff --git a/mysql-test/suite/perfschema/t/query_cache.test b/mysql-test/suite/perfschema/t/query_cache.test index 60d4a648222..802e574f89b 100644 --- a/mysql-test/suite/perfschema/t/query_cache.test +++ b/mysql-test/suite/perfschema/t/query_cache.test @@ -34,6 +34,7 @@ show status like "Qcache_hits"; select spins from performance_schema.events_waits_current order by event_name limit 1; +--replace_result CYCLE {CYCLE_OR_NANOSECOND} NANOSECOND {CYCLE_OR_NANOSECOND} select * from performance_schema.setup_timers where name='wait'; show status like "Qcache_queries_in_cache"; @@ -42,6 +43,7 @@ show status like "Qcache_hits"; select spins from performance_schema.events_waits_current order by event_name limit 1; +--replace_result CYCLE {CYCLE_OR_NANOSECOND} NANOSECOND {CYCLE_OR_NANOSECOND} select * from performance_schema.setup_timers where name='wait'; show status like "Qcache_queries_in_cache"; diff --git a/storage/perfschema/pfs.cc b/storage/perfschema/pfs.cc index 7c556ba4407..6e6f8dcb1c4 100644 --- a/storage/perfschema/pfs.cc +++ b/storage/perfschema/pfs.cc @@ -4832,6 +4832,7 @@ static void end_statement_v1(PSI_statement_locker *locker, void *stmt_da) memcpy(pfs->m_message_text, da->message(), MYSQL_ERRMSG_SIZE); pfs->m_message_text[MYSQL_ERRMSG_SIZE]= 0; pfs->m_sql_errno= da->sql_errno(); + pfs->m_error_count++; memcpy(pfs->m_sqlstate, da->get_sqlstate(), SQLSTATE_LENGTH); break; case Diagnostics_area::DA_DISABLED: diff --git a/storage/perfschema/pfs_timer.cc b/storage/perfschema/pfs_timer.cc index 8c3553db2b2..8348f165e5c 100644 --- a/storage/perfschema/pfs_timer.cc +++ b/storage/perfschema/pfs_timer.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2008, 2012, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2008, 2015, 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 @@ -124,6 +124,42 @@ void init_timers(void) Pick best replacements. */ + /* + For WAIT, the cycle timer is used by default. However, it is not available + on all architectures. Fall back to the nanosecond timer in this case. It is + unlikely that neither cycle nor nanosecond are available, but we continue + probing less resolution timers anyway for consistency with other events. + */ + + if (cycle_to_pico != 0) + { + /* Normal case. */ + wait_timer= TIMER_NAME_CYCLE; + } + else if (nanosec_to_pico != 0) + { + /* Robustness, no known cases. */ + wait_timer= TIMER_NAME_NANOSEC; + } + else if (microsec_to_pico != 0) + { + /* Robustness, no known cases. */ + wait_timer= TIMER_NAME_MICROSEC; + } + else if (millisec_to_pico != 0) + { + /* Robustness, no known cases. */ + wait_timer= TIMER_NAME_MILLISEC; + } + else + { + /* + Will never be reached on any architecture, but must provide a default if + no other timers are available. + */ + wait_timer= TIMER_NAME_TICK; + } + /* For STAGE and STATEMENT, a timer with a fixed frequency is better. The prefered timer is nanosecond, or lower resolutions. @@ -174,7 +210,7 @@ void init_timers(void) else if (millisec_to_pico != 0) { /* Robustness, no known cases. */ - idle_timer= TIMER_NAME_MILLISEC; + wait_timer= TIMER_NAME_MILLISEC; } else if (tick_to_pico != 0) { From 77c44a3470885e37489f85c90f6146e3309df030 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Fri, 9 Oct 2015 17:48:31 +0200 Subject: [PATCH 84/85] update innodb version --- storage/innobase/include/univ.i | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/storage/innobase/include/univ.i b/storage/innobase/include/univ.i index 8976052bf64..3f737089ac3 100644 --- a/storage/innobase/include/univ.i +++ b/storage/innobase/include/univ.i @@ -44,7 +44,7 @@ Created 1/20/1994 Heikki Tuuri #define INNODB_VERSION_MAJOR 5 #define INNODB_VERSION_MINOR 6 -#define INNODB_VERSION_BUGFIX 26 +#define INNODB_VERSION_BUGFIX 27 /* The following is the InnoDB version as shown in SELECT plugin_version FROM information_schema.plugins; From e7cb032e560e14865941ecdcb553cd3aba856b68 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Fri, 9 Oct 2015 19:29:03 +0200 Subject: [PATCH 85/85] fixes for buildbot: * update *.result files * fix XtraDB for Windows (again) --- mysql-test/r/subselect_no_exists_to_in.result | 70 ++++++++++++++++++- storage/xtradb/include/univ.i | 1 + 2 files changed, 69 insertions(+), 2 deletions(-) diff --git a/mysql-test/r/subselect_no_exists_to_in.result b/mysql-test/r/subselect_no_exists_to_in.result index 5434bb920e3..e25733cff17 100644 --- a/mysql-test/r/subselect_no_exists_to_in.result +++ b/mysql-test/r/subselect_no_exists_to_in.result @@ -85,7 +85,7 @@ SELECT 1 FROM (SELECT 1 as a) b WHERE 1 IN (SELECT (SELECT a)); select (SELECT 1 FROM (SELECT 1) a PROCEDURE ANALYSE(1)); ERROR HY000: Incorrect usage of PROCEDURE and subquery SELECT 1 FROM (SELECT 1) a PROCEDURE ANALYSE((SELECT 1)); -ERROR HY000: Incorrect parameters to procedure 'ANALYSE' +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'SELECT 1))' at line 1 SELECT (SELECT 1) as a FROM (SELECT 1) b WHERE (SELECT a) IS NULL; ERROR 42S22: Unknown column 'a' in 'field list' SELECT (SELECT 1) as a FROM (SELECT 1) b WHERE (SELECT a) IS NOT NULL; @@ -3594,7 +3594,7 @@ delete from t1 where c <= 1140006215 and (select b from t2 where a = 2) = 1; drop table t1, t2; CREATE TABLE t1 (a INT); CREATE VIEW v1 AS SELECT * FROM t1 WHERE no_such_column = ANY (SELECT 1); -ERROR 42S22: Unknown column 'no_such_column' in 'where clause' +ERROR 42S22: Unknown column 'no_such_column' in 'IN/ALL/ANY subquery' CREATE VIEW v2 AS SELECT * FROM t1 WHERE no_such_column = (SELECT 1); ERROR 42S22: Unknown column 'no_such_column' in 'where clause' SELECT * FROM t1 WHERE no_such_column = ANY (SELECT 1); @@ -7019,6 +7019,72 @@ select exists(select 1 from t1 group by `c` in (select `c` from t1)); exists(select 1 from t1 group by `c` in (select `c` from t1)) 0 drop table t1; +# +# MDEV-7565: Server crash with Signal 6 (part 2) +# +Select +(Select Sum(`TestCase`.Revenue) From mysql.slow_log E +Where TestCase.TemplateID not in (Select 1 from mysql.slow_log where 2=2) +) As `ControlRev` +From +(Select 3 as Revenue, 4 as TemplateID) As `TestCase` +Group By TestCase.Revenue, TestCase.TemplateID; +ControlRev +NULL +# +# MDEV-7445:Server crash with Signal 6 +# +CREATE PROCEDURE procedure2() +BEGIN +Select +(Select Sum(`TestCase`.Revenue) From mysql.slow_log E +Where TestCase.TemplateID not in (Select 1 from mysql.slow_log where 2=2) +) As `ControlRev` + From +(Select 3 as Revenue, 4 as TemplateID) As `TestCase` +Group By TestCase.Revenue, TestCase.TemplateID; +END | +call procedure2(); +ControlRev +NULL +call procedure2(); +ControlRev +NULL +drop procedure procedure2; +SELECT +(SELECT user FROM mysql.user +WHERE h.host in (SELECT host FROM mysql.user) +) AS sq +FROM mysql.host h GROUP BY h.host; +sq +# +# MDEV-7846:Server crashes in Item_subselect::fix +#_fields or fails with Thread stack overrun +# +CREATE TABLE t1 (column1 INT) ENGINE=MyISAM; +INSERT INTO t1 VALUES (3),(9); +CREATE TABLE t2 (column2 INT) ENGINE=MyISAM; +INSERT INTO t2 VALUES (1),(4); +CREATE TABLE t3 (column3 INT) ENGINE=MyISAM; +INSERT INTO t3 VALUES (6),(8); +CREATE TABLE t4 (column4 INT) ENGINE=MyISAM; +INSERT INTO t4 VALUES (2),(5); +PREPARE stmt FROM " +SELECT ( + SELECT MAX( table1.column1 ) AS field1 + FROM t1 AS table1 + WHERE table3.column3 IN ( SELECT table2.column2 AS field2 FROM t2 AS table2 ) +) AS sq +FROM t3 AS table3, t4 AS table4 GROUP BY sq +"; +EXECUTE stmt; +sq +NULL +EXECUTE stmt; +sq +NULL +deallocate prepare stmt; +drop table t1,t2,t3,t4; set optimizer_switch=default; select @@optimizer_switch like '%exists_to_in=off%'; @@optimizer_switch like '%exists_to_in=off%' diff --git a/storage/xtradb/include/univ.i b/storage/xtradb/include/univ.i index c9394647fef..1c52bd0925b 100644 --- a/storage/xtradb/include/univ.i +++ b/storage/xtradb/include/univ.i @@ -611,6 +611,7 @@ Windows, so define a typedef for it and a macro to use at the end of such functions. */ #ifdef __WIN__ +#define usleep(a) Sleep((a)/1000) typedef ulint os_thread_ret_t; #define OS_THREAD_DUMMY_RETURN return(0) #else