+mysql-wsrep-5.6 (5.6.41-0~u14.04+mos0) mos; urgency=medium
+
+ * Import mysql-wsrep 5.6.41 from codership
+ https://github.com/codership/mysql-wsrep/
+ * Import wsrep-API v25 since it's now a submodule
+ https://github.com/codership/wsrep-API/tree/v25
+
+ -- Denis Meltsaykin <dmeltsaykin@mirantis.com> Mon, 10 Sep 2018 12:12:00 +0200
+
mysql-wsrep-5.6 (5.6.39-0~u14.04+mos1) mos; urgency=medium
* Add percona-xtrabackup (>= 2.3.7) as a run-time dependency
-Placeholder
-
+You can find a detailed list of changes at
+ to https://github.com/mysql/mysql-server/commits/5.6
MYSQL_VERSION_MAJOR=5
MYSQL_VERSION_MINOR=6
-MYSQL_VERSION_PATCH=39
+MYSQL_VERSION_PATCH=41
MYSQL_VERSION_EXTRA=
/*
- Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
+ Copyright (c) 2000, 2018, 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
static int dump_tablespaces(char* ts_where);
static void print_comment(FILE *sql_file, my_bool is_error, const char *format,
...);
-static const char* fix_identifier_with_newline(char*);
+static char const* fix_identifier_with_newline(char const* object_name,
+ my_bool* freemem);
/*
}
else if (!opt_compact)
{
+ my_bool freemem= FALSE;
+ char const* text= fix_identifier_with_newline(db_name, &freemem);
+
print_comment(sql_file, 0,
"-- MySQL dump %s Distrib %s, for %s (%s)\n--\n",
DUMP_VERSION, MYSQL_SERVER_VERSION, SYSTEM_TYPE,
MACHINE_TYPE);
print_comment(sql_file, 0, "-- Host: %s Database: %s\n",
current_host ? current_host : "localhost",
- db_name ? fix_identifier_with_newline(db_name) : "");
+ text);
+ if (freemem)
+ my_free((void*)text);
+
print_comment(sql_file, 0,
"-- ------------------------------------------------------\n"
);
print_xml_comment(sql_file, strlen(comment_buff), comment_buff);
}
-/*
- This function accepts object names and prefixes -- wherever \n
- character is found.
- @param[in] object_name
+/**
+ @brief Accepts object names and prefixes them with "-- " wherever
+ end-of-line character ('\n') is found.
- @return
- @retval fixed object name.
-*/
+ @param[in] object_name object name list (concatenated string)
+ @param[out] freemem should buffer be released after usage
-static const char* fix_identifier_with_newline(char* object_name)
+ @return
+ @retval pointer to a string with prefixed objects
+*/
+static char const* fix_identifier_with_newline(char const* object_name, my_bool* freemem)
{
- static char buff[COMMENT_LENGTH]= {0};
- char *ptr= buff;
- memset(buff, 0, 255);
- while(*object_name)
+ const size_t PREFIX_LENGTH= 3; // strlen ("-- ")
+
+ // static buffer for replacement procedure
+ static char storage[NAME_LEN + 1];
+ static char* buffer= storage;
+ static size_t buffer_size= sizeof(storage) - 1;
+ size_t index= 0;
+ size_t required_size= 0;
+
+ // we presume memory allocation won't be needed
+ *freemem= FALSE;
+
+ // traverse and reformat objects
+ while (object_name && *object_name)
{
- *ptr++ = *object_name;
+ ++required_size;
if (*object_name == '\n')
- ptr= strmov(ptr, "-- ");
- object_name++;
+ required_size+= PREFIX_LENGTH;
+
+ // do we need dynamic (re)allocation
+ if (required_size > buffer_size)
+ {
+ // new alloc size increased in COMMENT_LENGTH multiple
+ buffer_size= COMMENT_LENGTH * (1 + required_size/COMMENT_LENGTH);
+
+ // is our buffer already dynamically allocated
+ if (*freemem)
+ {
+ // just realloc
+ buffer= (char*)my_realloc(buffer, buffer_size + 1, MYF(MY_WME));
+ if (!buffer)
+ exit(1);
+ }
+ else
+ {
+ // dynamic allocation + copy from static buffer
+ buffer= (char*)my_malloc(buffer_size + 1, MYF(MY_WME));
+ if (!buffer)
+ exit(1);
+
+ strncpy(buffer, storage, index);
+ *freemem= TRUE;
+ }
+ }
+
+ // copy a character
+ buffer[index]= *object_name;
+ ++index;
+
+ // prefix new lines with double dash
+ if (*object_name == '\n')
+ {
+ strcpy(buffer + index, "-- ");
+ index += PREFIX_LENGTH;
+ }
+
+ ++object_name;
}
- return buff;
+
+ // don't forget null termination
+ buffer[index]= '\0';
+ return buffer;
}
+
/*
create_delimiter
Generate a new (null-terminated) string that does not exist in query
char db_cl_name[MY_CS_NAME_SIZE];
int db_cl_altered= FALSE;
+ my_bool freemem= FALSE;
+ char const *text= fix_identifier_with_newline(db, &freemem);
DBUG_ENTER("dump_events_for_db");
DBUG_PRINT("enter", ("db: '%s'", db));
/* nice comments */
print_comment(sql_file, 0,
"\n--\n-- Dumping events for database '%s'\n--\n",
- fix_identifier_with_newline(db));
+ text);
+ if (freemem)
+ my_free((void*)text);
/*
not using "mysql_query_with_error_report" because we may have not
char db_cl_name[MY_CS_NAME_SIZE];
int db_cl_altered= FALSE;
+ my_bool freemem= FALSE;
+ char const *text= fix_identifier_with_newline(db, &freemem);
DBUG_ENTER("dump_routines_for_db");
DBUG_PRINT("enter", ("db: '%s'", db));
/* nice comments */
print_comment(sql_file, 0,
- "\n--\n-- Dumping routines for database '%s'\n--\n",
- fix_identifier_with_newline(db));
+ "\n--\n-- Dumping routines for database '%s'\n--\n", text);
+
+ if (freemem)
+ my_free((void*)text);
/*
not using "mysql_query_with_error_report" because we may have not
row[2] ? strlen(row[2]) : 0));
if (row[2] == NULL)
{
+ my_bool freemem= FALSE;
+ char const* text= fix_identifier_with_newline(current_user, &freemem);
+
print_comment(sql_file, 1, "\n-- insufficient privileges to %s\n",
query_buff);
print_comment(sql_file, 1,
"-- does %s have permissions on mysql.proc?\n\n",
- fix_identifier_with_newline(current_user));
+ text);
+ if (freemem)
+ my_free((void*)text);
+
maybe_die(EX_MYSQLERR,"%s has insufficent privileges to %s!", current_user, query_buff);
}
else if (strlen(row[2]))
/* Make an sql-file, if path was given iow. option -T was given */
char buff[20+FN_REFLEN];
MYSQL_FIELD *field;
+ my_bool freemem= FALSE;
+ char const *text;
my_snprintf(buff, sizeof(buff), "show create table %s", result_table);
write_header(sql_file, db);
}
+ text= fix_identifier_with_newline(result_table, &freemem);
if (strcmp (table_type, "VIEW") == 0) /* view */
print_comment(sql_file, 0,
"\n--\n-- Temporary table structure for view %s\n--\n\n",
- fix_identifier_with_newline(result_table));
+ text);
else
print_comment(sql_file, 0,
- "\n--\n-- Table structure for table %s\n--\n\n",
- fix_identifier_with_newline(result_table));
+ "\n--\n-- Table structure for table %s\n--\n\n", text);
+
+ if (freemem)
+ my_free((void*)text);
if (opt_drop)
{
/* Make an sql-file, if path was given iow. option -T was given */
if (!opt_no_create_info)
{
+ my_bool freemem= FALSE;
+ char const *text;
+
if (path)
{
if (!(sql_file= open_sql_file_for_table(table, O_WRONLY)))
write_header(sql_file, db);
}
+ text= fix_identifier_with_newline(result_table, &freemem);
print_comment(sql_file, 0,
"\n--\n-- Table structure for table %s\n--\n\n",
- fix_identifier_with_newline(result_table));
+ text);
+ if (freemem)
+ my_free((void*)text);
+
if (opt_drop)
fprintf(sql_file, "DROP TABLE IF EXISTS %s;\n", result_table);
if (!opt_xml)
}
else
{
- print_comment(md_result_file, 0,
- "\n--\n-- Dumping data for table %s\n--\n",
- fix_identifier_with_newline(result_table));
-
+ my_bool freemem= FALSE;
+ char const* text= fix_identifier_with_newline(result_table, &freemem);
+ print_comment(md_result_file, 0, "\n--\n-- Dumping data for table %s\n--\n",
+ text);
+ if (freemem)
+ my_free((void*)text);
+
dynstr_append_checked(&query_string, "SELECT /*!40001 SQL_NO_CACHE */ * FROM ");
dynstr_append_checked(&query_string, result_table);
if (where)
{
- print_comment(md_result_file, 0, "-- WHERE: %s\n",
- fix_identifier_with_newline(where));
+ freemem= FALSE;
+ text= fix_identifier_with_newline(where, &freemem);
+ print_comment(md_result_file, 0, "-- WHERE: %s\n", text);
+ if (freemem)
+ my_free((void*)text);
dynstr_append_checked(&query_string, " WHERE ");
dynstr_append_checked(&query_string, where);
}
if (order_by)
{
- print_comment(md_result_file, 0, "-- ORDER BY: %s\n",
- fix_identifier_with_newline(order_by));
+ freemem= FALSE;
+ text= fix_identifier_with_newline(order_by, &freemem);
+ print_comment(md_result_file, 0, "-- ORDER BY: %s\n", text);
+ if (freemem)
+ my_free((void*)text);
dynstr_append_checked(&query_string, " ORDER BY ");
dynstr_append_checked(&query_string, order_by);
*/
char quoted_database_buf[NAME_LEN*2+3];
char *qdatabase= quote_name(database,quoted_database_buf,opt_quoted);
+ my_bool freemem= FALSE;
+ char const* text= fix_identifier_with_newline(qdatabase, &freemem);
- print_comment(md_result_file, 0,
- "\n--\n-- Current Database: %s\n--\n",
- fix_identifier_with_newline(qdatabase));
+ print_comment(md_result_file, 0, "\n--\n-- Current Database: %s\n--\n",
+ text);
+ if (freemem)
+ my_free((void*)text);
/* Call the view or table specific function */
init_func(qdatabase);
char table_buff2[NAME_LEN*2+3];
char query[QUERY_LENGTH];
FILE *sql_file= md_result_file;
+ my_bool freemem= FALSE;
+ char const *text;
DBUG_ENTER("get_view_structure");
if (opt_no_create_info) /* Don't write table creation info */
write_header(sql_file, db);
}
+ text= fix_identifier_with_newline(result_table, &freemem);
print_comment(sql_file, 0,
- "\n--\n-- Final view structure for view %s\n--\n\n",
- fix_identifier_with_newline(result_table));
+ "\n--\n-- Final view structure for view %s\n--\n\n", text);
+ if (freemem)
+ my_free((void*)text);
verbose_msg("-- Dropping the temporary view structure created\n");
fprintf(sql_file, "/*!50001 DROP VIEW IF EXISTS %s*/;\n", opt_quoted_table);
-/* Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2000, 2018, 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
#include <welcome_copyright_notice.h> // ORACLE_WELCOME_COPYRIGHT_NOTICE
#include <algorithm>
+#include <sstream>
using std::min;
using std::max;
while ((bytes= fread(buf, 1, sizeof(buf), m_file)) > 0)
fwrite(buf, 1, bytes, stderr);
- if (!lines)
- {
- fprintf(stderr,
- "\nMore results from queries before failure can be found in %s\n",
- m_file_name);
- }
fflush(stderr);
DBUG_VOID_RETURN;
/* Init dynamic strings for warnings */
if (!disable_warnings)
{
- init_dynamic_string(&ds_prepare_warnings, NULL, 0, 256);
- init_dynamic_string(&ds_execute_warnings, NULL, 0, 256);
+ init_dynamic_string(&ds_prepare_warnings, "", 0, 256);
+ init_dynamic_string(&ds_execute_warnings, "", 0, 256);
}
/*
append_stmt_result(ds, stmt, fields, num_fields);
mysql_free_result(res); /* Free normal result set with meta data */
-
- /*
- Clear prepare warnings if there are execute warnings,
- since they are probably duplicated.
- */
- if (ds_execute_warnings.length || mysql->warning_count)
- dynstr_set(&ds_prepare_warnings, NULL);
}
else
{
dynstr_append_mem(ds, ds_warnings->str,
ds_warnings->length);
if (ds_prepare_warnings.length)
- dynstr_append_mem(ds, ds_prepare_warnings.str,
- ds_prepare_warnings.length);
+ {
+ /* Split the string to get each warning */
+ std::stringstream prepare_warnings(ds_prepare_warnings.str);
+ std::string prepare_warning;
+ /*
+ If the warning is already present in the execute phase,
+ do not append it
+ */
+ while (std::getline(prepare_warnings, prepare_warning))
+ {
+ std::string execute_warnings(ds_execute_warnings.str);
+ if ((execute_warnings + "\n").find(prepare_warning + "\n") ==
+ std::string::npos)
+ {
+ dynstr_append_mem(ds, prepare_warning.c_str(),
+ prepare_warning.length());
+ dynstr_append_mem(ds, "\n", 1);
+ }
+ }
+ }
if (ds_execute_warnings.length)
dynstr_append_mem(ds, ds_execute_warnings.str,
ds_execute_warnings.length);
-# Copyright (c) 2009 Sun Microsystems, Inc.
-# Use is subject to license terms.
+# Copyright (c) 2009, 2018, 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
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-IF(CMAKE_SYSTEM_NAME MATCHES "SunOS")
- # On Solaris, /opt/csw often contains a newer bison
- IF(NOT BISON_EXECUTABLE AND EXISTS /opt/csw/bin/bison)
- SET(BISON_EXECUTABLE /opt/csw/bin/bison)
- ENDIF()
-ENDIF()
FIND_PROGRAM(BISON_EXECUTABLE bison DOC "path to the bison executable")
MARK_AS_ADVANCED(BISON_EXECUTABLE "")
+
IF(NOT BISON_EXECUTABLE)
- MESSAGE("Warning: Bison executable not found in PATH")
+ MESSAGE(WARNING "Bison executable not found in PATH")
ELSEIF(BISON_EXECUTABLE AND NOT BISON_USABLE)
# Check version as well
EXEC_PROGRAM(${BISON_EXECUTABLE} ARGS --version OUTPUT_VARIABLE BISON_VERSION_STR)
STRING(REGEX REPLACE ".* ([0-9]+)\\.([0-9]+)" "\\1" BISON_VERSION_MAJOR "${FIRST_LINE}")
STRING(REGEX REPLACE ".* ([0-9]+)\\.([0-9]+)" "\\2" BISON_VERSION_MINOR "${FIRST_LINE}")
IF (BISON_VERSION_MAJOR LESS 2)
- MESSAGE("Warning: bison version is old. please update to version 2")
+ MESSAGE(WARNING "Bison version is old. please update to version 2")
ELSE()
SET(BISON_USABLE 1 CACHE INTERNAL "Bison version 2 or higher")
ENDIF()
ENDIF()
+
+# Handle out-of-source build from source package with possibly broken
+# bison. Copy bison output to from source to build directory, if not already
+# there
+MACRO(COPY_BISON_OUTPUT input_cc input_h output_cc output_h)
+ IF(EXISTS ${input_cc} AND NOT EXISTS ${output_cc})
+ CONFIGURE_FILE(${input_cc} ${output_cc} COPYONLY)
+ CONFIGURE_FILE(${input_h} ${output_h} COPYONLY)
+ ENDIF()
+ENDMACRO()
+
+
# Use bison to generate C++ and header file
MACRO (RUN_BISON input_yy output_cc output_h)
- IF(BISON_TOO_OLD)
- IF(EXISTS ${output_cc} AND EXISTS ${output_h})
- SET(BISON_USABLE FALSE)
- ENDIF()
- ENDIF()
IF(BISON_USABLE)
ADD_CUSTOM_COMMAND(
OUTPUT ${output_cc}
IF(EXISTS ${output_cc} AND EXISTS ${output_h})
IF(${input_yy} IS_NEWER_THAN ${output_cc} OR ${input_yy} IS_NEWER_THAN ${output_h})
# Possibly timestamps are messed up in source distribution.
- MESSAGE("Warning: no usable bison found, ${input_yy} will not be rebuilt.")
+ MESSAGE(WARNING "No usable bison found, ${input_yy} will not be rebuilt.")
ENDIF()
ELSE()
# Output files are missing, bail out.
${SSL_INCLUDE_DIRS}
${ZLIB_INCLUDE_DIR})
+ IF(WITH_WSREP)
+ INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/wsrep/src)
+ ENDIF()
+
LIST(GET ARG_DEFAULT_ARGS 0 plugin)
SET(SOURCES ${ARG_DEFAULT_ARGS})
LIST(REMOVE_AT SOURCES 0)
# so WSREP_VERSION is produced regardless
# Set the patch version
-SET(WSREP_PATCH_VERSION "22")
+SET(WSREP_PATCH_VERSION "23")
# Obtain patch revision number
SET(WSREP_REVISION $ENV{WSREP_REV})
# Obtain wsrep API version
EXECUTE_PROCESS(
- COMMAND sh -c "grep WSREP_INTERFACE_VERSION ${MySQL_SOURCE_DIR}/wsrep/wsrep_api.h | cut -d '\"' -f 2"
+ COMMAND sh -c "grep WSREP_INTERFACE_VERSION ${MySQL_SOURCE_DIR}/wsrep/src/wsrep_api.h | cut -d '\"' -f 2"
OUTPUT_VARIABLE WSREP_API_VERSION
RESULT_VARIABLE RESULT
)
-/* Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2000, 2018, 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
#ifdef MY_GLOBAL_INCLUDED
ulong STDCALL net_field_length(uchar **packet);
+ulong STDCALL net_field_length_checked(uchar **packet, ulong max_length);
my_ulonglong net_field_length_ll(uchar **packet);
uchar *net_store_length(uchar *pkg, ulonglong length);
#endif
#ifndef SQL_COMMON_INCLUDED
#define SQL_COMMON_INCLUDED
-/* Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2003, 2018, 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
void set_mysql_error(MYSQL *mysql, int errcode, const char *sqlstate);
void set_mysql_extended_error(MYSQL *mysql, int errcode, const char *sqlstate,
const char *format, ...);
+#ifdef EMBEDDED_LIBRARY
+int embedded_ssl_check(MYSQL *mysql);
+#endif
/* client side of the pluggable authentication */
struct st_plugin_vio_info;
extern struct st_mysql_client_plugin *mysql_client_builtins[];
uchar * send_client_connect_attrs(MYSQL *mysql, uchar *buf);
extern my_bool libmysql_cleartext_plugin_enabled;
+int is_file_or_dir_world_writable(const char *filepath);
#ifdef __cplusplus
}
-# Copyright (c) 2006, 2014, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2006, 2018, 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
${CMAKE_SOURCE_DIR}/sql/backup
)
+# We should generate these separately for libmysqld to avoid
+# compiling them for libmysqld while they are generated for sql.
+SET(GEN_YACC_SOURCES
+ ${CMAKE_CURRENT_BINARY_DIR}/sql_yacc.h
+ ${CMAKE_CURRENT_BINARY_DIR}/sql_yacc.cc
+)
+
SET(GEN_SOURCES
- ${CMAKE_BINARY_DIR}/sql/sql_yacc.h
- ${CMAKE_BINARY_DIR}/sql/sql_yacc.cc
${CMAKE_BINARY_DIR}/sql/sql_builtin.cc
- ${CMAKE_BINARY_DIR}/sql/lex_hash.h
)
-SET_SOURCE_FILES_PROPERTIES(${GEN_SOURCES} PROPERTIES GENERATED TRUE)
+ADD_CUSTOM_COMMAND(
+ OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/lex_hash.h
+ COMMAND gen_lex_hash > lex_hash.h
+ DEPENDS gen_lex_hash
+)
+
+SET_SOURCE_FILES_PROPERTIES(${GEN_YACC_SOURCES}
+ ${GEN_SOURCES}
+ PROPERTIES GENERATED TRUE)
FOREACH(file ${SQL_EXPORTED_SOURCES})
LIST(APPEND IMPORTED_SOURCES "../sql/${file}")
libmysqld.c
${GEN_SOURCES}
${MYSYS_LIBWRAP_SOURCE}
+ ${GEN_YACC_SOURCES}
../client/get_password.c
../libmysql/errmsg.c
../libmysql/libmysql.c
)
+
+# Handle out-of-source build from source package with possibly broken
+# bison. Copy bison output to from source to build directory, if not already
+# there
+INCLUDE(${CMAKE_SOURCE_DIR}/cmake/bison.cmake)
+COPY_BISON_OUTPUT(
+ ${CMAKE_SOURCE_DIR}/sql/sql_yacc.cc
+ ${CMAKE_SOURCE_DIR}/sql/sql_yacc.h
+ ${CMAKE_CURRENT_BINARY_DIR}/sql_yacc.cc
+ ${CMAKE_CURRENT_BINARY_DIR}/sql_yacc.h
+)
+
+RUN_BISON(
+ ${CMAKE_SOURCE_DIR}/sql/sql_yacc.yy
+ ${CMAKE_CURRENT_BINARY_DIR}/sql_yacc.cc
+ ${CMAKE_CURRENT_BINARY_DIR}/sql_yacc.h
+)
+
+ADD_CUSTOM_COMMAND(
+ OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/lex_token.h
+ COMMAND gen_lex_token > lex_token.h
+ DEPENDS gen_lex_token
+)
+
+SET_SOURCE_FILES_PROPERTIES(
+ ${CMAKE_CURRENT_BINARY_DIR}/sql/lex_token.h
+ PROPERTIES GENERATED 1)
+
+SET_SOURCE_FILES_PROPERTIES(
+ ${CMAKE_CURRENT_BINARY_DIR}/sql_yacc.cc
+ ${CMAKE_SOURCE_DIR}/sql/sql_digest.cc
+ PROPERTIES OBJECT_DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/lex_token.h
+)
+
+ADD_CUSTOM_TARGET(GenYaccEmbeddedSource DEPENDS ${GEN_YACC_SOURCES})
+
ADD_CONVENIENCE_LIBRARY(sql_embedded ${SQL_EMBEDDED_SOURCES})
DTRACE_INSTRUMENT(sql_embedded)
-ADD_DEPENDENCIES(sql_embedded GenError GenServerSource)
+ADD_DEPENDENCIES(sql_embedded GenError GenServerSource GenYaccEmbeddedSource)
# On Windows, static embedded server library is called mysqlserver.lib
# On Unix, it is libmysqld.a
SET(LIBS
- dbug strings regex mysys mysys_ssl vio
- ${ZLIB_LIBRARY} ${SSL_LIBRARIES}
+ dbug strings regex mysys mysys_ssl vio
+ ${ZLIB_LIBRARY} ${SSL_LIBRARIES}
${LIBWRAP} ${LIBCRYPT} ${LIBDL}
${MYSQLD_STATIC_PLUGIN_LIBS}
sql_embedded
ENDIF()
ENDFOREACH()
+LIST(REMOVE_DUPLICATES EMBEDDED_LIBS)
+
MERGE_LIBRARIES(mysqlserver STATIC ${EMBEDDED_LIBS}
OUTPUT_NAME ${MYSQLSERVER_OUTPUT_NAME} COMPONENT Embedded)
)
GET_TARGET_PROPERTY(libmysqld_link_flags libmysqld LINK_FLAGS)
- IF(NOT libmysqld_link_flag)
+ IF(NOT libmysqld_link_flags)
SET(libmysqld_link_flags)
ENDIF()
SET(libmysqld_link_flags
-/* Copyright (c) 2001, 2011, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2001, 2018, 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
if (db)
client_flag|=CLIENT_CONNECT_WITH_DB;
+ if (embedded_ssl_check(mysql))
+ goto error;
+
mysql->info_buffer= my_malloc(MYSQL_ERRMSG_SIZE, MYF(0));
mysql->thd= create_embedded_thd(client_flag);
.\" Title: \fBcomp_err\fR
.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author]
.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
-.\" Date: 06/02/2017
+.\" Date: 06/15/2018
.\" Manual: MySQL Database System
.\" Source: MySQL 5.6
.\" Language: English
.\"
-.TH "\FBCOMP_ERR\FR" "1" "06/02/2017" "MySQL 5\&.6" "MySQL Database System"
+.TH "\FBCOMP_ERR\FR" "1" "06/15/2018" "MySQL 5\&.6" "MySQL Database System"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.SH "COPYRIGHT"
.br
.PP
-Copyright \(co 1997, 2017, Oracle and/or its affiliates. All rights reserved.
+Copyright \(co 1997, 2018, Oracle and/or its affiliates. All rights reserved.
.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
.\" Title: \fBinnochecksum\fR
.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author]
.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
-.\" Date: 06/02/2017
+.\" Date: 06/15/2018
.\" Manual: MySQL Database System
.\" Source: MySQL 5.6
.\" Language: English
.\"
-.TH "\FBINNOCHECKSUM\FR" "1" "06/02/2017" "MySQL 5\&.6" "MySQL Database System"
+.TH "\FBINNOCHECKSUM\FR" "1" "06/15/2018" "MySQL 5\&.6" "MySQL Database System"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.SH "COPYRIGHT"
.br
.PP
-Copyright \(co 1997, 2017, Oracle and/or its affiliates. All rights reserved.
+Copyright \(co 1997, 2018, Oracle and/or its affiliates. All rights reserved.
.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
.\" Title: \fBmsql2mysql\fR
.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author]
.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
-.\" Date: 06/02/2017
+.\" Date: 06/15/2018
.\" Manual: MySQL Database System
.\" Source: MySQL 5.6
.\" Language: English
.\"
-.TH "\FBMSQL2MYSQL\FR" "1" "06/02/2017" "MySQL 5\&.6" "MySQL Database System"
+.TH "\FBMSQL2MYSQL\FR" "1" "06/15/2018" "MySQL 5\&.6" "MySQL Database System"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.SH "COPYRIGHT"
.br
.PP
-Copyright \(co 1997, 2017, Oracle and/or its affiliates. All rights reserved.
+Copyright \(co 1997, 2018, Oracle and/or its affiliates. All rights reserved.
.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
.\" Title: \fBmy_print_defaults\fR
.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author]
.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
-.\" Date: 06/02/2017
+.\" Date: 06/15/2018
.\" Manual: MySQL Database System
.\" Source: MySQL 5.6
.\" Language: English
.\"
-.TH "\FBMY_PRINT_DEFAULTS" "1" "06/02/2017" "MySQL 5\&.6" "MySQL Database System"
+.TH "\FBMY_PRINT_DEFAULTS\FR" "1" "06/15/2018" "MySQL 5\&.6" "MySQL Database System"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.nf
shell> \fBmy_print_defaults mysqlcheck client\fR
\-\-user=myusername
-\-\-password=secret
+\-\-password=\fIpassword\fR
\-\-host=localhost
.fi
.if n \{\
.SH "COPYRIGHT"
.br
.PP
-Copyright \(co 1997, 2017, Oracle and/or its affiliates. All rights reserved.
+Copyright \(co 1997, 2018, Oracle and/or its affiliates. All rights reserved.
.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
.\" Title: \fBmyisam_ftdump\fR
.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author]
.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
-.\" Date: 06/02/2017
+.\" Date: 06/15/2018
.\" Manual: MySQL Database System
.\" Source: MySQL 5.6
.\" Language: English
.\"
-.TH "\FBMYISAM_FTDUMP\FR" "1" "06/02/2017" "MySQL 5\&.6" "MySQL Database System"
+.TH "\FBMYISAM_FTDUMP\FR" "1" "06/15/2018" "MySQL 5\&.6" "MySQL Database System"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.PP
You can use
\fBmyisam_ftdump\fR
-to generate a list of index entries in order of frequency of occurrence like this:
+to generate a list of index entries in order of frequency of occurrence like this on Unix\-like systems:
.sp
.if n \{\
.RS 4
.RE
.\}
.PP
+On Windows, use:
+.sp
+.if n \{\
+.RS 4
+.\}
+.nf
+shell> \fBmyisam_ftdump \-c mytexttable 1 | sort /R\fR
+.fi
+.if n \{\
+.RE
+.\}
+.PP
\fBmyisam_ftdump\fR
supports the following options:
.sp
.SH "COPYRIGHT"
.br
.PP
-Copyright \(co 1997, 2017, Oracle and/or its affiliates. All rights reserved.
+Copyright \(co 1997, 2018, Oracle and/or its affiliates. All rights reserved.
.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
.\" Title: \fBmyisamchk\fR
.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author]
.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
-.\" Date: 06/02/2017
+.\" Date: 06/15/2018
.\" Manual: MySQL Database System
.\" Source: MySQL 5.6
.\" Language: English
.\"
-.TH "\FBMYISAMCHK\FR" "1" "06/02/2017" "MySQL 5\&.6" "MySQL Database System"
+.TH "\FBMYISAMCHK\FR" "1" "06/15/2018" "MySQL 5\&.6" "MySQL Database System"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
T{
ft_max_word_len
T}:T{
-version\-dependent
+version-dependent
T}
T{
ft_min_word_len
T{
ft_stopword_file
T}:T{
-built\-in list
+built-in list
T}
T{
key_buffer_size
system variable\&. For more information, see the description of
myisam_stats_method
in
-Section\ \&5.1.5, \(lqServer System Variables\(rq, and
+Section\ \&5.1.7, \(lqServer System Variables\(rq, and
Section\ \&8.3.7, \(lqInnoDB and MyISAM Index Statistics Collection\(rq\&.
.PP
ft_min_word_len
\fB\-\-character\-sets\-dir=\fR\fB\fIdir_name\fR\fR
.sp
The directory where character sets are installed\&. See
-Section\ \&10.5, \(lqCharacter Set Configuration\(rq\&.
+Section\ \&10.14, \(lqCharacter Set Configuration\(rq\&.
.RE
.sp
.RS 4
.SH "COPYRIGHT"
.br
.PP
-Copyright \(co 1997, 2017, Oracle and/or its affiliates. All rights reserved.
+Copyright \(co 1997, 2018, Oracle and/or its affiliates. All rights reserved.
.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
.\" Title: \fBmyisamlog\fR
.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author]
.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
-.\" Date: 06/02/2017
+.\" Date: 06/15/2018
.\" Manual: MySQL Database System
.\" Source: MySQL 5.6
.\" Language: English
.\"
-.TH "\FBMYISAMLOG\FR" "1" "06/02/2017" "MySQL 5\&.6" "MySQL Database System"
+.TH "\FBMYISAMLOG\FR" "1" "06/15/2018" "MySQL 5\&.6" "MySQL Database System"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.sp -1
.IP \(bu 2.3
.\}
+\fB\-F \fR\fB\fIfilepath/\fR\fR
+.sp
+Specify the file path with a trailing slash\&.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
\fB\-i\fR
.sp
Display extra information before exiting\&.
.SH "COPYRIGHT"
.br
.PP
-Copyright \(co 1997, 2017, Oracle and/or its affiliates. All rights reserved.
+Copyright \(co 1997, 2018, Oracle and/or its affiliates. All rights reserved.
.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
.\" Title: \fBmyisampack\fR
.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author]
.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
-.\" Date: 06/02/2017
+.\" Date: 06/15/2018
.\" Manual: MySQL Database System
.\" Source: MySQL 5.6
.\" Language: English
.\"
-.TH "\FBMYISAMPACK\FR" "1" "06/02/2017" "MySQL 5\&.6" "MySQL Database System"
+.TH "\FBMYISAMPACK\FR" "1" "06/15/2018" "MySQL 5\&.6" "MySQL Database System"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
\fB\-\-character\-sets\-dir=\fR\fB\fIdir_name\fR\fR
.sp
The directory where character sets are installed\&. See
-Section\ \&10.5, \(lqCharacter Set Configuration\(rq\&.
+Section\ \&10.14, \(lqCharacter Set Configuration\(rq\&.
.RE
.sp
.RS 4
.SH "COPYRIGHT"
.br
.PP
-Copyright \(co 1997, 2017, Oracle and/or its affiliates. All rights reserved.
+Copyright \(co 1997, 2018, Oracle and/or its affiliates. All rights reserved.
.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
+++ /dev/null
-'\" t
-.\" Title: \fBmysql-stress-test.pl\fR
-.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author]
-.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
-.\" Date: 06/01/2017
-.\" Manual: MySQL Database System
-.\" Source: MySQL
-.\" Language: English
-.\"
-.TH "\FBMYSQL\-STRESS\-TE" "1" "06/01/2017" "MySQL" "MySQL Database System"
-.\" -----------------------------------------------------------------
-.\" * Define some portability stuff
-.\" -----------------------------------------------------------------
-.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-.\" http://bugs.debian.org/507673
-.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
-.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-.ie \n(.g .ds Aq \(aq
-.el .ds Aq '
-.\" -----------------------------------------------------------------
-.\" * set default formatting
-.\" -----------------------------------------------------------------
-.\" disable hyphenation
-.nh
-.\" disable justification (adjust text to left margin only)
-.ad l
-.\" -----------------------------------------------------------------
-.\" * MAIN CONTENT STARTS HERE *
-.\" -----------------------------------------------------------------
-.SH "NAME"
-mysql-stress-test.pl \- server stress test program
-.SH "SYNOPSIS"
-.HP \w'\fBmysql\-stress\-test\&.pl\ [\fR\fB\fIoptions\fR\fR\fB]\fR\ 'u
-\fBmysql\-stress\-test\&.pl [\fR\fB\fIoptions\fR\fR\fB]\fR
-.SH "DESCRIPTION"
-.PP
-The
-\fBmysql\-stress\-test\&.pl\fR
-Perl script performs stress\-testing of the MySQL server\&.
-.PP
-\fBmysql\-stress\-test\&.pl\fR
-requires a version of Perl that has been built with threads support\&.
-.PP
-Invoke
-\fBmysql\-stress\-test\&.pl\fR
-like this:
-.sp
-.if n \{\
-.RS 4
-.\}
-.nf
-shell> \fBmysql\-stress\-test\&.pl [\fR\fB\fIoptions\fR\fR\fB]\fR
-.fi
-.if n \{\
-.RE
-.\}
-.PP
-\fBmysql\-stress\-test\&.pl\fR
-supports the following options:
-.sp
-.RS 4
-.ie n \{\
-\h'-04'\(bu\h'+03'\c
-.\}
-.el \{\
-.sp -1
-.IP \(bu 2.3
-.\}
-\fB\-\-help\fR
-.sp
-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
-.\}
-\fB\-\-abort\-on\-error=\fR\fB\fIN\fR\fR
-.sp
-Causes the program to abort if an error with severity less than or equal to N was encountered\&. Set to 1 to abort on any error\&.
-.RE
-.sp
-.RS 4
-.ie n \{\
-\h'-04'\(bu\h'+03'\c
-.\}
-.el \{\
-.sp -1
-.IP \(bu 2.3
-.\}
-\fB\-\-check\-tests\-file\fR
-.sp
-Periodically check the file that lists the tests to be run\&. If it has been modified, reread the file\&. This can be useful if you update the list of tests to be run during a stress test\&.
-.RE
-.sp
-.RS 4
-.ie n \{\
-\h'-04'\(bu\h'+03'\c
-.\}
-.el \{\
-.sp -1
-.IP \(bu 2.3
-.\}
-\fB\-\-cleanup\fR
-.sp
-Force cleanup of the working directory\&.
-.RE
-.sp
-.RS 4
-.ie n \{\
-\h'-04'\(bu\h'+03'\c
-.\}
-.el \{\
-.sp -1
-.IP \(bu 2.3
-.\}
-\fB\-\-log\-error\-details\fR
-.sp
-Log error details in the global error log file\&.
-.RE
-.sp
-.RS 4
-.ie n \{\
-\h'-04'\(bu\h'+03'\c
-.\}
-.el \{\
-.sp -1
-.IP \(bu 2.3
-.\}
-\fB\-\-loop\-count=\fR\fB\fIN\fR\fR
-.sp
-In sequential test mode, the number of loops to execute before exiting\&.
-.RE
-.sp
-.RS 4
-.ie n \{\
-\h'-04'\(bu\h'+03'\c
-.\}
-.el \{\
-.sp -1
-.IP \(bu 2.3
-.\}
-\fB\-\-mysqltest=\fR\fB\fIpath\fR\fR
-.sp
-The path name to the
-\fBmysqltest\fR
-program\&.
-.RE
-.sp
-.RS 4
-.ie n \{\
-\h'-04'\(bu\h'+03'\c
-.\}
-.el \{\
-.sp -1
-.IP \(bu 2.3
-.\}
-\fB\-\-server\-database=\fR\fB\fIdb_name\fR\fR
-.sp
-The database to use for the tests\&. The default is
-test\&.
-.RE
-.sp
-.RS 4
-.ie n \{\
-\h'-04'\(bu\h'+03'\c
-.\}
-.el \{\
-.sp -1
-.IP \(bu 2.3
-.\}
-\fB\-\-server\-host=\fR\fB\fIhost_name\fR\fR
-.sp
-The host name of the local host to use for making a TCP/IP connection to the local server\&. By default, the connection is made to
-localhost
-using a Unix socket file\&.
-.RE
-.sp
-.RS 4
-.ie n \{\
-\h'-04'\(bu\h'+03'\c
-.\}
-.el \{\
-.sp -1
-.IP \(bu 2.3
-.\}
-\fB\-\-server\-logs\-dir=\fR\fB\fIpath\fR\fR
-.sp
-This option is required\&.
-\fIpath\fR
-is the directory where all client session logs will be stored\&. Usually this is the shared directory that is associated with the server used for testing\&.
-.RE
-.sp
-.RS 4
-.ie n \{\
-\h'-04'\(bu\h'+03'\c
-.\}
-.el \{\
-.sp -1
-.IP \(bu 2.3
-.\}
-\fB\-\-server\-password=\fR\fB\fIpassword\fR\fR
-.sp
-The password to use when connecting to the server\&.
-.RE
-.sp
-.RS 4
-.ie n \{\
-\h'-04'\(bu\h'+03'\c
-.\}
-.el \{\
-.sp -1
-.IP \(bu 2.3
-.\}
-\fB\-\-server\-port=\fR\fB\fIport_num\fR\fR
-.sp
-The TCP/IP port number to use for connecting to the server\&. The default is 3306\&.
-.RE
-.sp
-.RS 4
-.ie n \{\
-\h'-04'\(bu\h'+03'\c
-.\}
-.el \{\
-.sp -1
-.IP \(bu 2.3
-.\}
-\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
-/tmp/mysql\&.sock\&.
-.RE
-.sp
-.RS 4
-.ie n \{\
-\h'-04'\(bu\h'+03'\c
-.\}
-.el \{\
-.sp -1
-.IP \(bu 2.3
-.\}
-\fB\-\-server\-user=\fR\fB\fIuser_name\fR\fR
-.sp
-The MySQL user name to use when connecting to the server\&. The default is
-root\&.
-.RE
-.sp
-.RS 4
-.ie n \{\
-\h'-04'\(bu\h'+03'\c
-.\}
-.el \{\
-.sp -1
-.IP \(bu 2.3
-.\}
-\fB\-\-sleep\-time=\fR\fB\fIN\fR\fR
-.sp
-The delay in seconds between test executions\&.
-.RE
-.sp
-.RS 4
-.ie n \{\
-\h'-04'\(bu\h'+03'\c
-.\}
-.el \{\
-.sp -1
-.IP \(bu 2.3
-.\}
-\fB\-\-stress\-basedir=\fR\fB\fIpath\fR\fR
-.sp
-This option is required\&.
-\fIpath\fR
-is the working directory for the test run\&. It is used as the temporary location for result tracking during testing\&.
-.RE
-.sp
-.RS 4
-.ie n \{\
-\h'-04'\(bu\h'+03'\c
-.\}
-.el \{\
-.sp -1
-.IP \(bu 2.3
-.\}
-\fB\-\-stress\-datadir=\fR\fB\fIpath\fR\fR
-.sp
-The directory of data files to be used during testing\&. The default location is the
-data
-directory under the location given by the
-\fB\-\-stress\-suite\-basedir\fR
-option\&.
-.RE
-.sp
-.RS 4
-.ie n \{\
-\h'-04'\(bu\h'+03'\c
-.\}
-.el \{\
-.sp -1
-.IP \(bu 2.3
-.\}
-\fB\-\-stress\-init\-file[=\fR\fB\fIpath\fR\fR\fB]\fR
-.sp
-\fIfile_name\fR
-is the location of the file that contains the list of tests to be run once to initialize the database for the testing\&. If missing, the default file is
-stress_init\&.txt
-in the test suite directory\&.
-.RE
-.sp
-.RS 4
-.ie n \{\
-\h'-04'\(bu\h'+03'\c
-.\}
-.el \{\
-.sp -1
-.IP \(bu 2.3
-.\}
-\fB\-\-stress\-mode=\fR\fB\fImode\fR\fR
-.sp
-This option indicates the test order in stress\-test mode\&. The
-\fImode\fR
-value is either
-random
-to select tests in random order or
-seq
-to run tests in each thread in the order specified in the test list file\&. The default mode is
-random\&.
-.RE
-.sp
-.RS 4
-.ie n \{\
-\h'-04'\(bu\h'+03'\c
-.\}
-.el \{\
-.sp -1
-.IP \(bu 2.3
-.\}
-\fB\-\-stress\-suite\-basedir=\fR\fB\fIpath\fR\fR
-.sp
-This option is required\&.
-\fIpath\fR
-is the directory that has the
-t
-and
-\fIr\fR
-subdirectories containing the test case and result files\&. This directory is also the default location of the
-stress\-test\&.txt
-file that contains the list of tests\&. (A different location can be specified with the
-\fB\-\-stress\-tests\-file\fR
-option\&.)
-.RE
-.sp
-.RS 4
-.ie n \{\
-\h'-04'\(bu\h'+03'\c
-.\}
-.el \{\
-.sp -1
-.IP \(bu 2.3
-.\}
-\fB\-\-stress\-tests\-file[=\fR\fB\fIfile_name\fR\fR\fB]\fR
-.sp
-Use this option to run the stress tests\&.
-\fIfile_name\fR
-is the location of the file that contains the list of tests\&. If
-\fIfile_name\fR
-is omitted, the default file is
-stress\-test\&.txt
-in the stress suite directory\&. (See
-\fB\-\-stress\-suite\-basedir\fR\&.)
-.RE
-.sp
-.RS 4
-.ie n \{\
-\h'-04'\(bu\h'+03'\c
-.\}
-.el \{\
-.sp -1
-.IP \(bu 2.3
-.\}
-\fB\-\-suite=\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)\&.
-.RE
-.sp
-.RS 4
-.ie n \{\
-\h'-04'\(bu\h'+03'\c
-.\}
-.el \{\
-.sp -1
-.IP \(bu 2.3
-.\}
-\fB\-\-test\-count=\fR\fB\fIN\fR\fR
-.sp
-The number of tests to execute before exiting\&.
-.RE
-.sp
-.RS 4
-.ie n \{\
-\h'-04'\(bu\h'+03'\c
-.\}
-.el \{\
-.sp -1
-.IP \(bu 2.3
-.\}
-\fB\-\-test\-duration=\fR\fB\fIN\fR\fR
-.sp
-The duration of stress testing in seconds\&.
-.RE
-.sp
-.RS 4
-.ie n \{\
-\h'-04'\(bu\h'+03'\c
-.\}
-.el \{\
-.sp -1
-.IP \(bu 2.3
-.\}
-\fB\-\-threads=\fR\fB\fIN\fR\fR
-.sp
-The number of threads\&. The default is 1\&.
-.RE
-.sp
-.RS 4
-.ie n \{\
-\h'-04'\(bu\h'+03'\c
-.\}
-.el \{\
-.sp -1
-.IP \(bu 2.3
-.\}
-\fB\-\-verbose\fR
-.sp
-Verbose mode\&. Print more information about what the program does\&.
-.RE
-.SH "COPYRIGHT"
-.br
-.PP
-Copyright \(co 2006, 2017, Oracle and/or its affiliates. All rights reserved.
-.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
-This documentation is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
-.PP
-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/.
-.SH AUTHOR
-Oracle Corporation (http://dev.mysql.com/).
+++ /dev/null
-'\" t
-.\" Title: \fBmysql-test-run.pl\fR
-.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author]
-.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
-.\" Date: 06/01/2017
-.\" Manual: MySQL Database System
-.\" Source: MySQL
-.\" Language: English
-.\"
-.TH "\FBMYSQL\-TEST\-RUN\" "1" "06/01/2017" "MySQL" "MySQL Database System"
-.\" -----------------------------------------------------------------
-.\" * Define some portability stuff
-.\" -----------------------------------------------------------------
-.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-.\" http://bugs.debian.org/507673
-.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
-.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-.ie \n(.g .ds Aq \(aq
-.el .ds Aq '
-.\" -----------------------------------------------------------------
-.\" * set default formatting
-.\" -----------------------------------------------------------------
-.\" disable hyphenation
-.nh
-.\" disable justification (adjust text to left margin only)
-.ad l
-.\" -----------------------------------------------------------------
-.\" * MAIN CONTENT STARTS HERE *
-.\" -----------------------------------------------------------------
-.SH "NAME"
-mysql-test-run.pl \- run MySQL 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
-.SH "DESCRIPTION"
-.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
-\fIThis content is no longer updated\&.\fR
-Any further updates to test framework documention take place in the MySQL Source Code documentation and can be accessed at
-\m[blue]\fBThe MySQL Test Framework, Version 2\&.0\fR\m[]\&\s-2\u[1]\d\s+2\&.
-.sp .5v
-.RE
-.PP
-The
-\fBmysql\-test\-run\&.pl\fR
-Perl script is the main application used to run the MySQL test suite\&. It invokes
-\fBmysqltest\fR
-to run individual test cases\&.
-.PP
-Invoke
-\fBmysql\-test\-run\&.pl\fR
-in the
-mysql\-test
-directory like this:
-.sp
-.if n \{\
-.RS 4
-.\}
-.nf
-shell> \fBmysql\-test\-run\&.pl [\fR\fB\fIoptions\fR\fR\fB] [\fR\fB\fItest_name\fR\fR\fB] \&.\&.\&.\fR
-.fi
-.if n \{\
-.RE
-.\}
-.PP
-Each
-\fItest_name\fR
-argument names a test case\&. The test case file that corresponds to the test name is
-t/\fItest_name\fR\&.test\&.
-.PP
-For each
-\fItest_name\fR
-argument,
-\fBmysql\-test\-run\&.pl\fR
-runs the named test case\&. With no
-\fItest_name\fR
-arguments,
-\fBmysql\-test\-run\&.pl\fR
-runs all
-\&.test
-files in the
-t
-subdirectory\&.
-.PP
-If no suffix is given for the test name, a suffix of
-\&.test
-is assumed\&. Any leading path name is ignored\&. These commands are equivalent:
-.sp
-.if n \{\
-.RS 4
-.\}
-.nf
-shell> \fBmysql\-test\-run\&.pl mytest\fR
-shell> \fBmysql\-test\-run\&.pl mytest\&.test\fR
-shell> \fBmysql\-test\-run\&.pl t/mytest\&.test\fR
-.fi
-.if n \{\
-.RE
-.\}
-.PP
-A suite name can be given as part of the test name\&. That is, the syntax for naming a test is:
-.sp
-.if n \{\
-.RS 4
-.\}
-.nf
-[\fIsuite_name\fR\&.]\fItest_name\fR[\&.\fIsuffix\fR]
-.fi
-.if n \{\
-.RE
-.\}
-.PP
-If a suite name is given,
-\fBmysql\-test\-run\&.pl\fR
-looks in that suite for the test\&. The test file corresponding to a test named
-\fIsuite_name\&.test_name\fR
-is found in
-suite/\fIsuite_name\fR/t/\fItest_name\fR\&.test\&. There is also an implicit suite name
-main
-for the tests in the top
-t
-directory\&. With no suite name,
-\fBmysql\-test\-run\&.pl\fR
-looks in the default list of suites for a match and runs the test in any suites where it finds the test\&. Suppose that the default suite list is
-main,
-binlog,
-rpl, and that a test
-mytest\&.test
-exists in the
-main
-and
-rpl
-suites\&. With an argument of
-mytest
-or
-mytest\&.test,
-\fBmysql\-test\-run\&.pl\fR
-will run
-mytest\&.test
-from the
-main
-and
-rpl
-suites\&.
-.PP
-To run a family of test cases for which the names share a common prefix, use the
-\fB\-\-do\-test=\fR\fB\fIprefix\fR\fR
-option\&. For example,
-\fB\-\-do\-test=rpl\fR
-runs the replication tests (test cases that have names beginning with
-rpl)\&.
-\fB\-\-skip\-test\fR
-has the opposite effect of skipping test cases for which the names share a common prefix\&.
-.PP
-The argument for the
-\fB\-\-do\-test\fR
-and
-\fB\-\-skip\-test\fR
-options also allows more flexible specification of which tests to perform or skip\&. If the argument contains a pattern metacharacter other than a lone period, it is interpreted as a Perl regular expression and applies to test names that match the pattern\&. If the argument contains a lone period or does not contain any pattern metacharacters, it is interpreted the same way as previously and matches test names that begin with the argument value\&. For example,
-\fB\-\-do\-test=testa\fR
-matches tests that begin with
-testa,
-\fB\-\-do\-test=main\&.testa\fR
-matches tests in the
-main
-test suite that begin with
-testa, and
-\fB\-\-do\-test=main\&.*testa\fR
-matches test names that contain
-main
-followed by
-testa
-with anything in between\&. In the latter case, the pattern match is not anchored to the beginning of the test name, so it also matches names such as
-xmainytesta\&.
-.PP
-As of MySQL 5\&.7, it is possible to put a list of test names in a file and have
-\fBmysql\-test\-run\&.pl\fR
-run those tests, using the option
-\fB\-\-do\-test\-list=\fR\fB\fIfile\fR\fR\&. The tests should be listed one per line in the file, using the fully qualified name
-\fIsuite\fR\&.\fItest\fR\&. A space may be used in place of the period\&. A line beginning with
-#
-indicates a comment and is ignored\&.
-.PP
-As of MySQL 8\&.0,
-\fBmysql\-test\-run\&.pl\fR
-supports a
-\fB\-\-do\-suite\fR
-option, which is similar to
-\fB\-\-do\-test\fR
-but permits specifying entire suites of tests to run\&.
-.PP
-To perform setup prior to running tests,
-\fBmysql\-test\-run\&.pl\fR
-needs to invoke
-\fBmysqld\fR
-with the
-\fB\-\-bootstrap\fR
-and
-\fB\-\-skip\-grant\-tables\fR
-options\&. If MySQL was built with the compiler flag
-\fB\-DDISABLE_GRANT_OPTIONS\fR, then
-\fB\-\-bootstrap\fR,
-\fB\-\-skip\-grant\-tables\fR, and
-\fB\-\-init\-file\fR
-will be disabled\&. To handle this, set the
-MYSQLD_BOOTSTRAP
-environment variable to the full path name of a server that has all options enabled\&.
-\fBmysql\-test\-run\&.pl\fR
-will use that server to perform setup; it is not used to run the tests\&.
-.PP
-The
-init_file
-test will fail if
-\fB\-\-init\-file\fR
-is disabled\&. This is an expected failure in this case\&.
-.PP
-To run
-\fBmysql\-test\-run\&.pl\fR
-on Windows, you\*(Aqll need either Cygwin or ActiveState Perl to run it\&. You may also need to install the modules required by the script\&. To run the test script, change location into the
-mysql\-test
-directory, set the
-MTR_VS_CONFIG
-environment variable to the configuration you selected earlier (or use the
-\fB\-\-vs\-config\fR
-option), and invoke
-\fBmysql\-test\-run\&.pl\fR\&. For example (using Cygwin and the
-\fBbash\fR
-shell):
-.sp
-.if n \{\
-.RS 4
-.\}
-.nf
-shell> \fBcd mysql\-test\fR
-shell> \fBexport MTR_VS_CONFIG=debug\fR
-shell> \fB\&./mysqltest\-run\&.pl \-\-force \-\-timer\fR
-shell> \fB\&./mysqltest\-run\&.pl \-\-force \-\-timer \-\-ps\-protocol\fR
-.fi
-.if n \{\
-.RE
-.\}
-.PP
-\fBmysql\-test\-run\&.pl\fR
-uses several environment variables\&. Some of them are listed in the following table\&. Some of these are set from the outside and used by
-\fBmysql\-test\-run\&.pl\fR, others are set by
-\fBmysql\-test\-run\&.pl\fR
-instead, and may be referred to in tests\&.
-.TS
-allbox tab(:);
-lB lB.
-T{
-Variable
-T}:T{
-Description
-T}
-.T&
-l l
-l l
-l l
-l l
-l l
-l l
-l l
-l l
-l l
-l l
-l l
-l l
-l l
-l l
-l l
-l l
-l l.
-T{
-MTR_BUILD_THREAD
-T}:T{
-If set, defines which port number range is used for the server
-T}
-T{
-MTR_MEM
-T}:T{
-If set to anything, will run tests with files in "memory" using tmpfs or
- ramdisk\&. Not available on Windows\&. Same as
- \fB\-\-mem\fR option
-T}
-T{
-MTR_MAX_PARALLEL
-T}:T{
-If set, defines maximum number of parallel threads if
- \fB\-\-parallel=auto\fR is given
-T}
-T{
-MTR_\fINAME\fR_TIMEOUT
-T}:T{
-Setting of a timeout in minutes or seconds, corresponding to command
- line option
- \fB\-\-\fR\fB\fIname\fR\fR\fB\-timeout\fR\&.
- Avaliable timeout names are TESTCASE,
- SUITE (both in minutes) and
- START, SHUTDOWN,
- CTEST (all in seconds)\&.
- MTR_CTEST_TIMEOUT is for
- \fBctest\fR unit tests; it was added in
- MySQL 8\&.0\&.0\&.
-T}
-T{
-MTR_PARALLEL
-T}:T{
-If set, defines number of parallel threads executing tests\&. Same as
- \fB\-\-parallel\fR option
-T}
-T{
-MTR_PORT_BASE
-T}:T{
-If set, defines which port number range is used for the server
-T}
-T{
-MYSQL_CONFIG_EDITOR
-T}:T{
-Path name to \fBmysql_config_editor\fR binary\&. Supported as
- of MySQL 5\&.6\&.6\&.
-T}
-T{
-MYSQL_TEST
-T}:T{
-Path name to \fBmysqltest\fR binary
-T}
-T{
-MYSQL_TEST_DIR
-T}:T{
-Full path to the mysql\-test directory where tests
- are being run from
-T}
-T{
-MYSQL_TEST_LOGIN_FILE
-T}:T{
-Path name to login file used by \fBmysql_config_editor\fR\&.
- If not set, the default is
- $HOME/\&.mylogin\&.cnf, or
- %APPDATA%\eMySQL\e\&.mylogin\&.cnf on
- Windows\&. Supported as of MySQL 5\&.6\&.6\&.
-T}
-T{
-MYSQL_TMP_DIR
-T}:T{
-Path to temp directory used for temporary files during tests
-T}
-T{
-MYSQLD
-T}:T{
-Full path to server executable used in tests\&. Supported as of MySQL
- 5\&.5\&.17\&.
-T}
-T{
-MYSQLD_BOOTSTRAP
-T}:T{
-Full path name to \fBmysqld\fR that has all options enabled
-T}
-T{
-MYSQLD_BOOTSTRAP_CMD
-T}:T{
-Full command line used for initial database setup for this test batch
-T}
-T{
-MYSQLD_CMD
-T}:T{
-Command line for starting server as used in tests, with the minimum set
- of required arguments\&. Supported as of MySQL 5\&.5\&.17\&.
-T}
-T{
-MYSQLTEST_VARDIR
-T}:T{
-Path name to the var directory that is used for
- logs, temporary files, and so forth
-T}
-T{
-TSAN_OPTIONS
-T}:T{
-Path name to a file containing ThreadSanitizer suppressions\&. Supported
- as of MySQL 8\&.0\&.1\&.
-T}
-.TE
-.sp 1
-.PP
-The variable
-MTR_PORT_BASE
-is a more logical replacement for the original variable
-MTR_BUILD_THREAD\&. It gives the actual port number directly (will be rounded down to a multiple of 10)\&. If you use
-MTR_BUILD_THREAD, the port number is found by multiplying this by 10 and adding 10000\&.
-.PP
-Tests sometimes rely on certain environment variables being defined\&. For example, certain tests assume that
-MYSQL_TEST
-is defined so that
-\fBmysqltest\fR
-can invoke itself with
-exec $MYSQL_TEST\&.
-.PP
-Other tests may refer to the last three variables listed in the preceding table, to locate files to read or write\&. For example, tests that need to create files will typically put them in
-$MYSQL_TMP_DIR/\fIfile_name\fR\&.
-.PP
-The variable
-$MYSQLD_CMD
-will include any server options added with the
-\fB\-\-mysqld\fR
-option to
-\fBmysql\-test\-run\&.pl\fR, but will not include server options added specifically for the currently running test\&.
-.PP
-\fBmysql\-test\-run\&.pl\fR
-supports the options in the following list\&. An argument of
-\fB\-\-\fR
-tells
-\fBmysql\-test\-run\&.pl\fR
-not to process any following arguments as options\&.
-.sp
-.RS 4
-.ie n \{\
-\h'-04'\(bu\h'+03'\c
-.\}
-.el \{\
-.sp -1
-.IP \(bu 2.3
-.\}
-\fB\-\-help\fR,
-\fB\-h\fR
-.sp
-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
-.\}
-\fB\-\-big\-test\fR
-.sp
-Allow tests marked as "big" to run\&. Tests can be thus marked by including the line
-\-\-source include/big_test\&.inc, and they will only be run if this option is given, or if the environment variable
-BIG_TEST
-is set to 1\&.
-.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\&.
-.sp
-If both
-\fB\-\-big\-test\fR
-and
-\fB\-\-only\-big\-tests\fR
-are given,
-\fB\-\-only\-big\-tests\fR
-is ignored\&.
-.RE
-.sp
-.RS 4
-.ie n \{\
-\h'-04'\(bu\h'+03'\c
-.\}
-.el \{\
-.sp -1
-.IP \(bu 2.3
-.\}
-\fB\-\-boot\-dbx\fR
-.sp
-Run the
-\fBmysqld\fR
-server used for bootstrapping the database through the
-\fBdbx\fR
-debugger\&. This option is available from MySQL 5\&.5\&.17\&.
-.RE
-.sp
-.RS 4
-.ie n \{\
-\h'-04'\(bu\h'+03'\c
-.\}
-.el \{\
-.sp -1
-.IP \(bu 2.3
-.\}
-\fB\-\-boot\-ddd\fR
-.sp
-Run the
-\fBmysqld\fR
-server used for bootstrapping the database through the
-\fBddd\fR
-debugger\&. This option is available from MySQL 5\&.5\&.17\&.
-.RE
-.sp
-.RS 4
-.ie n \{\
-\h'-04'\(bu\h'+03'\c
-.\}
-.el \{\
-.sp -1
-.IP \(bu 2.3
-.\}
-\fB\-\-boot\-gdb\fR
-.sp
-Run the
-\fBmysqld\fR
-server used for bootstrapping the database through the
-\fBgdb\fR
-debugger\&. This option is available from MySQL 5\&.5\&.17\&.
-.sp
-See also the
-\fB\-\-manual\-boot\-gdb\fR
-option\&.
-.RE
-.sp
-.RS 4
-.ie n \{\
-\h'-04'\(bu\h'+03'\c
-.\}
-.el \{\
-.sp -1
-.IP \(bu 2.3
-.\}
-\fB\-\-build\-thread=\fR\fB\fInumber\fR\fR
-.sp
-Specify a number to calculate port numbers from\&. The formula is 10 *
-\fIbuild_thread\fR
-+ 10000\&. Instead of a number, it can be set to
-auto, which is also the default value, in which case
-\fBmysql\-test\-run\&.pl\fR
-will allocate a number unique to this host\&.
-.sp
-The value (number or
-auto) can also be set with the
-MTR_BUILD_THREAD
-environment variable\&.
-.sp
-This option is kept for backward compatibility\&. The more logical
-\fB\-\-port\-base\fR
-is recommended instead\&.
-.RE
-.sp
-.RS 4
-.ie n \{\
-\h'-04'\(bu\h'+03'\c
-.\}
-.el \{\
-.sp -1
-.IP \(bu 2.3
-.\}
-\fB\-\-callgrind\fR
-.sp
-Instructs
-\fBvalgrind\fR
-to use
-\fBcallgrind\fR\&.
-.RE
-.sp
-.RS 4
-.ie n \{\
-\h'-04'\(bu\h'+03'\c
-.\}
-.el \{\
-.sp -1
-.IP \(bu 2.3
-.\}
-\fB\-\-charset\-for\-testdb=\fR\fB\fIcharset_name\fR\fR
-.sp
-Specify the default character set for the
-test
-database\&. The default value is
-latin1\&.
-.sp
-This option was added in MySQL 8\&.0\&.1\&.
-.RE
-.sp
-.RS 4
-.ie n \{\
-\h'-04'\(bu\h'+03'\c
-.\}
-.el \{\
-.sp -1
-.IP \(bu 2.3
-.\}
-\fB\-\-check\-testcases\fR
-.sp
-Check test cases for side effects\&. This is done by checking the system state before and after each test case; if there is any difference, a warning to that effect is written, but the test case is not marked as failed because of it\&. This check is enabled by default\&. To disable it, use the
-\fB\-\-nocheck\-testcases\fR
-option\&.
-.RE
-.sp
-.RS 4
-.ie n \{\
-\h'-04'\(bu\h'+03'\c
-.\}
-.el \{\
-.sp -1
-.IP \(bu 2.3
-.\}
-\fB\-\-clean\-vardir\fR
-.sp
-Clean up the
-var
-directory with logs and test results etc\&. after the test run, but only if there were no test failures\&. This option only has effect if also running with option
-\fB\-\-mem\fR\&. The intent is to alleviate the problem of using up memory for test results, in cases where many different test runs are being done on the same host\&.
-.RE
-.sp
-.RS 4
-.ie n \{\
-\h'-04'\(bu\h'+03'\c
-.\}
-.el \{\
-.sp -1
-.IP \(bu 2.3
-.\}
-\fB\-\-client\-bindir=\fR\fB\fIpath\fR\fR
-.sp
-The path to the directory where client binaries are located\&.
-.RE
-.sp
-.RS 4
-.ie n \{\
-\h'-04'\(bu\h'+03'\c
-.\}
-.el \{\
-.sp -1
-.IP \(bu 2.3
-.\}
-\fB\-\-client\-dbx\fR
-.sp
-Start
-\fBmysqltest\fR
-in the
-\fBdbx\fR
-debugger\&. Support for dbx is available from MySQL 5\&.5\&.12\&.
-.RE
-.sp
-.RS 4
-.ie n \{\
-\h'-04'\(bu\h'+03'\c
-.\}
-.el \{\
-.sp -1
-.IP \(bu 2.3
-.\}
-\fB\-\-client\-ddd\fR
-.sp
-Start
-\fBmysqltest\fR
-in the
-\fBddd\fR
-debugger\&.
-.RE
-.sp
-.RS 4
-.ie n \{\
-\h'-04'\(bu\h'+03'\c
-.\}
-.el \{\
-.sp -1
-.IP \(bu 2.3
-.\}
-\fB\-\-client\-debugger=\fR\fB\fIdebugger\fR\fR
-.sp
-Start
-\fBmysqltest\fR
-in the named debugger\&.
-.RE
-.sp
-.RS 4
-.ie n \{\
-\h'-04'\(bu\h'+03'\c
-.\}
-.el \{\
-.sp -1
-.IP \(bu 2.3
-.\}
-\fB\-\-client\-gdb\fR
-.sp
-Start
-\fBmysqltest\fR
-in the
-\fBgdb\fR
-debugger\&.
-.RE
-.sp
-.RS 4
-.ie n \{\
-\h'-04'\(bu\h'+03'\c
-.\}
-.el \{\
-.sp -1
-.IP \(bu 2.3
-.\}
-\fB\-\-client\-libdir=\fR\fB\fIpath\fR\fR
-.sp
-The path to the directory where client libraries are located\&.
-.RE
-.sp
-.RS 4
-.ie n \{\
-\h'-04'\(bu\h'+03'\c
-.\}
-.el \{\
-.sp -1
-.IP \(bu 2.3
-.\}
-\fB\-\-combination=\fR\fB\fIvalue\fR\fR
-.sp
-Extra option to pass to
-\fBmysqld\fR\&. The value should consist of a single
-\fBmysqld\fR
-option including dashes\&. This option is similar to
-\fB\-\-mysqld\fR
-but has a different effect\&.
-\fBmysql\-test\-run\&.pl\fR
-executes multiple test runs, using the options for each instance of
-\fB\-\-combination\fR
-in successive runs\&. If
-\fB\-\-combination\fR
-is given only once, it has no effect\&. For test runs specific to a given test suite, an alternative to the use of
-\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\&.
-.RE
-.sp
-.RS 4
-.ie n \{\
-\h'-04'\(bu\h'+03'\c
-.\}
-.el \{\
-.sp -1
-.IP \(bu 2.3
-.\}
-\fB\-\-comment=\fR\fB\fIstr\fR\fR
-.sp
-Write
-\fIstr\fR
-to the output within lines filled with
-#, as a form of banner\&.
-.RE
-.sp
-.RS 4
-.ie n \{\
-\h'-04'\(bu\h'+03'\c
-.\}
-.el \{\
-.sp -1
-.IP \(bu 2.3
-.\}
-\fB\-\-compress\fR
-.sp
-Compress all information sent between the client and the server if both support compression\&.
-.RE
-.sp
-.RS 4
-.ie n \{\
-\h'-04'\(bu\h'+03'\c
-.\}
-.el \{\
-.sp -1
-.IP \(bu 2.3
-.\}
-\fB\-\-cursor\-protocol\fR
-.sp
-Pass the
-\fB\-\-cursor\-protocol\fR
-option to
-\fBmysqltest\fR
-(implies
-\fB\-\-ps\-protocol\fR)\&.
-.RE
-.sp
-.RS 4
-.ie n \{\
-\h'-04'\(bu\h'+03'\c
-.\}
-.el \{\
-.sp -1
-.IP \(bu 2.3
-.\}
-\fB\-\-dbx\fR
-.sp
-Start
-\fBmysqld\fR
-in the
-\fBdbx\fR
-debugger\&. Support for dbx is available from MySQL 5\&.5\&.12\&.
-.RE
-.sp
-.RS 4
-.ie n \{\
-\h'-04'\(bu\h'+03'\c
-.\}
-.el \{\
-.sp -1
-.IP \(bu 2.3
-.\}
-\fB\-\-ddd\fR
-.sp
-Start
-\fBmysqld\fR
-in the
-\fBddd\fR
-debugger\&.
-.RE
-.sp
-.RS 4
-.ie n \{\
-\h'-04'\(bu\h'+03'\c
-.\}
-.el \{\
-.sp -1
-.IP \(bu 2.3
-.\}
-\fB\-\-debug\fR
-.sp
-Dump trace output for all clients and servers\&.
-.RE
-.sp
-.RS 4
-.ie n \{\
-\h'-04'\(bu\h'+03'\c
-.\}
-.el \{\
-.sp -1
-.IP \(bu 2.3
-.\}
-\fB\-\-debugger=\fR\fB\fIdebugger\fR\fR
-.sp
-Start
-\fBmysqld\fR
-using the named debugger\&.
-.RE
-.sp
-.RS 4
-.ie n \{\
-\h'-04'\(bu\h'+03'\c
-.\}
-.el \{\
-.sp -1
-.IP \(bu 2.3
-.\}
-\fB\-\-debug\-common\fR
-.sp
-This option works similar to
-\-\-debug
-but turns on debug only for the debug macro keywords
-query, info, error, enter, exit
-which are considered the most commonly used\&.
-.RE
-.sp
-.RS 4
-.ie n \{\
-\h'-04'\(bu\h'+03'\c
-.\}
-.el \{\
-.sp -1
-.IP \(bu 2.3
-.\}
-\fB\-\-debug\-server\fR
-.sp
-Runs
-mysqld\&.debug
-(if available) instead of
-mysqld
-as server\&. If it does find
-mysqld\&.debug, it will search for plugin libraries in a subdirectory
-debug
-under the directory where it\*(Aqs normally located\&. This option does not turn on trace output and is independent of the
-\fBdebug\fR
-option\&.
-.RE
-.sp
-.RS 4
-.ie n \{\
-\h'-04'\(bu\h'+03'\c
-.\}
-.el \{\
-.sp -1
-.IP \(bu 2.3
-.\}
-\fB\-\-debug\-sync\-timeout=\fR\fB\fIseconds\fR\fR
-.sp
-Controls whether the Debug Sync facility for testing and debugging is enabled\&. The option value is a timeout in seconds\&. The default value is 300\&. A value of 0 disables Debug Sync\&. The value of this option also becomes the default timeout for individual synchronization points\&.
-.sp
-\fBmysql\-test\-run\&.pl\fR
-passes
-\fB\-\-loose\-debug\-sync\-timeout=\fR\fB\fIseconds\fR\fR
-to
-\fBmysqld\fR\&. The
-\fB\-\-loose\fR
-prefix is used so that
-\fBmysqld\fR
-does not fail if Debug Sync is not compiled in\&.
-.sp
-For information about using the Debug Sync facility for testing, see
-Section\ \&4.15, \(lqThread Synchronization in Test Cases\(rq\&.
-.RE
-.sp
-.RS 4
-.ie n \{\
-\h'-04'\(bu\h'+03'\c
-.\}
-.el \{\
-.sp -1
-.IP \(bu 2.3
-.\}
-\fB\-\-default\-myisam\fR
-.sp
-Use
-MyISAM
-as the default storage engine for all except
-InnoDB\-specific tests\&. This option is on by default in MySQL 5\&.5 and 5\&.6, but is off by default as of MySQL 5\&.7\&. See also
-\fB\-\-nodefault\-myisam\fR\&.
-.RE
-.sp
-.RS 4
-.ie n \{\
-\h'-04'\(bu\h'+03'\c
-.\}
-.el \{\
-.sp -1
-.IP \(bu 2.3
-.\}
-\fB\-\-defaults\-file=\fR\fB\fIfile_name\fR\fR
-.sp
-Use the named file as fixed config file template for all tests\&.
-.RE
-.sp
-.RS 4
-.ie n \{\
-\h'-04'\(bu\h'+03'\c
-.\}
-.el \{\
-.sp -1
-.IP \(bu 2.3
-.\}
-\fB\-\-defaults_extra_file=\fR\fB\fIfile_name\fR\fR
-.sp
-Add setting from the named file to all generated configs\&.
-.RE
-.sp
-.RS 4
-.ie n \{\
-\h'-04'\(bu\h'+03'\c
-.\}
-.el \{\
-.sp -1
-.IP \(bu 2.3
-.\}
-\fB\-\-discover\fR
-.sp
-Attempt to preload
-discover, the Developer Studio Memory Error Discovery Tool when starting
-\fBmysqld\fR\&. Reports from
-discover
-may be found in
-log/mysqld\&.%p\&.txt
-under the directory given by
-\fB\-\-vardir\fR\&. This option was added in MySQL 8\&.0\&.1\&. It is supported only on SPARC\-M7 systems\&.
-.RE
-.sp
-.RS 4
-.ie n \{\
-\h'-04'\(bu\h'+03'\c
-.\}
-.el \{\
-.sp -1
-.IP \(bu 2.3
-.\}
-\fB\-\-do\-suite=\fR\fB\fIprefix or regex\fR\fR
-.sp
-Run all test cases from suites having a name that begins with the given
-\fIprefix\fR
-value or matches the regular expression\&. If the argument matches no existing suites,
-\fBmysql\-test\-run\&.pl\fR
-aborts\&.
-.sp
-The argument for the
-\fB\-\-do\-suite\fR
-option allows more flexible specification of which tests to perform\&. See the description of the
-\fB\-\-do\-test\fR
-option for details\&.
-.sp
-The
-\fB\-\-do\-suite\fR
-option was added in MySQL 8\&.0\&.
-.RE
-.sp
-.RS 4
-.ie n \{\
-\h'-04'\(bu\h'+03'\c
-.\}
-.el \{\
-.sp -1
-.IP \(bu 2.3
-.\}
-\fB\-\-do\-test=\fR\fB\fIprefix or regex\fR\fR
-.sp
-Run all test cases having a name that begins with the given
-\fIprefix\fR
-value or matches the regular expression\&. This option provides a convenient way to run a family of similarly named tests\&.
-.sp
-The argument for the
-\fB\-\-do\-test\fR
-option allows more flexible specification of which tests to perform\&. If the argument contains a pattern metacharacter other than a lone period, it is interpreted as a Perl regular expression and applies to test names that match the pattern\&. If the argument contains a lone period or does not contain any pattern metacharacters, it is interpreted the same way as previously and matches test names that begin with the argument value\&. For example,
-\fB\-\-do\-test=testa\fR
-matches tests that begin with
-testa,
-\fB\-\-do\-test=main\&.testa\fR
-matches tests in the
-main
-test suite that begin with
-testa, and
-\fB\-\-do\-test=main\&.*testa\fR
-matches test names that contain
-main
-followed by
-testa
-with anything in between\&. In the latter case, the pattern match is not anchored to the beginning of the test name, so it also matches names such as
-xmainytestz\&.
-.RE
-.sp
-.RS 4
-.ie n \{\
-\h'-04'\(bu\h'+03'\c
-.\}
-.el \{\
-.sp -1
-.IP \(bu 2.3
-.\}
-\fB\-\-do\-testlist=\fR\fB\fIfile\fR\fR
-.sp
-Run all tests listed in the file
-\fIfile\fR\&. In this file, tests should be listed one per line in the form
-\fIsuite\fR\&.\fItest\fR
-or alternatively, with a space instead of the period\&. A line beginning with
-#
-will be ignored and can be used for comments\&.
-.sp
-The
-\fB\-\-do\-test\-list\fR
-option is available from MySQL 5\&.7\&.
-.RE
-.sp
-.RS 4
-.ie n \{\
-\h'-04'\(bu\h'+03'\c
-.\}
-.el \{\
-.sp -1
-.IP \(bu 2.3
-.\}
-\fB\-\-embedded\-server\fR
-.sp
-Use a version of
-\fBmysqltest\fR
-built with the embedded server\&. This option was removed in MySQL 8\&.0\&.
-.RE
-.sp
-.RS 4
-.ie n \{\
-\h'-04'\(bu\h'+03'\c
-.\}
-.el \{\
-.sp -1
-.IP \(bu 2.3
-.\}
-\fB\-\-enable\-disabled\fR
-.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\&.
-.RE
-.sp
-.RS 4
-.ie n \{\
-\h'-04'\(bu\h'+03'\c
-.\}
-.el \{\
-.sp -1
-.IP \(bu 2.3
-.\}
-\fB\-\-experimental=\fR\fB\fIfile_name\fR\fR
-.sp
-Specify a file that contains a list of test cases that should be displayed with the
-[ exp\-fail ]
-code rather than
-[ fail ]
-if they fail\&.
-.sp
-For an example of a file that might be specified using this option, see
-mysql\-test/collections/default\&.experimental\&.
-.sp
-It is also possible to supply more than one
-\fB\-\-experimental\fR, test cases listed in all the files will be treated as experimental\&.
-.RE
-.sp
-.RS 4
-.ie n \{\
-\h'-04'\(bu\h'+03'\c
-.\}
-.el \{\
-.sp -1
-.IP \(bu 2.3
-.\}
-\fB\-\-explain\-protocol\fR,
-.sp
-Run
-EXPLAIN EXTENDED
-on all
-SELECT,
-INSERT,
-REPLACE,
-UPDATE, and
-DELETE
-statements\&.
-.RE
-.sp
-.RS 4
-.ie n \{\
-\h'-04'\(bu\h'+03'\c
-.\}
-.el \{\
-.sp -1
-.IP \(bu 2.3
-.\}
-\fB\-\-extern\fR
-\fIoption\fR=\fIvalue\fR
-.sp
-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
-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:
-.sp
-.if n \{\
-.RS 4
-.\}
-.nf
- \&./mysql\-test\-run\&.pl \-\-extern socket=var/tmp/mysqld\&.1\&.sock alias
-.fi
-.if n \{\
-.RE
-.\}
-.sp
-Note: If a test case has an
-\&.opt
-file that requires the server to be restarted with specific options, the file will not be used\&. The test case likely will fail as a result\&.
-.RE
-.sp
-.RS 4
-.ie n \{\
-\h'-04'\(bu\h'+03'\c
-.\}
-.el \{\
-.sp -1
-.IP \(bu 2.3
-.\}
-\fB\-\-fast\fR
-.sp
-Do not perform controlled shutdown when servers need to be restarted or at the end of the test run\&. This is equivalent to using
-\-\-shutdown\-timeout=0\&.
-.RE
-.sp
-.RS 4
-.ie n \{\
-\h'-04'\(bu\h'+03'\c
-.\}
-.el \{\
-.sp -1
-.IP \(bu 2.3
-.\}
-\fB\-\-fail\-check\-testcases\fR
-.sp
-Enabling this option when a test is run, causes it to fail if MTR\*(Aqs internal check of the test case fails\&. If this option is disabled, only a warning is generated while the test passes\&. This option is enabled by default\&. For additional information, see the description of the
-\fB\-\-check\-testcases\fR
-option\&.
-.sp
-The
-\fB\-\-fail\-check\-testcases\fR
-option was added in MySQL 8\&.0\&.
-.RE
-.sp
-.RS 4
-.ie n \{\
-\h'-04'\(bu\h'+03'\c
-.\}
-.el \{\
-.sp -1
-.IP \(bu 2.3
-.\}
-\fB\-\-force\fR
-.sp
-Normally,
-\fBmysql\-test\-run\&.pl\fR
-exits if a test case fails\&.
-\fB\-\-force\fR
-causes execution to continue regardless of test case failure\&.
-.RE
-.sp
-.RS 4
-.ie n \{\
-\h'-04'\(bu\h'+03'\c
-.\}
-.el \{\
-.sp -1
-.IP \(bu 2.3
-.\}
-\fB\-\-force\-restart\fR
-.sp
-Always restart the server(s) between each tast case, whether it\*(Aqs needed or not\&. Will also restart between repeated runs of the same test case\&. This may be useful e\&.g\&. when looking for the source of a memory leak, as there will only have been one test run before the server exits\&.
-.RE
-.sp
-.RS 4
-.ie n \{\
-\h'-04'\(bu\h'+03'\c
-.\}
-.el \{\
-.sp -1
-.IP \(bu 2.3
-.\}
-\fB\-\-gcov\fR
-.sp
-Run tests with the
-\fBgcov\fR
-test coverage tool\&.
-.RE
-.sp
-.RS 4
-.ie n \{\
-\h'-04'\(bu\h'+03'\c
-.\}
-.el \{\
-.sp -1
-.IP \(bu 2.3
-.\}
-\fB\-\-gdb\fR
-.sp
-Start
-\fBmysqld\fR
-in the
-\fBgdb\fR
-debugger\&.
-.RE
-.sp
-.RS 4
-.ie n \{\
-\h'-04'\(bu\h'+03'\c
-.\}
-.el \{\
-.sp -1
-.IP \(bu 2.3
-.\}
-\fB\-\-gprof\fR
-.sp
-Run tests with the
-\fBgprof\fR
-profiling tool\&.
-.RE
-.sp
-.RS 4
-.ie n \{\
-\h'-04'\(bu\h'+03'\c
-.\}
-.el \{\
-.sp -1
-.IP \(bu 2.3
-.\}
-\fB\-\-include\-ndbcluster\fR,
-\fB\-\-include\-ndb\fR
-.sp
-Run also tests that need Cluster\&.
-.RE
-.sp
-.RS 4
-.ie n \{\
-\h'-04'\(bu\h'+03'\c
-.\}
-.el \{\
-.sp -1
-.IP \(bu 2.3
-.\}
-\fB\-\-json\-explain\-protocol\fR,
-.sp
-Run
-EXPLAIN FORMAT=JSON
-on all SELECT, INSERT, REPLACE, UPDATE and DELETE queries\&. The
-json\-explain\-protocol
-option is available from MySQL 5\&.6\&.
-.RE
-.sp
-.RS 4
-.ie n \{\
-\h'-04'\(bu\h'+03'\c
-.\}
-.el \{\
-.sp -1
-.IP \(bu 2.3
-.\}
-\fB\-\-manual\-boot\-gdb\fR
-.sp
-This option is similar to
-\fB\-\-boot\-gdb\fR
-but attaches the debugger to the server during the bootstrapping process, permitting the use of a remote debugger\&. This option is available from MySQL 5\&.7\&.14\&.
-.RE
-.sp
-.RS 4
-.ie n \{\
-\h'-04'\(bu\h'+03'\c
-.\}
-.el \{\
-.sp -1
-.IP \(bu 2.3
-.\}
-\fB\-\-manual\-dbx\fR
-.sp
-Use a server that has already been started by the user in the
-\fBdbx\fR
-debugger\&. Support for dbx is available from MySQL 5\&.5\&.12\&.
-.RE
-.sp
-.RS 4
-.ie n \{\
-\h'-04'\(bu\h'+03'\c
-.\}
-.el \{\
-.sp -1
-.IP \(bu 2.3
-.\}
-\fB\-\-manual\-ddd\fR
-.sp
-Use a server that has already been started by the user in the
-\fBddd\fR
-debugger\&.
-.RE
-.sp
-.RS 4
-.ie n \{\
-\h'-04'\(bu\h'+03'\c
-.\}
-.el \{\
-.sp -1
-.IP \(bu 2.3
-.\}
-\fB\-\-manual\-debug\fR
-.sp
-Use a server that has already been started by the user in a debugger\&.
-.RE
-.sp
-.RS 4
-.ie n \{\
-\h'-04'\(bu\h'+03'\c
-.\}
-.el \{\
-.sp -1
-.IP \(bu 2.3
-.\}
-\fB\-\-manual\-gdb\fR
-.sp
-Use a server that has already been started by the user in the
-\fBgdb\fR
-debugger\&.
-.RE
-.sp
-.RS 4
-.ie n \{\
-\h'-04'\(bu\h'+03'\c
-.\}
-.el \{\
-.sp -1
-.IP \(bu 2.3
-.\}
-\fB\-\-mark\-progress\fR
-.sp
-Marks progress with timing (in milliseconds) and line number in
-var/log/\fItestname\fR\&.progress\&.
-.RE
-.sp
-.RS 4
-.ie n \{\
-\h'-04'\(bu\h'+03'\c
-.\}
-.el \{\
-.sp -1
-.IP \(bu 2.3
-.\}
-\fB\-\-max\-connections=\fR\fB\fInum\fR\fR
-.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\&.
-.RE
-.sp
-.RS 4
-.ie n \{\
-\h'-04'\(bu\h'+03'\c
-.\}
-.el \{\
-.sp -1
-.IP \(bu 2.3
-.\}
-\fB\-\-max\-save\-core=\fR\fB\fIN\fR\fR
-.sp
-Limit the number of core files saved, to avoid filling up disks in case of a frequently crashing server\&. Defaults to 5, set to 0 for no limit\&. May also be set with the environment variable
-MTR_MAX_SAVE_CORE
-.RE
-.sp
-.RS 4
-.ie n \{\
-\h'-04'\(bu\h'+03'\c
-.\}
-.el \{\
-.sp -1
-.IP \(bu 2.3
-.\}
-\fB\-\-max\-save\-datadir=\fR\fB\fIN\fR\fR
-.sp
-Limit the number of data directories saved after failed tests, to avoid filling up disks in case of frequent failures\&. Defaults to 20, set to 0 for no limit\&. May also be set with the environment variable
-MTR_MAX_SAVE_DATADIR
-.RE
-.sp
-.RS 4
-.ie n \{\
-\h'-04'\(bu\h'+03'\c
-.\}
-.el \{\
-.sp -1
-.IP \(bu 2.3
-.\}
-\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
-MTR_MAX_TEST_FAIL
-.RE
-.sp
-.RS 4
-.ie n \{\
-\h'-04'\(bu\h'+03'\c
-.\}
-.el \{\
-.sp -1
-.IP \(bu 2.3
-.\}
-\fB\-\-mem\fR
-.sp
-This option is not supported on Windows\&.
-.sp
-Run the test suite in memory, using tmpfs or ramdisk\&. This can decrease test times significantly, in particular if you would otherwise be running over a remote file system\&.
-\fBmysql\-test\-run\&.pl\fR
-attempts to find a suitable location using a built\-in list of standard locations for tmpfs and puts the
-var
-directory there\&. This option also affects placement of temporary files, which are created in
-var/tmp\&.
-.sp
-The default list includes
-/dev/shm\&. You can also enable this option by setting the environment variable
-MTR_MEM[=\fIdir_name\fR]\&. If
-\fIdir_name\fR
-is given, it is added to the beginning of the list of locations to search, so it takes precedence over any built\-in locations\&.
-.sp
-Once you have run tests with
-\fB\-\-mem\fR
-within a
-mysql\-testdirectory, a soflink
-var
-will have been set up to the temporary directory, and this will be re\-used the next time, until the soflink is deleted\&. Thus, you do not have to repeat the
-\fB\-\-mem\fR
-option next time\&.
-.RE
-.sp
-.RS 4
-.ie n \{\
-\h'-04'\(bu\h'+03'\c
-.\}
-.el \{\
-.sp -1
-.IP \(bu 2.3
-.\}
-\fB\-\-mysqld=\fR\fB\fIvalue\fR\fR
-.sp
-Extra option to pass to
-\fBmysqld\fR\&. Only one option may be specified in
-\fIvalue\fR; to specify more than one, use additional
-\fB\-\-mysqld\fR
-options\&. See
-Section\ \&4.9, \(lqPassing Options from mysql-test-run.pl to mysqld or mysqltest\(rq\&.
-.RE
-.sp
-.RS 4
-.ie n \{\
-\h'-04'\(bu\h'+03'\c
-.\}
-.el \{\
-.sp -1
-.IP \(bu 2.3
-.\}
-\fB\-\-mysqld\-env=\fR\fB\fIvariable\fR\fR\fB=\fR\fB\fIvalue\fR\fR
-.sp
-Sets (or changes) an environment variable before starting
-\fBmysqld\fR\&. Varibles set in the environment from which you run
-\fBmysql\-test\-run\&.pl\fR
-will normally also be propagated to
-\fBmysqld\fR, but there may be cases where you want a setting just for a single run, or you may not want the setting to affect other programs\&. You may use additional
-\fB\-\-mysqld\-env\fR
-options to set more than one variable\&.
-.RE
-.sp
-.RS 4
-.ie n \{\
-\h'-04'\(bu\h'+03'\c
-.\}
-.el \{\
-.sp -1
-.IP \(bu 2.3
-.\}
-\fB\-\-mysqltest=\fR\fB\fIoptions\fR\fR
-.sp
-Extra options to pass to
-\fBmysqltest\fR\&.
-.sp
-This option was added in MySQL 8\&.0\&.0\&.
-.RE
-.sp
-.RS 4
-.ie n \{\
-\h'-04'\(bu\h'+03'\c
-.\}
-.el \{\
-.sp -1
-.IP \(bu 2.3
-.\}
-\fB\-\-ndb\-connectstring=\fR\fB\fIstr\fR\fR
-.sp
-Pass
-\fB\-\-ndb\-connectstring=\fR\fB\fIstr\fR\fR
-to the master MySQL server\&. This option also prevents
-\fBmysql\-test\-run\&.pl\fR
-from starting a cluster\&. It is assumed that there is already a cluster running to which the server can connect with the given connectstring\&.
-.RE
-.sp
-.RS 4
-.ie n \{\
-\h'-04'\(bu\h'+03'\c
-.\}
-.el \{\
-.sp -1
-.IP \(bu 2.3
-.\}
-\fB\-\-nocheck\-testcases\fR
-.sp
-Disable the check for test case side effects\&. For additional information, see the description of the
-\fB\-\-check\-testcases\fR
-option\&.
-.RE
-.sp
-.RS 4
-.ie n \{\
-\h'-04'\(bu\h'+03'\c
-.\}
-.el \{\
-.sp -1
-.IP \(bu 2.3
-.\}
-\fB\-\-nodefault\-myisam\fR
-.sp
-For MySQL 5\&.5 or 5\&.6, do not override the build\-in default engine to use MyISAM instead for non\-InnoDB tests\&. Since the existing collection of tests were originally adapted for MyISAM as default, many tests will fail when this option is used, because the test behaves differently or produces different output when the engine switches to InnoDB\&.
-.sp
-From MySQL 5\&.7, the default engine for tests has been changed to InnoDB and this option will have no effect\&.
-.RE
-.sp
-.RS 4
-.ie n \{\
-\h'-04'\(bu\h'+03'\c
-.\}
-.el \{\
-.sp -1
-.IP \(bu 2.3
-.\}
-\fB\-\-noreorder\fR
-.sp
-Do not reorder tests to reduce number of restarts, but run them in exactly the order given\&. If a whole suite is to be run, the tests are run in alphabetic order, though similiar combinations will be grouped together\&. If more than one suite is listed, the tests are run one suite at a time, in the order listed\&.
-.RE
-.sp
-.RS 4
-.ie n \{\
-\h'-04'\(bu\h'+03'\c
-.\}
-.el \{\
-.sp -1
-.IP \(bu 2.3
-.\}
-\fB\-\-no\-skip\fR
-.sp
-This option forces all tests to run, ignoring any
-\fB\-\-skip\fR
-commands used in the test\&. This ensures that all tests are run\&. An excluded list (excludenoskip\&.list) is maintained to track which tests should continue to be skipped\&. The
-\fB\-\-no\-skip\fR
-option continues to skip the tests that are named in the excluded list\&. The default value of
-\fB\-\-no\-skip\fR
-introduced variable is OFF, which implies users are not forced to run all tests unless the
-\fB\-\-no\-skip\fR
-is explicitly used\&.
-.sp
-.if n \{\
-.RS 4
-.\}
-.nf
-shell> \fBmysql\-test\-run\&.pl\fR
- \fB\-\-suite=innodb\fR
- \fB\-\-no\-skip\fR
-.fi
-.if n \{\
-.RE
-.\}
-.RE
-.sp
-.RS 4
-.ie n \{\
-\h'-04'\(bu\h'+03'\c
-.\}
-.el \{\
-.sp -1
-.IP \(bu 2.3
-.\}
-\fB\-\-notimer\fR
-.sp
-Cause
-\fBmysqltest\fR
-not to generate a timing file\&. The effect of this is that the report from each test case does not include the timing in milliseconds as it normally does\&.
-.RE
-.sp
-.RS 4
-.ie n \{\
-\h'-04'\(bu\h'+03'\c
-.\}
-.el \{\
-.sp -1
-.IP \(bu 2.3
-.\}
-\fB\-\-nounit\-tests\fR
-.sp
-Do not run unit tests, overriding default behavior or setting of the
-MTR_UNIT_TESTS
-variable\&.
-.sp
-Running of unit tests was enabled from MySQL 5\&.5\&.11\&.
-.RE
-.sp
-.RS 4
-.ie n \{\
-\h'-04'\(bu\h'+03'\c
-.\}
-.el \{\
-.sp -1
-.IP \(bu 2.3
-.\}
-\fB\-\-nowarnings\fR
-.sp
-Do not look for and report errors and warning in the server logs\&.
-.RE
-.sp
-.RS 4
-.ie n \{\
-\h'-04'\(bu\h'+03'\c
-.\}
-.el \{\
-.sp -1
-.IP \(bu 2.3
-.\}
-\fB\-\-only\-big\-tests\fR
-.sp
-This option causes only big tests to run\&. Normal (non\-big) tests are skipped\&. If both
-\fB\-\-big\-test\fR
-and
-\fB\-\-only\-big\-tests\fR
-are given,
-\fB\-\-only\-big\-tests\fR
-is ignored\&.
-.sp
-\fB\-\-only\-big\-tests\fR
-was added in MySQL 8\&.0\&.1\&.
-.RE
-.sp
-.RS 4
-.ie n \{\
-\h'-04'\(bu\h'+03'\c
-.\}
-.el \{\
-.sp -1
-.IP \(bu 2.3
-.\}
-\fB\-\-parallel={\fR\fB\fIN\fR\fR\fB|auto}\fR
-.sp
-Run tests using
-\fIN\fR
-parallel threads\&. By default, 1 thread is used\&. Use
-\fB\-\-parallel=auto\fR
-to set
-\fIN\fR
-automatically\&.
-.sp
-Setting the
-MTR_PARALLEL
-environment variable to
-\fIN\fR
-has the same effect as specifying
-\fB\-\-parallel=\fR\fB\fIN\fR\fR\&.
-.sp
-The
-MTR_MAX_PARALLEL
-environment variable, if set, specifies the maximum number of parallel workers that can be spawned when the
-\fB\-\-parallel=auto\fR
-option is specified\&. If
-\fB\-\-parallel=auto\fR
-is not specified,
-MTR_MAX_PARALLEL
-variable has no effect\&.
-.RE
-.sp
-.RS 4
-.ie n \{\
-\h'-04'\(bu\h'+03'\c
-.\}
-.el \{\
-.sp -1
-.IP \(bu 2.3
-.\}
-\fB\-\-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
-should be divisible by 10; if it is not, it will be rounded down\&. If running with more than one parallel test thread, thread 2 will use the next block of 10 and so on\&.
-.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
-MTR_PORT_BASE\&.
-.sp
-\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 precedence\&.
-.RE
-.sp
-.RS 4
-.ie n \{\
-\h'-04'\(bu\h'+03'\c
-.\}
-.el \{\
-.sp -1
-.IP \(bu 2.3
-.\}
-\fB\-\-print\-testcases\fR
-.sp
-Do not run any tests, but print details about all tests, in the order they would have been run\&.
-.RE
-.sp
-.RS 4
-.ie n \{\
-\h'-04'\(bu\h'+03'\c
-.\}
-.el \{\
-.sp -1
-.IP \(bu 2.3
-.\}
-\fB\-\-ps\-protocol\fR
-.sp
-Pass the
-\fB\-\-ps\-protocol\fR
-option to
-\fBmysqltest\fR\&.
-.RE
-.sp
-.RS 4
-.ie n \{\
-\h'-04'\(bu\h'+03'\c
-.\}
-.el \{\
-.sp -1
-.IP \(bu 2.3
-.\}
-\fB\-\-record\fR
-.sp
-Pass the
-\fB\-\-record\fR
-option to
-\fBmysqltest\fR\&. This option requires a specific test case to be named on the command line\&.
-.RE
-.sp
-.RS 4
-.ie n \{\
-\h'-04'\(bu\h'+03'\c
-.\}
-.el \{\
-.sp -1
-.IP \(bu 2.3
-.\}
-\fB\-\-reorder\fR
-.sp
-Reorder tests to minimize the number of server restarts needed\&. This is the default behavior\&. There is no guarantee that a particular set of tests will always end up in the same order\&.
-.RE
-.sp
-.RS 4
-.ie n \{\
-\h'-04'\(bu\h'+03'\c
-.\}
-.el \{\
-.sp -1
-.IP \(bu 2.3
-.\}
-\fB\-\-repeat=\fR\fB\fIN\fR\fR
-.sp
-Run each test
-\fIN\fR
-number of times\&.
-.RE
-.sp
-.RS 4
-.ie n \{\
-\h'-04'\(bu\h'+03'\c
-.\}
-.el \{\
-.sp -1
-.IP \(bu 2.3
-.\}
-\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\&.
-.RE
-.sp
-.RS 4
-.ie n \{\
-\h'-04'\(bu\h'+03'\c
-.\}
-.el \{\
-.sp -1
-.IP \(bu 2.3
-.\}
-\fB\-\-report\-times\fR
-.sp
-At the end of the test run, write a summary of how much time was spent in various phases of execution\&. If you run with
-\fB\-\-parallel\fR, the total will exceed the wall clock time passed, since it will be summed over all threads\&.
-.sp
-The times reported should only be treated as approximations, and the exact points where the time is taken may also change between releases\&. If the test run is aborted, including if a test fails and
-\fB\-\-force\fR
-is not in use, the time report will not be produced\&.
-.sp
-The
-\fB\-\-report\-times\fR
-is available from MySQL 5\&.5\&.
-.RE
-.sp
-.RS 4
-.ie n \{\
-\h'-04'\(bu\h'+03'\c
-.\}
-.el \{\
-.sp -1
-.IP \(bu 2.3
-.\}
-\fB\-\-retry=\fR\fB\fIN\fR\fR
-.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
-\fB\-\-force\fR
-is also used; without it, test execution will terminate after the first failure\&.
-.sp
-The
-\fB\-\-retry\fR
-and
-\fB\-\-retry\-failure\fR
-options do not affect how many times a test repeated with
-\fB\-\-repeat\fR
-may fail in total, as each repetition is considered a new test case, which may in turn be retried if it fails\&.
-.RE
-.sp
-.RS 4
-.ie n \{\
-\h'-04'\(bu\h'+03'\c
-.\}
-.el \{\
-.sp -1
-.IP \(bu 2.3
-.\}
-\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
-.RE
-.sp
-.RS 4
-.ie n \{\
-\h'-04'\(bu\h'+03'\c
-.\}
-.el \{\
-.sp -1
-.IP \(bu 2.3
-.\}
-\fB\-\-sanitize\fR
-.sp
-Scan the server log files for warnings from various sanitizers\&. Use of this option assumes that MySQL was configured with
-\fB\-DWITH_ASAN\fR
-or
-\fB\-DWITH_UBSAN\fR\&.
-.sp
-This option was added in MySQL 8\&.0\&.0\&. As of MySQL 8\&.0\&.1, the
-TSAN_OPTIONS
-environment variable can be set to specify the path name of a file containing ThreadSanitizer suppressions\&.
-.RE
-.sp
-.RS 4
-.ie n \{\
-\h'-04'\(bu\h'+03'\c
-.\}
-.el \{\
-.sp -1
-.IP \(bu 2.3
-.\}
-\fB\-\-shutdown\-timeout=\fR\fB\fIseconds\fR\fR
-.sp
-Max number of seconds to wait for servers to do controlled shutdown before killing them\&. Default is 10\&.
-.RE
-.sp
-.RS 4
-.ie n \{\
-\h'-04'\(bu\h'+03'\c
-.\}
-.el \{\
-.sp -1
-.IP \(bu 2.3
-.\}
-\fB\-\-skip\-combinations\fR
-.sp
-Do not apply combinations; ignore combinations file or option\&.
-.RE
-.sp
-.RS 4
-.ie n \{\
-\h'-04'\(bu\h'+03'\c
-.\}
-.el \{\
-.sp -1
-.IP \(bu 2.3
-.\}
-\fB\-\-skip\-ndbcluster\fR,
-\fB\-\-skip\-ndb\fR
-.sp
-Do not start NDB Cluster; skip Cluster test cases\&. This option only has effect if you do have NDB, if not it will have no effect as it cannot run those tests anyway\&.
-.RE
-.sp
-.RS 4
-.ie n \{\
-\h'-04'\(bu\h'+03'\c
-.\}
-.el \{\
-.sp -1
-.IP \(bu 2.3
-.\}
-\fB\-\-skip\-ndbcluster\-slave\fR,
-\fB\-\-skip\-ndb\-slave\fR
-.sp
-Do not start an NDB Cluster slave\&.
-.RE
-.sp
-.RS 4
-.ie n \{\
-\h'-04'\(bu\h'+03'\c
-.\}
-.el \{\
-.sp -1
-.IP \(bu 2.3
-.\}
-\fB\-\-skip\-rpl\fR
-.sp
-Skip replication test cases\&.
-.RE
-.sp
-.RS 4
-.ie n \{\
-\h'-04'\(bu\h'+03'\c
-.\}
-.el \{\
-.sp -1
-.IP \(bu 2.3
-.\}
-\fB\-\-skip\-ssl\fR
-.sp
-Do not start
-\fBmysqld\fR
-with support for SSL connections\&.
-.RE
-.sp
-.RS 4
-.ie n \{\
-\h'-04'\(bu\h'+03'\c
-.\}
-.el \{\
-.sp -1
-.IP \(bu 2.3
-.\}
-\fB\-\-skip\-test=\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
-The argument for the
-\fB\-\-skip\-test\fR
-option allows more flexible specification of which tests to skip\&. If the argument contains a pattern metacharacter other than a lone period, it is interpreted as a Perl regular expression and applies to test names that match the pattern\&. See the description of the
-\fB\-\-do\-test\fR
-option for details\&.
-.RE
-.sp
-.RS 4
-.ie n \{\
-\h'-04'\(bu\h'+03'\c
-.\}
-.el \{\
-.sp -1
-.IP \(bu 2.3
-.\}
-\fB\-\-skip\-test\-list=\fR\fB\fIfile\fR\fR
-.sp
-Specify a file listing tests that should be skipped (disabled)\&.
-.sp
-The file has the same format as the
-disabled\&.def
-file listing disabled tests\&. With this option, disabling can be done on a case by case basis\&. The
-\fB\-\-skip\-test\-list\fR
-option is supported from MySQL 5\&.5\&.
-.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
-options not otherwise recognized by
-\fBmysql\-test\-run\&.pl\fR
-are passed to the master server\&.
-.RE
-.sp
-.RS 4
-.ie n \{\
-\h'-04'\(bu\h'+03'\c
-.\}
-.el \{\
-.sp -1
-.IP \(bu 2.3
-.\}
-\fB\-\-sleep=\fR\fB\fIN\fR\fR
-.sp
-Pass
-\fB\-\-sleep=\fR\fB\fIN\fR\fR
-to
-\fBmysqltest\fR\&.
-.RE
-.sp
-.RS 4
-.ie n \{\
-\h'-04'\(bu\h'+03'\c
-.\}
-.el \{\
-.sp -1
-.IP \(bu 2.3
-.\}
-\fB\-\-sp\-protocol\fR
-.sp
-Pass the
-\fB\-\-sp\-protocol\fR
-option to
-\fBmysqltest\fR\&.
-.RE
-.sp
-.RS 4
-.ie n \{\
-\h'-04'\(bu\h'+03'\c
-.\}
-.el \{\
-.sp -1
-.IP \(bu 2.3
-.\}
-\fB\-\-ssl\fR
-.sp
-If
-\fBmysql\-test\-run\&.pl\fR
-is started with the
-\fB\-\-ssl\fR
-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
-exits with an error message:
-Couldn\*(Aqt find support for SSL
-.RE
-.sp
-.RS 4
-.ie n \{\
-\h'-04'\(bu\h'+03'\c
-.\}
-.el \{\
-.sp -1
-.IP \(bu 2.3
-.\}
-\fB\-\-start\fR
-.sp
-Initialize and start servers with the startup settings for the specified test case\&. You can use this option to start a server to which you can connect later\&. For example, after building a source distribution you can start a server and connect to it with the
-\fBmysql\fR
-client like this:
-.sp
-.if n \{\
-.RS 4
-.\}
-.nf
-shell> \fBcd mysql\-test\fR
-shell> \fB\&./mysql\-test\-run\&.pl \-\-start alias &\fR
-shell> \fB\&.\&./mysql \-S \&./var/tmp/master\&.sock \-h localhost \-u root\fR
-.fi
-.if n \{\
-.RE
-.\}
-.sp
-If no tests are named on the command line, the server(s) will be started with settings for the first test that would have been run without the
-\fB\-\-start\fR
-option\&.
-.sp
-\fBmysql\-test\-run\&.pl\fR
-will stop once the server has been started, but will terminate if the server dies\&. If killed, it will also shut down the server\&.
-.RE
-.sp
-.RS 4
-.ie n \{\
-\h'-04'\(bu\h'+03'\c
-.\}
-.el \{\
-.sp -1
-.IP \(bu 2.3
-.\}
-\fB\-\-start\-and\-exit\fR
-.sp
-This is similar to
-\fB\-\-start\fR, but
-\fBmysql\-test\-run\&.pl\fR
-terminates once the server has been started, leaving just the server process running\&.
-.RE
-.sp
-.RS 4
-.ie n \{\
-\h'-04'\(bu\h'+03'\c
-.\}
-.el \{\
-.sp -1
-.IP \(bu 2.3
-.\}
-\fB\-\-start\-dirty\fR
-.sp
-This is similar to
-\fB\-\-start\fR, but will skip the database initialization phase and assume that database files are already available\&. Usually this means you must have run another test first\&.
-.RE
-.sp
-.RS 4
-.ie n \{\
-\h'-04'\(bu\h'+03'\c
-.\}
-.el \{\
-.sp -1
-.IP \(bu 2.3
-.\}
-\fB\-\-start\-from=\fR\fB\fItest_name\fR\fR
-.sp
-\fBmysql\-test\-run\&.pl\fR
-sorts the list of names of the test cases to be run, and then begins with
-\fItest_name\fR\&.
-.RE
-.sp
-.RS 4
-.ie n \{\
-\h'-04'\(bu\h'+03'\c
-.\}
-.el \{\
-.sp -1
-.IP \(bu 2.3
-.\}
-\fB\-\-strace\-client\fR
-.sp
-Create
-\fBstrace\fR
-output for
-\fBmysqltest\fR\&. Will produce default
-\fBstrace\fR
-output as
-mysqltest\&.strace\&. Note that this will be overwritten for each new test case, so it\*(Aqs most useful for running only one test\&.
-.sp
-The
-\fBstrace\-client\fR
-option is functional from MySQL 5\&.5\&.20, and only supported on Linux\&. The option was available in earlier versions too, but was not working properly\&.
-.RE
-.sp
-.RS 4
-.ie n \{\
-\h'-04'\(bu\h'+03'\c
-.\}
-.el \{\
-.sp -1
-.IP \(bu 2.3
-.\}
-\fB\-\-strace\-server\fR
-.sp
-Create
-\fBstrace\fR
-output for the server\&. Will produce default
-\fBstrace\fR
-output as
-mysqld\&.1\&.strace\&. Note that this will be overwritten each time the server is restarted, so it\*(Aqs most useful for running a single test, or if you want trace from the first test that fails\&.
-.sp
-The
-\fBstrace\-server\fR
-option is available from MySQL 5\&.5\&.20, on Linux only\&.
-.RE
-.sp
-.RS 4
-.ie n \{\
-\h'-04'\(bu\h'+03'\c
-.\}
-.el \{\
-.sp -1
-.IP \(bu 2.3
-.\}
-\fB\-\-stress=\fR\fB\fIstress options\fR\fR
-.sp
-Start a server, but instead of running a test, run
-\fBmysql\-stress\-test\&.pl\fR
-with the supplied arguments\&. Arguments needed to communicate with the server will be automatically provided, the rest should be given as arguments to this option\&. Command line options for
-\fBmysql\-stress\-test\&.pl\fR
-should be separeted by a comma\&.
-.sp
-The
-\fBstress\fR
-option was added in MySQL 5\&.5\&.17, it is not a direct replacement for the option of the same name that exists in version 1 of
-\fBmysql\-test\-run\&.pl\fR\&.
-.RE
-.sp
-.RS 4
-.ie n \{\
-\h'-04'\(bu\h'+03'\c
-.\}
-.el \{\
-.sp -1
-.IP \(bu 2.3
-.\}
-\fB\-\-suite=\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)\&.
-.RE
-.sp
-.RS 4
-.ie n \{\
-\h'-04'\(bu\h'+03'\c
-.\}
-.el \{\
-.sp -1
-.IP \(bu 2.3
-.\}
-\fB\-\-suite\-timeout=\fR\fB\fIminutes\fR\fR
-.sp
-Specify the maximum test suite runtime in minutes\&.
-.RE
-.sp
-.RS 4
-.ie n \{\
-\h'-04'\(bu\h'+03'\c
-.\}
-.el \{\
-.sp -1
-.IP \(bu 2.3
-.\}
-\fB\-\-summary\-report=\fR\fB\fIfile_name\fR\fR
-.sp
-Generate a plain text version of the test summary only and write it to the file named as the option argument\&. The file is suitable for sending by email\&. This option was added in MySQL 8\&.0\&.1\&.
-.RE
-.sp
-.RS 4
-.ie n \{\
-\h'-04'\(bu\h'+03'\c
-.\}
-.el \{\
-.sp -1
-.IP \(bu 2.3
-.\}
-\fB\-\-test\-progress\fR
-.sp
-Display the percentage of tests remaining\&. This option was added in MySQL 5\&.7\&.19\&.
-.RE
-.sp
-.RS 4
-.ie n \{\
-\h'-04'\(bu\h'+03'\c
-.\}
-.el \{\
-.sp -1
-.IP \(bu 2.3
-.\}
-\fB\-\-testcase\-timeout=\fR\fB\fIminutes\fR\fR
-.sp
-Specify the maximum test case runtime in minutes\&.
-.RE
-.sp
-.RS 4
-.ie n \{\
-\h'-04'\(bu\h'+03'\c
-.\}
-.el \{\
-.sp -1
-.IP \(bu 2.3
-.\}
-\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\&.
-.RE
-.sp
-.RS 4
-.ie n \{\
-\h'-04'\(bu\h'+03'\c
-.\}
-.el \{\
-.sp -1
-.IP \(bu 2.3
-.\}
-\fB\-\-timer\fR
-.sp
-Cause
-\fBmysqltest\fR
-to generate a timing file\&. The default file is named
-\&./var/log/timer\&.
-.RE
-.sp
-.RS 4
-.ie n \{\
-\h'-04'\(bu\h'+03'\c
-.\}
-.el \{\
-.sp -1
-.IP \(bu 2.3
-.\}
-\fB\-\-timestamp\fR
-.sp
-Prints a timestamp before the test case name in each test report line, showing when the test ended\&.
-.RE
-.sp
-.RS 4
-.ie n \{\
-\h'-04'\(bu\h'+03'\c
-.\}
-.el \{\
-.sp -1
-.IP \(bu 2.3
-.\}
-\fB\-\-tmpdir=\fR\fB\fIpath\fR\fR
-.sp
-The directory where temporary file are stored\&. The default location is
-\&./var/tmp\&. The environment variable
-MYSQL_TMP_DIR
-will be set to the path for this directory, whether it has the default value or has been set explicitly\&. This may be referred to in tests\&.
-.RE
-.sp
-.RS 4
-.ie n \{\
-\h'-04'\(bu\h'+03'\c
-.\}
-.el \{\
-.sp -1
-.IP \(bu 2.3
-.\}
-\fB\-\-unit\-tests\fR
-.sp
-Force running of unit tests, overriding default behavior or setting of the
-MTR_UNIT_TESTS
-variable\&.
-.sp
-Running of unit tests was enabled from MySQL 5\&.5\&.11\&.
-.RE
-.sp
-.RS 4
-.ie n \{\
-\h'-04'\(bu\h'+03'\c
-.\}
-.el \{\
-.sp -1
-.IP \(bu 2.3
-.\}
-\fB\-\-unit\-tests\-report\fR
-.sp
-Extend the unit test run by also outputting the log from the test run, independently of whether it succeeded or not\&. This option implies
-\fB\-\-unit\-tests\fR
-so it is not necessary to specify both\&. The
-\fB\-\-unit\-tests\-report\fR
-option is available in MySQL 5\&.5 from version 5\&.5\&.44, in 5\&.6 from version 5\&.6\&.25 as well as in MySQL 5\&.7\&.
-.RE
-.sp
-.RS 4
-.ie n \{\
-\h'-04'\(bu\h'+03'\c
-.\}
-.el \{\
-.sp -1
-.IP \(bu 2.3
-.\}
-\fB\-\-user=\fR\fB\fIuser_name\fR\fR
-.sp
-The MySQL user name to use when connecting to the server\&.
-.RE
-.sp
-.RS 4
-.ie n \{\
-\h'-04'\(bu\h'+03'\c
-.\}
-.el \{\
-.sp -1
-.IP \(bu 2.3
-.\}
-\fB\-\-user\-args\fR
-.sp
-Drops all non\-essential command line arguments to the
-\fBmysqld\fR
-server, except those supplied with
-\fB\-\-mysqld\fR
-arguemnts, if any\&. Only works in combination with
-\fB\-\-start\fR,
-\fB\-\-start\-and\-exit\fR
-or
-\fB\-\-start\-dirty\fR, and only if no test name is given\&.
-.RE
-.sp
-.RS 4
-.ie n \{\
-\h'-04'\(bu\h'+03'\c
-.\}
-.el \{\
-.sp -1
-.IP \(bu 2.3
-.\}
-\fB\-\-valgrind\fR
-.sp
-Run
-\fBmysqltest\fR
-and
-\fBmysqld\fR
-with
-\fBvalgrind\fR\&. This and the following
-\fB\-\-valgrind\fR
-options require that the executables have been build with
-\fBvalgrind\fR
-support\&.
-.sp
-When the server is run with valgrind, an extra pass over the server log file(s) will be performed after all tests are run, and any report with problems that have been reported at server shutdown will be extracted and printed\&. The most common warnings are memory leaks\&. With each report will also be listed all tests that were run since previous server restart; one of these is likely to have caused the problem\&.
-.sp
-From MySQL 5\&.5\&.13, a final "pseudo" test named
-valgrind_report
-is added to the list of tests when the server is run in valgrind\&. This test is reported as failed if any such shutdown warnings were produced by valgrind\&. Pass or failure of this test is also added to the total test count reported\&.
-.RE
-.sp
-.RS 4
-.ie n \{\
-\h'-04'\(bu\h'+03'\c
-.\}
-.el \{\
-.sp -1
-.IP \(bu 2.3
-.\}
-\fB\-\-valgrind\-clients\fR
-.sp
-Run all clients started by
-\&.test
-files with
-\fBvalgrind\fR\&. This option requires
-\fBvalgrind\fR
-3\&.9 or later\&.
-.sp
-\fB\-\-valgrind\-clients\fR
-was added in MySQL 5\&.7\&.9\&.
-.RE
-.sp
-.RS 4
-.ie n \{\
-\h'-04'\(bu\h'+03'\c
-.\}
-.el \{\
-.sp -1
-.IP \(bu 2.3
-.\}
-\fB\-\-valgrind\-mysqld\fR
-.sp
-Run the
-\fBmysqld\fR
-server with
-\fBvalgrind\fR\&.
-.RE
-.sp
-.RS 4
-.ie n \{\
-\h'-04'\(bu\h'+03'\c
-.\}
-.el \{\
-.sp -1
-.IP \(bu 2.3
-.\}
-\fB\-\-valgrind\-mysqltest\fR
-.sp
-Run
-\fBmysqltest\fR
-with
-\fBvalgrind\fR\&.
-.RE
-.sp
-.RS 4
-.ie n \{\
-\h'-04'\(bu\h'+03'\c
-.\}
-.el \{\
-.sp -1
-.IP \(bu 2.3
-.\}
-\fB\-\-valgrind\-option=\fR\fB\fIstr\fR\fR
-.sp
-Extra options to pass to
-\fBvalgrind\fR\&.
-.RE
-.sp
-.RS 4
-.ie n \{\
-\h'-04'\(bu\h'+03'\c
-.\}
-.el \{\
-.sp -1
-.IP \(bu 2.3
-.\}
-\fB\-\-valgrind\-path=\fR\fB\fIpath\fR\fR
-.sp
-Specify the path name to the
-\fBvalgrind\fR
-executable\&.
-.RE
-.sp
-.RS 4
-.ie n \{\
-\h'-04'\(bu\h'+03'\c
-.\}
-.el \{\
-.sp -1
-.IP \(bu 2.3
-.\}
-\fB\-\-vardir=\fR\fB\fIpath\fR\fR
-.sp
-Specify the path where files generated during the test run are stored\&. The default location is
-\&./var\&. The environment variable
-MYSQLTEST_VARDIR
-will be set to the path for this directory, whether it has the default value or has been set explicitly\&. This may be referred to in tests\&.
-.RE
-.sp
-.RS 4
-.ie n \{\
-\h'-04'\(bu\h'+03'\c
-.\}
-.el \{\
-.sp -1
-.IP \(bu 2.3
-.\}
-\fB\-\-verbose\fR
-.sp
-Give more verbose output regarding test execution\&. Use the option twice to get even more output\&. Note that the output generated within each test case is not affected\&.
-.RE
-.sp
-.RS 4
-.ie n \{\
-\h'-04'\(bu\h'+03'\c
-.\}
-.el \{\
-.sp -1
-.IP \(bu 2.3
-.\}
-\fB\-\-verbose\-restart\fR
-.sp
-Write when and why servers are restarted between test cases\&.
-.RE
-.sp
-.RS 4
-.ie n \{\
-\h'-04'\(bu\h'+03'\c
-.\}
-.el \{\
-.sp -1
-.IP \(bu 2.3
-.\}
-\fB\-\-view\-protocol\fR
-.sp
-Pass the
-\fB\-\-view\-protocol\fR
-option to
-\fBmysqltest\fR\&.
-.RE
-.sp
-.RS 4
-.ie n \{\
-\h'-04'\(bu\h'+03'\c
-.\}
-.el \{\
-.sp -1
-.IP \(bu 2.3
-.\}
-\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\&.
-.RE
-.sp
-.RS 4
-.ie n \{\
-\h'-04'\(bu\h'+03'\c
-.\}
-.el \{\
-.sp -1
-.IP \(bu 2.3
-.\}
-\fB\-\-wait\-all\fR
-.sp
-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\&.
-.RE
-.sp
-.RS 4
-.ie n \{\
-\h'-04'\(bu\h'+03'\c
-.\}
-.el \{\
-.sp -1
-.IP \(bu 2.3
-.\}
-\fB\-\-warnings\fR
-.sp
-Search the server log for errors or warning after each test and report any suspicious ones; if any are found, the test will be marked as failed\&. This is the default behavior, it may be turned off with
-\fB\-\-nowarnings\fR\&.
-.RE
-.sp
-.RS 4
-.ie n \{\
-\h'-04'\(bu\h'+03'\c
-.\}
-.el \{\
-.sp -1
-.IP \(bu 2.3
-.\}
-\fB\-\-with\-ndbcluster\-only\fR
-.sp
-Run only test cases that have
-ndb
-in their name\&.
-.RE
-.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
-The hostname resolves to 127\&.0\&.0\&.1 and not to the actual IP address\&.
-.sp .5v
-.RE
-.SH "COPYRIGHT"
-.br
-.PP
-Copyright \(co 2006, 2017, Oracle and/or its affiliates. All rights reserved.
-.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
-This documentation is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
-.PP
-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 "NOTES"
-.IP " 1." 4
-The MySQL Test Framework, Version 2.0
-.RS 4
-\%http://dev.mysql.com/doc/dev/mysql-server/latest/PAGE_MYSQL_TEST_RUN.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/.
-.SH AUTHOR
-Oracle Corporation (http://dev.mysql.com/).
.\" Title: \fBmysql\fR
.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author]
.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
-.\" Date: 06/02/2017
+.\" Date: 06/15/2018
.\" Manual: MySQL Database System
.\" Source: MySQL 5.6
.\" Language: English
.\"
-.TH "\FBMYSQL\FR" "1" "06/02/2017" "MySQL 5\&.6" "MySQL Database System"
+.TH "\FBMYSQL\FR" "1" "06/15/2018" "MySQL 5\&.6" "MySQL Database System"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
\fB\-\-character\-sets\-dir=\fR\fB\fIdir_name\fR\fR
.sp
The directory where character sets are installed\&. See
-Section\ \&10.5, \(lqCharacter Set Configuration\(rq\&.
+Section\ \&10.14, \(lqCharacter Set Configuration\(rq\&.
.RE
.sp
.RS 4
\fB\-\-comments\fR,
\fB\-c\fR
.sp
-Whether to preserve comments in statements sent to the server\&. The default is
+Whether to strip or preserve comments in statements sent to the server\&. The default is
\fB\-\-skip\-comments\fR
-(discard comments), enable with
+(strip comments), enable with
\fB\-\-comments\fR
(preserve comments)\&.
.RE
client by default uses another\&. In this case, output may be formatted incorrectly\&. You can usually fix such issues by using this option to force the client to use the system character set instead\&.
.sp
For more information, see
-Section\ \&10.1.4, \(lqConnection Character Sets and Collations\(rq, and
-Section\ \&10.5, \(lqCharacter Set Configuration\(rq\&.
+Section\ \&10.4, \(lqConnection Character Sets and Collations\(rq, and
+Section\ \&10.14, \(lqCharacter Set Configuration\(rq\&.
.RE
.sp
.RS 4
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)\&.
+Section\ \&5.1.10, \(lqServer SQL Modes\(rq)\&.
.RE
.sp
.RS 4
or
\fB\-\-local\-infile=1\fR
to explicitly disable or enable
-LOCAL\&. Enabling local data loading has no effect if the server does not also support it; see
+LOCAL\&. Enabling local data loading also requires that the server permits it; see
Section\ \&6.1.6, \(lqSecurity Issues with LOAD DATA LOCAL\(rq
.RE
.sp
.sp -1
.IP \(bu 2.3
.\}
-\fB\-\-server\-public\-key\-path=\fR\fBfile_name\fR
+\fB\-\-server\-public\-key\-path=\fR\fB\fIfile_name\fR\fR
.sp
-The path name to a file containing the server RSA public key\&. The file must be in PEM format\&. The public key is used for RSA encryption of the client password for connections to the server made using accounts that authenticate with the
+The path name to a file containing a client\-side copy of the public key required by the server for RSA key pair\-based password exchange\&. The file must be in PEM format\&. This option applies to clients that connect to the server using an account that authenticates with the
sha256_password
-plugin\&. This option is ignored for client accounts that do not authenticate with that plugin\&. It is also ignored if password encryption is not needed, as is the case when the client connects to the server using an SSL connection\&.
+authentication plugin\&. This option is ignored for accounts that do not authenticate with one of those plugins\&. It is also ignored if RSA\-based password exchange is not used, as is the case when the client connects to the server using a secure connection\&.
.sp
-The server sends the public key to the client as needed, so it is not necessary to use this option for RSA password encryption to occur\&. It is more efficient to do so because then the server need not send the key\&.
+This option is available only if MySQL was built using OpenSSL\&.
.sp
-For additional discussion regarding use of the
+For information about the
sha256_password
-plugin, including how to get the RSA public key, see
+plugin, see
Section\ \&6.5.1.4, \(lqSHA-256 Pluggable Authentication\(rq\&.
-.sp
-This option is available only if MySQL was built using OpenSSL\&.
.RE
.sp
.RS 4
\fB\-\-shared\-memory\-base\-name=\fR\fB\fIname\fR\fR
.sp
On Windows, the shared\-memory name to use, for connections made using shared memory to a local server\&. The default value is
-MYSQL\&. The shared\-memory name is case sensitive\&.
+MYSQL\&. The shared\-memory name is case\-sensitive\&.
.sp
The server must be started with the
\fB\-\-shared\-memory\fR
Options that begin with
\fB\-\-ssl\fR
specify whether to connect to the server using SSL and indicate where to find SSL keys and certificates\&. See
-Section\ \&6.4.5, \(lqCommand Options for Secure Connections\(rq\&.
+Section\ \&6.4.2, \(lqCommand Options for Encrypted Connections\(rq\&.
.RE
.sp
.RS 4
is used with
\fBmysql\fR
matches that of
-\fBmysqldump \fR\fB\fB\-\-xml\fR\fR\&. See
-\fBmysqldump\fR(1)
-for details\&.
+\fBmysqldump\fR
+\fB\-\-xml\fR\&. See
+\fBmysqldump\fR(1), for details\&.
.sp
The XML output also uses an XML namespace, as shown here:
.sp
source
command)\&.
.PP
-Each command has both a long and short form\&. The long form is not case sensitive; the short form is\&. The long form can be followed by an optional semicolon terminator, but the short form should not\&.
+Each command has both a long and short form\&. The long form is not case\-sensitive; the short form is\&. The long form can be followed by an optional semicolon terminator, but the short form should not\&.
.PP
The use of short\-form commands within multiple\-line
/* \&.\&.\&. */
;, instances of that character are sent to the server without interpretation\&. However, the server itself still interprets
;
as a statement delimiter and processes statements accordingly\&. This behavior on the server side comes into play for multiple\-statement execution (see
-Section\ \&23.8.17, \(lqC API Support for Multiple Statement Execution\(rq), and for parsing the body of stored procedures and functions, triggers, and events (see
+Section\ \&23.8.16, \(lqC API Multiple Statement Execution Support\(rq), and for parsing the body of stored procedures and functions, triggers, and events (see
Section\ \&20.1, \(lqDefining Stored Programs\(rq)\&.
.RE
.sp
l l
l l.
T{
-\ec
+\c
T}:T{
A counter that increments for each statement you issue
T}
T{
-\eD
+\D
T}:T{
The full current date
T}
T{
-\ed
+\d
T}:T{
The default database
T}
T{
-\eh
+\h
T}:T{
The server host
T}
T{
-\el
+\l
T}:T{
The current delimiter
T}
T{
-\em
+\m
T}:T{
Minutes of the current time
T}
T{
-\en
+\n
T}:T{
A newline character
T}
T{
-\eO
+\O
T}:T{
-The current month in three\-letter format (Jan, Feb, \&...)
+The current month in three-letter format (Jan, Feb, \&...)
T}
T{
-\eo
+\o
T}:T{
The current month in numeric format
T}
T{
-\eP
+\P
T}:T{
am/pm
T}
T{
-\ep
+\p
T}:T{
The current TCP/IP port or socket file
T}
T{
-\eR
+\R
T}:T{
-The current time, in 24\-hour military time (0\(en23)
+The current time, in 24-hour military time (0\(en23)
T}
T{
-\er
+\r
T}:T{
-The current time, standard 12\-hour time (1\(en12)
+The current time, standard 12-hour time (1\(en12)
T}
T{
-\eS
+\S
T}:T{
Semicolon
T}
T{
-\es
+\s
T}:T{
Seconds of the current time
T}
T{
-\et
+\t
T}:T{
A tab character
T}
T{
-\eU
+\U
T}:T{
.PP
Your full
account name
T}
T{
-\eu
+\u
T}:T{
Your user name
T}
T{
-\ev
+\v
T}:T{
The server version
T}
T{
-\ew
+\w
T}:T{
-The current day of the week in three\-letter format (Mon, Tue, \&...)
+The current day of the week in three-letter format (Mon, Tue, \&...)
T}
T{
-\eY
+\Y
T}:T{
The current year, four digits
T}
T{
-\ey
+\y
T}:T{
The current year, two digits
T}
T{
-\e_
+\_
T}:T{
A space
T}
T{
-\e\ \&
+\\ \&
T}:T{
A space (a space follows the backslash)
T}
T{
-\e\*(Aq
+\'
T}:T{
Single quote
T}
T{
-\e"
+\"
T}:T{
Double quote
T}
T{
-\e\e
+\\
T}:T{
-A literal \e backslash character
+A literal \ backslash character
T}
T{
-\e\fIx\fR
+\\fIx\fR
T}:T{
.PP
\fIx\fR, for any
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
mysql
database be initialized with help topic information (see
-Section\ \&5.1.10, \(lqServer-Side Help\(rq)\&.
+Section\ \&5.1.13, \(lqServer-Side Help\(rq)\&.
.PP
If there is no match for the search string, the search fails:
.sp
.\}
.PP
See
-Section\ \&5.1.5, \(lqServer System Variables\(rq\&.
+Section\ \&5.1.7, \(lqServer System Variables\(rq\&.
.PP
The
SET
option\&.
.PP
For more information about auto\-reconnect and its effect on state information when a reconnection occurs, see
-Section\ \&23.8.16, \(lqControlling Automatic Reconnection Behavior\(rq\&.
+Section\ \&23.8.20, \(lqC API Automatic Reconnection Control\(rq\&.
.SH "COPYRIGHT"
.br
.PP
-Copyright \(co 1997, 2017, Oracle and/or its affiliates. All rights reserved.
+Copyright \(co 1997, 2018, Oracle and/or its affiliates. All rights reserved.
.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
.\" Title: \fBmysql.server\fR
.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author]
.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
-.\" Date: 06/02/2017
+.\" Date: 06/15/2018
.\" Manual: MySQL Database System
.\" Source: MySQL 5.6
.\" Language: English
.\"
-.TH "\FBMYSQL\&.SERVER\FR" "1" "06/02/2017" "MySQL 5\&.6" "MySQL Database System"
+.TH "\FBMYSQL\&.SERVER\FR" "1" "06/15/2018" "MySQL 5\&.6" "MySQL Database System"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
directory name
T}
T{
-pid\-file
+pid-file
T}:T{
File in which server should write its process ID
T}:T{
file name
T}
T{
-service\-startup\-timeout
+service-startup-timeout
T}:T{
How long to wait for server startup
T}:T{
.SH "COPYRIGHT"
.br
.PP
-Copyright \(co 1997, 2017, Oracle and/or its affiliates. All rights reserved.
+Copyright \(co 1997, 2018, Oracle and/or its affiliates. All rights reserved.
.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
+++ /dev/null
-'\" t
-.\" Title: \fBmysql_client_test\fR
-.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author]
-.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
-.\" Date: 06/01/2017
-.\" Manual: MySQL Database System
-.\" Source: MySQL
-.\" Language: English
-.\"
-.TH "\FBMYSQL_CLIENT_TEST" "1" "06/01/2017" "MySQL" "MySQL Database System"
-.\" -----------------------------------------------------------------
-.\" * Define some portability stuff
-.\" -----------------------------------------------------------------
-.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-.\" http://bugs.debian.org/507673
-.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
-.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-.ie \n(.g .ds Aq \(aq
-.el .ds Aq '
-.\" -----------------------------------------------------------------
-.\" * set default formatting
-.\" -----------------------------------------------------------------
-.\" disable hyphenation
-.nh
-.\" disable justification (adjust text to left margin only)
-.ad l
-.\" -----------------------------------------------------------------
-.\" * MAIN CONTENT STARTS HERE *
-.\" -----------------------------------------------------------------
-.SH "NAME"
-mysql_client_test \- test client API
-.br
-mysql_client_test_embedded \- test client API for embedded server
-.SH "SYNOPSIS"
-.HP \w'\fBmysql_client_test\ [\fR\fB\fIoptions\fR\fR\fB]\ [\fR\fB\fItest_name\fR\fR\fB]\ \&.\&.\&.\fR\ 'u
-\fBmysql_client_test [\fR\fB\fIoptions\fR\fR\fB] [\fR\fB\fItest_name\fR\fR\fB] \&.\&.\&.\fR
-.HP \w'\fBmysql_client_test_embedded\ [\fR\fB\fIoptions\fR\fR\fB]\ [\fR\fB\fItest_name\fR\fR\fB]\ \&.\&.\&.\fR\ 'u
-\fBmysql_client_test_embedded [\fR\fB\fIoptions\fR\fR\fB] [\fR\fB\fItest_name\fR\fR\fB] \&.\&.\&.\fR
-.SH "DESCRIPTION"
-.PP
-The
-\fBmysql_client_test\fR
-program is used for testing aspects of the MySQL client API that cannot be tested using
-\fBmysqltest\fR
-and its test language\&.
-\fBmysql_client_test\fR
-is run as part of the test suite\&.
-.PP
-\fBmysql_client_test_embedded\fR
-is similar but is used for testing the embedded server\&. This program is available only prior to MySQL 8\&.0\&.
-.PP
-The source code for the programs can be found in in
-tests/mysql_client_test\&.c
-in a source distribution\&. The program serves as a good source of examples illustrating how to use various features of the client API\&.
-.PP
-\fBmysql_client_test\fR
-is used in a test by the same name in the main tests suite of
-\fBmysql\-test\-run\&.pl\fR
-but may also be run directly\&. Unlike the other programs listed here, it does not read an external description of what tests to run\&. Instead, all tests are coded into the program, which is written to cover all aspects of the C language API\&.
-.PP
-\fBmysql_client_test\fR
-supports the following options:
-.sp
-.RS 4
-.ie n \{\
-\h'-04'\(bu\h'+03'\c
-.\}
-.el \{\
-.sp -1
-.IP \(bu 2.3
-.\}
-\fB\-\-help\fR,
-\fB\-?\fR
-.sp
-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
-.\}
-\fB\-\-basedir=\fR\fB\fIdir_name\fR\fR,
-\fB\-b \fR\fB\fIdir_name\fR\fR
-.sp
-The base directory for the tests\&.
-.RE
-.sp
-.RS 4
-.ie n \{\
-\h'-04'\(bu\h'+03'\c
-.\}
-.el \{\
-.sp -1
-.IP \(bu 2.3
-.\}
-\fB\-\-count=\fR\fB\fIcount\fR\fR,
-\fB\-t \fR\fB\fIcount\fR\fR
-.sp
-The number of times to execute the tests\&.
-.RE
-.sp
-.RS 4
-.ie n \{\
-\h'-04'\(bu\h'+03'\c
-.\}
-.el \{\
-.sp -1
-.IP \(bu 2.3
-.\}
-\fB\-\-database=\fR\fB\fIdb_name\fR\fR,
-\fB\-D \fR\fB\fIdb_name\fR\fR
-.sp
-The database to use\&.
-.RE
-.sp
-.RS 4
-.ie n \{\
-\h'-04'\(bu\h'+03'\c
-.\}
-.el \{\
-.sp -1
-.IP \(bu 2.3
-.\}
-\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
-\fIdebug_options\fR
-value is
-\*(Aqd:t:o,/tmp/mysql_client_test\&.trace\*(Aq\&.
-.RE
-.sp
-.RS 4
-.ie n \{\
-\h'-04'\(bu\h'+03'\c
-.\}
-.el \{\
-.sp -1
-.IP \(bu 2.3
-.\}
-\fB\-\-getopt\-ll\-test=\fR\fB\fIoption\fR\fR,
-\fB\-g \fR\fB\fIoption\fR\fR
-.sp
-Option to use for testing bugs in the
-getopt
-library\&.
-.RE
-.sp
-.RS 4
-.ie n \{\
-\h'-04'\(bu\h'+03'\c
-.\}
-.el \{\
-.sp -1
-.IP \(bu 2.3
-.\}
-\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
-.\}
-\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, you are prompted for one\&.
-.RE
-.sp
-.RS 4
-.ie n \{\
-\h'-04'\(bu\h'+03'\c
-.\}
-.el \{\
-.sp -1
-.IP \(bu 2.3
-.\}
-\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
-.\}
-\fB\-\-server\-arg=\fR\fB\fIarg\fR\fR,
-\fB\-A \fR\fB\fIarg\fR\fR
-.sp
-Argument to send to the embedded server\&. This option was removed in MySQL 8\&.0\&.
-.RE
-.sp
-.RS 4
-.ie n \{\
-\h'-04'\(bu\h'+03'\c
-.\}
-.el \{\
-.sp -1
-.IP \(bu 2.3
-.\}
-\fB\-\-show\-tests\fR,
-\fB\-T\fR
-.sp
-Show all test names\&.
-.RE
-.sp
-.RS 4
-.ie n \{\
-\h'-04'\(bu\h'+03'\c
-.\}
-.el \{\
-.sp -1
-.IP \(bu 2.3
-.\}
-\fB\-\-silent\fR,
-\fB\-s\fR
-.sp
-Be more silent\&.
-.RE
-.sp
-.RS 4
-.ie n \{\
-\h'-04'\(bu\h'+03'\c
-.\}
-.el \{\
-.sp -1
-.IP \(bu 2.3
-.\}
-\fB\-\-socket=\fR\fB\fIpath\fR\fR,
-\fB\-S \fR\fB\fIpath\fR\fR
-.sp
-The socket file to use when connecting to
-localhost
-(which is the default host)\&.
-.RE
-.sp
-.RS 4
-.ie n \{\
-\h'-04'\(bu\h'+03'\c
-.\}
-.el \{\
-.sp -1
-.IP \(bu 2.3
-.\}
-\fB\-\-testcase\fR,
-\fB\-c\fR
-.sp
-The option is used when called from
-\fBmysql\-test\-run\&.pl\fR, so that
-\fBmysql_client_test\fR
-may optionally behave in a different way than if called manually, for example by skipping some tests\&. Currently, there is no difference in behavior but the option is included to make this possible\&.
-.RE
-.sp
-.RS 4
-.ie n \{\
-\h'-04'\(bu\h'+03'\c
-.\}
-.el \{\
-.sp -1
-.IP \(bu 2.3
-.\}
-\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\&.
-.RE
-.sp
-.RS 4
-.ie n \{\
-\h'-04'\(bu\h'+03'\c
-.\}
-.el \{\
-.sp -1
-.IP \(bu 2.3
-.\}
-\fB\-v \fR\fB\fIdir_name\fR\fR,
-\fB\-\-vardir=\fR\fB\fIdir_name\fR\fR
-.sp
-The data directory for tests\&. The default is
-mysql\-test/var\&.
-.RE
-.SH "COPYRIGHT"
-.br
-.PP
-Copyright \(co 2006, 2017, Oracle and/or its affiliates. All rights reserved.
-.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
-This documentation is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
-.PP
-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/.
-.SH AUTHOR
-Oracle Corporation (http://dev.mysql.com/).
+++ /dev/null
-.so mysql_client_test.1
.\" Title: \fBmysql_config\fR
.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author]
.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
-.\" Date: 06/02/2017
+.\" Date: 06/15/2018
.\" Manual: MySQL Database System
.\" Source: MySQL 5.6
.\" Language: English
.\"
-.TH "\FBMYSQL_CONFIG\FR" "1" "06/02/2017" "MySQL 5\&.6" "MySQL Database System"
+.TH "\FBMYSQL_CONFIG\FR" "1" "06/15/2018" "MySQL 5\&.6" "MySQL Database System"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.SH "COPYRIGHT"
.br
.PP
-Copyright \(co 1997, 2017, Oracle and/or its affiliates. All rights reserved.
+Copyright \(co 1997, 2018, Oracle and/or its affiliates. All rights reserved.
.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
.\" Title: \fBmysql_config_editor\fR
.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author]
.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
-.\" Date: 06/02/2017
+.\" Date: 06/15/2018
.\" Manual: MySQL Database System
.\" Source: MySQL 5.6
.\" Language: English
.\"
-.TH "\FBMYSQL_CONFIG_EDIT" "1" "06/02/2017" "MySQL 5\&.6" "MySQL Database System"
+.TH "\FBMYSQL_CONFIG_EDITOR\FR" "1" "06/15/2018" "MySQL 5\&.6" "MySQL Database System"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
Options read from the login path file take precedence over options read from other option files\&. Options read from login path groups appearing later in the login path file take precedence over options read from groups appearing earlier in the file\&.
.PP
\fBmysql_config_editor\fR
-adds login paths to the login path file in the order you create them, so you should create more general login paths first and more specific paths later\&. If you need to move a login path within the file, you can remove it, then recreate it to add it to the end\&.
+adds login paths to the login path file in the order you create them, so you should create more general login paths first and more specific paths later\&. If you need to move a login path within the file, you can remove it, then recreate it to add it to the end\&. For example, a
+client
+login path is more general because it is read by all client programs, whereas a
+mysqldump
+login path is read only by
+\fBmysqldump\fR\&. Options specified later override options specified earlier, so putting the login paths in the order
+client,
+mysqldump
+enables
+\fBmysqldump\fR\-specific options to override
+client
+options\&.
.PP
When you use the
set
.SH "COPYRIGHT"
.br
.PP
-Copyright \(co 1997, 2017, Oracle and/or its affiliates. All rights reserved.
+Copyright \(co 1997, 2018, Oracle and/or its affiliates. All rights reserved.
.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
.\" Title: \fBmysql_convert_table_format\fR
.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author]
.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
-.\" Date: 06/02/2017
+.\" Date: 06/15/2018
.\" Manual: MySQL Database System
.\" Source: MySQL 5.6
.\" Language: English
.\"
-.TH "\FBMYSQL_CONVERT_TAB" "1" "06/02/2017" "MySQL 5\&.6" "MySQL Database System"
+.TH "\FBMYSQL_CONVERT_TABLE_FORMAT\FR" "1" "06/15/2018" "MySQL 5\&.6" "MySQL Database System"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.SH "COPYRIGHT"
.br
.PP
-Copyright \(co 1997, 2017, Oracle and/or its affiliates. All rights reserved.
+Copyright \(co 1997, 2018, Oracle and/or its affiliates. All rights reserved.
.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
.\" Title: \fBmysql_find_rows\fR
.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author]
.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
-.\" Date: 06/02/2017
+.\" Date: 06/15/2018
.\" Manual: MySQL Database System
.\" Source: MySQL 5.6
.\" Language: English
.\"
-.TH "\FBMYSQL_FIND_ROWS\F" "1" "06/02/2017" "MySQL 5\&.6" "MySQL Database System"
+.TH "\FBMYSQL_FIND_ROWS\FR" "1" "06/15/2018" "MySQL 5\&.6" "MySQL Database System"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.SH "COPYRIGHT"
.br
.PP
-Copyright \(co 1997, 2017, Oracle and/or its affiliates. All rights reserved.
+Copyright \(co 1997, 2018, Oracle and/or its affiliates. All rights reserved.
.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
.\" Title: \fBmysql_fix_extensions\fR
.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author]
.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
-.\" Date: 06/02/2017
+.\" Date: 06/15/2018
.\" Manual: MySQL Database System
.\" Source: MySQL 5.6
.\" Language: English
.\"
-.TH "\FBMYSQL_FIX_EXTENSI" "1" "06/02/2017" "MySQL 5\&.6" "MySQL Database System"
+.TH "\FBMYSQL_FIX_EXTENSIONS\FR" "1" "06/15/2018" "MySQL 5\&.6" "MySQL Database System"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.SH "COPYRIGHT"
.br
.PP
-Copyright \(co 1997, 2017, Oracle and/or its affiliates. All rights reserved.
+Copyright \(co 1997, 2018, Oracle and/or its affiliates. All rights reserved.
.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
.\" Title: \fBmysql_install_db\fR
.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author]
.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
-.\" Date: 06/02/2017
+.\" Date: 06/15/2018
.\" Manual: MySQL Database System
.\" Source: MySQL 5.6
.\" Language: English
.\"
-.TH "\FBMYSQL_INSTALL_DB\" "1" "06/02/2017" "MySQL 5\&.6" "MySQL Database System"
+.TH "\FBMYSQL_INSTALL_DB\FR" "1" "06/15/2018" "MySQL 5\&.6" "MySQL Database System"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
sql_mode
system variable to
NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES\&. This setting produces a server configuration that results in errors rather than warnings for bad data in operations that modify transactional tables\&. See
-Section\ \&5.1.8, \(lqServer SQL Modes\(rq\&.
+Section\ \&5.1.10, \(lqServer SQL Modes\(rq\&.
.PP
To invoke
\fBmysql_install_db\fR, use the following syntax:
.SH "COPYRIGHT"
.br
.PP
-Copyright \(co 1997, 2017, Oracle and/or its affiliates. All rights reserved.
+Copyright \(co 1997, 2018, Oracle and/or its affiliates. All rights reserved.
.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
.\" Title: \fBmysql_plugin\fR
.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author]
.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
-.\" Date: 06/02/2017
+.\" Date: 06/15/2018
.\" Manual: MySQL Database System
.\" Source: MySQL 5.6
.\" Language: English
.\"
-.TH "\FBMYSQL_PLUGIN\FR" "1" "06/02/2017" "MySQL 5\&.6" "MySQL Database System"
+.TH "\FBMYSQL_PLUGIN\FR" "1" "06/15/2018" "MySQL 5\&.6" "MySQL Database System"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
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.5.2, \(lqInstalling and Uninstalling Plugins\(rq\&.
+Section\ \&5.5.1, \(lqInstalling and Uninstalling Plugins\(rq\&.
.PP
Each invocation of
\fBmysql_plugin\fR
ENABLE
or
DISABLE
-(not case sensitive) specify whether to enable or disable components of the plugin library named in the configuration file\&. The order of the
+(not case\-sensitive) specify whether to enable or disable components of the plugin library named in the configuration file\&. The order of the
\fIplugin\fR
and
ENABLE
.SH "COPYRIGHT"
.br
.PP
-Copyright \(co 1997, 2017, Oracle and/or its affiliates. All rights reserved.
+Copyright \(co 1997, 2018, Oracle and/or its affiliates. All rights reserved.
.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
.\" Title: \fBmysql_secure_installation\fR
.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author]
.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
-.\" Date: 06/02/2017
+.\" Date: 06/15/2018
.\" Manual: MySQL Database System
.\" Source: MySQL 5.6
.\" Language: English
.\"
-.TH "\FBMYSQL_SECURE_INST" "1" "06/02/2017" "MySQL 5\&.6" "MySQL Database System"
+.TH "\FBMYSQL_SECURE_INSTALLATION\FR" "1" "06/15/2018" "MySQL 5\&.6" "MySQL Database System"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.SH "COPYRIGHT"
.br
.PP
-Copyright \(co 1997, 2017, Oracle and/or its affiliates. All rights reserved.
+Copyright \(co 1997, 2018, Oracle and/or its affiliates. All rights reserved.
.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
.\" Title: \fBmysql_setpermission\fR
.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author]
.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
-.\" Date: 06/02/2017
+.\" Date: 06/15/2018
.\" Manual: MySQL Database System
.\" Source: MySQL 5.6
.\" Language: English
.\"
-.TH "\FBMYSQL_SETPERMISSI" "1" "06/02/2017" "MySQL 5\&.6" "MySQL Database System"
+.TH "\FBMYSQL_SETPERMISSION\FR" "1" "06/15/2018" "MySQL 5\&.6" "MySQL Database System"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.SH "COPYRIGHT"
.br
.PP
-Copyright \(co 1997, 2017, Oracle and/or its affiliates. All rights reserved.
+Copyright \(co 1997, 2018, Oracle and/or its affiliates. All rights reserved.
.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
.\" Title: \fBmysql_tzinfo_to_sql\fR
.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author]
.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
-.\" Date: 06/02/2017
+.\" Date: 06/15/2018
.\" Manual: MySQL Database System
.\" Source: MySQL 5.6
.\" Language: English
.\"
-.TH "\FBMYSQL_TZINFO_TO_S" "1" "06/02/2017" "MySQL 5\&.6" "MySQL Database System"
+.TH "\FBMYSQL_TZINFO_TO_SQL\FR" "1" "06/15/2018" "MySQL 5\&.6" "MySQL Database System"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
/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\ \&10.6, \(lqMySQL Server Time Zone Support\(rq\&.
+Section\ \&5.1.12, \(lqMySQL Server Time Zone Support\(rq\&.
.PP
\fBmysql_tzinfo_to_sql\fR
can be invoked several ways:
.SH "COPYRIGHT"
.br
.PP
-Copyright \(co 1997, 2017, Oracle and/or its affiliates. All rights reserved.
+Copyright \(co 1997, 2018, Oracle and/or its affiliates. All rights reserved.
.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
.\" Title: \fBmysql_upgrade\fR
.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author]
.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
-.\" Date: 06/02/2017
+.\" Date: 06/15/2018
.\" Manual: MySQL Database System
.\" Source: MySQL 5.6
.\" Language: English
.\"
-.TH "\FBMYSQL_UPGRADE\FR" "1" "06/02/2017" "MySQL 5\&.6" "MySQL Database System"
+.TH "\FBMYSQL_UPGRADE\FR" "1" "06/15/2018" "MySQL 5\&.6" "MySQL Database System"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.PP
\fBmysql_upgrade\fR
does not upgrade the contents of the help tables\&. For upgrade instructions, see
-Section\ \&5.1.10, \(lqServer-Side Help\(rq\&.
+Section\ \&5.1.13, \(lqServer-Side Help\(rq\&.
.PP
By default,
\fBmysql_upgrade\fR
\fB\-\-character\-sets\-dir=\fR\fB\fIdir_name\fR\fR
.sp
The directory where character sets are installed\&. See
-Section\ \&10.5, \(lqCharacter Set Configuration\(rq\&.
+Section\ \&10.14, \(lqCharacter Set Configuration\(rq\&.
.RE
.sp
.RS 4
Use
\fIcharset_name\fR
as the default character set\&. See
-Section\ \&10.5, \(lqCharacter Set Configuration\(rq\&.
+Section\ \&10.14, \(lqCharacter Set Configuration\(rq\&.
.RE
.sp
.RS 4
\fB\-\-shared\-memory\-base\-name=\fR\fB\fIname\fR\fR
.sp
On Windows, the shared\-memory name to use, for connections made using shared memory to a local server\&. The default value is
-MYSQL\&. The shared\-memory name is case sensitive\&.
+MYSQL\&. The shared\-memory name is case\-sensitive\&.
.sp
The server must be started with the
\fB\-\-shared\-memory\fR
Options that begin with
\fB\-\-ssl\fR
specify whether to connect to the server using SSL and indicate where to find SSL keys and certificates\&. See
-Section\ \&6.4.5, \(lqCommand Options for Secure Connections\(rq\&.
+Section\ \&6.4.2, \(lqCommand Options for Encrypted Connections\(rq\&.
.RE
.sp
.RS 4
\fB\-\-skip\-write\-binlog\fR
option effectively does nothing\&.)
.sp
-Running
-\fBmysql_upgrade\fR
-is not recommended with a MySQL Server that is running with global transaction identifiers enabled (Bug #13833710)\&. This is because enabling GTIDs means that any updates which
-\fBmysql_upgrade\fR
-might need to perform on system tables using a nontransactional storage engine such as
-MyISAM
-to fail\&. See
-Section\ \&17.1.3.4, \(lqRestrictions on Replication with GTIDs\(rq, for more information\&.
+When the server is running with global transaction identifiers (GTIDs) enabled (gtid_mode=ON), do not enable binary logging by
+\fBmysql_upgrade\fR\&.
.RE
.SH "COPYRIGHT"
.br
.PP
-Copyright \(co 1997, 2017, Oracle and/or its affiliates. All rights reserved.
+Copyright \(co 1997, 2018, Oracle and/or its affiliates. All rights reserved.
.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
.\" Title: \fBmysql_waitpid\fR
.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author]
.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
-.\" Date: 06/02/2017
+.\" Date: 06/15/2018
.\" Manual: MySQL Database System
.\" Source: MySQL 5.6
.\" Language: English
.\"
-.TH "\FBMYSQL_WAITPID\FR" "1" "06/02/2017" "MySQL 5\&.6" "MySQL Database System"
+.TH "\FBMYSQL_WAITPID\FR" "1" "06/15/2018" "MySQL 5\&.6" "MySQL Database System"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.SH "COPYRIGHT"
.br
.PP
-Copyright \(co 1997, 2017, Oracle and/or its affiliates. All rights reserved.
+Copyright \(co 1997, 2018, Oracle and/or its affiliates. All rights reserved.
.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
.\" Title: \fBmysql_zap\fR
.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author]
.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
-.\" Date: 06/02/2017
+.\" Date: 06/15/2018
.\" Manual: MySQL Database System
.\" Source: MySQL 5.6
.\" Language: English
.\"
-.TH "\FBMYSQL_ZAP\FR" "1" "06/02/2017" "MySQL 5\&.6" "MySQL Database System"
+.TH "\FBMYSQL_ZAP\FR" "1" "06/15/2018" "MySQL 5\&.6" "MySQL Database System"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.SH "COPYRIGHT"
.br
.PP
-Copyright \(co 1997, 2017, Oracle and/or its affiliates. All rights reserved.
+Copyright \(co 1997, 2018, Oracle and/or its affiliates. All rights reserved.
.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
.\" Title: \fBmysqlaccess\fR
.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author]
.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
-.\" Date: 06/02/2017
+.\" Date: 06/15/2018
.\" Manual: MySQL Database System
.\" Source: MySQL 5.6
.\" Language: English
.\"
-.TH "\FBMYSQLACCESS\FR" "1" "06/02/2017" "MySQL 5\&.6" "MySQL Database System"
+.TH "\FBMYSQLACCESS\FR" "1" "06/15/2018" "MySQL 5\&.6" "MySQL Database System"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.SH "COPYRIGHT"
.br
.PP
-Copyright \(co 1997, 2017, Oracle and/or its affiliates. All rights reserved.
+Copyright \(co 1997, 2018, Oracle and/or its affiliates. All rights reserved.
.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
.\" Title: \fBmysqladmin\fR
.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author]
.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
-.\" Date: 06/02/2017
+.\" Date: 06/15/2018
.\" Manual: MySQL Database System
.\" Source: MySQL 5.6
.\" Language: English
.\"
-.TH "\FBMYSQLADMIN\FR" "1" "06/02/2017" "MySQL 5\&.6" "MySQL Database System"
+.TH "\FBMYSQLADMIN\FR" "1" "06/15/2018" "MySQL 5\&.6" "MySQL Database System"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.\}
debug
.sp
-Tell the server to write debug information to the error log\&. Format and content of this information is subject to change\&.
+Tell the server to write debug information to the error log\&. The connected user must have the
+SUPER
+privilege\&. Format and content of this information is subject to change\&.
.sp
This includes information about the Event Scheduler\&. See
Section\ \&20.4.5, \(lqEvent Scheduler Status\(rq\&.
kill \fIid\fR,\fIid\fR,\&.\&.\&.
.sp
Kill server threads\&. If multiple thread ID values are given, there must be no spaces in the list\&.
+.sp
+To kill threads belonging to other users, the connected user must have the
+SUPER
+privilege\&.
.RE
.sp
.RS 4
for connecting to the server\&. Thus, the next time you invoke
\fBmysqladmin\fR
(or any other client program) using the same account, you will need to specify the new password\&.
+.if n \{\
.sp
+.\}
+.RS 4
+.it 1 an-trap
+.nr an-no-space-flag 1
+.nr an-break-flag 1
+.br
+.ps +1
+\fBWarning\fR
+.ps -1
+.br
+Setting a password using
+\fBmysqladmin\fR
+should be considered
+\fIinsecure\fR\&. On some systems, your password becomes visible to system status programs such as
+\fBps\fR
+that may be invoked by other users to display command lines\&. MySQL clients typically overwrite the command\-line password argument with zeros during their initialization sequence\&. However, there is still a brief interval during which the value is visible\&. Also, on some systems this overwriting strategy is ineffective and the password remains visible to
+\fBps\fR\&. (SystemV Unix systems and perhaps others are subject to this problem\&.)
+.sp .5v
+.RE
If the
\fInew_password\fR
value contains spaces or other characters that are special to your command interpreter, you need to enclose it within quotation marks\&. On Windows, be sure to use double quotation marks rather than single quotation marks; single quotation marks are not stripped from the password, but rather are interpreted as part of the password\&. For example:
\fB\-\-character\-sets\-dir=\fR\fB\fIdir_name\fR\fR
.sp
The directory where character sets are installed\&. See
-Section\ \&10.5, \(lqCharacter Set Configuration\(rq\&.
+Section\ \&10.14, \(lqCharacter Set Configuration\(rq\&.
.RE
.sp
.RS 4
Use
\fIcharset_name\fR
as the default character set\&. See
-Section\ \&10.5, \(lqCharacter Set Configuration\(rq\&.
+Section\ \&10.14, \(lqCharacter Set Configuration\(rq\&.
.RE
.sp
.RS 4
\fB\-\-shared\-memory\-base\-name=\fR\fB\fIname\fR\fR
.sp
On Windows, the shared\-memory name to use, for connections made using shared memory to a local server\&. The default value is
-MYSQL\&. The shared\-memory name is case sensitive\&.
+MYSQL\&. The shared\-memory name is case\-sensitive\&.
.sp
The server must be started with the
\fB\-\-shared\-memory\fR
Options that begin with
\fB\-\-ssl\fR
specify whether to connect to the server using SSL and indicate where to find SSL keys and certificates\&. See
-Section\ \&6.4.5, \(lqCommand Options for Secure Connections\(rq\&.
+Section\ \&6.4.2, \(lqCommand Options for Encrypted Connections\(rq\&.
.RE
.sp
.RS 4
.SH "COPYRIGHT"
.br
.PP
-Copyright \(co 1997, 2017, Oracle and/or its affiliates. All rights reserved.
+Copyright \(co 1997, 2018, Oracle and/or its affiliates. All rights reserved.
.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
.\" Title: \fBmysqlbinlog\fR
.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author]
.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
-.\" Date: 06/02/2017
+.\" Date: 06/15/2018
.\" Manual: MySQL Database System
.\" Source: MySQL 5.6
.\" Language: English
.\"
-.TH "\FBMYSQLBINLOG\FR" "1" "06/02/2017" "MySQL 5\&.6" "MySQL Database System"
+.TH "\FBMYSQLBINLOG\FR" "1" "06/15/2018" "MySQL 5\&.6" "MySQL Database System"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.sp
This option determines when events should be displayed encoded as base\-64 strings using
BINLOG
-statements\&. The option has these permissible values (not case sensitive):
+statements\&. The option has these permissible values (not case\-sensitive):
.sp
.RS 4
.ie n \{\
\fB\-\-binlog\-row\-event\-max\-size=\fR\fB\fIN\fR\fR
.TS
allbox tab(:);
-l l s s
-l l l s
-^ l l s
-^ l l s
-^ l l s.
+lB lB.
T{
-\fBCommand\-Line Format\fR
+Property
T}:T{
-\-\-binlog\-row\-event\-max\-size=#
+Value
T}
+.T&
+l l
+l l
+l l
+l l
+l l.
T{
-\fBPermitted Values\fR (64\-bit platforms)
+\fBCommand-Line Format\fR
T}:T{
-\fBType\fR
+--binlog-row-event-max-size=#
+T}
+T{
+\fBType\fR (64-bit platforms)
T}:T{
numeric
T}
-:T{
-\fBDefault\fR
+T{
+\fBDefault Value\fR (64-bit platforms)
T}:T{
4294967040
T}
-:T{
-\fBMin Value\fR
+T{
+\fBMinimum Value\fR (64-bit platforms)
T}:T{
256
T}
-:T{
-\fBMax Value\fR
+T{
+\fBMaximum Value\fR (64-bit platforms)
T}:T{
18446744073709547520
T}
\fB\-\-character\-sets\-dir=\fR\fB\fIdir_name\fR\fR
.sp
The directory where character sets are installed\&. See
-Section\ \&10.5, \(lqCharacter Set Configuration\(rq\&.
+Section\ \&10.14, \(lqCharacter Set Configuration\(rq\&.
.RE
.sp
.RS 4
\fB\-\-shared\-memory\-base\-name=\fR\fB\fIname\fR\fR
.sp
On Windows, the shared\-memory name to use, for connections made using shared memory to a local server\&. The default value is
-MYSQL\&. The shared\-memory name is case sensitive\&.
+MYSQL\&. The shared\-memory name is case\-sensitive\&.
.sp
The server must be started with the
\fB\-\-shared\-memory\fR
Options that begin with
\fB\-\-ssl\fR
specify whether to connect to the server using SSL and indicate where to find SSL keys and certificates\&. See
-Section\ \&6.4.5, \(lqCommand Options for Secure Connections\(rq\&.
+Section\ \&6.4.2, \(lqCommand Options for Encrypted Connections\(rq\&.
.RE
.sp
.RS 4
T}:T{
UNKNOWN_EVENT
T}:T{
-This event should never be present in the log\&.
+This event should never be present in the log.
T}
T{
01
T}:T{
START_EVENT_V3
T}:T{
-This indicates the start of a log file written by MySQL 4 or earlier\&.
+This indicates the start of a log file written by MySQL 4 or earlier.
T}
T{
02
T}:T{
QUERY_EVENT
T}:T{
-The most common type of events\&. These contain statements executed on the
- master\&.
+The most common type of events. These contain statements executed on the
+ master.
T}
T{
03
T}:T{
STOP_EVENT
T}:T{
-Indicates that master has stopped\&.
+Indicates that master has stopped.
T}
T{
04
T}:T{
ROTATE_EVENT
T}:T{
-Written when the master switches to a new log file\&.
+Written when the master switches to a new log file.
T}
T{
05
INTVAR_EVENT
T}:T{
Used for AUTO_INCREMENT values or when the
- LAST_INSERT_ID()
- function is used in the statement\&.
+ LAST_INSERT_ID()
+ function is used in the statement.
T}
T{
06
LOAD_EVENT
T}:T{
Used for LOAD DATA
- INFILE in MySQL 3\&.23\&.
+ INFILE in MySQL 3.23.
T}
T{
07
T}:T{
SLAVE_EVENT
T}:T{
-Reserved for future use\&.
+Reserved for future use.
T}
T{
08
CREATE_FILE_EVENT
T}:T{
Used for LOAD DATA
- INFILE statements\&. This indicates the
- start of execution of such a statement\&. A temporary
- file is created on the slave\&. Used in MySQL 4 only\&.
+ INFILE statements. This indicates the start
+ of execution of such a statement. A temporary file is
+ created on the slave. Used in MySQL 4 only.
T}
T{
09
APPEND_BLOCK_EVENT
T}:T{
Contains data for use in a
- LOAD DATA
- INFILE statement\&. The data is stored in
- the temporary file on the slave\&.
+ LOAD DATA
+ INFILE statement. The data is stored in the
+ temporary file on the slave.
T}
T{
0a
EXEC_LOAD_EVENT
T}:T{
Used for LOAD DATA
- INFILE statements\&. The contents of the
- temporary file is stored in the table on the slave\&.
- Used in MySQL 4 only\&.
+ INFILE statements. The contents of the
+ temporary file is stored in the table on the slave.
+ Used in MySQL 4 only.
T}
T{
0b
DELETE_FILE_EVENT
T}:T{
Rollback of a LOAD DATA
- INFILE statement\&. The temporary file
- should be deleted on the slave\&.
+ INFILE statement. The temporary file should
+ be deleted on the slave.
T}
T{
0c
NEW_LOAD_EVENT
T}:T{
Used for LOAD DATA
- INFILE in MySQL 4 and earlier\&.
+ INFILE in MySQL 4 and earlier.
T}
T{
0d
RAND_EVENT
T}:T{
Used to send information about random values if the
- RAND() function is
- used in the statement\&.
+ RAND() function is used
+ in the statement.
T}
T{
0e
T}:T{
USER_VAR_EVENT
T}:T{
-Used to replicate user variables\&.
+Used to replicate user variables.
T}
T{
0f
T}:T{
FORMAT_DESCRIPTION_EVENT
T}:T{
-This indicates the start of a log file written by MySQL 5 or later\&.
+This indicates the start of a log file written by MySQL 5 or later.
T}
T{
10
T}:T{
XID_EVENT
T}:T{
-Event indicating commit of an XA transaction\&.
+Event indicating commit of an XA transaction.
T}
T{
11
BEGIN_LOAD_QUERY_EVENT
T}:T{
Used for LOAD DATA
- INFILE statements in MySQL 5 and later\&.
+ INFILE statements in MySQL 5 and later.
T}
T{
12
EXECUTE_LOAD_QUERY_EVENT
T}:T{
Used for LOAD DATA
- INFILE statements in MySQL 5 and later\&.
+ INFILE statements in MySQL 5 and later.
T}
T{
13
T}:T{
TABLE_MAP_EVENT
T}:T{
-Information about a table definition\&. Used in MySQL 5\&.1\&.5 and later\&.
+Information about a table definition. Used in MySQL 5.1.5 and later.
T}
T{
14
T}:T{
PRE_GA_WRITE_ROWS_EVENT
T}:T{
-Row data for a single table that should be created\&. Used in MySQL 5\&.1\&.5
- to 5\&.1\&.17\&.
+Row data for a single table that should be created. Used in MySQL 5.1.5
+ to 5.1.17.
T}
T{
15
T}:T{
PRE_GA_UPDATE_ROWS_EVENT
T}:T{
-Row data for a single table that needs to be updated\&. Used in MySQL
- 5\&.1\&.5 to 5\&.1\&.17\&.
+Row data for a single table that needs to be updated. Used in MySQL
+ 5.1.5 to 5.1.17.
T}
T{
16
T}:T{
PRE_GA_DELETE_ROWS_EVENT
T}:T{
-Row data for a single table that should be deleted\&. Used in MySQL 5\&.1\&.5
- to 5\&.1\&.17\&.
+Row data for a single table that should be deleted. Used in MySQL 5.1.5
+ to 5.1.17.
T}
T{
17
T}:T{
WRITE_ROWS_EVENT
T}:T{
-Row data for a single table that should be created\&. Used in MySQL 5\&.1\&.18
- and later\&.
+Row data for a single table that should be created. Used in MySQL 5.1.18
+ and later.
T}
T{
18
T}:T{
UPDATE_ROWS_EVENT
T}:T{
-Row data for a single table that needs to be updated\&. Used in MySQL
- 5\&.1\&.18 and later\&.
+Row data for a single table that needs to be updated. Used in MySQL
+ 5.1.18 and later.
T}
T{
19
T}:T{
DELETE_ROWS_EVENT
T}:T{
-Row data for a single table that should be deleted\&. Used in MySQL 5\&.1\&.18
- and later\&.
+Row data for a single table that should be deleted. Used in MySQL 5.1.18
+ and later.
T}
T{
1a
T}:T{
INCIDENT_EVENT
T}:T{
-Something out of the ordinary happened\&. Added in MySQL 5\&.1\&.18\&.
+Something out of the ordinary happened. Added in MySQL 5.1.18.
T}
.TE
.sp 1
T}:T{
LOG_EVENT_BINLOG_IN_USE_F
T}:T{
-Log file correctly closed\&. (Used only in
- FORMAT_DESCRIPTION_EVENT\&.) If
- this flag is set (if the flags are, for example,
- \*(Aq01 00\*(Aq) in a
- FORMAT_DESCRIPTION_EVENT, the log
- file has not been properly closed\&. Most probably
- this is because of a master crash (for example, due
- to power failure)\&.
+Log file correctly closed. (Used only in
+ FORMAT_DESCRIPTION_EVENT.) If this
+ flag is set (if the flags are, for example,
+ '01 00') in a
+ FORMAT_DESCRIPTION_EVENT, the log
+ file has not been properly closed. Most probably this
+ is because of a master crash (for example, due to
+ power failure).
T}
T{
02
T}:T{
-\ \&
T}:T{
-Reserved for future use\&.
+Reserved for future use.
T}
T{
04
LOG_EVENT_THREAD_SPECIFIC_F
T}:T{
Set if the event is dependent on the connection it was executed in (for
- example, \*(Aq04 00\*(Aq), for example,
- if the event uses temporary tables\&.
+ example, '04 00'), for example, if
+ the event uses temporary tables.
T}
T{
08
LOG_EVENT_SUPPRESS_USE_F
T}:T{
Set in some circumstances when the event is not dependent on the default
- database\&.
+ database.
T}
.TE
.sp 1
allbox tab(:);
lB lB.
T{
-\fB\-\-result\-file\fR Option
+\fB--result-file\fR Option
T}:T{
Output File Names
T}
l l
l l.
T{
-\fB\-\-result\-file=x\fR
+\fB--result-file=x\fR
T}:T{
-xbinlog\&.000999 and up
+xbinlog.000999 and up
T}
T{
-\fB\-\-result\-file=/tmp/\fR
+\fB--result-file=/tmp/\fR
T}:T{
-/tmp/binlog\&.000999 and up
+/tmp/binlog.000999 and up
T}
T{
-\fB\-\-result\-file=/tmp/x\fR
+\fB--result-file=/tmp/x\fR
T}:T{
-/tmp/xbinlog\&.000999 and up
+/tmp/xbinlog.000999 and up
T}
.TE
.sp 1
.SH "COPYRIGHT"
.br
.PP
-Copyright \(co 1997, 2017, Oracle and/or its affiliates. All rights reserved.
+Copyright \(co 1997, 2018, Oracle and/or its affiliates. All rights reserved.
.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
.\" Title: \fBmysqlbug\fR
.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author]
.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
-.\" Date: 06/02/2017
+.\" Date: 06/15/2018
.\" Manual: MySQL Database System
.\" Source: MySQL 5.6
.\" Language: English
.\"
-.TH "\FBMYSQLBUG\FR" "1" "06/02/2017" "MySQL 5\&.6" "MySQL Database System"
+.TH "\FBMYSQLBUG\FR" "1" "06/15/2018" "MySQL 5\&.6" "MySQL Database System"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.SH "COPYRIGHT"
.br
.PP
-Copyright \(co 1997, 2017, Oracle and/or its affiliates. All rights reserved.
+Copyright \(co 1997, 2018, Oracle and/or its affiliates. All rights reserved.
.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
.\" Title: \fBmysqlcheck\fR
.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author]
.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
-.\" Date: 06/02/2017
+.\" Date: 06/15/2018
.\" Manual: MySQL Database System
.\" Source: MySQL 5.6
.\" Language: English
.\"
-.TH "\FBMYSQLCHECK\FR" "1" "06/02/2017" "MySQL 5\&.6" "MySQL Database System"
+.TH "\FBMYSQLCHECK\FR" "1" "06/15/2018" "MySQL 5\&.6" "MySQL Database System"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
T{
\fBmysqlrepair\fR
T}:T{
-The default option is \fB\-\-repair\fR
+The default option is \fB--repair\fR
T}
T{
\fBmysqlanalyze\fR
T}:T{
-The default option is \fB\-\-analyze\fR
+The default option is \fB--analyze\fR
T}
T{
\fBmysqloptimize\fR
T}:T{
-The default option is \fB\-\-optimize\fR
+The default option is \fB--optimize\fR
T}
.TE
.sp 1
\fB\-\-character\-sets\-dir=\fR\fB\fIdir_name\fR\fR
.sp
The directory where character sets are installed\&. See
-Section\ \&10.5, \(lqCharacter Set Configuration\(rq\&.
+Section\ \&10.14, \(lqCharacter Set Configuration\(rq\&.
.RE
.sp
.RS 4
Use
\fIcharset_name\fR
as the default character set\&. See
-Section\ \&10.5, \(lqCharacter Set Configuration\(rq\&.
+Section\ \&10.14, \(lqCharacter Set Configuration\(rq\&.
.RE
.sp
.RS 4
\fB\-\-shared\-memory\-base\-name=\fR\fB\fIname\fR\fR
.sp
On Windows, the shared\-memory name to use, for connections made using shared memory to a local server\&. The default value is
-MYSQL\&. The shared\-memory name is case sensitive\&.
+MYSQL\&. The shared\-memory name is case\-sensitive\&.
.sp
The server must be started with the
\fB\-\-shared\-memory\fR
.\}
\fB\-\-skip\-database=\fR\fB\fIdb_name\fR\fR
.sp
-Do not include the named database (case sensitive) in the operations performed by
+Do not include the named database (case\-sensitive) in the operations performed by
\fBmysqlcheck\fR\&. This option was added in MySQL 5\&.6\&.11\&.
.RE
.sp
Options that begin with
\fB\-\-ssl\fR
specify whether to connect to the server using SSL and indicate where to find SSL keys and certificates\&. See
-Section\ \&6.4.5, \(lqCommand Options for Secure Connections\(rq\&.
+Section\ \&6.4.2, \(lqCommand Options for Encrypted Connections\(rq\&.
.RE
.sp
.RS 4
.SH "COPYRIGHT"
.br
.PP
-Copyright \(co 1997, 2017, Oracle and/or its affiliates. All rights reserved.
+Copyright \(co 1997, 2018, Oracle and/or its affiliates. All rights reserved.
.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
.\" Title: \fBmysqld\fR
.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author]
.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
-.\" Date: 06/02/2017
+.\" Date: 06/15/2018
.\" Manual: MySQL Database System
.\" Source: MySQL 5.6
.\" Language: English
.\"
-.TH "\FBMYSQLD\FR" "8" "06/02/2017" "MySQL 5\&.6" "MySQL Database System"
+.TH "\FBMYSQLD\FR" "8" "06/15/2018" "MySQL 5\&.6" "MySQL Database System"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.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\&.
+.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
+Some installation packages contain a debugging version of the server named
+\fBmysqld\-debug\fR\&. Invoke this version instead of
+\fBmysqld\fR
+for debugging support, memory allocation checking, and trace file support (see
+Section\ \&24.5.1.2, \(lqCreating Trace Files\(rq)\&.
+.sp .5v
+.RE
.PP
When MySQL server starts, it listens for network connections from client programs and manages access to databases on behalf of those clients\&.
.PP
.SH "COPYRIGHT"
.br
.PP
-Copyright \(co 1997, 2017, Oracle and/or its affiliates. All rights reserved.
+Copyright \(co 1997, 2018, Oracle and/or its affiliates. All rights reserved.
.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
.\" Title: \fBmysqld_multi\fR
.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author]
.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
-.\" Date: 06/02/2017
+.\" Date: 06/15/2018
.\" Manual: MySQL Database System
.\" Source: MySQL 5.6
.\" Language: English
.\"
-.TH "\FBMYSQLD_MULTI\FR" "1" "06/02/2017" "MySQL 5\&.6" "MySQL Database System"
+.TH "\FBMYSQLD_MULTI\FR" "1" "06/15/2018" "MySQL 5\&.6" "MySQL Database System"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
\fBmysqld\fR
process and restarts it if the process terminates due to a signal sent using
kill \-9
-or for other reasons, such as a segmentation fault\&. The
-\fBmysqld_safe\fR
-script might require that you start it from a certain place\&. This means that you might have to change location to a certain directory before running
-\fBmysqld_multi\fR\&. If you have problems starting, please see the
-\fBmysqld_safe\fR
-script\&. Check especially the lines:
-.sp
-.if n \{\
-.RS 4
-.\}
-.nf
-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-
-MY_PWD=`pwd`
-# Check if we are starting this relative (for the binary release)
-if test \-d $MY_PWD/data/mysql \-a \e
- \-f \&./share/mysql/english/errmsg\&.sys \-a \e
- \-x \&./bin/mysqld
-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-
-.fi
-.if n \{\
-.RE
-.\}
-.sp
-The test performed by these lines should be successful, or you might encounter problems\&. See
-\fBmysqld_safe\fR(1)\&.
+or for other reasons, such as a segmentation fault\&.
.RE
.sp
.RS 4
.SH "COPYRIGHT"
.br
.PP
-Copyright \(co 1997, 2017, Oracle and/or its affiliates. All rights reserved.
+Copyright \(co 1997, 2018, Oracle and/or its affiliates. All rights reserved.
.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
.\" Title: \fBmysqld_safe\fR
.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author]
.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
-.\" Date: 06/02/2017
+.\" Date: 06/15/2018
.\" Manual: MySQL Database System
.\" Source: MySQL 5.6
.\" Language: English
.\"
-.TH "\FBMYSQLD_SAFE\FR" "1" "06/02/2017" "MySQL 5\&.6" "MySQL Database System"
+.TH "\FBMYSQLD_SAFE\FR" "1" "06/15/2018" "MySQL 5\&.6" "MySQL Database System"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
\fBmysqld\fR
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\&. A description of error logging is given later in this section\&.
+adds some safety features such as restarting the server when an error occurs and logging runtime information to an error log\&. A description of error logging is given later in this section\&.
.PP
\fBmysqld_safe\fR
tries to start an executable named
\fBmysqld_safe\fR
are the same as the options to
\fBmysqld\fR\&. See
-Section\ \&5.1.4, \(lqServer Command Options\(rq\&.
+Section\ \&5.1.6, \(lqServer Command Options\(rq\&.
.PP
Options unknown to
\fBmysqld_safe\fR
is used, the
daemon\&.err
syslog facility/severity is used for all log messages\&.
+.sp
+\fBmysqld_safe\fR
+ignores
+\fB\-\-syslog\fR
+if
+\fB\-\-log\-error\fR
+is also given\&.
.RE
.sp
.RS 4
.SH "COPYRIGHT"
.br
.PP
-Copyright \(co 1997, 2017, Oracle and/or its affiliates. All rights reserved.
+Copyright \(co 1997, 2018, Oracle and/or its affiliates. All rights reserved.
.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
.\" Title: \fBmysqldump\fR
.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author]
.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
-.\" Date: 06/02/2017
+.\" Date: 06/15/2018
.\" Manual: MySQL Database System
.\" Source: MySQL 5.6
.\" Language: English
.\"
-.TH "\FBMYSQLDUMP\FR" "1" "06/02/2017" "MySQL 5\&.6" "MySQL Database System"
+.TH "\FBMYSQLDUMP\FR" "1" "06/15/2018" "MySQL 5\&.6" "MySQL Database System"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.\}
.PP
However, UTF\-16 is not permitted as a connection character set (see
-Section\ \&10.1.4, \(lqConnection Character Sets and Collations\(rq), so the dump file will not load correctly\&. To work around this issue, use the
+Section\ \&10.4, \(lqConnection Character Sets and Collations\(rq), so the dump file will not load correctly\&. To work around this issue, use the
\fB\-\-result\-file\fR
option, which creates the output in ASCII format:
.sp
Options that begin with
\fB\-\-ssl\fR
specify whether to connect to the server using SSL and indicate where to find SSL keys and certificates\&. See
-Section\ \&6.4.5, \(lqCommand Options for Secure Connections\(rq\&.
+Section\ \&6.4.2, \(lqCommand Options for Encrypted Connections\(rq\&.
.RE
.sp
.RS 4
\fB\-\-character\-sets\-dir=\fR\fB\fIdir_name\fR\fR
.sp
The directory where character sets are installed\&. See
-Section\ \&10.5, \(lqCharacter Set Configuration\(rq\&.
+Section\ \&10.14, \(lqCharacter Set Configuration\(rq\&.
.RE
.sp
.RS 4
Use
\fIcharset_name\fR
as the default character set\&. See
-Section\ \&10.5, \(lqCharacter Set Configuration\(rq\&. If no character set is specified,
+Section\ \&10.14, \(lqCharacter Set Configuration\(rq\&. If no character set is specified,
\fBmysqldump\fR
uses
utf8\&.
T{
OFF
T}:T{
-Add no SET statement to the output\&.
+Add no SET statement to the output.
T}
T{
ON
T}:T{
-Add a SET statement to the output\&. An error occurs if
- GTIDs are not enabled on the server\&.
+Add a SET statement to the output. An error occurs if
+ GTIDs are not enabled on the server.
T}
T{
AUTO
T}:T{
Add a SET statement to the output if GTIDs are
- enabled on the server\&.
+ enabled on the server.
T}
.TE
.sp 1
ON)\&.
.RE
.sp
+.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
+It is not recommended to load a dump file when GTIDs are enabled on the server (gtid_mode=ON), if your dump file includes system tables\&.
+\fBmysqldump\fR
+issues DML instructions for the system tables which use the non\-transactional MyISAM storage engine, and this combination is not permitted when GTIDs are enabled\&. Also be aware that loading a dump file from a server with GTIDs enabled, into another server with GTIDs enabled, causes different transaction identifiers to be generated\&.
+.sp .5v
+.RE
This option was added in MySQL 5\&.6\&.9\&.
.RE
Format Options.PP
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\&.
+Section\ \&5.1.10, \(lqServer SQL Modes\(rq\&.
.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
T{
NULL (\fIunknown value\fR)
T}:T{
+.PP
<field name="\fIcolumn_name\fR" xsi:nil="true" />
T}
T{
-\*(Aq\*(Aq (\fIempty string\fR)
+'' (\fIempty string\fR)
T}:T{
+.PP
<field name="\fIcolumn_name\fR"></field>
T}
T{
-\*(AqNULL\*(Aq (\fIstring value\fR)
+'NULL' (\fIstring value\fR)
T}:T{
+.PP
<field name="\fIcolumn_name\fR">NULL</field>
T}
.TE
\fB\-\-shared\-memory\-base\-name=\fR\fB\fIname\fR\fR
.sp
On Windows, the shared\-memory name to use, for connections made using shared memory to a local server\&. The default value is
-MYSQL\&. The shared\-memory name is case sensitive\&.
+MYSQL\&. The shared\-memory name is case\-sensitive\&.
.sp
The server must be started with the
\fB\-\-shared\-memory\fR
.SH "COPYRIGHT"
.br
.PP
-Copyright \(co 1997, 2017, Oracle and/or its affiliates. All rights reserved.
+Copyright \(co 1997, 2018, Oracle and/or its affiliates. All rights reserved.
.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
.\" Title: \fBmysqldumpslow\fR
.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author]
.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
-.\" Date: 06/02/2017
+.\" Date: 06/15/2018
.\" Manual: MySQL Database System
.\" Source: MySQL 5.6
.\" Language: English
.\"
-.TH "\FBMYSQLDUMPSLOW\FR" "1" "06/02/2017" "MySQL 5\&.6" "MySQL Database System"
+.TH "\FBMYSQLDUMPSLOW\FR" "1" "06/15/2018" "MySQL 5\&.6" "MySQL Database System"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.SH "COPYRIGHT"
.br
.PP
-Copyright \(co 1997, 2017, Oracle and/or its affiliates. All rights reserved.
+Copyright \(co 1997, 2018, Oracle and/or its affiliates. All rights reserved.
.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
.\" Title: \fBmysqlhotcopy\fR
.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author]
.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
-.\" Date: 06/02/2017
+.\" Date: 06/15/2018
.\" Manual: MySQL Database System
.\" Source: MySQL 5.6
.\" Language: English
.\"
-.TH "\FBMYSQLHOTCOPY\FR" "1" "06/02/2017" "MySQL 5\&.6" "MySQL Database System"
+.TH "\FBMYSQLHOTCOPY\FR" "1" "06/15/2018" "MySQL 5\&.6" "MySQL Database System"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.SH "COPYRIGHT"
.br
.PP
-Copyright \(co 1997, 2017, Oracle and/or its affiliates. All rights reserved.
+Copyright \(co 1997, 2018, Oracle and/or its affiliates. All rights reserved.
.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
.\" Title: \fBmysqlimport\fR
.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author]
.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
-.\" Date: 06/02/2017
+.\" Date: 06/15/2018
.\" Manual: MySQL Database System
.\" Source: MySQL 5.6
.\" Language: English
.\"
-.TH "\FBMYSQLIMPORT\FR" "1" "06/02/2017" "MySQL 5\&.6" "MySQL Database System"
+.TH "\FBMYSQLIMPORT\FR" "1" "06/15/2018" "MySQL 5\&.6" "MySQL Database System"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
\fB\-\-character\-sets\-dir=\fR\fB\fIdir_name\fR\fR
.sp
The directory where character sets are installed\&. See
-Section\ \&10.5, \(lqCharacter Set Configuration\(rq\&.
+Section\ \&10.14, \(lqCharacter Set Configuration\(rq\&.
.RE
.sp
.RS 4
Use
\fIcharset_name\fR
as the default character set\&. See
-Section\ \&10.5, \(lqCharacter Set Configuration\(rq\&.
+Section\ \&10.14, \(lqCharacter Set Configuration\(rq\&.
.RE
.sp
.RS 4
.sp
By default, files are read by the server on the server host\&. With this option,
\fBmysqlimport\fR
-reads input files locally on the client host\&. Enabling local data loading has no effect if the server does not also support it; see
+reads input files locally on the client host\&. Enabling local data loading also requires that the server permits it; see
Section\ \&6.1.6, \(lqSecurity Issues with LOAD DATA LOCAL\(rq
.RE
.sp
\fB\-\-shared\-memory\-base\-name=\fR\fB\fIname\fR\fR
.sp
On Windows, the shared\-memory name to use, for connections made using shared memory to a local server\&. The default value is
-MYSQL\&. The shared\-memory name is case sensitive\&.
+MYSQL\&. The shared\-memory name is case\-sensitive\&.
.sp
The server must be started with the
\fB\-\-shared\-memory\fR
Options that begin with
\fB\-\-ssl\fR
specify whether to connect to the server using SSL and indicate where to find SSL keys and certificates\&. See
-Section\ \&6.4.5, \(lqCommand Options for Secure Connections\(rq\&.
+Section\ \&6.4.2, \(lqCommand Options for Encrypted Connections\(rq\&.
.RE
.sp
.RS 4
.SH "COPYRIGHT"
.br
.PP
-Copyright \(co 1997, 2017, Oracle and/or its affiliates. All rights reserved.
+Copyright \(co 1997, 2018, Oracle and/or its affiliates. All rights reserved.
.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
.\" Title: \fBmysqlshow\fR
.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author]
.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
-.\" Date: 06/02/2017
+.\" Date: 06/15/2018
.\" Manual: MySQL Database System
.\" Source: MySQL 5.6
.\" Language: English
.\"
-.TH "\FBMYSQLSHOW\FR" "1" "06/02/2017" "MySQL 5\&.6" "MySQL Database System"
+.TH "\FBMYSQLSHOW\FR" "1" "06/15/2018" "MySQL 5\&.6" "MySQL Database System"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
\fB\-\-character\-sets\-dir=\fR\fB\fIdir_name\fR\fR
.sp
The directory where character sets are installed\&. See
-Section\ \&10.5, \(lqCharacter Set Configuration\(rq\&.
+Section\ \&10.14, \(lqCharacter Set Configuration\(rq\&.
.RE
.sp
.RS 4
Use
\fIcharset_name\fR
as the default character set\&. See
-Section\ \&10.5, \(lqCharacter Set Configuration\(rq\&.
+Section\ \&10.14, \(lqCharacter Set Configuration\(rq\&.
.RE
.sp
.RS 4
\fB\-\-shared\-memory\-base\-name=\fR\fB\fIname\fR\fR
.sp
On Windows, the shared\-memory name to use, for connections made using shared memory to a local server\&. The default value is
-MYSQL\&. The shared\-memory name is case sensitive\&.
+MYSQL\&. The shared\-memory name is case\-sensitive\&.
.sp
The server must be started with the
\fB\-\-shared\-memory\fR
Options that begin with
\fB\-\-ssl\fR
specify whether to connect to the server using SSL and indicate where to find SSL keys and certificates\&. See
-Section\ \&6.4.5, \(lqCommand Options for Secure Connections\(rq\&.
+Section\ \&6.4.2, \(lqCommand Options for Encrypted Connections\(rq\&.
.RE
.sp
.RS 4
.SH "COPYRIGHT"
.br
.PP
-Copyright \(co 1997, 2017, Oracle and/or its affiliates. All rights reserved.
+Copyright \(co 1997, 2018, Oracle and/or its affiliates. All rights reserved.
.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
.\" Title: \fBmysqlslap\fR
.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author]
.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
-.\" Date: 06/02/2017
+.\" Date: 06/15/2018
.\" Manual: MySQL Database System
.\" Source: MySQL 5.6
.\" Language: English
.\"
-.TH "\FBMYSQLSLAP\FR" "1" "06/02/2017" "MySQL 5\&.6" "MySQL Database System"
+.TH "\FBMYSQLSLAP\FR" "1" "06/15/2018" "MySQL 5\&.6" "MySQL Database System"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
Options that begin with
\fB\-\-ssl\fR
specify whether to connect to the server using SSL and indicate where to find SSL keys and certificates\&. See
-Section\ \&6.4.5, \(lqCommand Options for Secure Connections\(rq\&.
+Section\ \&6.4.2, \(lqCommand Options for Encrypted Connections\(rq\&.
.RE
.sp
.RS 4
.SH "COPYRIGHT"
.br
.PP
-Copyright \(co 1997, 2017, Oracle and/or its affiliates. All rights reserved.
+Copyright \(co 1997, 2018, Oracle and/or its affiliates. All rights reserved.
.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
+++ /dev/null
-'\" t
-.\" Title: \fBmysqltest\fR
-.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author]
-.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
-.\" Date: 06/01/2017
-.\" Manual: MySQL Database System
-.\" Source: MySQL
-.\" Language: English
-.\"
-.TH "\FBMYSQLTEST\FR" "1" "06/01/2017" "MySQL" "MySQL Database System"
-.\" -----------------------------------------------------------------
-.\" * Define some portability stuff
-.\" -----------------------------------------------------------------
-.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-.\" http://bugs.debian.org/507673
-.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
-.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-.ie \n(.g .ds Aq \(aq
-.el .ds Aq '
-.\" -----------------------------------------------------------------
-.\" * set default formatting
-.\" -----------------------------------------------------------------
-.\" disable hyphenation
-.nh
-.\" disable justification (adjust text to left margin only)
-.ad l
-.\" -----------------------------------------------------------------
-.\" * MAIN CONTENT STARTS HERE *
-.\" -----------------------------------------------------------------
-.SH "NAME"
-mysqltest \- program to run test cases
-.br
-mysqltest_embedded \- program to run embedded test cases
-.SH "SYNOPSIS"
-.HP \w'\fBmysqltest\ [\fR\fB\fIoptions\fR\fR\fB]\ [\fR\fB\fIdb_name\fR\fR\fB]\fR\ 'u
-\fBmysqltest [\fR\fB\fIoptions\fR\fR\fB] [\fR\fB\fIdb_name\fR\fR\fB]\fR
-.HP \w'\fBmysqltest_embedded\ [\fR\fB\fIoptions\fR\fR\fB]\ [\fR\fB\fIdb_name\fR\fR\fB]\fR\ 'u
-\fBmysqltest_embedded [\fR\fB\fIoptions\fR\fR\fB] [\fR\fB\fIdb_name\fR\fR\fB]\fR
-.SH "DESCRIPTION"
-.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
-\fBmysqltest\fR
-using
-\fBmysql\-test\-run\&.pl\fR
-rather than invoking it directly\&.
-.PP
-\fBmysqltest_embedded\fR
-is similar but is built with support for the
-libmysqld
-embedded server\&. This program is available only prior to MySQL 8\&.0\&.
-.PP
-Features of
-\fBmysqltest\fR:
-.sp
-.RS 4
-.ie n \{\
-\h'-04'\(bu\h'+03'\c
-.\}
-.el \{\
-.sp -1
-.IP \(bu 2.3
-.\}
-Can send SQL statements to MySQL servers for execution
-.RE
-.sp
-.RS 4
-.ie n \{\
-\h'-04'\(bu\h'+03'\c
-.\}
-.el \{\
-.sp -1
-.IP \(bu 2.3
-.\}
-Can execute external shell commands
-.RE
-.sp
-.RS 4
-.ie n \{\
-\h'-04'\(bu\h'+03'\c
-.\}
-.el \{\
-.sp -1
-.IP \(bu 2.3
-.\}
-Can test whether the result from an SQL statement or shell command is as expected
-.RE
-.sp
-.RS 4
-.ie n \{\
-\h'-04'\(bu\h'+03'\c
-.\}
-.el \{\
-.sp -1
-.IP \(bu 2.3
-.\}
-Can connect to one or more standalone
-\fBmysqld\fR
-servers and switch between connections
-.RE
-.sp
-.RS 4
-.ie n \{\
-\h'-04'\(bu\h'+03'\c
-.\}
-.el \{\
-.sp -1
-.IP \(bu 2.3
-.\}
-Can connect to an embedded server (libmysqld), if MySQL is compiled with support for
-libmysqld\&. (In this case, the executable is named
-\fBmysqltest_embedded\fR
-rather than
-\fBmysqltest\fR\&.)
-.RE
-.PP
-By default,
-\fBmysqltest\fR
-reads the test case on the standard input\&. To run
-\fBmysqltest\fR
-this way, you normally invoke it like this:
-.sp
-.if n \{\
-.RS 4
-.\}
-.nf
-shell> \fBmysqltest [\fR\fB\fIoptions\fR\fR\fB] [\fR\fB\fIdb_name\fR\fR\fB] < \fR\fB\fItest_file\fR\fR
-.fi
-.if n \{\
-.RE
-.\}
-.PP
-You can also name the test case file with a
-\fB\-\-test\-file=\fR\fB\fIfile_name\fR\fR
-option\&.
-.PP
-The exit value from
-\fBmysqltest\fR
-is 0 for success, 1 for failure, and 62 if it skips the test case (for example, if after checking some preconditions it decides not to run the test)\&.
-.PP
-\fBmysqltest\fR
-supports the following options:
-.sp
-.RS 4
-.ie n \{\
-\h'-04'\(bu\h'+03'\c
-.\}
-.el \{\
-.sp -1
-.IP \(bu 2.3
-.\}
-\fB\-\-help\fR,
-\fB\-?\fR
-.sp
-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
-.\}
-\fB\-\-basedir=\fR\fB\fIdir_name\fR\fR,
-\fB\-b \fR\fB\fIdir_name\fR\fR
-.sp
-The base directory for tests\&.
-.RE
-.sp
-.RS 4
-.ie n \{\
-\h'-04'\(bu\h'+03'\c
-.\}
-.el \{\
-.sp -1
-.IP \(bu 2.3
-.\}
-\fB\-\-character\-sets\-dir=\fR\fB\fIpath\fR\fR
-.sp
-The directory where character sets are installed\&.
-.RE
-.sp
-.RS 4
-.ie n \{\
-\h'-04'\(bu\h'+03'\c
-.\}
-.el \{\
-.sp -1
-.IP \(bu 2.3
-.\}
-\fB\-\-compress\fR,
-\fB\-C\fR
-.sp
-Compress all information sent between the client and the server if both support compression\&.
-.RE
-.sp
-.RS 4
-.ie n \{\
-\h'-04'\(bu\h'+03'\c
-.\}
-.el \{\
-.sp -1
-.IP \(bu 2.3
-.\}
-\fB\-\-cursor\-protocol\fR
-.sp
-Use cursors for prepared statements\&.
-.RE
-.sp
-.RS 4
-.ie n \{\
-\h'-04'\(bu\h'+03'\c
-.\}
-.el \{\
-.sp -1
-.IP \(bu 2.3
-.\}
-\fB\-\-database=\fR\fB\fIdb_name\fR\fR,
-\fB\-D \fR\fB\fIdb_name\fR\fR
-.sp
-The default database to use\&.
-.RE
-.sp
-.RS 4
-.ie n \{\
-\h'-04'\(bu\h'+03'\c
-.\}
-.el \{\
-.sp -1
-.IP \(bu 2.3
-.\}
-\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
-\fIdebug_options\fR
-value is
-\*(Aqd:t:S:i:O,/tmp/mysqltest\&.trace\*(Aq\&.
-.RE
-.sp
-.RS 4
-.ie n \{\
-\h'-04'\(bu\h'+03'\c
-.\}
-.el \{\
-.sp -1
-.IP \(bu 2.3
-.\}
-\fB\-\-debug\-check\fR
-.sp
-Print some debugging information when the program exits\&.
-.RE
-.sp
-.RS 4
-.ie n \{\
-\h'-04'\(bu\h'+03'\c
-.\}
-.el \{\
-.sp -1
-.IP \(bu 2.3
-.\}
-\fB\-\-debug\-info\fR
-.sp
-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
-.\}
-\fB\-\-explain\-protocol\fR,
-.sp
-Run
-EXPLAIN EXTENDED
-on all SELECT, INSERT, REPLACE, UPDATE and DELETE queries\&.
-.RE
-.sp
-.RS 4
-.ie n \{\
-\h'-04'\(bu\h'+03'\c
-.\}
-.el \{\
-.sp -1
-.IP \(bu 2.3
-.\}
-\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
-.\}
-\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\&.
-.RE
-.sp
-.RS 4
-.ie n \{\
-\h'-04'\(bu\h'+03'\c
-.\}
-.el \{\
-.sp -1
-.IP \(bu 2.3
-.\}
-\fB\-\-json\-explain\-protocol\fR,
-.sp
-Run
-EXPLAIN FORMAT=JSON
-on all SELECT, INSERT, REPLACE, UPDATE and DELETE queries\&. The
-json\-explain\-protocol
-option is available from MySQL 5\&.6\&.
-.RE
-.sp
-.RS 4
-.ie n \{\
-\h'-04'\(bu\h'+03'\c
-.\}
-.el \{\
-.sp -1
-.IP \(bu 2.3
-.\}
-\fB\-\-logdir=\fR\fB\fIdir_name\fR\fR
-.sp
-The directory to use for log files\&.
-.RE
-.sp
-.RS 4
-.ie n \{\
-\h'-04'\(bu\h'+03'\c
-.\}
-.el \{\
-.sp -1
-.IP \(bu 2.3
-.\}
-\fB\-\-mark\-progress\fR
-.sp
-Write the line number and elapsed time to
-\fItest_file\fR\&.progress\&.
-.RE
-.sp
-.RS 4
-.ie n \{\
-\h'-04'\(bu\h'+03'\c
-.\}
-.el \{\
-.sp -1
-.IP \(bu 2.3
-.\}
-\fB\-\-max\-connect\-retries=\fR\fB\fInum\fR\fR
-.sp
-The maximum number of connection attempts when connecting to server\&.
-.RE
-.sp
-.RS 4
-.ie n \{\
-\h'-04'\(bu\h'+03'\c
-.\}
-.el \{\
-.sp -1
-.IP \(bu 2.3
-.\}
-\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\&.
-.RE
-.sp
-.RS 4
-.ie n \{\
-\h'-04'\(bu\h'+03'\c
-.\}
-.el \{\
-.sp -1
-.IP \(bu 2.3
-.\}
-\fB\-\-no\-defaults\fR
-.sp
-Do not read default options from any option files\&. If used, this must be the first option\&.
-.RE
-.sp
-.RS 4
-.ie n \{\
-\h'-04'\(bu\h'+03'\c
-.\}
-.el \{\
-.sp -1
-.IP \(bu 2.3
-.\}
-\fB\-\-plugin\-dir=\fR\fB\fIpath\fR\fR
-.sp
-The directory in which to look for plugins\&. It may be necessary to specify this option if the
-\fIdefault_auth\fR
-argument is used for the
-connect()
-command to specify an authentication plugin but
-\fBmysqltest\fR
-does not find it\&. This option was added in MySQL 5\&.5\&.7\&.
-.RE
-.sp
-.RS 4
-.ie n \{\
-\h'-04'\(bu\h'+03'\c
-.\}
-.el \{\
-.sp -1
-.IP \(bu 2.3
-.\}
-\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, you are prompted for one\&.
-.RE
-.sp
-.RS 4
-.ie n \{\
-\h'-04'\(bu\h'+03'\c
-.\}
-.el \{\
-.sp -1
-.IP \(bu 2.3
-.\}
-\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
-.\}
-\fB\-\-protocol=\fR\fB{TCP|SOCKET|PIPE|MEMORY}\fR
-.sp
-Choose the protocol for communication with the server\&.
-SOCKET
-is default\&.
-.sp
-The
-\fB\-\-protocol\fR
-option is ignored if running with the embedded server\&.
-.RE
-.sp
-.RS 4
-.ie n \{\
-\h'-04'\(bu\h'+03'\c
-.\}
-.el \{\
-.sp -1
-.IP \(bu 2.3
-.\}
-\fB\-\-ps\-protocol\fR
-.sp
-Use the prepared\-statement protocol for communication\&.
-.RE
-.sp
-.RS 4
-.ie n \{\
-\h'-04'\(bu\h'+03'\c
-.\}
-.el \{\
-.sp -1
-.IP \(bu 2.3
-.\}
-\fB\-\-quiet\fR
-.sp
-Suppress all normal output\&. This is a synonym for
-\fB\-\-silent\fR\&.
-.RE
-.sp
-.RS 4
-.ie n \{\
-\h'-04'\(bu\h'+03'\c
-.\}
-.el \{\
-.sp -1
-.IP \(bu 2.3
-.\}
-\fB\-\-record\fR,
-\fB\-r\fR
-.sp
-Record the output that results from running the test file into the file named by the
-\fB\-\-result\-file\fR
-option, if that option is given\&. It is an error to use this option without also using
-\fB\-\-result\-file\fR\&.
-.RE
-.sp
-.RS 4
-.ie n \{\
-\h'-04'\(bu\h'+03'\c
-.\}
-.el \{\
-.sp -1
-.IP \(bu 2.3
-.\}
-\fB\-\-result\-file=\fR\fB\fIfile_name\fR\fR,
-\fB\-R \fR\fB\fIfile_name\fR\fR
-.sp
-This option specifies the file for test case expected results\&.
-\fB\-\-result\-file\fR, together with
-\fB\-\-record\fR, determines how
-\fBmysqltest\fR
-treats the test actual and expected results for a test case:
-.sp
-.RS 4
-.ie n \{\
-\h'-04'\(bu\h'+03'\c
-.\}
-.el \{\
-.sp -1
-.IP \(bu 2.3
-.\}
-If the test produces no results,
-\fBmysqltest\fR
-exits with an error message to that effect, unless
-\fB\-\-result\-file\fR
-is given and the named file is an empty file\&.
-.RE
-.sp
-.RS 4
-.ie n \{\
-\h'-04'\(bu\h'+03'\c
-.\}
-.el \{\
-.sp -1
-.IP \(bu 2.3
-.\}
-Otherwise, if
-\fB\-\-result\-file\fR
-is not given,
-\fBmysqltest\fR
-sends test results to the standard output\&.
-.RE
-.sp
-.RS 4
-.ie n \{\
-\h'-04'\(bu\h'+03'\c
-.\}
-.el \{\
-.sp -1
-.IP \(bu 2.3
-.\}
-With
-\fB\-\-result\-file\fR
-but not
-\fB\-\-record\fR,
-\fBmysqltest\fR
-reads the expected results from the given file and compares them with the actual results\&. If the results do not match,
-\fBmysqltest\fR
-writes a
-\&.reject
-file in the same directory as the result file, outputs a diff of the two files, and exits with an error\&.
-.RE
-.sp
-.RS 4
-.ie n \{\
-\h'-04'\(bu\h'+03'\c
-.\}
-.el \{\
-.sp -1
-.IP \(bu 2.3
-.\}
-With both
-\fB\-\-result\-file\fR
-and
-\fB\-\-record\fR,
-\fBmysqltest\fR
-updates the given file by writing the actual test results to it\&.
-.RE
-.RE
-.sp
-.RS 4
-.ie n \{\
-\h'-04'\(bu\h'+03'\c
-.\}
-.el \{\
-.sp -1
-.IP \(bu 2.3
-.\}
-\fB\-\-server\-arg=\fR\fB\fIvalue\fR\fR,
-\fB\-A \fR\fB\fIvalue\fR\fR
-.sp
-Pass the argument as an argument to the embedded server\&. For example,
-\fB\-\-server\-arg=\-\-tmpdir=/tmp\fR
-or
-\fB\-\-server\-arg=\-\-core\fR\&. Up to 64 arguments can be given\&. This option was removed in MySQL 8\&.0\&.
-.RE
-.sp
-.RS 4
-.ie n \{\
-\h'-04'\(bu\h'+03'\c
-.\}
-.el \{\
-.sp -1
-.IP \(bu 2.3
-.\}
-\fB\-\-server\-file=\fR\fB\fIfile_name\fR\fR,
-\fB\-F \fR\fB\fIfile_name\fR\fR
-.sp
-Read arguments for the embedded server from the given file\&. The file should contain one argument per line\&. This option was removed in MySQL 8\&.0\&.
-.RE
-.sp
-.RS 4
-.ie n \{\
-\h'-04'\(bu\h'+03'\c
-.\}
-.el \{\
-.sp -1
-.IP \(bu 2.3
-.\}
-\fB\-\-server\-public\-key\-path=\fR\fBfile_name\fR
-.sp
-The path name to a file containing the server RSA public key\&. The file must be in PEM format\&. The public key is used for RSA encryption of the client password for connections to the server made using accounts that authenticate with the
-sha256_password
-plugin\&. This option is ignored for client accounts that do not authenticate with that plugin\&. It is also ignored if password encryption is not needed, as is the case when the client connects to the server using an SSL connection\&.
-.sp
-The server sends the public key to the client as needed, so it is not necessary to use this option for RSA password encryption to occur\&. It is more efficient to do so because then the server need not send the key\&.
-.sp
-For additional discussion regarding use of the
-sha256_password
-plugin, including how to get the RSA public key, see
-\m[blue]\fBSHA\-256 Pluggable Authentication\fR\m[]\&\s-2\u[1]\d\s+2\&.
-.sp
-This option is available only if MySQL was built using OpenSSL\&. It was added in MySQL 5\&.6\&.6 under the name
-\fB\-\-server\-public\-key\fR
-and renamed in 5\&.6\&.7 to
-\fB\-\-server\-public\-key\-path\fR\&.
-.RE
-.sp
-.RS 4
-.ie n \{\
-\h'-04'\(bu\h'+03'\c
-.\}
-.el \{\
-.sp -1
-.IP \(bu 2.3
-.\}
-\fB\-\-silent\fR,
-\fB\-s\fR
-.sp
-Suppress all normal output\&.
-.RE
-.sp
-.RS 4
-.ie n \{\
-\h'-04'\(bu\h'+03'\c
-.\}
-.el \{\
-.sp -1
-.IP \(bu 2.3
-.\}
-\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
-.\}
-\fB\-\-sleep=\fR\fB\fInum\fR\fR,
-\fB\-T \fR\fB\fInum\fR\fR
-.sp
-Cause all
-sleep
-commands in the test case file to sleep
-\fInum\fR
-seconds\&. This option does not affect
-real_sleep
-commands\&.
-.sp
-An option value of 0 can also be used, which effectively disables
-sleep
-commands in the test case\&.
-.RE
-.sp
-.RS 4
-.ie n \{\
-\h'-04'\(bu\h'+03'\c
-.\}
-.el \{\
-.sp -1
-.IP \(bu 2.3
-.\}
-\fB\-\-socket=\fR\fB\fIpath\fR\fR,
-\fB\-S \fR\fB\fIpath\fR\fR
-.sp
-The socket file to use when connecting to
-localhost
-(which is the default host)\&.
-.RE
-.sp
-.RS 4
-.ie n \{\
-\h'-04'\(bu\h'+03'\c
-.\}
-.el \{\
-.sp -1
-.IP \(bu 2.3
-.\}
-\fB\-\-sp\-protocol\fR
-.sp
-Execute DML statements within a stored procedure\&. For every DML statement,
-\fBmysqltest\fR
-creates and invokes a stored procedure that executes the statement rather than executing the statement directly\&.
-.RE
-.sp
-.RS 4
-.ie n \{\
-\h'-04'\(bu\h'+03'\c
-.\}
-.el \{\
-.sp -1
-.IP \(bu 2.3
-.\}
-\fB\-\-tail\-lines=\fR\fB\fInn\fR\fR
-.sp
-Specify how many lines of the result to include in the output if the test fails because an SQL statement fails\&. The default is 0, meaning no lines of result printed\&.
-.RE
-.sp
-.RS 4
-.ie n \{\
-\h'-04'\(bu\h'+03'\c
-.\}
-.el \{\
-.sp -1
-.IP \(bu 2.3
-.\}
-\fB\-\-test\-file=\fR\fB\fIfile_name\fR\fR,
-\fB\-x \fR\fB\fIfile_name\fR\fR
-.sp
-Read test input from this file\&. The default is to read from the standard input\&.
-.RE
-.sp
-.RS 4
-.ie n \{\
-\h'-04'\(bu\h'+03'\c
-.\}
-.el \{\
-.sp -1
-.IP \(bu 2.3
-.\}
-\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
-\fBmysql\-test\-run\&.pl\fR
-for its reporting\&.
-.RE
-.sp
-.RS 4
-.ie n \{\
-\h'-04'\(bu\h'+03'\c
-.\}
-.el \{\
-.sp -1
-.IP \(bu 2.3
-.\}
-\fB\-\-tls\-version=\fR\fB\fIprotocol_list\fR\fR
-.sp
-The protocols permitted by the client for encrypted connections\&. The value is a comma\-separated list containing one or more of these protocols: TLSv1, TLSv1\&.1, TLSv1\&.2\&. (TLSv1\&.2 is supported only if MySQL was compiled using OpenSSL 1\&.0\&.1 or higher\&. It is not supported if MySQL was compiled using yaSSL\&.)
-.sp
-This option was added in MySQL 5\&.7\&.10\&.
-.RE
-.sp
-.RS 4
-.ie n \{\
-\h'-04'\(bu\h'+03'\c
-.\}
-.el \{\
-.sp -1
-.IP \(bu 2.3
-.\}
-\fB\-\-tmpdir=\fR\fB\fIdir_name\fR\fR,
-\fB\-t \fR\fB\fIdir_name\fR\fR
-.sp
-The temporary directory where socket files are created\&.
-.RE
-.sp
-.RS 4
-.ie n \{\
-\h'-04'\(bu\h'+03'\c
-.\}
-.el \{\
-.sp -1
-.IP \(bu 2.3
-.\}
-\fB\-\-trace\-exec\fR
-.sp
-If enabled, this option causes
-\fBmysqltest\fR
-to immediately display the output from executed programs to
-stdout\&.
-.sp
-This option was added in MySQL 8\&.0\&.0\&.
-.RE
-.sp
-.RS 4
-.ie n \{\
-\h'-04'\(bu\h'+03'\c
-.\}
-.el \{\
-.sp -1
-.IP \(bu 2.3
-.\}
-\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\&.
-.RE
-.sp
-.RS 4
-.ie n \{\
-\h'-04'\(bu\h'+03'\c
-.\}
-.el \{\
-.sp -1
-.IP \(bu 2.3
-.\}
-\fB\-\-verbose\fR,
-\fB\-v\fR
-.sp
-Verbose mode\&. Print out more information about what the program does\&.
-.RE
-.sp
-.RS 4
-.ie n \{\
-\h'-04'\(bu\h'+03'\c
-.\}
-.el \{\
-.sp -1
-.IP \(bu 2.3
-.\}
-\fB\-\-version\fR,
-\fB\-V\fR
-.sp
-Display version information and exit\&.
-.RE
-.sp
-.RS 4
-.ie n \{\
-\h'-04'\(bu\h'+03'\c
-.\}
-.el \{\
-.sp -1
-.IP \(bu 2.3
-.\}
-\fB\-\-view\-protocol\fR
-.sp
-Every
-SELECT
-statement is wrapped inside a view\&.
-.RE
-.SH "COPYRIGHT"
-.br
-.PP
-Copyright \(co 2006, 2017, Oracle and/or its affiliates. All rights reserved.
-.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
-This documentation is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
-.PP
-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 "NOTES"
-.IP " 1." 4
-SHA-256 Pluggable Authentication
-.RS 4
-\%http://dev.mysql.com/doc/refman/8.0/en/sha256-pluggable-authentication.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/.
-.SH AUTHOR
-Oracle Corporation (http://dev.mysql.com/).
+++ /dev/null
-.so mysqltest.1
.\" Title: \fBperror\fR
.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author]
.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
-.\" Date: 06/02/2017
+.\" Date: 06/15/2018
.\" Manual: MySQL Database System
.\" Source: MySQL 5.6
.\" Language: English
.\"
-.TH "\FBPERROR\FR" "1" "06/02/2017" "MySQL 5\&.6" "MySQL Database System"
+.TH "\FBPERROR\FR" "1" "06/15/2018" "MySQL 5\&.6" "MySQL Database System"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.SH "COPYRIGHT"
.br
.PP
-Copyright \(co 1997, 2017, Oracle and/or its affiliates. All rights reserved.
+Copyright \(co 1997, 2018, Oracle and/or its affiliates. All rights reserved.
.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
.\" Title: \fBreplace\fR
.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author]
.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
-.\" Date: 06/02/2017
+.\" Date: 06/15/2018
.\" Manual: MySQL Database System
.\" Source: MySQL 5.6
.\" Language: English
.\"
-.TH "\FBREPLACE\FR" "1" "06/02/2017" "MySQL 5\&.6" "MySQL Database System"
+.TH "\FBREPLACE\FR" "1" "06/15/2018" "MySQL 5\&.6" "MySQL Database System"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.SH "COPYRIGHT"
.br
.PP
-Copyright \(co 1997, 2017, Oracle and/or its affiliates. All rights reserved.
+Copyright \(co 1997, 2018, Oracle and/or its affiliates. All rights reserved.
.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
.\" Title: \fBresolve_stack_dump\fR
.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author]
.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
-.\" Date: 06/02/2017
+.\" Date: 06/15/2018
.\" Manual: MySQL Database System
.\" Source: MySQL 5.6
.\" Language: English
.\"
-.TH "\FBRESOLVE_STACK_DUM" "1" "06/02/2017" "MySQL 5\&.6" "MySQL Database System"
+.TH "\FBRESOLVE_STACK_DUMP\FR" "1" "06/15/2018" "MySQL 5\&.6" "MySQL Database System"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.SH "COPYRIGHT"
.br
.PP
-Copyright \(co 1997, 2017, Oracle and/or its affiliates. All rights reserved.
+Copyright \(co 1997, 2018, Oracle and/or its affiliates. All rights reserved.
.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
.\" Title: \fBresolveip\fR
.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author]
.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
-.\" Date: 06/02/2017
+.\" Date: 06/15/2018
.\" Manual: MySQL Database System
.\" Source: MySQL 5.6
.\" Language: English
.\"
-.TH "\FBRESOLVEIP\FR" "1" "06/02/2017" "MySQL 5\&.6" "MySQL Database System"
+.TH "\FBRESOLVEIP\FR" "1" "06/15/2018" "MySQL 5\&.6" "MySQL Database System"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.SH "COPYRIGHT"
.br
.PP
-Copyright \(co 1997, 2017, Oracle and/or its affiliates. All rights reserved.
+Copyright \(co 1997, 2018, Oracle and/or its affiliates. All rights reserved.
.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
funcs_1.charset_collation_1 # depends on compile-time decisions
main.func_math @freebsd # Bug#11751977 2010-05-04 alik main.func_math fails on FreeBSD in PB2
-main.mysqlslap @windows # Bug#11761520 2010-08-10 alik mysqlslap fails sporadically starting from Dahlia
main.index_merge_innodb # BUG#11754168 2012-05-08 jorgen Doing an attempt at reenabling tests disabled by bug. EXPLAIN's row estimates varies for innodb so marked experimental for a while
--let $diff_tables= master:t1,slave:t1
--source include/diff_tables.inc
---echo ######### 8 - Bug#55375(Regression Bug) Transaction bigger than ##########
+--echo ####### 8 - LOAD DATA INFILE INTO TABLE #######
+
+#
+# This scenario verifies that load data infile fails when
+# binlog cache exceeds max_binlog_cache_size
+#
+--source include/rpl_connection_master.inc
+CREATE TABLE t6 (a varchar(20)) ENGINE=Innodb;
+
+# Save the current binary log position
+--let $pos_before= query_get_value(show master status,Position,1)
+
+--disable_query_log
+--let $write_var =`SELECT REPEAT('Testing\n', 1000)`
+--let $write_to_file = GENERATE
+--source include/write_var_to_file.inc
+--enable_query_log
+
+# Below transaction generates transaction cache more than
+# the max_binlog_cache_size i.e 4096. Hence results in error.
+--replace_result $write_to_file temp_file
+--error ER_TRANS_CACHE_FULL
+eval LOAD DATA INFILE '$write_to_file' INTO TABLE t6;
+
+--exec rm $write_to_file
+
+# Check that the above transaction has not been logged in the binary log
+--let $assert_text= assert that the above Event has not been added to binlog
+--let $assert_cond= [SHOW MASTER STATUS, Position,1] = $pos_before
+--source include/assert.inc
+
+# Check that the table is empty on master
+--let $assert_text = Check that the LOAD DATA didn't add any data into the table
+--let $assert_cond = [SELECT COUNT(*) FROM t6] = 0
+--source include/assert.inc
+
+--source include/sync_slave_sql_with_master.inc
+
+# Check that the table is empty on slave
+--let $assert_text = Check that the LOAD DATA didn't add any data into the table
+--let $assert_cond = [SELECT COUNT(*) FROM t6] = 0
+--source include/assert.inc
+
+--source include/rpl_connection_master.inc
+DROP TABLE t6;
+--source include/sync_slave_sql_with_master.inc
+
+--echo ######### 9 - Bug#55375(Regression Bug) Transaction bigger than ##########
--echo ######### max_binlog_cache_size crashes slave ##########
--echo # [ On Slave ]
--- /dev/null
+###############################################################################
+# This .inc file is to check that filtering rules on
+# CREATE DATABASE/ALTER DATABASE/DROP DATABASE statements
+# works properly.
+# NOTE: Filter rules should be set in such a way that 'db1'
+# is filtered out on Slave. Setting the filtering rule
+# should be done in the test that includes this .inc file.
+# For eg:
+# --replicate-ignore-db=db1
+# --source ../extra/rpl_tests/rpl_db_stmts_ignored.inc
+# (OR)
+# --replicate-do-db=db2
+# --source ../extra/rpl_tests/rpl_db_stmts_ignored.inc
+# (OR)
+# --replicate-wild-ignore-table=db1.%
+# --source ../extra/rpl_tests/rpl_db_stmts_ignored.inc
+###############################################################################
+--source include/rpl_connection_master.inc
+--echo #
+--echo # Execute 'CREATE DATABASE db1' on Master.
+--echo #
+CREATE DATABASE db1;
+
+--echo #
+--echo # Sync with Slave (using gtid values)
+--echo #
+--let $use_gtids=1
+--source include/sync_slave_sql_with_master.inc
+
+--echo #
+--echo # Check that even after sync is completed 'db1' does not exists
+--echo # on Slave which implies that 'CREATE DATABASE db1' is filtered
+--echo # out.
+--echo #
+--error ER_BAD_DB_ERROR
+USE db1;
+
+--echo #
+--echo # Execute other database commands (ALTER/DROP) on Master.
+--echo #
+--source include/rpl_connection_master.inc
+ALTER DATABASE db1 CHARACTER SET latin1;
+DROP DATABASE db1;
+
+--echo #
+--echo # Check that we are able to sync with slave successfully
+--echo # which implies that those commands are filtered out.
+--echo # If they were executed by Slave, that will break replication
+--echo # as we do not have 'db1' database on Slave.
+--let $use_gtids=1
+--source include/sync_slave_sql_with_master.inc
--echo *** slave must stop (Trying to delete a referenced foreing key)
connection slave;
+--let $slave_sql_errno= convert_error(ER_ROW_IS_REFERENCED_2)
source include/wait_for_slave_sql_to_stop.inc;
let $last_error = query_get_value("SHOW SLAVE STATUS", Last_SQL_Errno, 1);
--echo *** slave must stop (Trying to insert an invalid foreign key)
connection slave;
+--let $slave_sql_errno= convert_error(ER_NO_REFERENCED_ROW_2)
source include/wait_for_slave_sql_to_stop.inc;
let $last_error = query_get_value("SHOW SLAVE STATUS", Last_SQL_Errno, 1);
--echo *** slave must stop (Trying to insert a dupliacte key)
connection slave;
+--let $slave_sql_errno= convert_error(ER_DUP_ENTRY)
source include/wait_for_slave_sql_to_stop.inc;
let $last_error = query_get_value("SHOW SLAVE STATUS", Last_SQL_Errno, 1);
--echo *** slave must stop (Key was not found)
connection slave;
+--let $slave_sql_errno= convert_error(ER_KEY_NOT_FOUND)
source include/wait_for_slave_sql_to_stop.inc;
let $last_error = query_get_value("SHOW SLAVE STATUS", Last_SQL_Errno, 1);
--let $status_items= Last_IO_Errno, Last_IO_Error
--source include/show_slave_status.inc
+--let $slave_io_errno= convert_error(ER_MASTER_FATAL_ERROR_READING_BINLOG)
--source include/stop_slave.inc
RESET SLAVE;
--- /dev/null
+--disable_query_log
+--disable_result_log
+
+let OPENSSL_VERSION_INFO= $MYSQLTEST_VARDIR/log/openssl_version_info.txt;
+let OPENSSL_CONFIG_INC= $MYSQLTEST_VARDIR/log/openssl_binary_config.inc;
+
+--error 0,1
+--remove_file $OPENSSL_VERSION_INFO
+--error 0,1
+--remove_file $OPENSSL_CONFIG_INC
+
+--error 0,1, 127
+--exec openssl version > $OPENSSL_VERSION_INFO
+
+perl;
+ use strict;
+ my $search_file= $ENV{'OPENSSL_VERSION_INFO'};
+ my $search_pattern_1= "0.9.*";
+ my $search_pattern_2= "1.0.0.*";
+ my $search_pattern_3= "1.0.1.*";
+ my $content= "";
+ my $dir= $ENV{'MYSQLTEST_VARDIR'};
+ open(CONFIG_INC, ">$dir/log/openssl_binary_config.inc");
+ open(FILE, "$search_file") or die("Unable to open '$search_file' : $!\n");
+ read(FILE, $content, 100, 0);
+ close(FILE);
+
+ if ( ($content =~ m{$search_pattern_1}) || ($content =~ m{$search_pattern_2}) ||
+ ($content =~ m{$search_pattern_3}) ) {
+ print CONFIG_INC "let \$STATUS_VAR = 1;\n";
+ }
+ else {
+ print CONFIG_INC "let \$STATUS_VAR = 0;\n";
+ }
+ close(CONFIG_INC);
+EOF
+
+--source $OPENSSL_CONFIG_INC
+
+if ($STATUS_VAR)
+{
+ --error 0,1
+ --remove_file $OPENSSL_VERSION_INFO
+ --error 0,1
+ --remove_file $OPENSSL_CONFIG_INC
+ --skip Test requires openssl version to be 1.0.2+
+}
+
+--error 0,1
+--remove_file $OPENSSL_VERSION_INFO
+--error 0,1
+--remove_file $OPENSSL_CONFIG_INC
+
+--enable_query_log
+--enable_result_log
--- /dev/null
+# Only run this test if OpenSSL is supported
+let $shavars= query_get_value("SHOW STATUS LIKE 'Rsa_public_key'", Variable_name, 1);
+if ($shavars != 'Rsa_public_key'){
+ skip Need OpenSSL support;
+}
SHOW STATUS LIKE 'slave_open_temp_tables';
+ -- Show open connections/transactions in wsrep provider
+ SHOW STATUS LIKE 'wsrep_open%';
+
-- Checksum system tables to make sure they have been properly
-- restored after test
checksum table
--- Copyright (c) 2008, 2016, Oracle and/or its affiliates. All rights reserved.
+-- Copyright (c) 2008, 2017, 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
("Insecure configuration for --secure-file-priv:*"),
/*
- Galera suppressions
+ Galera suppressions
*/
("WSREP:*down context*"),
("WSREP: Failed to send state UUID:*"),
("install timer expired"),
("Last Applied Action message in non-primary configuration from member"),
+ /*
+ Bug#26585560, warning related to --pid-file
+ */
+ ("Insecure configuration for --pid-file:*"),
+ ("Few location(s) are inaccessible while checking PID filepath"),
+
("THE_LAST_SUPPRESSION")||
# --let $slave_param_value= No
# [--let $slave_param_comparison= [ < | <= | >= | > | = | != ]]
# [--let $slave_timeout= NUMBER]
+# [--let $slave_error_param= [Last_SQL_Errno | Last_IO_Errno]]
# [--let $slave_error_param= [Slave_SQL_Errno | Slave_IO_Errno]]
# [--let $rpl_debug= 1]
+# [--let $slave_io_errno= NUMBER [, NUMBER ...] [# comment]]
+# [--let $slave_sql_errno= NUMBER [, NUMBER ...] [# comment]]
# --source include/wait_for_slave_param.inc
#
# Parameters:
# setting $slave_timeout. The unit is one second.
#
# $slave_error_param
-# If set, this script will check if the column of the output from
-# SHOW SLAVE STATUS named $slave_error_param is nonzero. If it is,
-# this script will faile immediately. Typically, this should be set
+# If set, this script will check for errors in the column of the
+# output from SHOW SLAVE STATUS named $slave_error_param while
+# waiting for the parameter. Once finding an error that is not
+# expected (see $slave_io_errno and $slave_sql_errno parameters)
+# this script will fail immediately. Typically, this should be set
# to Last_IO_Errno or Last_SQL_Errno.
#
# $rpl_debug
# See include/rpl_init.inc
+#
+# $slave_io_errno
+# See include/wait_for_slave_io_error.inc
+#
+# $slave_sql_errno
+# See include/wait_for_slave_sql_error.inc
--let $include_filename= wait_for_slave_param.inc [$slave_param]
let $_slave_timeout= `select $default_timeout * $sleep_freq`;
}
-if ($slave_error_param == '')
+if ($slave_error_param)
{
- --let $slave_error_param= 1
+ if ($slave_error_param != "Last_SQL_Errno")
+ {
+ if ($slave_error_param != "Last_IO_Errno")
+ {
+ --echo *** slave_error_param = $slave_error_param
+ --die slave_error_param must be null, Last_SQL_Errno or Last_IO_Errno
+ }
+ }
}
let $_slave_param_comparison= $slave_param_comparison;
--die SHOW SLAVE STATUS returned empty result set. Slave not configured.
}
+
+# Strip away comments on $slave_io_errno and $slave_sql_errno parameters
+--let $_slave_io_errno= `SELECT IF(LOCATE('#', '$slave_io_errno') != 0, SUBSTR('$slave_io_errno', 1, LOCATE('#', '$slave_io_errno') - 1), '$slave_io_errno')`
+--let $_slave_sql_errno= `SELECT IF(LOCATE('#', '$slave_sql_errno') != 0, SUBSTR('$slave_sql_errno', 1, LOCATE('#', '$slave_sql_errno') - 1), '$slave_sql_errno')`
+
--let $_slave_timeout_counter= `select $_slave_timeout * $sleep_freq`
--let $_slave_continue= 1
while ($_slave_continue)
--let $_show_slave_status_value= query_get_value("SHOW SLAVE STATUS", $slave_param, 1)
# Check if an error condition is reached.
- if (!$slave_error_param)
+ if ($slave_error_param)
{
--let $_show_slave_status_error_value= query_get_value("SHOW SLAVE STATUS", $slave_error_param, 1)
+
+ # Check if the error condition was expected
+ if ($_show_slave_status_error_value)
+ {
+ --let $_expected_error=
+ if ($slave_error_param == "Last_IO_Errno")
+ {
+ --let $_expected_error=`SELECT FIND_IN_SET('$_show_slave_status_error_value','$_slave_io_errno')`
+ }
+ if ($slave_error_param == "Last_SQL_Errno")
+ {
+ --let $_expected_error=`SELECT FIND_IN_SET('$_show_slave_status_error_value','$_slave_sql_errno')`
+ }
+ # If the error is an expected error, just ignore it
+ if ($_expected_error)
+ {
+ --let $_show_slave_status_error_value=
+ }
+ }
+
if ($_show_slave_status_error_value)
{
--echo **** ERROR: $slave_error_param = '$_show_slave_status_error_value' while waiting for slave parameter $slave_param $_slave_param_comparison $slave_param_value ****
# *before* it clears Last_SQL_Errno. So we have to allow errors in
# the SQL thread here.
-#--let $slave_error_param= Last_SQL_Errno
+--let $slave_error_param=
source include/wait_for_slave_param.inc;
#--let $slave_error_param=
#!/usr/bin/perl
# -*- cperl -*-
-# Copyright (c) 2004, 2017, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2004, 2018, 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
mtr_report(" - skipping '$worker_savedir/'");
rmtree($worker_savedir);
}
- else {
- mtr_report(" - saving '$worker_savedir/' to '$savedir/'");
- rename($worker_savedir, $savedir);
+ else
+ {
+ rename($worker_savedir, $savedir) if $worker_savedir ne $savedir;
+
+ # Look for the test log file and put that in savedir location
+ my $logfile= "$result->{shortname}" . ".log";
+ my $logfilepath= dirname($worker_savedir) . "/" . $logfile;
+ move($logfilepath, $savedir);
+ mtr_report(" - the logfile can be found in '$savedir/$logfile'");
+
# Move any core files from e.g. mysqltest
foreach my $coref (glob("core*"), glob("*.dmp"))
{
# too many times already
my $tname= $result->{name};
my $failures= $result->{failures};
- if ($opt_retry > 1 and $failures >= $opt_retry_failure){
+ if ($opt_retry > 1 and $failures >= $opt_retry_failure)
+ {
mtr_report("\nTest $tname has failed $failures times,",
"no more retries!\n");
}
- else {
+ else
+ {
mtr_report("\nRetrying test $tname, ".
"attempt($retries/$opt_retry)...\n");
- #saving the log file as filename.failed in case of retry
- if ( $result->is_failed() ) {
- my $worker_logdir= $result->{savedir};
- my $log_file_name=dirname($worker_logdir)."/".$result->{shortname}.".log";
- rename $log_file_name,$log_file_name.".failed";
- }
delete($result->{result});
- $result->{retries}= $retries+1;
+ $result->{retries}= $retries + 1;
$result->write_test($sock, 'TESTCASE');
next;
}
$ENV{'DEFAULT_MASTER_PORT'}= $mysqld_variables{'port'};
$ENV{'MYSQL_TMP_DIR'}= $opt_tmpdir;
$ENV{'MYSQLTEST_VARDIR'}= $opt_vardir;
+ $ENV{'MYSQL_TEST_DIR_ABS'}= getcwd();
$ENV{'MYSQL_BINDIR'}= "$bindir";
$ENV{'MYSQL_SHAREDIR'}= $path_language;
$ENV{'MYSQL_CHARSETSDIR'}= $path_charsetsdir;
return defined $wsrep_on
}
+sub wsrep_is_bootstrap_server($) {
+ my $mysqld= shift;
+ return $mysqld->if_exist('wsrep_cluster_address') &&
+ ($mysqld->value('wsrep_cluster_address') eq "gcomm://" ||
+ $mysqld->value('wsrep_cluster_address') eq "'gcomm://'");
+}
sub check_wsrep_support() {
if (have_wsrep())
for (my $loop= 1; $loop <= $loops; $loop++)
{
- if (run_query_output($mysqld, $query, $outfile) != 0)
- {
- $tinfo->{logfile}= "WSREP error while trying to determine node state";
- return 0;
- }
-
- if (mtr_grab_file($outfile) =~ /^ON/)
+ if (run_query_output($mysqld, $query, $outfile) == 0 &&
+ mtr_grab_file($outfile) =~ /^ON/)
{
unlink($outfile);
return 1;
sleep_until_file_created("$datadir/auto.cnf", $opt_start_timeout,
$mysqld->{'proc'});
+ # If wsrep is on, we need to wait until the first
+ # server starts and bootstraps the cluster before
+ # starting other servers.
+ if (have_wsrep() && wsrep_is_bootstrap_server($mysqld))
+ {
+ mtr_verbose("WSREP waiting for first server to bootstrap cluster");
+ if (!wait_wsrep_ready($tinfo, $mysqld))
+ {
+ return 1;
+ }
+ }
}
}
SET @x = 0;
REPEAT SET @x = @x + 1; UNTIL @x > p1 END REPEAT;
END ;||
-Warnings:
-Warning 1404 Failed to grant EXECUTE and ALTER ROUTINE privileges
SHOW GRANTS FOR 'user1'@'localhost';
Grants for user1@localhost
GRANT USAGE ON *.* TO 'user1'@'localhost'
Grants for user2@%
GRANT USAGE ON *.* TO 'user2'@'%'
GRANT CREATE, CREATE ROUTINE ON `db1`.* TO 'user2'@'%'
+GRANT EXECUTE, ALTER ROUTINE ON PROCEDURE `db1`.`proc2` TO 'user2'@'%'
DROP PROCEDURE db1.proc1;
DROP PROCEDURE db1.proc2;
REVOKE ALL ON db1.* FROM 'user1'@'localhost';
--- /dev/null
+CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE=InnoDB ROW_FORMAT=COMPACT;
+FLUSH TABLES t1 FOR EXPORT;
+UNLOCK TABLES;
+DROP TABLE t1;
+SET GLOBAL innodb_file_format=`Barracuda`;
+SET GLOBAL innodb_file_per_table= ON;
+CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE=InnoDB ROW_FORMAT=DYNAMIC;
+ALTER TABLE t1 DISCARD TABLESPACE;
+ALTER TABLE t1 IMPORT TABLESPACE;
+ERROR HY000: Schema mismatch (Table flags don't match,server table has ROW_TYPE_DYNAMIC and the meta-data file has ROW_TYPE_COMPACT)
+DROP TABLE t1;
+SET GLOBAL innodb_file_format=`Antelope`;
select 1 as a limit 4294967296,10;
a
End of 5.1 tests
+CREATE TABLE t1 (id INT NOT NULL AUTO_INCREMENT,
+k INT,
+payload CHAR(100),
+PRIMARY KEY(id),
+KEY idx_k (k));
+INSERT INTO t1(k) VALUES (1), (2), (3), (4), (5), (6), (7), (8), (9), (10);
+ANALYZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 analyze status OK
+EXPLAIN SELECT * FROM t1 FORCE INDEX (idx_k)
+WHERE k BETWEEN 2 AND 5
+GROUP BY id
+ORDER BY id LIMIT 0,1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 range PRIMARY,idx_k idx_k 5 NULL 3 Using index condition; Using filesort
+EXPLAIN SELECT * FROM t1 FORCE INDEX (idx_k)
+WHERE k BETWEEN 2 AND 5
+GROUP BY id
+LIMIT 0,1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 range PRIMARY,idx_k idx_k 5 NULL 3 Using index condition; Using filesort
+EXPLAIN SELECT * FROM t1 FORCE INDEX (idx_k)
+WHERE k BETWEEN 2 AND 5
+ORDER BY id LIMIT 0,1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 range idx_k idx_k 5 NULL 3 Using index condition; Using filesort
+EXPLAIN SELECT * FROM t1 FORCE INDEX (idx_k)
+WHERE k BETWEEN 2 AND 5
+GROUP BY id
+ORDER BY id;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 range PRIMARY,idx_k idx_k 5 NULL 3 Using index condition; Using filesort
+SELECT * FROM t1 FORCE INDEX (idx_k)
+WHERE k BETWEEN 2 AND 5
+GROUP BY id
+ORDER BY id LIMIT 0,1;
+id k payload
+2 2 NULL
+SELECT * FROM t1 FORCE INDEX (idx_k)
+WHERE k BETWEEN 2 AND 5
+GROUP BY id
+LIMIT 0,1;
+id k payload
+2 2 NULL
+SELECT * FROM t1 FORCE INDEX (idx_k)
+WHERE k BETWEEN 2 AND 5
+ORDER BY id LIMIT 0,1;
+id k payload
+2 2 NULL
+SELECT * FROM t1 FORCE INDEX (idx_k)
+WHERE k BETWEEN 2 AND 5
+GROUP BY id
+ORDER BY id;
+id k payload
+2 2 NULL
+3 3 NULL
+4 4 NULL
+5 5 NULL
+DROP TABLE t1;
--wsrep-causal-reads
(DEPRECATED) setting this variable is equivalent to
setting wsrep_sync_wait READ flag
+ --wsrep-certification-rules=name
+ Certification rules to use in the cluster. Possible
+ values are: "strict": stricter rules that could result in
+ more certification failures. "optimized": relaxed rules
+ that allow more concurrency and cause less certification
+ failures.
--wsrep-certify-nonPK
Certify tables with no primary key
(Defaults to on; use --skip-wsrep-certify-nonPK to disable.)
wsrep-OSU-method TOI
wsrep-auto-increment-control TRUE
wsrep-causal-reads FALSE
+wsrep-certification-rules strict
wsrep-certify-nonPK TRUE
wsrep-cluster-address
wsrep-cluster-name my_wsrep_cluster
--- /dev/null
+#
+# Bug#26040870 - ASSERT ON KILL'ING A STORED ROUTINE INVOCATION.
+#
+CREATE TABLE t1 (a INT);
+CREATE FUNCTION f1() RETURNS INT
+BEGIN
+INSERT INTO t1 VALUES (1);
+RETURN 1;
+END|
+SET DEBUG_SYNC= "sp_lex_instr_before_exec_core SIGNAL sp_ready WAIT_FOR sp_finish";
+SELECT f1();
+SET DEBUG_SYNC="now WAIT_FOR sp_ready";
+KILL QUERY sp_con_id;
+SET DEBUG_SYNC="now SIGNAL sp_finish";
+# Diagnostics area is not set if routine statement execution is
+# interrupted by the KILL operation. Accessing diagnostics area in such
+# case results in the issue reported.
+# Patch for the bug25586773, checks if diagnostics area is set before
+# accessing it.
+ERROR 70100: Query execution was interrupted
+SET DEBUG_SYNC='RESET';
+DROP TABLE t1;
+DROP FUNCTION f1;
--- /dev/null
+### Trying to connect without ssl. This should establish an unencrypted connection.
+Variable_name Value
+Ssl_cipher
+### Trying to connect with ssl-mode as REQUIRED. This should establish an encrypted connection.
+Variable_name Value
+Ssl_cipher SSL_CIPHER
+### Trying to connect with ssl-verify-server-cert option. This should establish an encrypted connection.
+Variable_name Value
+Ssl_cipher SSL_CIPHER
+### Trying to connect with ssl-verify-server-cert option and hostname as nonexistent. This should fail.
+#Search for the error in the file
+### Trying to connect with ssl-verify-server-cert option and hostname as localhost. This should establish an encrypted connection as localhost is present in Alternative Subject Name in the certificate.
+Variable_name Value
+Ssl_cipher SSL_CIPHER
+### Trying to connect with ssl-verify-server-cert option and hostname as 127.0.0.1. This should establish an encrypted connection as localhost is present in Alternative Subject Name in the certificate.
+Variable_name Value
+Ssl_cipher SSL_CIPHER
SET @@long_query_time= @old_long_query_time;
SET @@global.log_output= @old_log_output;
SET @@global.slow_query_log= @old_slow_query_log;
+#
+# Bug#27197235 USER VARIABLE + UINON + DECIMAL COLUMN RETURNS
+# WRONG VALUES
+#
+SET NAMES utf8;
+SET @advertAcctId = 1000003;
+select @advertAcctId as a from dual union all select 1.0 from dual;
+a
+1000003.0
+1.0
+SET NAMES latin1;
+SET @advertAcctId = 1000003;
+select @advertAcctId as a from dual union all select 1.0 from dual;
+a
+1000003.0
+1.0
--- /dev/null
+-----BEGIN CERTIFICATE-----
+MIIDmTCCAoGgAwIBAgIJAO9Te7BEDh7eMA0GCSqGSIb3DQEBCwUAMGMxCzAJBgNV
+BAYTAklOMRIwEAYDVQQIDAlLYXJuYXRha2ExEjAQBgNVBAcMCUJhbmdhbG9yZTEP
+MA0GA1UECgwGT3JhY2xlMQ4wDAYDVQQLDAVNeVNRTDELMAkGA1UEAwwCQ0EwHhcN
+MTgwNDExMTAyMzM0WhcNMjgwMjE4MTAyMzM0WjBjMQswCQYDVQQGEwJJTjESMBAG
+A1UECAwJS2FybmF0YWthMRIwEAYDVQQHDAlCYW5nYWxvcmUxDzANBgNVBAoMBk9y
+YWNsZTEOMAwGA1UECwwFTXlTUUwxCzAJBgNVBAMMAkNBMIIBIjANBgkqhkiG9w0B
+AQEFAAOCAQ8AMIIBCgKCAQEAzmDykfk/Wd1aGE3IjAZkgd/dAP8rWF3Lnw7F9Ufo
+pTJaPRW50F1ZjqKSf83jLHYseZrvoVB9SsKQx35cLOnYUO6qKfHdHlrJ3it6chk+
+1+xsPhygXWA6qKXn7QEJTL3xQybGvO6b2hyOOmkYCNOpV5W8kfLTpUR2RbeISu7f
+9pw7EJo0uJQdhs2pzzKDVKLh7Pn7cGZGD6ByjzyOSArvpXDieErp1XOJs9qZ3llt
+2xFncpZGyCrIYADUkbqZtoITj9DemdHHoEYJon55U/u2XDFS1hELeFRYI6p6dZtk
+mGX8+FOjv7fg0sdqPPZgC84abxnfHloKrpv3BlBuHCGyewIDAQABo1AwTjAdBgNV
+HQ4EFgQU7Q3134XYDQ00T4qITT5rvnXK0gAwHwYDVR0jBBgwFoAU7Q3134XYDQ00
+T4qITT5rvnXK0gAwDAYDVR0TBAUwAwEB/zANBgkqhkiG9w0BAQsFAAOCAQEAk2mi
+j0DKq5V8ac8MPk5giCnAfVtAcFHRgYl2bBHU7k/Onu4I4dIZTGV7LfMekM/NjgZ3
+c70/fZGD0aHPaDVV7OQu1+jZelJ/8YuXrOgFyJYnGPsksBhBXLgETmai2OW1xayv
+4D0RALZYye5HqbL2IaPdJhyuo/gF6hzuMGt1k8sDfvb014zbX2mwe10ns50+BCT0
+5V3NXHdMrVS5Z8uUzntu7G0jJxq3P6Mkb5dnOLirZP+8SAlC/mLaz+pEA5tLQldN
+Dx4AhaSr4PCUPy0QBh1Uo1NahCEcdrrQ46DIQES1kxjOTAa1KItmYkkcod8TCB37
+H6uaikrzrywKXoba+Q==
+-----END CERTIFICATE-----
--- /dev/null
+-----BEGIN CERTIFICATE-----
+MIIDPjCCAiYCAQEwDQYJKoZIhvcNAQELBQAwYzELMAkGA1UEBhMCSU4xEjAQBgNV
+BAgMCUthcm5hdGFrYTESMBAGA1UEBwwJQmFuZ2Fsb3JlMQ8wDQYDVQQKDAZPcmFj
+bGUxDjAMBgNVBAsMBU15U1FMMQswCQYDVQQDDAJDQTAeFw0xODA0MTExMDI3MDha
+Fw0yODAyMTgxMDI3MDhaMGcxCzAJBgNVBAYTAklOMRIwEAYDVQQIDAlLYXJuYXRh
+a2ExEjAQBgNVBAcMCUJhbmdhbG9yZTEPMA0GA1UECgwGT3JhY2xlMQ4wDAYDVQQL
+DAVNeVNRTDEPMA0GA1UEAwwGQ2xpZW50MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8A
+MIIBCgKCAQEAv+FDomsx3sLX/yFM+g94YvbiO50jqf7fOC1gnzT2dsgcMxCtjlm+
+RdKpJDHaSfQ8hc76dp8hWwsahNtY2fSHvv61l6dO5NRZTn26eLpM1pDbVWz17wp0
+1zYICWtIEMrA7mxGPH+Lwy8YiSWa9/pmv0gk9BB1d6o5mBo/c0jA/n1iYujPiRHy
+6QTjZuWqZZwYK4pXF9jGuw0xwFMVjN+6/BMkoz/Pa46PpcQ/t2sblZympqN2n86Q
+cSlDlPu/sx0Y2PxHL0lkzxw1HDycLAX5cM7vg1AOpeq/3y55pmGPIZh3kOBcQVvF
+GjkMs2I3O8N3ztwb0iE/iLk0mcWHKVCFyQIDAQABMA0GCSqGSIb3DQEBCwUAA4IB
+AQA64dUgzwuBeugtTGD22YYsnZD6h1bZXxFdkUU06GJ9kqojJmUS5KEsY+42mmDG
+JRDovhGNr6wazwDNUUhnDqLtGTarb+E3G/0X+J38CcGgicMML0Atof5/yk6SSHa5
+K27QMfX4VtCwefB7H/g/0/cDpoaEaeZ1pCdkyEk1fsX3dQEx7RS+fPcNmH233Xxu
+No604ChGlV3Ik0VXZVjss1lwDt7D6o90O4GpIY9ngnUWMAy2JZYqMZo1Od5WBs8L
+QBT8TYePJy/jcQVf+cB1DnJIDil7Pqa+owkM+DEVLsXjVdXgT9TcTC6uxteEKKY9
+PPBRX1wsgtb2b/I4ZehqH81g
+-----END CERTIFICATE-----
--- /dev/null
+-----BEGIN RSA PRIVATE KEY-----
+MIIEowIBAAKCAQEAv+FDomsx3sLX/yFM+g94YvbiO50jqf7fOC1gnzT2dsgcMxCt
+jlm+RdKpJDHaSfQ8hc76dp8hWwsahNtY2fSHvv61l6dO5NRZTn26eLpM1pDbVWz1
+7wp01zYICWtIEMrA7mxGPH+Lwy8YiSWa9/pmv0gk9BB1d6o5mBo/c0jA/n1iYujP
+iRHy6QTjZuWqZZwYK4pXF9jGuw0xwFMVjN+6/BMkoz/Pa46PpcQ/t2sblZympqN2
+n86QcSlDlPu/sx0Y2PxHL0lkzxw1HDycLAX5cM7vg1AOpeq/3y55pmGPIZh3kOBc
+QVvFGjkMs2I3O8N3ztwb0iE/iLk0mcWHKVCFyQIDAQABAoIBAD116jQcId04i/cs
+s3tleSo56j0uGD5bZSSZZFmanVduwZmZvf3awRecYpE1ZrZJhRlXMuLMFeMTq2ri
+15L4wIJtE71/2cVyPyjlHNWO1w3jWF4EiMIIl2RX6jsaIfs+9o1oIRc/w4TBkRpc
+8UZ87mxWr399xiKOY+RUg/5pT2g0Mxj/ZstseJy9Z69jnV2Oa/2nXhiCBxn8b89m
+lunkePcBvqjoLtZPXr0S/zQlsaUAdR0KKl+5TRD/V8rjKtW7P7VCStpdEaqa8fic
+b2uCW24jsGvmwmbtrTINYQ959M6m3/Dwxl4t8QpR9rUc+WC4I0F/KvXLgINuGCxd
+0DhnSAECgYEA6pXytFGOONQF7NbqxsFWoHW+lBaGWvIJoAGwvNbqmu+rbI7wqx1z
+biWPAn6vc2nFvNnOk+jhMH/guxXlmjE9ZlmnucV2KoaPGy4uGo6NC+kOKhuSjvGG
+GCPeMK5EFUzy9fMZcIBgVsq7Jm1kdN48+CecPRQ4Tf4rpwBDO1xYOHMCgYEA0WVS
+NNdHlIGbAbk1RTA5pNTHhVkgFZcFAsViqOZnborooCUBlX6EoVlbh0fkj9h/Lh+S
+dCeptOPdG+JFGeL4aVIJn8uuAf6kKty10rBgpeoa71yH3Gpw5cil59Y5hW7Yc0bw
+ZIwNMk6st1ua2c7fbP/OKD4GuGIt/zppXLNRRdMCgYBzrFTtTXnP09zIGIHUV+mb
+XfQHmcPOfKL6X1sDAwbUN3JUKXfLKM6Odb67ADULuBBlOxF+JctE2wm5tuZszfL0
+0Si/lfrapVdTk8XwGnK6eMUfRlFSYw44QReC8atoxXTYinL04pies4DtRevPJPbz
+drS3+Yx6COcFhj+gubxWuQKBgQCRc+RKuFAMpIrcA58xVHJ2QSfnRSW4WZMtfZcu
+4/1tGCjHNW2IPr46piuiKRpnoWeWzm+ZKAQGl1H8EI0XkkYkQsxUp9NTp2K6M15J
+4CMCnT/gjVIClh2eQGaeSHzkZz8LtHdAINj53RS0uXkzWzRwLrEx2wQoCGsTI6wU
+rKsD6QKBgBktQAc7Q+1RC94tLjteK3KYE9POvd9Q0OrCrORgiyybYnk4zfXvbafa
+cPFYZwmhsN8L3KyOm5S0SsWP+vPbm6qmoryuz/MtDwCJozgtoz7fNGxcWbILF/1S
+UQDuGs1mG14od7IKu/RqLpUK5vYTOObm+9TH4zsO7qDBaG1HNMY+
+-----END RSA PRIVATE KEY-----
--- /dev/null
+-----BEGIN CERTIFICATE-----
+MIID5zCCAs+gAwIBAgIBATANBgkqhkiG9w0BAQsFADBjMQswCQYDVQQGEwJJTjES
+MBAGA1UECAwJS2FybmF0YWthMRIwEAYDVQQHDAlCYW5nYWxvcmUxDzANBgNVBAoM
+Bk9yYWNsZTEOMAwGA1UECwwFTXlTUUwxCzAJBgNVBAMMAkNBMB4XDTE4MDQxMTEw
+MjUyNFoXDTI4MDIxODEwMjUyNFowcDELMAkGA1UEBhMCSU4xEjAQBgNVBAgMCUth
+cm5hdGFrYTESMBAGA1UEBwwJQmFuZ2Fsb3JlMQ8wDQYDVQQKDAZPcmFjbGUxDjAM
+BgNVBAsMBU15U1FMMRgwFgYDVQQDDA9ub25leGlzdGVudC5jb20wggEiMA0GCSqG
+SIb3DQEBAQUAA4IBDwAwggEKAoIBAQC/sSYMr3chNWCyoHGc5EZmhINxGrWwnyQW
+5+kcOWgwpGgTNy3Ruvt2k26iMrBRFtFq6pR8SHzrJAAGhECY12+rWRh8uD6sQS4l
+P5+F5l8bXgtoMvqpX4Bkgxj880dqBJurOpXl1VVql69uWfBsxOHSRkeMZOJNIMTY
+VKljEjGaDcGAFXTJoKxe+Df63XPgwYyhH7OpUZdTkCfedU1M+C3Sw5782luW5L+E
+JiwulblHBGnTDN/6G9aXS4+l0gs3z4h2aElKmVjy0tKaXTv81zkYnClUhVFEnvzN
+G//gGsZm9Sn+Cv/V+BGEnS2gsK7FziCPJbitS03/rhS9xYcEDZcNAgMBAAGjgZgw
+gZUwCQYDVR0TBAIwADAsBglghkgBhvhCAQ0EHxYdT3BlblNTTCBHZW5lcmF0ZWQg
+Q2VydGlmaWNhdGUwHQYDVR0OBBYEFI3O1OuzzKnpmZkAKgYEz2q9uRFDMB8GA1Ud
+IwQYMBaAFO0N9d+F2A0NNE+KiE0+a751ytIAMBoGA1UdEQQTMBGCCWxvY2FsaG9z
+dIcEfwAAATANBgkqhkiG9w0BAQsFAAOCAQEAZCgA6kj6hvo+X3TUa7kZx90KHlsH
+kxSHEiEw1wjxZVwW9GzSzX/qLnK4EZjH9V5BC2k1nbBGmUJE8i5VSzIG6unRhncX
+H1+bcEvlKIESWGQ1Hk+vFW8jEhoLGsuF62TTcE5urnvWix8k/VgLZ8GbkihSVPiM
+98syw007eHUfauBj2QTYxnZuZFlW8p5BIWclDbSMQ8iuKQqLPzmipmWEVaxgI5XI
+o/k5704aW6An7LsgPNKunXT7Ykbz4HvmH4/OVIYJSWTtuVYy3tYLyKwAFtGaCe9U
+wMe/YuA2/74ir2CxbiYtVAuDa9o4Hq8oCbTfE9gQReEmHPWsw4tcwuPVZA==
+-----END CERTIFICATE-----
--- /dev/null
+-----BEGIN RSA PRIVATE KEY-----
+MIIEpQIBAAKCAQEAv7EmDK93ITVgsqBxnORGZoSDcRq1sJ8kFufpHDloMKRoEzct
+0br7dpNuojKwURbRauqUfEh86yQABoRAmNdvq1kYfLg+rEEuJT+fheZfG14LaDL6
+qV+AZIMY/PNHagSbqzqV5dVVapevblnwbMTh0kZHjGTiTSDE2FSpYxIxmg3BgBV0
+yaCsXvg3+t1z4MGMoR+zqVGXU5An3nVNTPgt0sOe/NpbluS/hCYsLpW5RwRp0wzf
++hvWl0uPpdILN8+IdmhJSplY8tLSml07/Nc5GJwpVIVRRJ78zRv/4BrGZvUp/gr/
+1fgRhJ0toLCuxc4gjyW4rUtN/64UvcWHBA2XDQIDAQABAoIBAQCivOwGnPhQMxay
+z09k2M+DvUAxx3E0Twa+g4f9tCbmFM1ectvtUAan9iZYgRv625pSYHBKyudyYQ+8
+eI62sz9UgsEtMOXUK0nXyZnOfXOEsmSQw6bWIAPKURnntUmNkffueEBF7MUlRz1i
+O+zHCqaEc7HOWN9eh1FWLxnWx91gYJEHXPkv8lITgsMO2eMqS7EMjmRNt0zpy+4M
+gGQpZvO+wyXQqjnxqSi+lwlLF18dXHZtCzatRgjUY7armU9AMSD21Hl1p9LBcP1A
+1wllqwz8xTf9iTZjlThdymZTDhlpDfNC8yBMA/vUaUc9IDSWzPpRUqUg4ViIArxA
+pfqJ3DiBAoGBAOK++/X2b5IVRc8ZD+s5FlAvGBIqBiT2qV/klBmuO5/XiTD9jd7C
+W9D1leubksn2yPtVSgrM/YXZuLOkazGCZlfFdvNoOPH2MQu4FME4AoYnHGysORtS
+uC+MuCQlKxXwCyMtTawY3U0rvCV5BgyAHuUtnsTb2ts/igbONxhSAql9AoGBANhs
+ZFqcCQRlcoPkiBfE2tMPHcubTvfkn3treK2pmXFAwc19p+2yjgTWQDFAdEUafg67
+40NYLp8YthAMQrfWTF9R1HKv4J3dIiyLAbsZZfkvh/EiiT2y53SStfFUpB4WM1Jj
+3WaWyz20tEE+kt/utxOPoGBcqMmmt9fGCyV0a5jRAoGAb6UUEMa3ptk8lz1C3lIs
+j2yw0HjKr7aYLTQyS/bDOu/4iBvAmBdg+CGEIQ9oFnOiAEa9f1Xx2s8aJ7HkaetI
+Ex2SdUUzDMho29lWttCqRX3KfCPMtoxjTl5eaMW4UkPwZ/CtlvhjNtU6/cR6WvtW
+uwdcbpfGSkAd6T3uWNZAo00CgYEAyTFy1Z0q8NBSdfR05AvYFc9+tnJKJj9+V2Eg
+jekVwWgfAqZm/503U53NjTvLGxa2y4G1kzyeEr8JOb/8IiTxWMecxYVlPbx+cYRE
+dqf02YNrUCr4BMiVTRS6WYCDFYkz6sr13tIeXN3pmKHQLqcfwOqLgCmDq/r1+3yb
+jhU9lZECgYEAr/rWaeKuJlE5U64kxZO+TcseDSSeUt+f8mLYf/KLBoh5xcGq1qPv
+4d9ljOLciJJZo1XBW9LZa5ryrIQ18wdZcj6B38GyjW4vgz5SZ+/H+KjuIdxbKNGa
+93Jar7+ZhdkdV2KBN6ucYNJJJ7R+H39Av6Vv91OBGs3jss8+rfMvlv8=
+-----END RSA PRIVATE KEY-----
--- /dev/null
+call mtr.add_suppression("An error occurred during flush stage of the commit");
+call mtr.add_suppression("Attempting backtrace. You can use the following information to find out*");
+RESET MASTER;
+CREATE TABLE t1(i INT);
+
+# Case 1 (binlog_error_action = ABORT_SERVER)
+
+SET GLOBAL binlog_error_action = ABORT_SERVER;
+
+# Case 1.1 CLIENT DISCONNECTION
+BEGIN;
+INSERT INTO t1 VALUES (1);
+SET SESSION debug= "+d,simulate_tmpdir_partition_full";
+INSERT INTO t1 VALUES (2);
+INSERT INTO t1 VALUES (3);
+ERROR HY000: Error writing file <tmp_file_name> (Errcode: ##)
+SET SESSION debug= "-d,simulate_tmpdir_partition_full";
+
+# Case 1.2 ROLLBACK
+BEGIN;
+INSERT INTO t1 VALUES (1);
+SET SESSION debug= "+d,simulate_tmpdir_partition_full";
+INSERT INTO t1 VALUES (2);
+INSERT INTO t1 VALUES (3);
+ERROR HY000: Error writing file <tmp_file_name> (Errcode: ##)
+ROLLBACK;
+SET SESSION debug= "-d,simulate_tmpdir_partition_full";
+
+# Case 1.3 COMMIT
+BEGIN;
+INSERT INTO t1 VALUES (1);
+SET SESSION debug= "+d,simulate_tmpdir_partition_full";
+INSERT INTO t1 VALUES (2);
+INSERT INTO t1 VALUES (3);
+ERROR HY000: Error writing file <tmp_file_name> (Errcode: ##)
+COMMIT;
+ERROR HY000: Binary logging not possible. Message: An error occurred during flush stage of the commit. 'binlog_error_action' is set to 'ABORT_SERVER'. Hence aborting the server.
+include/assert_grep.inc [An error occurred during flush stage of the commit. 'binlog_error_action' is set to 'ABORT_SERVER'.]
+include/assert.inc [Count of elements in t1 should be 0.]
+include/assert.inc [Query is not binlogged as expected.]
+TRUNCATE TABLE t1;
+
+# Case 2 (binlog_error_action = IGNORE_ERROR)
+
+RESET MASTER;
+SET GLOBAL binlog_error_action= IGNORE_ERROR;
+BEGIN;
+INSERT INTO t1 VALUES (1);
+SET SESSION debug= "+d,simulate_tmpdir_partition_full";
+INSERT INTO t1 VALUES (2);
+INSERT INTO t1 VALUES (3);
+ERROR HY000: Error writing file <tmp_file_name> (Errcode: ##)
+COMMIT;
+Warnings:
+Error 3 Error writing file MYSQLTEST_VARDIR/tmp/temp_file (Errcode: ##)
+Error 1026 Error writing file MYSQLTEST_VARDIR/tmp/temp_file (Errcode: ##)
+SET SESSION debug= "-d,simulate_tmpdir_partition_full";
+include/assert.inc [Count of elements in t1 should be 2.]
+SHOW BINARY LOGS;
+ERROR HY000: You are not using binary logging
+include/assert_grep.inc [An error occurred during flush stage of the commit. 'binlog_error_action' is set to 'IGNORE_ERROR'.]
+include/assert.inc [Count of elements in t1 should be 2.]
+DROP TABLE t1;
+RESET MASTER;
--- /dev/null
+--default-storage-engine=InnoDB --gtid-mode=on --enforce-gtid-consistency=on --log-slave-updates
--- /dev/null
+# === Purpose ===
+#
+# Verify that disk full/out of space errors generated during the flush
+# stage of binlog commit are properly handled by the server.
+#
+# === Implementation ===
+#
+# 1) Simulate the disk full scenario using dbug simulations so that
+# every alternate statement fails with 'No Space Error'.
+# 2) With binlog_error_action= ABORT_SERVER, prepare a transaction
+# and perform the following operations.
+# 2.1) Disconnect
+# 2.2) Rollback
+# 2.3) Commit
+# 3) Repeat step 2 with binlog_error_action= IGNORE_ERROR.
+#
+# === References ===
+#
+# Bug #27399620 BINLOG AND ENGINE BECOME INCONSISTENT WHEN BINLOG CACHE FILE
+# GETS OUT OF SPACE
+
+--source include/have_gtid.inc
+--source include/have_binlog_format_row.inc
+--source include/have_log_bin.inc
+--source include/have_debug.inc
+# Don't test this under valgrind, memory leaks will occur
+--source include/not_valgrind.inc
+# Avoid CrashReporter popup on Mac
+--source include/not_crashrep.inc
+
+call mtr.add_suppression("An error occurred during flush stage of the commit");
+call mtr.add_suppression("Attempting backtrace. You can use the following information to find out*");
+
+RESET MASTER;
+CREATE TABLE t1(i INT);
+
+--echo
+--echo # Case 1 (binlog_error_action = ABORT_SERVER)
+--echo
+--let $log_pos_before = query_get_value("SHOW BINARY LOGS", File_size, 1)
+SET GLOBAL binlog_error_action = ABORT_SERVER;
+--exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
+
+--echo
+--echo # Case 1.1 CLIENT DISCONNECTION
+connect(con1,localhost,root,,);
+--connection con1
+BEGIN;
+INSERT INTO t1 VALUES (1);
+SET SESSION debug= "+d,simulate_tmpdir_partition_full";
+INSERT INTO t1 VALUES (2);
+--replace_regex /.*Error writing file.*/Error writing file <tmp_file_name> (Errcode: ##)/
+--error ER_ERROR_ON_WRITE,
+INSERT INTO t1 VALUES (3);
+SET SESSION debug= "-d,simulate_tmpdir_partition_full";
+--disconnect con1
+
+--echo
+--echo # Case 1.2 ROLLBACK
+--connection default
+BEGIN;
+INSERT INTO t1 VALUES (1);
+SET SESSION debug= "+d,simulate_tmpdir_partition_full";
+INSERT INTO t1 VALUES (2);
+--replace_regex /.*Error writing file.*/Error writing file <tmp_file_name> (Errcode: ##)/
+--error ER_ERROR_ON_WRITE,
+INSERT INTO t1 VALUES (3);
+ROLLBACK;
+SET SESSION debug= "-d,simulate_tmpdir_partition_full";
+
+--echo
+--echo # Case 1.3 COMMIT
+BEGIN;
+INSERT INTO t1 VALUES (1);
+SET SESSION debug= "+d,simulate_tmpdir_partition_full";
+INSERT INTO t1 VALUES (2);
+--replace_regex /.*Error writing file.*/Error writing file <tmp_file_name> (Errcode: ##)/
+--error ER_ERROR_ON_WRITE,
+INSERT INTO t1 VALUES (3);
+
+# Check that flush error causing server to abort and client gets
+# ER_BINLOG_LOGGING_IMPOSSIBLE when binlog_error_action= 'ABORT_SERVER'.
+--replace_result $MYSQLTEST_VARDIR/ MYSQLTEST_VARDIR/
+--error ER_BINLOG_LOGGING_IMPOSSIBLE
+COMMIT;
+
+--exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
+--enable_reconnect
+--source include/wait_until_connected_again.inc
+
+# Check that error is present in error log
+--let $assert_file= $MYSQLTEST_VARDIR/log/mysqld.1.err
+--let $assert_only_after = CURRENT_TEST: binlog.binlog_cache_write_failure
+--let $assert_count = 1
+--let $assert_select = An error occurred during flush stage of the commit. 'binlog_error_action' is set to 'ABORT_SERVER'.
+--let $assert_text = An error occurred during flush stage of the commit. 'binlog_error_action' is set to 'ABORT_SERVER'.
+--source include/assert_grep.inc
+
+# Check that transaction is not committed
+--let $assert_cond= COUNT(*) = 0 FROM t1;
+--let $assert_text= Count of elements in t1 should be 0.
+--source include/assert.inc
+
+# Check that transaction is not binlogged as well
+--let $log_pos_after = query_get_value("SHOW BINARY LOGS", File_size, 1)
+--let $assert_cond = $log_pos_before = $log_pos_after
+--let $assert_text = Query is not binlogged as expected.
+--source include/assert.inc
+TRUNCATE TABLE t1;
+
+--echo
+--echo # Case 2 (binlog_error_action = IGNORE_ERROR)
+--echo
+RESET MASTER;
+SET GLOBAL binlog_error_action= IGNORE_ERROR;
+
+BEGIN;
+INSERT INTO t1 VALUES (1);
+SET SESSION debug= "+d,simulate_tmpdir_partition_full";
+INSERT INTO t1 VALUES (2);
+--replace_regex /.*Error writing file.*/Error writing file <tmp_file_name> (Errcode: ##)/
+--error ER_ERROR_ON_WRITE,
+INSERT INTO t1 VALUES (3);
+--replace_regex /.*Error writing file.*/Error writing file MYSQLTEST_VARDIR\/tmp\/temp_file (Errcode: ##)/
+COMMIT;
+SET SESSION debug= "-d,simulate_tmpdir_partition_full";
+
+# Check that transaction is committed
+--let $assert_cond = COUNT(*) = 2 FROM t1;
+--let $assert_text = Count of elements in t1 should be 2.
+--source include/assert.inc
+
+# Test to prove that binary log is disabled
+--error ER_NO_BINARY_LOGGING
+SHOW BINARY LOGS;
+
+# Check that error is present in error log
+--let $assert_file= $MYSQLTEST_VARDIR/log/mysqld.1.err
+--let $assert_only_after = CURRENT_TEST: binlog.binlog_cache_write_failure
+--let $assert_count = 1
+--let $assert_select = An error occurred during flush stage of the commit. 'binlog_error_action' is set to 'IGNORE_ERROR'.
+--let $assert_text = An error occurred during flush stage of the commit. 'binlog_error_action' is set to 'IGNORE_ERROR'.
+--source include/assert_grep.inc
+
+# Restart so that binary log is enabled again and we can do the below test
+--source include/restart_mysqld.inc
+
+# Check that transaction is committed (binlog position check cannot be done
+# as we would have written STOP_EVENT in the binlog while closing
+# it)
+--let $assert_cond = COUNT(*) = 2 FROM t1;
+--let $assert_text = Count of elements in t1 should be 2.
+--source include/assert.inc
+
+# Cleanup
+DROP TABLE t1;
+RESET MASTER;
# Do not use any TAB characters for whitespace.
#
##############################################################################
-
-binlog_index : codership/mysql-wsrep##71 Regression: Duplicate "file was not purged because it is the active log file" warning
+# Codership disabled tests begin here
+# Tests that have disabler=CODERSHIP will be forcefully run with "./mtr --enable-disabled" by Jenkins
+binlog_drop_if_exists : Issue#330 2018-05-16 CODERSHIP https://github.com/codership/mysql-wsrep/issues/330
+binlog_index : codership/mysql-wsrep##71 0000-00-00 CODERSHIP Regression: Duplicate "file was not purged because it is the active log file" warning
+# Codership disabled tests end here
+++ /dev/null
-
-#
-# Let's understand the topology.
-# * Independent Master with server-id = 1
-# * Galera cluster with 2 nodes: node#1 and node#2 with server-id = 2, 3
-# node#1 act as slave to Independent Master with server-id = 1
-# * Independent Slave with server-id = 4 replicating from galera node#2
-#
-
-# Use default setting for mysqld processes
-!include include/default_mysqld.cnf
-
-[mysqld]
-log-slave-updates
-log-bin=mysqld-bin
-binlog-format=row
-gtid-mode=on
-enforce-gtid-consistency=true
-
-[mysqld.1]
-server-id=1
-
-[mysqld.2]
-server-id=2
-
-wsrep_provider=@ENV.WSREP_PROVIDER
-wsrep_cluster_address='gcomm://'
-wsrep_provider_options='base_port=@mysqld.2.#galera_port;evs.install_timeout = PT15S; evs.max_install_timeouts=1;'
-
-# enforce read-committed characteristics across the cluster
-wsrep_causal_reads=ON
-wsrep_sync_wait = 15
-
-wsrep_node_address=127.0.0.1
-wsrep_sst_receive_address=127.0.0.2:@mysqld.2.#sst_port
-wsrep_node_incoming_address=127.0.0.1:@mysqld.2.port
-
-# Required for Galera
-innodb_autoinc_lock_mode=2
-
-innodb_flush_log_at_trx_commit=2
-
-[mysqld.3]
-server-id=3
-
-wsrep_provider=@ENV.WSREP_PROVIDER
-wsrep_cluster_address='gcomm://127.0.0.1:@mysqld.2.#galera_port'
-wsrep_provider_options='base_port=@mysqld.3.#galera_port;evs.install_timeout = PT15S; evs.max_install_timeouts = 1;'
-
-# enforce read-committed characteristics across the cluster
-wsrep_causal_reads=ON
-wsrep_sync_wait = 15
-
-wsrep_node_address=127.0.0.1
-wsrep_sst_receive_address=127.0.0.2:@mysqld.3.#sst_port
-wsrep_node_incoming_address=127.0.0.1:@mysqld.3.port
-
-# Required for Galera
-innodb_autoinc_lock_mode=2
-
-innodb_flush_log_at_trx_commit=2
-
-[mysqld.4]
-server-id=4
-
-[ENV]
-NODE_MYPORT_1= @mysqld.1.port
-NODE_MYSOCK_1= @mysqld.1.socket
-
-NODE_MYPORT_2= @mysqld.2.port
-NODE_MYSOCK_2= @mysqld.2.socket
-
-NODE_MYPORT_3= @mysqld.3.port
-NODE_MYSOCK_3= @mysqld.3.socket
-
-NODE_MYPORT_4= @mysqld.4.port
-NODE_MYSOCK_4= @mysqld.4.socket
-
-NODE_GALERAPORT_2= @mysqld.2.#galera_port
-NODE_GALERAPORT_3= @mysqld.3.#galera_port
-
-NODE_SSTPORT_2= @mysqld.2.#sst_port
-NODE_SSTPORT_3= @mysqld.3.#sst_port
+++ /dev/null
-#
-# This .cnf file creates a setup with a 2-node Galera cluster and one stand-alone MySQL server, to be used as a slave
-#
-
-# Use default setting for mysqld processes
-!include include/default_mysqld.cnf
-
-[mysqld]
-default-storage-engine=InnoDB
-
-[mysqld.1]
-server-id=1
-binlog-format=row
-log-bin=mysqld-bin
-log_slave_updates
-gtid-mode=on
-enforce-gtid-consistency=true
-event-scheduler=1
-
-wsrep_provider=@ENV.WSREP_PROVIDER
-wsrep_cluster_address='gcomm://'
-wsrep_provider_options='base_port=@mysqld.1.#galera_port'
-
-# enforce read-committed characteristics across the cluster
-wsrep_causal_reads=ON
-wsrep_sync_wait = 15
-
-wsrep_node_address=127.0.0.1
-wsrep_sst_receive_address=127.0.0.2:@mysqld.1.#sst_port
-wsrep_node_incoming_address=127.0.0.1:@mysqld.1.port
-
-# Required for Galera
-innodb_autoinc_lock_mode=2
-
-innodb_flush_log_at_trx_commit=2
-
-[mysqld.2]
-server-id=2
-binlog-format=row
-log-bin=mysqld-bin
-log_slave_updates
-gtid-mode=on
-enforce-gtid-consistency=true
-event-scheduler=1
-
-wsrep_provider=@ENV.WSREP_PROVIDER
-wsrep_cluster_address='gcomm://127.0.0.1:@mysqld.1.#galera_port'
-wsrep_provider_options='base_port=@mysqld.2.#galera_port'
-
-# enforce read-committed characteristics across the cluster
-wsrep_causal_reads=ON
-wsrep_sync_wait = 15
-
-wsrep_node_address=127.0.0.1
-wsrep_sst_receive_address=127.0.0.2:@mysqld.2.#sst_port
-wsrep_node_incoming_address=127.0.0.1:@mysqld.2.port
-
-# Required for Galera
-innodb_autoinc_lock_mode=2
-
-innodb_flush_log_at_trx_commit=2
-
-[mysqld.3]
-server-id=3
-replicate-ignore-db=test
-replicate-wild-ignore-table=test.%
-log-bin=mysqld-bin
-log_slave_updates
-gtid-mode=on
-enforce-gtid-consistency=true
-event-scheduler=1
-
-[ENV]
-NODE_MYPORT_1= @mysqld.1.port
-NODE_MYSOCK_1= @mysqld.1.socket
-
-NODE_MYPORT_2= @mysqld.2.port
-NODE_MYSOCK_2= @mysqld.2.socket
-
-NODE_MYPORT_3= @mysqld.3.port
-NODE_MYSOCK_3= @mysqld.3.socket
-
-NODE_GALERAPORT_1= @mysqld.1.#galera_port
-NODE_GALERAPORT_2= @mysqld.2.#galera_port
-
-NODE_SSTPORT_1= @mysqld.1.#sst_port
-NODE_SSTPORT_2= @mysqld.2.#sst_port
1 1 1
DROP TABLE c;
DROP TABLE p;
+SET GLOBAL wsrep_certification_rules='strict';
+SET GLOBAL wsrep_certification_rules='strict';
+CREATE TABLE p (f1 INTEGER PRIMARY KEY) ENGINE=INNODB;
+CREATE TABLE c (
+f1 INTEGER PRIMARY KEY,
+p_id INTEGER,
+CONSTRAINT fk_1 FOREIGN KEY (p_id) REFERENCES p (f1)
+);
+INSERT INTO p VALUES (1);
+SET AUTOCOMMIT=ON;
+START TRANSACTION;
+INSERT INTO c (f1, p_id) VALUES (10, 1);
+SET SESSION wsrep_sync_wait = 0;
+SET GLOBAL wsrep_provider_options = 'dbug=d,apply_monitor_slave_enter_sync';
+INSERT INTO c (f1, p_id) VALUES (20, 1);
+SET SESSION wsrep_on = 0;
+SET SESSION wsrep_on = 1;
+SET GLOBAL wsrep_provider_options = 'dbug=';
+SET GLOBAL wsrep_provider_options = 'dbug=d,local_monitor_enter_sync';
+COMMIT;
+SET SESSION wsrep_on = 0;
+SET SESSION wsrep_on = 1;
+SET GLOBAL wsrep_provider_options = 'signal=apply_monitor_slave_enter_sync';
+SET GLOBAL wsrep_provider_options = 'signal=local_monitor_enter_sync';
+SET GLOBAL wsrep_provider_options = 'dbug=';
+ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
+SELECT * FROM p;
+f1
+1
+SELECT * FROM c;
+f1 p_id
+20 1
+SET GLOBAL wsrep_certification_rules=default;
+SET GLOBAL wsrep_certification_rules=default;
+DROP TABLE c;
+DROP TABLE p;
+SET GLOBAL wsrep_certification_rules='optimized';
+SET GLOBAL wsrep_certification_rules='optimized';
+CREATE TABLE p (f1 INTEGER PRIMARY KEY) ENGINE=INNODB;
+CREATE TABLE c (
+f1 INTEGER PRIMARY KEY,
+p_id INTEGER,
+CONSTRAINT fk_1 FOREIGN KEY (p_id) REFERENCES p (f1)
+);
+INSERT INTO p VALUES (1);
+SET AUTOCOMMIT=ON;
+START TRANSACTION;
+INSERT INTO c (f1, p_id) VALUES (10, 1);
+SET SESSION wsrep_sync_wait = 0;
+SET GLOBAL wsrep_provider_options = 'dbug=d,apply_monitor_slave_enter_sync';
+INSERT INTO c (f1, p_id) VALUES (20, 1);
+SET SESSION wsrep_on = 0;
+SET SESSION wsrep_on = 1;
+SET GLOBAL wsrep_provider_options = 'dbug=';
+SET GLOBAL wsrep_provider_options = 'dbug=d,local_monitor_enter_sync';
+COMMIT;
+SET SESSION wsrep_on = 0;
+SET SESSION wsrep_on = 1;
+SET GLOBAL wsrep_provider_options = 'signal=apply_monitor_slave_enter_sync';
+SET GLOBAL wsrep_provider_options = 'signal=local_monitor_enter_sync';
+SET GLOBAL wsrep_provider_options = 'dbug=';
+SELECT * FROM p;
+f1
+1
+SELECT * FROM c;
+f1 p_id
+10 1
+20 1
+SET GLOBAL wsrep_certification_rules=default;
+SET GLOBAL wsrep_certification_rules=default;
+DROP TABLE c;
+DROP TABLE p;
--- /dev/null
+SET SESSION wsrep_sync_wait = 0;
+SET GLOBAL wsrep_provider_options="gmcast.isolate=2";
+SET SESSION wsrep_sync_wait = 0;
+SHOW STATUS LIKE 'wsrep_cluster_status';
+Variable_name Value
+wsrep_cluster_status non-Primary
+SET SESSION wsrep_sync_wait = default;
+SET GLOBAL wsrep_provider_options="pc.bootstrap=1";
+SET SESSION wsrep_on=0;
+CALL mtr.add_suppression("WSREP: exception from gcomm, backend must be restarted: Gcomm backend termination was requested by setting gmcast.isolate=2.");
--- /dev/null
+SET GLOBAL wsrep_provider_options = 'pc.weight=3';
+SHOW GLOBAL VARIABLES LIKE 'wsrep_provider_options';
+Variable_name Value
+wsrep_provider_options pc.weight = 3
+SET GLOBAL wsrep_provider_options = 'pc.weight=1';
VARIABLE_NAME VARIABLE_VALUE
WSREP_AUTO_INCREMENT_CONTROL ON
WSREP_CAUSAL_READS ON
+WSREP_CERTIFICATION_RULES strict
WSREP_CERTIFY_NONPK ON
WSREP_CLUSTER_ADDRESS gcomm://
WSREP_CLUSTER_NAME my_wsrep_cluster
WHERE VARIABLE_NAME LIKE 'wsrep_%'
AND VARIABLE_NAME != 'wsrep_debug_sync_waiters';
COUNT(*)
-57
+60
SELECT VARIABLE_NAME FROM INFORMATION_SCHEMA.GLOBAL_STATUS
WHERE VARIABLE_NAME LIKE 'wsrep_%'
AND VARIABLE_NAME != 'wsrep_debug_sync_waiters'
WSREP_CLUSTER_SIZE
WSREP_CLUSTER_STATE_UUID
WSREP_CLUSTER_STATUS
+WSREP_CLUSTER_WEIGHT
WSREP_COMMIT_OOOE
WSREP_COMMIT_OOOL
WSREP_COMMIT_WINDOW
WSREP_LOCAL_STATE
WSREP_LOCAL_STATE_COMMENT
WSREP_LOCAL_STATE_UUID
+WSREP_OPEN_CONNECTIONS
+WSREP_OPEN_TRANSACTIONS
WSREP_PROTOCOL_VERSION
WSREP_PROVIDER_NAME
WSREP_PROVIDER_VENDOR
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
UNLOCK TABLES;
+SET SESSION wsrep_sync_wait = DEFAULT;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
--- /dev/null
+CREATE TABLE p (f1 INTEGER PRIMARY KEY, f2 INTEGER) ENGINE=INNODB;
+CREATE TABLE c (f1 INTEGER PRIMARY KEY, p_id INTEGER) ENGINE=INNODB;
+INSERT INTO p VALUES (1, 0);
+INSERT INTO p VALUES (2, 0);
+INSERT INTO c VALUES (1, 1);
+INSERT INTO c VALUES (2, 2);
+SET AUTOCOMMIT=ON;
+START TRANSACTION;
+UPDATE p SET f1 = f1 + 100;
+SET SESSION wsrep_sync_wait = 0;
+SET GLOBAL wsrep_provider_options = 'dbug=d,apply_monitor_slave_enter_sync';
+ALTER TABLE c ADD FOREIGN KEY (p_id) REFERENCES p(f1);
+SET SESSION wsrep_on = 0;
+SET SESSION wsrep_on = 1;
+SET GLOBAL wsrep_provider_options = 'dbug=';
+SET GLOBAL wsrep_provider_options = 'dbug=d,local_monitor_enter_sync';
+COMMIT;
+SET SESSION wsrep_on = 0;
+SET SESSION wsrep_on = 1;
+SET GLOBAL wsrep_provider_options = 'signal=apply_monitor_slave_enter_sync';
+SET GLOBAL wsrep_provider_options = 'signal=local_monitor_enter_sync';
+SET GLOBAL wsrep_provider_options = 'dbug=';
+ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
+SELECT * FROM p;
+f1 f2
+1 0
+2 0
+SELECT * FROM c;
+f1 p_id
+1 1
+2 2
+DROP TABLE c;
+DROP TABLE p;
+CREATE TABLE p1 (f1 INTEGER PRIMARY KEY, f2 INTEGER) ENGINE=INNODB;
+CREATE TABLE p2 (f1 INTEGER PRIMARY KEY, f2 INTEGER) ENGINE=INNODB;
+CREATE TABLE c (f1 INTEGER PRIMARY KEY, p_id1 INTEGER, p_id2 INTEGER) ENGINE=INNODB;
+INSERT INTO p1 VALUES (1, 0), (2, 0);
+INSERT INTO p2 VALUES (1, 0), (2, 0);
+INSERT INTO c VALUES (1, 1, 1);
+INSERT INTO c VALUES (2, 2, 2);
+SET AUTOCOMMIT=ON;
+START TRANSACTION;
+UPDATE p1 SET f1 = f1 + 100;
+SET SESSION wsrep_sync_wait = 0;
+SET GLOBAL wsrep_provider_options = 'dbug=d,apply_monitor_slave_enter_sync';
+ALTER TABLE c ADD FOREIGN KEY (p_id1) REFERENCES p1(f1), ADD FOREIGN KEY (p_id2) REFERENCES p2(f1);
+SET SESSION wsrep_on = 0;
+SET SESSION wsrep_on = 1;
+SET GLOBAL wsrep_provider_options = 'dbug=';
+SET GLOBAL wsrep_provider_options = 'dbug=d,local_monitor_enter_sync';
+COMMIT;
+SET SESSION wsrep_on = 0;
+SET SESSION wsrep_on = 1;
+SET GLOBAL wsrep_provider_options = 'signal=apply_monitor_slave_enter_sync';
+SET GLOBAL wsrep_provider_options = 'signal=local_monitor_enter_sync';
+SET GLOBAL wsrep_provider_options = 'dbug=';
+ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
+SELECT * FROM p1;
+f1 f2
+1 0
+2 0
+SELECT * FROM p2;
+f1 f2
+1 0
+2 0
+SELECT * FROM c;
+f1 p_id1 p_id2
+1 1 1
+2 2 2
+DROP TABLE c;
+DROP TABLE p1;
+DROP TABLE p2;
+CREATE TABLE p1 (f1 INTEGER PRIMARY KEY, f2 INTEGER) ENGINE=INNODB;
+CREATE TABLE p2 (f1 INTEGER PRIMARY KEY, f2 INTEGER) ENGINE=INNODB;
+CREATE TABLE c (f1 INTEGER PRIMARY KEY, p_id1 INTEGER, p_id2 INTEGER) ENGINE=INNODB;
+INSERT INTO p1 VALUES (1, 0), (2, 0);
+INSERT INTO p2 VALUES (1, 0), (2, 0);
+INSERT INTO c VALUES (1, 1, 1);
+INSERT INTO c VALUES (2, 2, 2);
+SET AUTOCOMMIT=ON;
+START TRANSACTION;
+UPDATE p2 SET f1 = f1 + 100;
+SET SESSION wsrep_sync_wait = 0;
+SET GLOBAL wsrep_provider_options = 'dbug=d,apply_monitor_slave_enter_sync';
+ALTER TABLE c ADD FOREIGN KEY (p_id1) REFERENCES p1(f1), ADD FOREIGN KEY (p_id2) REFERENCES p2(f1);
+SET SESSION wsrep_on = 0;
+SET SESSION wsrep_on = 1;
+SET GLOBAL wsrep_provider_options = 'dbug=';
+SET GLOBAL wsrep_provider_options = 'dbug=d,local_monitor_enter_sync';
+COMMIT;
+SET SESSION wsrep_on = 0;
+SET SESSION wsrep_on = 1;
+SET GLOBAL wsrep_provider_options = 'signal=apply_monitor_slave_enter_sync';
+SET GLOBAL wsrep_provider_options = 'signal=local_monitor_enter_sync';
+SET GLOBAL wsrep_provider_options = 'dbug=';
+ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
+SELECT * FROM p1;
+f1 f2
+1 0
+2 0
+SELECT * FROM p2;
+f1 f2
+1 0
+2 0
+SELECT * FROM c;
+f1 p_id1 p_id2
+1 1 1
+2 2 2
+DROP TABLE c;
+DROP TABLE p1;
+DROP TABLE p2;
DROP TABLE c;
DROP TABLE p;
+#
+# Test F1 Outline:
+# ================
+#
+# Test two concurrent INSERTs on the child table.
+# (with wsrep_certification_rules=strict)
+#
+# The p table will originally have row (1)
+# The c table will originally be empty
+#
+# A new row (10, 1) pointing to parent row (1) is inserted from
+# connection node_2. A transaction which tries to INSERT another child
+# row (20, 1), pointing to the same parent, is run from connection node_1.
+#
+# Expected Outcome:
+# =================
+# A certification failure because both INSERTs try to append conflicting
+# certification keys to the writeset:
+# node_1:
+# (db=test, table=c, table index=PK f1=10, type=exclusive) (ok)
+# (db=test, table=p, table index=FK f1=1, type=exclusive) (conflict with below)
+# node_2:
+# (db=test, table=c, table index=PK f1=20, type=exclusive) (ok)
+# (db=test, table=p, table index=FK f1=1, type=exclusive) (conflict with above)
+#
+# At the end of the test:
+# parent table should have row (1)
+# child table should have row (20, 1)
+
+--connection node_1
+SET GLOBAL wsrep_certification_rules='strict';
+
+--connection node_2
+SET GLOBAL wsrep_certification_rules='strict';
+
+CREATE TABLE p (f1 INTEGER PRIMARY KEY) ENGINE=INNODB;
+CREATE TABLE c (
+ f1 INTEGER PRIMARY KEY,
+ p_id INTEGER,
+ CONSTRAINT fk_1 FOREIGN KEY (p_id) REFERENCES p (f1)
+);
+
+INSERT INTO p VALUES (1);
+
+# This is run on node1:
+--let $mw_369_parent_query = INSERT INTO c (f1, p_id) VALUES (10, 1)
+# This is run on node2:
+--let $mw_369_child_query = INSERT INTO c (f1, p_id) VALUES (20, 1)
+--source MW-369.inc
+
+# Commit fails
+--connection node_1
+--error ER_LOCK_DEADLOCK
+--reap
+
+--connection node_2
+SELECT * FROM p;
+SELECT * FROM c;
+
+--connection node_1
+SET GLOBAL wsrep_certification_rules=default;
+
+--connection node_2
+SET GLOBAL wsrep_certification_rules=default;
+
+DROP TABLE c;
+DROP TABLE p;
+
+#
+# Test F2 Outline:
+# ================
+#
+# Test two concurrent INSERTs on the child table.
+# (with wsrep_certification_rules=optimized)
+#
+# The p table will originally have row (1)
+# The c table will originally be empty
+#
+# A new row (10, 1) pointing to parent row (1) is inserted from
+# connection node_2. A transaction which tries to INSERT another child
+# row (20, 1), pointing to the same parent, is run from connection node_1.
+#
+# Expected Outcome:
+# =================
+# Both INSERTs should succeed since they don't modify the common parent
+# key.
+#
+# At the end of the test:
+# parent table should have row (1)
+# child table should have rows (10, 1), (20, 1)
+
+--connection node_1
+SET GLOBAL wsrep_certification_rules='optimized';
+
+--connection node_2
+SET GLOBAL wsrep_certification_rules='optimized';
+
+--connection node_1
+
+CREATE TABLE p (f1 INTEGER PRIMARY KEY) ENGINE=INNODB;
+CREATE TABLE c (
+ f1 INTEGER PRIMARY KEY,
+ p_id INTEGER,
+ CONSTRAINT fk_1 FOREIGN KEY (p_id) REFERENCES p (f1)
+);
+
+INSERT INTO p VALUES (1);
+
+# This is run on node1:
+--let $mw_369_parent_query = INSERT INTO c (f1, p_id) VALUES (10, 1)
+# This is run on node2:
+--let $mw_369_child_query = INSERT INTO c (f1, p_id) VALUES (20, 1)
+--source MW-369.inc
+
+--connection node_1
+--reap
+
+--connection node_2
+SELECT * FROM p;
+SELECT * FROM c;
+
+--connection node_1
+SET GLOBAL wsrep_certification_rules=default;
+
+--connection node_2
+SET GLOBAL wsrep_certification_rules=default;
+
+DROP TABLE c;
+DROP TABLE p;
-galera_wsrep_provider_unset_set : lp1379204 'Unsupported protocol downgrade: incremental data collection disabled. Expect abort.'
-galera_kill_nochanges : mysql-wsrep#24 Galera server does not restart properly if killed
-galera_toi_ddl_fk_insert : qa#39 galera_toi_ddl_fk_insert fails sporadically
-galera_sst_xtrabackup-v2-options : SST Encryption does not work with xtrabackup 2.4.2
+##############################################################################
+#
+# List the test cases that are to be disabled temporarily.
+#
+# Separate the test case name and the comment with ':'.
+#
+# <testcasename> : BUG#<xxxx> <date disabled> <disabler> <comment>
+#
+# Do not use any TAB characters for whitespace.
+#
+##############################################################################
+# Tests that have disabler=CODERSHIP will be forcefully run with "./mtr --enable-disabled" by Jenkins
+galera_kill_nochanges : mysql-wsrep#24 0000-00-00 CODERSHIP Galera server does not restart properly if killed
+galera_sst_xtrabackup-v2-options : N/A 0000-00-00 CODERSHIP SST Encryption does not work with xtrabackup 2.4.2
+galera_toi_ddl_fk_insert : qa#39 0000-00-00 CODERSHIP galera_toi_ddl_fk_insert fails sporadically
+galera_var_innodb_disallow_writes : Issue#330 2018-05-16 CODERSHIP https://github.com/codership/mysql-wsrep/issues/330
+galera_wsrep_provider_unset_set : lp1379204 0000-00-00 CODERSHIP 'Unsupported protocol downgrade: incremental data collection disabled. Expect abort.'
--- /dev/null
+#
+# The purpose of this test is to verify that if an exception is
+# thrown from gcomm background thread, the provider terminates properly
+# and wsrep_ready becomes 0.
+#
+
+--source include/have_innodb.inc
+--source include/galera_cluster.inc
+
+# Force node_2 gcomm background thread to terminate via exception.
+--connection node_2
+--let $wsrep_cluster_address = `SELECT @@wsrep_cluster_address`
+# Setting gmcast.isolate=2 will force gcomm background thread to
+# throw exception.
+SET SESSION wsrep_sync_wait = 0;
+SET GLOBAL wsrep_provider_options="gmcast.isolate=2";
+
+# Wait until wsrep_ready becomes 0.
+--let $wait_condition = SELECT VARIABLE_VALUE = 0 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME ='wsrep_ready'
+--source include/wait_condition.inc
+
+# Wait until node_1 ends up in non-prim and rebootstrap the cluster.
+--connection node_1
+SET SESSION wsrep_sync_wait = 0;
+--let $wait_condition = SELECT VARIABLE_VALUE = 1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME ='wsrep_cluster_size'
+--source include/wait_condition.inc
+SHOW STATUS LIKE 'wsrep_cluster_status';
+SET SESSION wsrep_sync_wait = default;
+SET GLOBAL wsrep_provider_options="pc.bootstrap=1";
+
+# Restart node_2
+--connection node_2
+SET SESSION wsrep_on=0;
+--source include/restart_mysqld.inc
+
+--connection node_2
+CALL mtr.add_suppression("WSREP: exception from gcomm, backend must be restarted: Gcomm backend termination was requested by setting gmcast.isolate=2.");
--- /dev/null
+# galera#505 - Change of pc.weight wsrep param will be correctly stored in wsrep_provider_options variable
+
+--source include/galera_cluster.inc
+
+--connection node_1
+
+# Convert "... pc.weight = N; ..." to "N; ..."
+--let $s1 = `SELECT SUBSTR(@@wsrep_provider_options, LOCATE('pc.weight =', @@wsrep_provider_options) + LENGTH('pc.weight = '))`
+# Convert "N; ..." to "N"
+--let $pc_weight_value = `SELECT SUBSTR('$s1', 1, LOCATE(';', '$s1') - 1)`
+
+SET GLOBAL wsrep_provider_options = 'pc.weight=3';
+
+-- replace_regex /.*(pc\.weight = [0-9]+);.*/\1/
+SHOW GLOBAL VARIABLES LIKE 'wsrep_provider_options';
+
+--eval SET GLOBAL wsrep_provider_options = 'pc.weight=$pc_weight_value'
--source include/galera_cluster.inc
--source include/big_test.inc
+--source include/have_log_bin.inc
SET SESSION wsrep_sync_wait = 0;
CREATE TABLE t1 (f1 INTEGER PRIMARY KEY AUTO_INCREMENT, f2 LONGBLOB) ENGINE=InnoDB;
DELIMITER ;|
+--let $wsrep_last_committed_before = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'wsrep_last_committed'`
+
--connect node_1_insert_simple, 127.0.0.1, root, , test, $NODE_MYPORT_1
--connect node_1_insert_multi, 127.0.0.1, root, , test, $NODE_MYPORT_1
--connect node_1_insert_transaction, 127.0.0.1, root, , test, $NODE_MYPORT_1
--connection node_2
SET SESSION wsrep_sync_wait = 0;
+
+# Make sure that node_2 is not killed while TOIs are applied.
+# Otherwhise we risk that grastate file is marked unsafe, and
+# as a consequence the node cannot rejoin with IST.
+--let $wait_condition = SELECT VARIABLE_VALUE > $wsrep_last_committed_before FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'wsrep_last_committed'
+--source include/wait_condition.inc
+
--source include/kill_galera.inc
--sleep 10
--source include/start_mysqld.inc
--connection node_1
---source include/wait_until_connected_again.inc
---source include/galera_wait_ready.inc
--let $wait_condition = SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
+--source include/wait_condition.inc
--let $diff_servers = 1 2
--source include/diff_servers.inc
while ($count)
{
--disable_query_log
- --let $ddl_var = `SELECT CONCAT("CREATE TABLE t", $count, " (f1 INTEGER AUTO_INCREMENT PRIMARY KEY) ENGINE=InnoDB")`
+ --let $ddl_var = `SELECT CONCAT("CREATE TABLE t", $count, " (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB")`
--eval $ddl_var
--enable_query_log
--dec $count
while ($count)
{
--disable_query_log
- --let $ddl_var = `SELECT CONCAT("INSERT INTO t", $count, " VALUES (DEFAULT)")`
+ --let $ddl_var = `SELECT CONCAT("INSERT INTO t", $count, " VALUES (1)")`
--eval $ddl_var
--enable_query_log
--dec $count
--echo Shutting down server ...
--source include/shutdown_mysqld.inc
---sleep 5
--connection node_1
INSERT INTO t1 VALUES (11);
--connection node_3
--source include/start_mysqld.inc
---sleep 5
---source include/wait_until_connected_again.inc
INSERT INTO t1 VALUES (131);
--echo Shutting down server ...
--source include/shutdown_mysqld.inc
---sleep 5
--connection node_1
INSERT INTO t1 VALUES (21);
--connection node_2
--source include/start_mysqld.inc
---sleep 5
---source include/wait_until_connected_again.inc
INSERT INTO t1 VALUES (221);
--echo Shutting down server ...
--source include/shutdown_mysqld.inc
---sleep 5
--connection node_1
INSERT INTO t1 VALUES (31);
--connection node_4
--source include/start_mysqld.inc
---sleep 5
---source include/wait_until_connected_again.inc
INSERT INTO t1 VALUES (341);
INSERT INTO t1 VALUES (13);
--source include/kill_galera.inc
---sleep 5
--connection node_1
---source include/wait_until_connected_again.inc
INSERT INTO t1 VALUES (11);
--connection node_2
--connection node_3
--source include/start_mysqld.inc
---sleep 5
---source include/wait_until_connected_again.inc
INSERT INTO t1 VALUES (131);
INSERT INTO t1 VALUES (22);
--source include/kill_galera.inc
---sleep 5
--connection node_1
---source include/wait_until_connected_again.inc
INSERT INTO t1 VALUES (21);
--connection node_3
--connection node_2
--source include/start_mysqld.inc
---sleep 5
---source include/wait_until_connected_again.inc
INSERT INTO t1 VALUES (221);
INSERT INTO t1 VALUES (34);
--source include/kill_galera.inc
---sleep 5
--connection node_1
---source include/wait_until_connected_again.inc
INSERT INTO t1 VALUES (31);
--connection node_2
--connection node_4
--source include/start_mysqld.inc
---sleep 5
---source include/wait_until_connected_again.inc
INSERT INTO t1 VALUES (341);
--connection node_2a
--reap
UNLOCK TABLES;
---sleep 2
+
+SET SESSION wsrep_sync_wait = DEFAULT;
SHOW CREATE TABLE t1;
SELECT * from t1;
--- /dev/null
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+--source include/have_debug_sync.inc
+--source suite/galera/include/galera_have_debug_sync.inc
+
+# Open connection node_1a here, MW-369.inc will use it later
+--connect node_1a, 127.0.0.1, root, , test, $NODE_MYPORT_1
+
+#
+# Test the scenario where a foreign key is added to an existing child table, and
+# concurrently UPDATE the parent table so that it violates the constraint.
+#
+# We expect that ALTER TABLE ADD FOREIGN KEY adds a table level key on both
+# parent and child table. And therefore we also expect the UPDATE to fail
+# certification.
+#
+--connection node_1
+CREATE TABLE p (f1 INTEGER PRIMARY KEY, f2 INTEGER) ENGINE=INNODB;
+CREATE TABLE c (f1 INTEGER PRIMARY KEY, p_id INTEGER) ENGINE=INNODB;
+
+INSERT INTO p VALUES (1, 0);
+INSERT INTO p VALUES (2, 0);
+
+INSERT INTO c VALUES (1, 1);
+INSERT INTO c VALUES (2, 2);
+
+--let $mw_369_parent_query = UPDATE p SET f1 = f1 + 100
+--let $mw_369_child_query = ALTER TABLE c ADD FOREIGN KEY (p_id) REFERENCES p(f1)
+
+--source MW-369.inc
+
+# Expect certification failure
+--connection node_1
+--error ER_LOCK_DEADLOCK
+--reap
+
+--connection node_2
+SELECT * FROM p;
+SELECT * FROM c;
+
+DROP TABLE c;
+DROP TABLE p;
+
+
+#
+# Same as above, except that two foreign keys pointing to different parent
+# tables are added, p1 and p2. Concurrently UPDATE p1.
+#
+# Expect certification error on UPDATE.
+#
+--connection node_1
+CREATE TABLE p1 (f1 INTEGER PRIMARY KEY, f2 INTEGER) ENGINE=INNODB;
+CREATE TABLE p2 (f1 INTEGER PRIMARY KEY, f2 INTEGER) ENGINE=INNODB;
+CREATE TABLE c (f1 INTEGER PRIMARY KEY, p_id1 INTEGER, p_id2 INTEGER) ENGINE=INNODB;
+
+INSERT INTO p1 VALUES (1, 0), (2, 0);
+INSERT INTO p2 VALUES (1, 0), (2, 0);
+
+INSERT INTO c VALUES (1, 1, 1);
+INSERT INTO c VALUES (2, 2, 2);
+
+--let $mw_369_parent_query = UPDATE p1 SET f1 = f1 + 100
+--let $mw_369_child_query = ALTER TABLE c ADD FOREIGN KEY (p_id1) REFERENCES p1(f1), ADD FOREIGN KEY (p_id2) REFERENCES p2(f1)
+
+--source MW-369.inc
+
+# Expect certification failure
+--connection node_1
+--error ER_LOCK_DEADLOCK
+--reap
+
+--connection node_2
+SELECT * FROM p1;
+SELECT * FROM p2;
+SELECT * FROM c;
+
+DROP TABLE c;
+DROP TABLE p1;
+DROP TABLE p2;
+
+
+#
+# Same as above, except that UPDATE is on p2.
+#
+--connection node_1
+CREATE TABLE p1 (f1 INTEGER PRIMARY KEY, f2 INTEGER) ENGINE=INNODB;
+CREATE TABLE p2 (f1 INTEGER PRIMARY KEY, f2 INTEGER) ENGINE=INNODB;
+CREATE TABLE c (f1 INTEGER PRIMARY KEY, p_id1 INTEGER, p_id2 INTEGER) ENGINE=INNODB;
+
+INSERT INTO p1 VALUES (1, 0), (2, 0);
+INSERT INTO p2 VALUES (1, 0), (2, 0);
+
+INSERT INTO c VALUES (1, 1, 1);
+INSERT INTO c VALUES (2, 2, 2);
+
+--let $mw_369_parent_query = UPDATE p2 SET f1 = f1 + 100
+--let $mw_369_child_query = ALTER TABLE c ADD FOREIGN KEY (p_id1) REFERENCES p1(f1), ADD FOREIGN KEY (p_id2) REFERENCES p2(f1)
+
+--source MW-369.inc
+
+# Expect certification failure
+--connection node_1
+--error ER_LOCK_DEADLOCK
+--reap
+
+--connection node_2
+SELECT * FROM p1;
+SELECT * FROM p2;
+SELECT * FROM c;
+
+DROP TABLE c;
+DROP TABLE p1;
+DROP TABLE p2;
SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
VARIABLE_VALUE = 2
1
+SET SESSION wsrep_sync_wait = DEFAULT;
SELECT COUNT(*) = 1 FROM t1;
COUNT(*) = 1
1
+SELECT VARIABLE_VALUE = 3 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_weight';
+VARIABLE_VALUE = 3
+1
SET GLOBAL wsrep_provider_options = 'pc.weight=3';
-Suspending node ...
+SELECT VARIABLE_VALUE = 5 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_weight';
+VARIABLE_VALUE = 5
+1
+SET GLOBAL wsrep_provider_options = 'gmcast.isolate=1';
SET SESSION wsrep_sync_wait=0;
SET SESSION wsrep_on=OFF;
SET SESSION wsrep_on=ON;
SHOW STATUS LIKE 'wsrep_cluster_size';
Variable_name Value
wsrep_cluster_size 2
+SHOW STATUS LIKE 'wsrep_cluster_weight';
+Variable_name Value
+wsrep_cluster_weight 0
SHOW STATUS LIKE 'wsrep_cluster_status';
Variable_name Value
wsrep_cluster_status non-Primary
Variable_name Value
wsrep_local_state_comment Initialized
SET SESSION wsrep_sync_wait=0;
+SET SESSION wsrep_on=OFF;
+SET SESSION wsrep_on=ON;
SHOW STATUS LIKE 'wsrep_cluster_size';
Variable_name Value
wsrep_cluster_size 2
+SHOW STATUS LIKE 'wsrep_cluster_weight';
+Variable_name Value
+wsrep_cluster_weight 0
SHOW STATUS LIKE 'wsrep_cluster_status';
Variable_name Value
wsrep_cluster_status non-Primary
SHOW STATUS LIKE 'wsrep_local_state_comment';
Variable_name Value
wsrep_local_state_comment Initialized
-Resuming node ...
+SELECT VARIABLE_VALUE = 3 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_weight';
+VARIABLE_VALUE = 3
+1
SELECT VARIABLE_VALUE = 'Primary' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status';
VARIABLE_VALUE = 'Primary'
1
VARIABLE_VALUE = 'Synced'
1
SET GLOBAL wsrep_provider_options = 'pc.weight=1';
-SET SESSION wsrep_sync_wait=0;
-SET SESSION wsrep_sync_wait=0;
+SELECT VARIABLE_VALUE = 1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_weight';
+VARIABLE_VALUE = 1
+1
+SET GLOBAL wsrep_provider_options = 'gmcast.isolate=0';
SELECT VARIABLE_VALUE = 3 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
VARIABLE_VALUE = 3
1
+SELECT VARIABLE_VALUE = 3 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_weight';
+VARIABLE_VALUE = 3
+1
SELECT VARIABLE_VALUE = 'Primary' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status';
VARIABLE_VALUE = 'Primary'
1
SELECT VARIABLE_VALUE = 3 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
VARIABLE_VALUE = 3
1
+SELECT VARIABLE_VALUE = 3 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_weight';
+VARIABLE_VALUE = 3
+1
SELECT VARIABLE_VALUE = 'Primary' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status';
VARIABLE_VALUE = 'Primary'
1
SELECT VARIABLE_VALUE = 3 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
VARIABLE_VALUE = 3
1
+SELECT VARIABLE_VALUE = 3 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_weight';
+VARIABLE_VALUE = 3
+1
SELECT VARIABLE_VALUE = 'Primary' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status';
VARIABLE_VALUE = 'Primary'
1
--- /dev/null
+##############################################################################
+#
+# List the test cases that are to be disabled temporarily.
+#
+# Separate the test case name and the comment with ':'.
+#
+# <testcasename> : BUG#<xxxx> <date disabled> <disabler> <comment>
+#
+# Do not use any TAB characters for whitespace.
+#
+##############################################################################
+# Tests that have disabler=CODERSHIP will be forcefully run with "./mtr --enable-disabled" by Jenkins
+galera_evs_suspect_timeout : Issue#330 2018-05-16 CODERSHIP https://github.com/codership/mysql-wsrep/issues/330
--enable_query_log
--source include/wait_until_connected_again.inc
+SET SESSION wsrep_sync_wait = DEFAULT;
SELECT COUNT(*) = 1 FROM t1;
DROP TABLE t1;
--source include/have_innodb.inc
--connection node_1
+SELECT VARIABLE_VALUE = 3 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_weight';
SET GLOBAL wsrep_provider_options = 'pc.weight=3';
---source include/galera_suspend.inc
---sleep 10
+SELECT VARIABLE_VALUE = 5 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_weight';
+
+# Isolate node_1 from the cluster.
+SET GLOBAL wsrep_provider_options = 'gmcast.isolate=1';
--connection node_2
# Do not wait for causality as we are no longer in the primary component
# We can not use SELECT queries here, as only SHOW is allowed to run.
# For nodes #2 and #3, we expect a non-primary component of size 2
-
+# and cluster weight 0
SHOW STATUS LIKE 'wsrep_cluster_size';
+SHOW STATUS LIKE 'wsrep_cluster_weight';
SHOW STATUS LIKE 'wsrep_cluster_status';
SHOW STATUS LIKE 'wsrep_connected';
SHOW STATUS LIKE 'wsrep_ready';
--source include/galera_connect.inc
--connection node_3
SET SESSION wsrep_sync_wait=0;
+SET SESSION wsrep_on=OFF;
+--let $wait_condition = SELECT VARIABLE_VALUE = 'non-Primary' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status'
+--source include/wait_condition.inc
+SET SESSION wsrep_on=ON;
SHOW STATUS LIKE 'wsrep_cluster_size';
+SHOW STATUS LIKE 'wsrep_cluster_weight';
SHOW STATUS LIKE 'wsrep_cluster_status';
SHOW STATUS LIKE 'wsrep_connected';
SHOW STATUS LIKE 'wsrep_ready';
SHOW STATUS LIKE 'wsrep_local_state_comment';
--connection node_1
---source include/galera_resume.inc
---sleep 10
---source include/wait_until_connected_again.inc
# For Node #1, we expect a primary component of size 1
--let $wait_condition = SELECT VARIABLE_VALUE = 1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'
--source include/wait_condition.inc
+SELECT VARIABLE_VALUE = 3 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_weight';
SELECT VARIABLE_VALUE = 'Primary' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status';
SELECT VARIABLE_VALUE = 'ON' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_connected';
SELECT VARIABLE_VALUE = 'ON' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_ready';
SELECT VARIABLE_VALUE = 'Synced' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_state_comment';
SET GLOBAL wsrep_provider_options = 'pc.weight=1';
+SELECT VARIABLE_VALUE = 1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_weight';
-# Restore the cluster by resetting wsrep_cluster_address on nodes #1 and #2
+# Resume cluster connectivity on node_1
+--connection node_1
+SET GLOBAL wsrep_provider_options = 'gmcast.isolate=0';
---connection node_2
---disable_query_log
---eval SET GLOBAL wsrep_cluster_address = @@wsrep_cluster_address;
---enable_query_log
+--let $wait_condition = SELECT VARIABLE_VALUE = 3 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'
+--source include/wait_condition.inc
-SET SESSION wsrep_sync_wait=0;
---source include/wait_until_connected_again.inc
+--connection node_2
+--source include/wait_condition.inc
--connection node_3
---disable_query_log
---eval SET GLOBAL wsrep_cluster_address = @@wsrep_cluster_address;
---enable_query_log
-
-SET SESSION wsrep_sync_wait=0;
---source include/wait_until_connected_again.inc
-
-# On all nodes, we now expect a Primary component of size 3, Synced and ready
+--source include/wait_condition.inc
--connection node_1
---source include/wait_until_connected_again.inc
+--source include/wait_condition.inc
+
+# On all nodes, we now expect a Primary component of size 3, weight 3, Synced and ready
SELECT VARIABLE_VALUE = 3 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
+SELECT VARIABLE_VALUE = 3 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_weight';
SELECT VARIABLE_VALUE = 'Primary' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status';
SELECT VARIABLE_VALUE = 'ON' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_connected';
SELECT VARIABLE_VALUE = 'ON' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_ready';
--connection node_2
SELECT VARIABLE_VALUE = 3 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
+SELECT VARIABLE_VALUE = 3 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_weight';
SELECT VARIABLE_VALUE = 'Primary' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status';
SELECT VARIABLE_VALUE = 'ON' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_connected';
SELECT VARIABLE_VALUE = 'ON' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_ready';
--connection node_3
SELECT VARIABLE_VALUE = 3 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
+SELECT VARIABLE_VALUE = 3 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_weight';
SELECT VARIABLE_VALUE = 'Primary' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status';
SELECT VARIABLE_VALUE = 'ON' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_connected';
SELECT VARIABLE_VALUE = 'ON' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_ready';
--- /dev/null
+CREATE TABLE parent (a INT PRIMARY KEY, b INT NOT NULL) ENGINE = InnoDB;
+INSERT INTO parent VALUES(1,2),(2,2);
+CREATE TABLE child (a INT PRIMARY KEY, b INT NOT NULL) ENGINE = InnoDB;
+INSERT INTO child VALUES (10, 2);
+SET DEBUG_SYNC = 'innodb_inplace_alter_table_enter SIGNAL start_create
+WAIT_FOR go_ahead';
+CREATE UNIQUE INDEX idx ON parent(b);;
+SET DEBUG_SYNC = 'now WAIT_FOR start_create';
+INSERT INTO parent VALUES(4, 2);
+SET DEBUG_SYNC = 'now SIGNAL go_ahead';
+ERROR 23000: Duplicate entry '2' for key 'idx'
+SET DEBUG_SYNC = 'now SIGNAL conn_add_fk';
+SET DEBUG_SYNC = 'now WAIT_FOR conn_add_fk';
+ALTER TABLE child ADD CONSTRAINT cfx FOREIGN KEY (b) REFERENCES parent(b);
+ERROR HY000: Cannot add foreign key constraint
+DROP TABLE child;
+DROP TABLE parent;
DROP TABLE source_db.t1;
DROP DATABASE source_db;
DROP DATABASE dest_db;
+#
+# BUG #26334149 MYSQL CRASHES WHEN FULL TEXT INDEXES IBD FILES ARE
+# ORPHANED DUE TO RENAME TABLE
+#
+CREATE DATABASE db1;
+USE db1;
+CREATE TABLE notes (
+id int(11) NOT NULL AUTO_INCREMENT,
+body text COLLATE utf8_unicode_ci,
+PRIMARY KEY (id)
+) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8
+COLLATE=utf8_unicode_ci;
+ALTER TABLE notes ADD FULLTEXT INDEX index_ft_body (body(255));
+Warnings:
+Warning 124 InnoDB rebuilding table to add column FTS_DOC_ID
+DROP INDEX index_ft_body ON notes;
+CREATE DATABASE db2;
+RENAME TABLE db1.notes TO db2.notes;
+DROP DATABASE db1;
+DROP DATABASE db2;
ERROR HY000: Tablespace has been discarded for table 't1'
restore: t1 .ibd and .cfg files
ALTER TABLE t1 IMPORT TABLESPACE;
-ERROR HY000: Schema mismatch (Table flags don't match, server table has 0x5 and the meta-data file has 0x0)
+ERROR HY000: Schema mismatch (Table flags don't match,server table has ROW_TYPE_COMPACT and the meta-data file has ROW_TYPE_REDUNDANT)
unlink: t1.ibd
unlink: t1.cfg
DROP TABLE t1;
ERROR HY000: Tablespace has been discarded for table 't1'
restore: t1 .ibd and .cfg files
ALTER TABLE t1 IMPORT TABLESPACE;
-ERROR HY000: Schema mismatch (Table flags don't match, server table has 0x5 and the meta-data file has 0x0)
+ERROR HY000: Schema mismatch (Table flags don't match,server table has ROW_TYPE_DYNAMIC and the meta-data file has ROW_TYPE_REDUNDANT)
unlink: t1.ibd
unlink: t1.cfg
DROP TABLE t1;
ERROR HY000: Tablespace has been discarded for table 't1'
restore: t1 .ibd and .cfg files
ALTER TABLE t1 IMPORT TABLESPACE;
-ERROR HY000: Schema mismatch (Table flags don't match, server table has 0x5 and the meta-data file has 0x1)
+ERROR HY000: Schema mismatch (Table flags don't match,server table has ROW_TYPE_REDUNDANT and the meta-data file has ROW_TYPE_COMPACT)
unlink: t1.ibd
unlink: t1.cfg
DROP TABLE t1;
ERROR HY000: Tablespace has been discarded for table 't1'
restore: t1 .ibd and .cfg files
ALTER TABLE t1 IMPORT TABLESPACE;
-ERROR HY000: Schema mismatch (Table flags don't match, server table has 0x5 and the meta-data file has 0x1)
+ERROR HY000: Schema mismatch (Table flags don't match,server table has ROW_TYPE_DYNAMIC and the meta-data file has ROW_TYPE_COMPACT)
unlink: t1.ibd
unlink: t1.cfg
DROP TABLE t1;
ERROR HY000: Tablespace has been discarded for table 't1'
restore: t1 .ibd and .cfg files
ALTER TABLE t1 IMPORT TABLESPACE;
-ERROR HY000: Schema mismatch (Table flags don't match, server table has 0x5 and the meta-data file has 0x21)
+ERROR HY000: Schema mismatch (Table flags don't match,server table has ROW_TYPE_COMPACT and the meta-data file has ROW_TYPE_DYNAMIC)
unlink: t1.ibd
unlink: t1.cfg
DROP TABLE t1;
ERROR HY000: Tablespace has been discarded for table 't1'
restore: t1 .ibd and .cfg files
ALTER TABLE t1 IMPORT TABLESPACE;
-ERROR HY000: Schema mismatch (Table flags don't match, server table has 0x5 and the meta-data file has 0x21)
+ERROR HY000: Schema mismatch (Table flags don't match,server table has ROW_TYPE_REDUNDANT and the meta-data file has ROW_TYPE_DYNAMIC)
unlink: t1.ibd
unlink: t1.cfg
DROP TABLE t1;
--- /dev/null
+#
+## Bug #26654685 INDEX->ID == BTR_PAGE_GET_INDEX_ID(PAGE)
+## AT BTR_CUR_SEARCH_TO_NTH_LEVEL IN BTR/B
+#
+
+--source include/have_debug.inc
+--source include/have_debug_sync.inc
+--source include/count_sessions.inc
+--source include/have_innodb_16k.inc
+
+CREATE TABLE parent (a INT PRIMARY KEY, b INT NOT NULL) ENGINE = InnoDB;
+INSERT INTO parent VALUES(1,2),(2,2);
+CREATE TABLE child (a INT PRIMARY KEY, b INT NOT NULL) ENGINE = InnoDB;
+INSERT INTO child VALUES (10, 2);
+
+# This should rollback due to dup key
+SET DEBUG_SYNC = 'innodb_inplace_alter_table_enter SIGNAL start_create
+WAIT_FOR go_ahead';
+--send CREATE UNIQUE INDEX idx ON parent(b);
+
+# Make table ref_count > 1
+connect (con1,localhost,root,,);
+connection con1;
+SET DEBUG_SYNC = 'now WAIT_FOR start_create';
+# If the Galera library is loaded then the INSERT below is aborted:
+# 2018-07-31 18:10:18 53686 [Note] WSREP: TO BEGIN: -1, 0 : CREATE UNIQUE INDEX idx ON parent(b)
+# 2018-07-31 18:10:18 53686 [Note] WSREP: TO BEGIN: 5, 2
+# 2018-07-31 18:10:18 53686 [Note] WSREP: commit failed for reason: 3 5 INSERT INTO parent VALUES(4, 2)
+# 2018-07-31 18:10:18 53686 [Note] WSREP: conflict state: 0
+# 2018-07-31 18:10:18 53686 [Note] WSREP: cluster conflict due to certification failure for threads:
+# 2018-07-31 18:10:18 53686 [Note] WSREP: Victim thread:
+# THD: 5, mode: local, state: executing, conflict: cert failure, seqno: 6
+# SQL: INSERT INTO parent VALUES(4, 2)
+# 2018-07-31 18:10:18 53686 [Note] WSREP: cleanup transaction for LOCAL_STATE: INSERT INTO parent VALUES(4, 2)
+# 2018-07-31 18:10:18 53686 [Note] WSREP: wsrep retrying AC query: INSERT INTO parent VALUES(4, 2)
+# 2018-07-31 18:10:18 53686 [Note] WSREP: commit failed for reason: 3 5 INSERT INTO parent VALUES(4, 2)
+# 2018-07-31 18:10:18 53686 [Note] WSREP: conflict state: 0
+# 2018-07-31 18:10:18 53686 [Note] WSREP: cluster conflict due to certification failure for threads:
+# 2018-07-31 18:10:18 53686 [Note] WSREP: Victim thread:
+# THD: 5, mode: local, state: executing, conflict: cert failure, seqno: 7
+# SQL: INSERT INTO parent VALUES(4, 2)
+# 2018-07-31 18:10:18 53686 [Note] WSREP: cleanup transaction for LOCAL_STATE: INSERT INTO parent VALUES(4, 2)
+# 2018-07-31 18:10:18 53686 [Note] WSREP: cert failure, thd: 5 is_AC: 1, retry: 1 - 1 SQL: INSERT INTO parent VALUES(4, 2)
+# 2018-07-31 18:10:18 53686 [Note] WSREP: releasing retry_query: conf 0 sent 0 kill 0 errno 1213 SQL INSERT INTO parent VALUES(4, 2)
+--error 0,ER_LOCK_DEADLOCK
+INSERT INTO parent VALUES(4, 2);
+SET DEBUG_SYNC = 'now SIGNAL go_ahead';
+
+connection default;
+--error ER_DUP_ENTRY
+reap;
+SET DEBUG_SYNC = 'now SIGNAL conn_add_fk';
+
+connection con1;
+SET DEBUG_SYNC = 'now WAIT_FOR conn_add_fk';
+--error ER_CANNOT_ADD_FOREIGN
+ALTER TABLE child ADD CONSTRAINT cfx FOREIGN KEY (b) REFERENCES parent(b);
+
+--connection default
+DROP TABLE child;
+DROP TABLE parent;
+--disconnect con1
# Do not use any TAB characters for whitespace.
#
##############################################################################
+# Codership disabled tests begin here
+# Tests that have disabler=CODERSHIP will be forcefully run with "./mtr --enable-disabled" by Jenkins
+innodb_bug-13628249 : Issue#330 2018-05-16 CODERSHIP https://github.com/codership/mysql-wsrep/issues/330
+monitor : Issue#330 2018-05-16 CODERSHIP https://github.com/codership/mysql-wsrep/issues/330
+innodb_file_limit_check : BUG#89208 2018-05-31 VasilDimov https://bugs.mysql.com/bug.php?id=89208
+# Codership disabled tests end here
eval DROP DATABASE $source_db;
eval DROP DATABASE $dest_db;
+--echo #
+--echo # BUG #26334149 MYSQL CRASHES WHEN FULL TEXT INDEXES IBD FILES ARE
+--echo # ORPHANED DUE TO RENAME TABLE
+--echo #
+CREATE DATABASE db1; USE db1;
+CREATE TABLE notes (
+ id int(11) NOT NULL AUTO_INCREMENT,
+ body text COLLATE utf8_unicode_ci,
+ PRIMARY KEY (id)
+ ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8
+COLLATE=utf8_unicode_ci;
+
+ALTER TABLE notes ADD FULLTEXT INDEX index_ft_body (body(255));
+DROP INDEX index_ft_body ON notes;
+
+CREATE DATABASE db2;
+RENAME TABLE db1.notes TO db2.notes;
+DROP DATABASE db1;
+DROP DATABASE db2;
create table t1 (f1 int not null primary key, f2 varchar(100),
FTS_DOC_ID bigint(20) unsigned not null auto_increment,
unique key `FTS_DOC_ID_INDEX` (`FTS_DOC_ID`),
-fulltext key (f2))engine=innodb, auto_increment=100000;
+fulltext key (f2))engine=innodb;
set auto_increment_increment = 65535;
insert into t1(f1, f2) values(1, "This is the first record");
insert into t1(f1, f2) values(2, "This is the second record");
insert into t1(f1, f2) values(3, "This is the third record");
select FTS_DOC_ID from t1;
FTS_DOC_ID
+1
+65536
131071
-196606
-262141
drop table t1;
+call mtr.add_suppression("\\[ERROR\\] InnoDB: Doc ID 20030101000000 is too big. Its difference with largest used Doc ID 0 cannot exceed or equal to 65535");
+CREATE TABLE t1 (FTS_DOC_ID BIGINT UNSIGNED AUTO_INCREMENT NOT NULL PRIMARY KEY,
+title VARCHAR(200), FULLTEXT(title)) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (NULL, NULL), (20030101000000, 20030102000000);
+ERROR HY000: Invalid InnoDB FTS Doc ID
+DROP TABLE t1;
create table t1 (f1 int not null primary key, f2 varchar(100),
FTS_DOC_ID bigint(20) unsigned not null auto_increment,
unique key `FTS_DOC_ID_INDEX` (`FTS_DOC_ID`),
- fulltext key (f2))engine=innodb, auto_increment=100000;
+ fulltext key (f2))engine=innodb;
set auto_increment_increment = 65535;
insert into t1(f1, f2) values(1, "This is the first record");
insert into t1(f1, f2) values(3, "This is the third record");
select FTS_DOC_ID from t1;
drop table t1;
+
+call mtr.add_suppression("\\[ERROR\\] InnoDB: Doc ID 20030101000000 is too big. Its difference with largest used Doc ID 0 cannot exceed or equal to 65535");
+CREATE TABLE t1 (FTS_DOC_ID BIGINT UNSIGNED AUTO_INCREMENT NOT NULL PRIMARY KEY,
+ title VARCHAR(200), FULLTEXT(title)) ENGINE=InnoDB;
+--error 182
+INSERT INTO t1 VALUES (NULL, NULL), (20030101000000, 20030102000000);
+DROP TABLE t1;
# Do not use any TAB characters for whitespace.
#
##############################################################################
+# Codership disabled tests begin here
+# Tests that have disabler=CODERSHIP will be forcefully run with "./mtr --enable-disabled" by Jenkins
+partition_debug : Issue#330 2018-05-16 CODERSHIP https://github.com/codership/mysql-wsrep/issues/330
+# Codership disabled tests end here
partition_max_parts_hash_innodb : Bug#17719504 2013-11-01 Horst PARTITION_MAX_PARTS ARE FAILING SPORADICLY.
partition_max_parts_inv_innodb : Bug#17719504 2013-11-01 Horst PARTITION_MAX_PARTS ARE FAILING SPORADICLY.
# Do not use any TAB characters for whitespace.
#
##############################################################################
-
+# Codership disabled tests begin here
+# Tests that have disabler=CODERSHIP will be forcefully run with "./mtr --enable-disabled" by Jenkins
+global_read_lock : Issue#79 2018-07-26 CODERSHIP https://github.com/codership/mysql-wsrep/issues/79
perfschema.sizing_growth : Galera LP#1370988 2014-10-28 pstoev Performance schema heuristics need to be updated
ortho_iter : Galera mysql-wsrep#34 2014-12-19 perfschema.ortho_iter MTR test fails sporadically
+# Codership disabled tests end here
Note #### Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information.
START SLAVE;
include/wait_for_slave_io_error.inc [errno=1045, 1593]
-include/stop_slave.inc
+include/stop_slave_sql.inc
CHANGE MASTER TO MASTER_USER= 'root', MASTER_PASSWORD= '';
Warnings:
Note #### Sending passwords in plain text without SSL/TLS is extremely insecure.
--- /dev/null
+include/master-slave.inc
+Warnings:
+Note #### Sending passwords in plain text without SSL/TLS is extremely insecure.
+Note #### Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information.
+[connection master]
+#
+# Test replicate-ignore-db=db1 filter
+#
+include/rpl_restart_server.inc [server_number=2 gtids=on parameters: --replicate-ignore-db=db1 --skip_slave_start=FALSE]
+[connection master]
+#
+# Execute 'CREATE DATABASE db1' on Master.
+#
+CREATE DATABASE db1;
+#
+# Sync with Slave (using gtid values)
+#
+include/sync_slave_sql_with_master.inc
+#
+# Check that even after sync is completed 'db1' does not exists
+# on Slave which implies that 'CREATE DATABASE db1' is filtered
+# out.
+#
+USE db1;
+ERROR 42000: Unknown database 'db1'
+#
+# Execute other database commands (ALTER/DROP) on Master.
+#
+[connection master]
+ALTER DATABASE db1 CHARACTER SET latin1;
+DROP DATABASE db1;
+#
+# Check that we are able to sync with slave successfully
+# which implies that those commands are filtered out.
+# If they were executed by Slave, that will break replication
+# as we do not have 'db1' database on Slave.
+include/sync_slave_sql_with_master.inc
+#
+# Test replicate-do-db=db2 filter
+#
+include/rpl_restart_server.inc [server_number=2 gtids=on parameters: --replicate-do-db=db2 --skip_slave_start=FALSE]
+[connection master]
+#
+# Execute 'CREATE DATABASE db1' on Master.
+#
+CREATE DATABASE db1;
+#
+# Sync with Slave (using gtid values)
+#
+include/sync_slave_sql_with_master.inc
+#
+# Check that even after sync is completed 'db1' does not exists
+# on Slave which implies that 'CREATE DATABASE db1' is filtered
+# out.
+#
+USE db1;
+ERROR 42000: Unknown database 'db1'
+#
+# Execute other database commands (ALTER/DROP) on Master.
+#
+[connection master]
+ALTER DATABASE db1 CHARACTER SET latin1;
+DROP DATABASE db1;
+#
+# Check that we are able to sync with slave successfully
+# which implies that those commands are filtered out.
+# If they were executed by Slave, that will break replication
+# as we do not have 'db1' database on Slave.
+include/sync_slave_sql_with_master.inc
+#
+# Test replicate-wild-ignore-table=db1.% filter
+#
+include/rpl_restart_server.inc [server_number=2 gtids=on parameters: --replicate-wild-ignore-table=db1.% --skip_slave_start=FALSE]
+[connection master]
+#
+# Execute 'CREATE DATABASE db1' on Master.
+#
+CREATE DATABASE db1;
+#
+# Sync with Slave (using gtid values)
+#
+include/sync_slave_sql_with_master.inc
+#
+# Check that even after sync is completed 'db1' does not exists
+# on Slave which implies that 'CREATE DATABASE db1' is filtered
+# out.
+#
+USE db1;
+ERROR 42000: Unknown database 'db1'
+#
+# Execute other database commands (ALTER/DROP) on Master.
+#
+[connection master]
+ALTER DATABASE db1 CHARACTER SET latin1;
+DROP DATABASE db1;
+#
+# Check that we are able to sync with slave successfully
+# which implies that those commands are filtered out.
+# If they were executed by Slave, that will break replication
+# as we do not have 'db1' database on Slave.
+include/sync_slave_sql_with_master.inc
+#
+# Test replicate-wild-ignore-table=db1.% and --replicate-do-db=db2
+# filter combination
+include/rpl_restart_server.inc [server_number=2 gtids=on parameters: --replicate-do-db=db2 --replicate-wild-ignore-table=db1.t% --skip_slave_start=FALSE]
+[connection master]
+#
+# Execute 'CREATE DATABASE db1' on Master.
+#
+CREATE DATABASE db1;
+#
+# Sync with Slave (using gtid values)
+#
+include/sync_slave_sql_with_master.inc
+#
+# Check that even after sync is completed 'db1' does not exists
+# on Slave which implies that 'CREATE DATABASE db1' is filtered
+# out.
+#
+USE db1;
+ERROR 42000: Unknown database 'db1'
+#
+# Execute other database commands (ALTER/DROP) on Master.
+#
+[connection master]
+ALTER DATABASE db1 CHARACTER SET latin1;
+DROP DATABASE db1;
+#
+# Check that we are able to sync with slave successfully
+# which implies that those commands are filtered out.
+# If they were executed by Slave, that will break replication
+# as we do not have 'db1' database on Slave.
+include/sync_slave_sql_with_master.inc
+#
+# Cleanup
+#
+include/rpl_end.inc
call mtr.add_suppression("Slave SQL.*Duplicate entry .1. for key .PRIMARY.. on query.* Error_code: 1062");
call mtr.add_suppression("Slave SQL.*Request to stop slave SQL Thread received while applying a group that has non-transactional changes; waiting for completion of the group");
Heartbeat events are received while sql thread stopped (1 means 'yes'): 1
-include/stop_slave.inc
+include/stop_slave_io.inc
DELETE FROM t1;
include/start_slave.inc
include/sync_slave_sql_with_master.inc
include/stop_slave.inc
TRUNCATE mysql.general_log;
START SLAVE USER='root' PASSWORD='secret';
-include/stop_slave.inc
+include/wait_for_slave_io_error.inc [errno=1045]
+include/stop_slave_sql.inc
START SLAVE USER = 'root' PASSWORD = '<secret>';
-include/stop_slave.inc
+include/wait_for_slave_io_error.inc [errno=1045]
+include/stop_slave_sql.inc
TRUNCATE mysql.general_log;
START SLAVE IO_THREAD USER='root' PASSWORD='secret' DEFAULT_AUTH= 'auth_test_plugin' PLUGIN_DIR= 'PLUGIN_AUTH_DIR';
-include/stop_slave.inc
+include/wait_for_slave_io_error.inc [errno=1045]
+include/stop_slave_sql.inc
START SLAVE IO_THREAD USER = 'root' PASSWORD = '<secret>' DEFAULT_AUTH = 'auth_test_plugin' PLUGIN_DIR = 'PLUGIN_AUTH_DIR';
-include/stop_slave.inc
+include/wait_for_slave_io_error.inc [errno=1045]
+include/stop_slave_sql.inc
TRUNCATE mysql.general_log;
START SLAVE IO_THREAD, SQL_THREAD USER='root' PASSWORD='secret' DEFAULT_AUTH= 'auth_test_plugin' PLUGIN_DIR= 'PLUGIN_AUTH_DIR';
-include/stop_slave.inc
+include/wait_for_slave_io_error.inc [errno=1045]
+include/stop_slave_sql.inc
START SLAVE IO_THREAD, SQL_THREAD USER = 'root' PASSWORD = '<secret>' DEFAULT_AUTH = 'auth_test_plugin' PLUGIN_DIR = 'PLUGIN_AUTH_DIR';
-include/stop_slave.inc
+include/wait_for_slave_io_error.inc [errno=1045]
+include/stop_slave_sql.inc
TRUNCATE mysql.general_log;
START SLAVE IO_THREAD, SQL_THREAD UNTIL MASTER_LOG_FILE='dummy-log.000001', MASTER_LOG_POS=116 USER='root' PASSWORD='secret' DEFAULT_AUTH= 'auth_test_plugin' PLUGIN_DIR= 'PLUGIN_AUTH_DIR';
-include/stop_slave.inc
+include/wait_for_slave_io_error.inc [errno=1045]
+include/stop_slave_sql.inc
START SLAVE IO_THREAD, SQL_THREAD UNTIL MASTER_LOG_FILE = 'dummy-log.000001', MASTER_LOG_POS = 116 USER = 'root' PASSWORD = '<secret>' DEFAULT_AUTH = 'auth_test_plugin' PLUGIN_DIR = 'PLUGIN_AUTH_DIR';
-include/stop_slave.inc
+include/wait_for_slave_io_error.inc [errno=1045]
+include/stop_slave_sql.inc
TRUNCATE mysql.general_log;
START SLAVE IO_THREAD, SQL_THREAD UNTIL RELAY_LOG_FILE='dummy-log.000001', RELAY_LOG_POS=116 USER='root' PASSWORD='secret' DEFAULT_AUTH= 'auth_test_plugin' PLUGIN_DIR= 'PLUGIN_AUTH_DIR';
-include/stop_slave.inc
+include/wait_for_slave_io_error.inc [errno=1045]
+include/stop_slave_sql.inc
START SLAVE IO_THREAD, SQL_THREAD UNTIL RELAY_LOG_FILE = 'dummy-log.000001', RELAY_LOG_POS = 116 USER = 'root' PASSWORD = '<secret>' DEFAULT_AUTH = 'auth_test_plugin' PLUGIN_DIR = 'PLUGIN_AUTH_DIR';
-include/stop_slave.inc
+include/wait_for_slave_io_error.inc [errno=1045]
+include/stop_slave_sql.inc
SET GLOBAL log_output= @old_log_output;
TRUNCATE mysql.general_log;
include/start_slave.inc
Got one of the listed errors
COMMIT;
include/diff_tables.inc [master:t1,slave:t1]
-######### 8 - Bug#55375(Regression Bug) Transaction bigger than ##########
+####### 8 - LOAD DATA INFILE INTO TABLE #######
+[connection master]
+CREATE TABLE t6 (a varchar(20)) ENGINE=Innodb;
+LOAD DATA INFILE 'temp_file' INTO TABLE t6;
+ERROR HY000: Multi-statement transaction required more than 'max_binlog_cache_size' bytes of storage; increase this mysqld variable and try again
+include/assert.inc [assert that the above Event has not been added to binlog]
+include/assert.inc [Check that the LOAD DATA didn't add any data into the table]
+include/sync_slave_sql_with_master.inc
+include/assert.inc [Check that the LOAD DATA didn't add any data into the table]
+[connection master]
+DROP TABLE t6;
+include/sync_slave_sql_with_master.inc
+######### 9 - Bug#55375(Regression Bug) Transaction bigger than ##########
######### max_binlog_cache_size crashes slave ##########
# [ On Slave ]
SET GLOBAL max_binlog_cache_size = 4096;
--- /dev/null
+include/master-slave.inc
+Warnings:
+Note #### Sending passwords in plain text without SSL/TLS is extremely insecure.
+Note #### Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information.
+[connection master]
+CREATE DATABASE db1;
+CREATE DATABASE db2;
+CREATE TABLE db1.t1 ( id INT(11) PRIMARY KEY ) ENGINE=INNODB;
+CREATE TABLE db2.t1 ( id INT(11) PRIMARY KEY ) ENGINE=INNODB;
+INSERT INTO db1.t1 VALUES (40);
+INSERT INTO db2.t1 VALUES (40);
+include/sync_slave_sql_with_master.inc
+SET @save_debug = @@GLOBAL.debug;
+SET @save_slave_checkpoint_group= @@GLOBAL.slave_checkpoint_group;
+SET @save_slave_checkpoint_period= @@GLOBAL.slave_checkpoint_period;
+SET GLOBAL slave_checkpoint_group=512;
+SET GLOBAL slave_checkpoint_period=3000000;
+[connection master]
+insert into db1.t1 values (30);
+insert into db2.t1 values (30);
+insert into db1.t1 values (29);
+insert into db2.t1 values (29);
+insert into db1.t1 values (28);
+insert into db2.t1 values (28);
+insert into db1.t1 values (27);
+insert into db2.t1 values (27);
+insert into db1.t1 values (26);
+insert into db2.t1 values (26);
+insert into db1.t1 values (25);
+insert into db2.t1 values (25);
+insert into db1.t1 values (24);
+insert into db2.t1 values (24);
+insert into db1.t1 values (23);
+insert into db2.t1 values (23);
+insert into db1.t1 values (22);
+insert into db2.t1 values (22);
+insert into db1.t1 values (21);
+insert into db2.t1 values (21);
+insert into db1.t1 values (20);
+insert into db2.t1 values (20);
+insert into db1.t1 values (19);
+insert into db2.t1 values (19);
+insert into db1.t1 values (18);
+insert into db2.t1 values (18);
+insert into db1.t1 values (17);
+insert into db2.t1 values (17);
+insert into db1.t1 values (16);
+insert into db2.t1 values (16);
+insert into db1.t1 values (15);
+insert into db2.t1 values (15);
+insert into db1.t1 values (14);
+insert into db2.t1 values (14);
+insert into db1.t1 values (13);
+insert into db2.t1 values (13);
+insert into db1.t1 values (12);
+insert into db2.t1 values (12);
+insert into db1.t1 values (11);
+insert into db2.t1 values (11);
+insert into db1.t1 values (10);
+insert into db2.t1 values (10);
+insert into db1.t1 values (9);
+insert into db2.t1 values (9);
+insert into db1.t1 values (8);
+insert into db2.t1 values (8);
+insert into db1.t1 values (7);
+insert into db2.t1 values (7);
+insert into db1.t1 values (6);
+insert into db2.t1 values (6);
+insert into db1.t1 values (5);
+insert into db2.t1 values (5);
+insert into db1.t1 values (4);
+insert into db2.t1 values (4);
+insert into db1.t1 values (3);
+insert into db2.t1 values (3);
+insert into db1.t1 values (2);
+insert into db2.t1 values (2);
+insert into db1.t1 values (1);
+insert into db2.t1 values (1);
+include/sync_slave_io_with_master.inc
+[connection slave]
+include/stop_slave_io.inc
+[connection master]
+BEGIN;
+INSERT INTO db1.t1 VALUES (50);
+COMMIT;
+[connection slave]
+SET global debug="d,simulate_stop_when_mts_in_group";
+include/start_slave_io.inc
+include/wait_for_slave_sql_to_stop.inc
+include/assert_grep.inc [Assert that the expected entry is in the error log during STOP SLAVE]
+SET GLOBAL debug=@save_debug;
+SET @@GLOBAL.slave_checkpoint_group= @save_slave_checkpoint_group;
+set @@GLOBAL.slave_checkpoint_period= @save_slave_checkpoint_period;
+include/start_slave.inc
+include/assert_grep.inc [Assert that the expected entry is in the error log during START SLAVE]
+[connection master]
+include/sync_slave_sql_with_master.inc
+[connection master]
+DROP DATABASE db1;
+DROP DATABASE db2;
+include/rpl_end.inc
Got one of the listed errors
COMMIT;
include/diff_tables.inc [master:t1,slave:t1]
-######### 8 - Bug#55375(Regression Bug) Transaction bigger than ##########
+####### 8 - LOAD DATA INFILE INTO TABLE #######
+[connection master]
+CREATE TABLE t6 (a varchar(20)) ENGINE=Innodb;
+LOAD DATA INFILE 'temp_file' INTO TABLE t6;
+ERROR HY000: Multi-statement transaction required more than 'max_binlog_cache_size' bytes of storage; increase this mysqld variable and try again
+include/assert.inc [assert that the above Event has not been added to binlog]
+include/assert.inc [Check that the LOAD DATA didn't add any data into the table]
+include/sync_slave_sql_with_master.inc
+include/assert.inc [Check that the LOAD DATA didn't add any data into the table]
+[connection master]
+DROP TABLE t6;
+include/sync_slave_sql_with_master.inc
+######### 9 - Bug#55375(Regression Bug) Transaction bigger than ##########
######### max_binlog_cache_size crashes slave ##########
# [ On Slave ]
SET GLOBAL max_binlog_cache_size = 4096;
include/start_slave.inc
UPDATE t1_11753004, t2_11753004 SET t1_11753004.c1=3, t2_11753004.c1=4 WHERE t1_11753004.c1=1 OR t2_11753004.c1=2;
include/wait_for_slave_sql_error.inc [errno=1593 ]
-include/stop_slave.inc
+include/stop_slave_io.inc
SET GLOBAL debug="-d,inject_tblmap_same_id_maps_diff_table";
include/start_slave.inc
include/rpl_reset.inc
START SLAVE;
call mtr.add_suppression("Slave SQL.*Unable to use slave.s temporary directory.* Error_code: 12");
include/wait_for_slave_sql_error.inc [errno=12]
+include/wait_for_slave_io_to_start.inc
include/stop_slave_io.inc
RESET SLAVE;
include/rpl_end.inc
Note #### Sending passwords in plain text without SSL/TLS is extremely insecure.
Note #### Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information.
start slave;
-insert into t1 values (1);
-select * from t1;
-t
-stop slave;
-include/wait_for_slave_to_stop.inc
+include/wait_for_slave_io_error.inc [errno=1045]
+include/stop_slave_sql.inc
change master to master_ssl=1 , master_ssl_ca ='MYSQL_TEST_DIR/std_data/cacert.pem', master_ssl_cert='MYSQL_TEST_DIR/std_data/client-cert.pem', master_ssl_key='MYSQL_TEST_DIR/std_data/client-key.pem';
start slave;
include/wait_for_slave_to_start.inc
+insert into t1 values (1);
include/sync_slave_sql_with_master.inc
select * from t1;
t
Got one of the listed errors
COMMIT;
include/diff_tables.inc [master:t1,slave:t1]
-######### 8 - Bug#55375(Regression Bug) Transaction bigger than ##########
+####### 8 - LOAD DATA INFILE INTO TABLE #######
+[connection master]
+CREATE TABLE t6 (a varchar(20)) ENGINE=Innodb;
+LOAD DATA INFILE 'temp_file' INTO TABLE t6;
+ERROR HY000: Multi-statement transaction required more than 'max_binlog_cache_size' bytes of storage; increase this mysqld variable and try again
+include/assert.inc [assert that the above Event has not been added to binlog]
+include/assert.inc [Check that the LOAD DATA didn't add any data into the table]
+include/sync_slave_sql_with_master.inc
+include/assert.inc [Check that the LOAD DATA didn't add any data into the table]
+[connection master]
+DROP TABLE t6;
+include/sync_slave_sql_with_master.inc
+######### 9 - Bug#55375(Regression Bug) Transaction bigger than ##########
######### max_binlog_cache_size crashes slave ##########
# [ On Slave ]
SET GLOBAL max_binlog_cache_size = 4096;
# Do not use any TAB characters for whitespace.
#
##############################################################################
+# Codership disabled tests begin here
+# Tests that have disabler=CODERSHIP will be forcefully run with "./mtr --enable-disabled" by Jenkins
+rpl_sporadic_master : Issue#330 2018-05-16 CODERSHIP https://github.com/codership/mysql-wsrep/issues/330
+rpl_sync : Issue#330 2018-05-16 CODERSHIP https://github.com/codership/mysql-wsrep/issues/330
+# Codership disabled tests end here
rpl_row_create_table : Bug#11759274 2010-02-27 andrei failed different way than earlier with bug#45576
rpl_delayed_slave : Bug#11764654 2010-11-09 andrei rpl_delayed_slave fails sporadically in pb
--source include/wait_for_slave_sql_error.inc
# Reset slave.
+# On slower machines, when the SQL thread is killed due to error
+# ER_CANT_SET_GTID_NEXT_TO_GTID_WHEN_GTID_MODE_IS_OFF, it may happen that the IO
+# thread is also killed while it is still reading events from the binlog.
+--let $slave_io_errno= 2013 #CR_SERVER_LOST
+--let $rpl_allow_error= 1
--source include/stop_slave.inc
RESET MASTER;
RESET SLAVE;
# the error with the err_count exported in the retries field, we should
# get 3 retries (one per second) when the IO thread gives up, ie,
# when it stops.
+--let $slave_io_errno= 2005
-- source include/wait_for_slave_io_to_stop.inc
-- let $error= query_get_value("SHOW SLAVE STATUS", Last_IO_Error, 1)
if (!`SELECT "$error" LIKE "%retries: 3"`)
START SLAVE;
--let $slave_io_errno= 1045, 1593
--source include/wait_for_slave_io_error.inc
---source include/stop_slave.inc
+--source include/stop_slave_sql.inc
--replace_column 2 ####
CHANGE MASTER TO MASTER_USER= 'root', MASTER_PASSWORD= '';
--- /dev/null
+#
+# ==== Purpose ====
+#
+# This test script is created to test how filtering rules act
+# against CREATE/ALTER/DROP DATABASE commands (CAD commands)
+# Also it will check that there will be gtid empty transaction
+# created after these CAD commands are filtered out.
+#
+# ==== Implementation ====
+#
+# USE-CASE 1: Test --replication-ignore-db=db1 filter
+#
+# S1: Install --replication-ignore-db=db1 filter on slave
+# S2: Try all three CAD statements (CREATE/ALTER/DROP)
+# S3: Check that they are filtered and check that there is no gap in
+# GTID_EXECUTED_SET.
+# USE-CASE 2: Repeat S1-S3 steps against --replicate-do-db=db2 filter rule.
+# USE-CASE 3: Repeat S1-S3 steps against --replicate-wild-ignore-table=db1.%
+# filter rule.
+# USE-CASE 4: Repeat S1-S3 steps against --replicate-do-db=db2 and
+# --replicate-wild-ignore-table=db1.t% filter rule.
+#
+# ==== References ====
+#
+# Bug#27308751 FILTERED REPLICATION LEAVES GTID HOLES WITH CREATE DATABASE
+#
+--source include/have_gtid.inc
+--source include/have_binlog_format_statement.inc
+--source include/master-slave.inc
+
+--echo #
+--echo # Test replicate-ignore-db=db1 filter
+--echo #
+#
+# Test replicate-ignore-db=db1 filter rule on
+# CREATE/ALTER/DROP DATABASE 'db1' command
+# These commands should be skipped.
+#
+--let $rpl_server_number= 2
+--let $rpl_start_with_gtids= 1
+--let $rpl_server_parameters=--replicate-ignore-db=db1 --skip_slave_start=FALSE
+--source include/rpl_restart_server.inc
+--source extra/rpl_tests/rpl_db_stmts_ignored.inc
+
+--echo #
+--echo # Test replicate-do-db=db2 filter
+--echo #
+#
+# Test replicate-do-db=db2 filter rule on
+# CREATE/ALTER/DROP DATABASE 'db1' command
+# These commands should be skipped.
+#
+--let $rpl_server_number= 2
+--let $rpl_start_with_gtids= 1
+--let $rpl_server_parameters=--replicate-do-db=db2 --skip_slave_start=FALSE
+--source include/rpl_restart_server.inc
+--source extra/rpl_tests/rpl_db_stmts_ignored.inc
+
+--echo #
+--echo # Test replicate-wild-ignore-table=db1.% filter
+--echo #
+#
+# Test replicate-wild-ignore-table=db1.% filter rule on
+# CREATE/ALTER/DROP DATABASE 'db1' command.
+# These commands should be skipped.
+#
+--let $rpl_server_number= 2
+--let $rpl_start_with_gtids= 1
+--let $rpl_server_parameters=--replicate-wild-ignore-table=db1.% --skip_slave_start=FALSE
+--source include/rpl_restart_server.inc
+--source extra/rpl_tests/rpl_db_stmts_ignored.inc
+
+--echo #
+--echo # Test replicate-wild-ignore-table=db1.% and --replicate-do-db=db2
+--echo # filter combination
+#
+# Test replicate-wild-ignore-table=db1.% and --replicate-do-db=db2
+# filter combination rule on CREATE/ALTER/DROP DATABASE 'db1' command.
+# These commands should be skipped.
+#
+--let $rpl_server_number= 2
+--let $rpl_start_with_gtids= 1
+--let $rpl_server_parameters= --replicate-do-db=db2 --replicate-wild-ignore-table=db1.t% --skip_slave_start=FALSE
+--source include/rpl_restart_server.inc
+--source extra/rpl_tests/rpl_db_stmts_ignored.inc
+
+--echo #
+--echo # Cleanup
+--echo #
+--source include/force_restart.inc
+--source include/rpl_end.inc
let $rcvd_heartbeats_after= query_get_value(SHOW STATUS LIKE 'slave_received_heartbeats', Value, 1);
let $result= query_get_value(SELECT ($rcvd_heartbeats_after - $rcvd_heartbeats_before) > 0 AS Result, Result, 1);
--echo Heartbeat events are received while sql thread stopped (1 means 'yes'): $result
---source include/stop_slave.inc
+--source include/stop_slave_io.inc
DELETE FROM t1;
--source include/start_slave.inc
--connection master
--let $slave_io_errno=1593
--source include/wait_for_slave_io_error.inc
+--let $slave_io_errno= convert_error(ER_SLAVE_FATAL_ERROR)
--source include/stop_slave.inc
TRUNCATE mysql.general_log;
START SLAVE USER='root' PASSWORD='secret';
--let $rewritten= `SELECT argument FROM mysql.general_log WHERE argument LIKE "%PASSWORD = '<secret>'%"`
# execute it to see if the rewrite generated a (syntatically) valid command
---source include/stop_slave.inc
+--let $slave_io_errno= convert_error(ER_ACCESS_DENIED_ERROR)
+--source include/wait_for_slave_io_error.inc
+--source include/stop_slave_sql.inc
--eval $rewritten
---source include/stop_slave.inc
+--let $slave_io_errno= convert_error(ER_ACCESS_DENIED_ERROR)
+--source include/wait_for_slave_io_error.inc
+--source include/stop_slave_sql.inc
TRUNCATE mysql.general_log;
--replace_result $PLUGIN_AUTH_DIR PLUGIN_AUTH_DIR
--eval START SLAVE IO_THREAD USER='root' PASSWORD='secret' DEFAULT_AUTH= 'auth_test_plugin' PLUGIN_DIR= '$PLUGIN_AUTH_DIR'
--let $rewritten= `SELECT argument FROM mysql.general_log WHERE argument LIKE "%PASSWORD = '<secret>'%"`
# execute it to see if the rewrite generated a (syntatically) valid command
---source include/stop_slave.inc
+--let $slave_io_errno= convert_error(ER_ACCESS_DENIED_ERROR)
+--source include/wait_for_slave_io_error.inc
+--source include/stop_slave_sql.inc
--replace_result $PLUGIN_AUTH_DIR PLUGIN_AUTH_DIR
--eval $rewritten
---source include/stop_slave.inc
+--let $slave_io_errno= convert_error(ER_ACCESS_DENIED_ERROR)
+--source include/wait_for_slave_io_error.inc
+--source include/stop_slave_sql.inc
TRUNCATE mysql.general_log;
--replace_result $PLUGIN_AUTH_DIR PLUGIN_AUTH_DIR
--eval START SLAVE IO_THREAD, SQL_THREAD USER='root' PASSWORD='secret' DEFAULT_AUTH= 'auth_test_plugin' PLUGIN_DIR= '$PLUGIN_AUTH_DIR'
--let $rewritten= `SELECT argument FROM mysql.general_log WHERE argument LIKE "%PASSWORD = '<secret>'%"`
# execute it to see if the rewrite generated a (syntatically) valid command
---source include/stop_slave.inc
+--let $slave_io_errno= convert_error(ER_ACCESS_DENIED_ERROR)
+--source include/wait_for_slave_io_error.inc
+--source include/stop_slave_sql.inc
--replace_result $PLUGIN_AUTH_DIR PLUGIN_AUTH_DIR
--eval $rewritten
---source include/stop_slave.inc
+--let $slave_io_errno= convert_error(ER_ACCESS_DENIED_ERROR)
+--source include/wait_for_slave_io_error.inc
+--source include/stop_slave_sql.inc
TRUNCATE mysql.general_log;
--replace_result $PLUGIN_AUTH_DIR PLUGIN_AUTH_DIR
--eval START SLAVE IO_THREAD, SQL_THREAD UNTIL MASTER_LOG_FILE='dummy-log.000001', MASTER_LOG_POS=116 USER='root' PASSWORD='secret' DEFAULT_AUTH= 'auth_test_plugin' PLUGIN_DIR= '$PLUGIN_AUTH_DIR'
--let $rewritten= `SELECT argument FROM mysql.general_log WHERE argument LIKE "%PASSWORD = '<secret>'%"`
# execute it to see if the rewrite generated a (syntatically) valid command
---source include/stop_slave.inc
+--let $slave_io_errno= convert_error(ER_ACCESS_DENIED_ERROR)
+--source include/wait_for_slave_io_error.inc
+--source include/stop_slave_sql.inc
--replace_result $PLUGIN_AUTH_DIR PLUGIN_AUTH_DIR
--eval $rewritten
---source include/stop_slave.inc
+--let $slave_io_errno= convert_error(ER_ACCESS_DENIED_ERROR)
+--source include/wait_for_slave_io_error.inc
+--source include/stop_slave_sql.inc
TRUNCATE mysql.general_log;
--replace_result $PLUGIN_AUTH_DIR PLUGIN_AUTH_DIR
--eval START SLAVE IO_THREAD, SQL_THREAD UNTIL RELAY_LOG_FILE='dummy-log.000001', RELAY_LOG_POS=116 USER='root' PASSWORD='secret' DEFAULT_AUTH= 'auth_test_plugin' PLUGIN_DIR= '$PLUGIN_AUTH_DIR'
--let $rewritten= `SELECT argument FROM mysql.general_log WHERE argument LIKE "%PASSWORD = '<secret>'%"`
# execute it to see if the rewrite generated a (syntatically) valid command
---source include/stop_slave.inc
+--let $slave_io_errno= convert_error(ER_ACCESS_DENIED_ERROR)
+--source include/wait_for_slave_io_error.inc
+--source include/stop_slave_sql.inc
--replace_result $PLUGIN_AUTH_DIR PLUGIN_AUTH_DIR
--eval $rewritten
---source include/stop_slave.inc
+--let $slave_io_errno= convert_error(ER_ACCESS_DENIED_ERROR)
+--source include/wait_for_slave_io_error.inc
+--source include/stop_slave_sql.inc
--enable_warnings
--- /dev/null
+--relay-log-info-repository=TABLE --master-info-repository=TABLE --slave_transaction_retries=0 --sync-master-info=1
--- /dev/null
+# ==== Purpose ====
+#
+# Verify that the positions that are reported by the applier thread during
+# STOP SLAVE are the same as that of the most recent checkpoint in case of
+# Multi Threaded Slave.
+#
+# ==== Implementation ====
+#
+# 1) Create two databases and do some DML operations on these databases.
+# 2) Sync the slave applier with master to insure that a checkpoint is done.
+# 3) Set bigger values for slave_checkpoint_period/group so that no further
+# checkpoints are done on slave server.
+# 4) Execute few more DMLS on master and wait till they are applied on slave.
+# 5) This is to prove that applier thread has few more committed transactions
+# after the checkpoint done at step 2.
+# 6) Execute STOP SLAVE command.
+# 7) Assert that the positions that are reported in error log are as per the
+# latest checkpoint.
+#
+# ==== References ====
+#
+# Bug#27300658: IN MTS SQL THREAD EXITING AND INITIALIZING
+# MESSAGE WITH DIFFERENT POSITION
+
+# This test case is binary log format agnostic
+--source include/have_binlog_format_row.inc
+--source include/have_debug.inc
+--source include/only_mts_slave_parallel_workers.inc
+--source include/master-slave.inc
+
+# Do some DMLs on master and sync with slave to make sure that one checkpoint
+# is done.
+CREATE DATABASE db1;
+CREATE DATABASE db2;
+CREATE TABLE db1.t1 ( id INT(11) PRIMARY KEY ) ENGINE=INNODB;
+CREATE TABLE db2.t1 ( id INT(11) PRIMARY KEY ) ENGINE=INNODB;
+INSERT INTO db1.t1 VALUES (40);
+INSERT INTO db2.t1 VALUES (40);
+--source include/sync_slave_sql_with_master.inc
+
+# Save the global variables that are being modified. Set bigger values for
+# slave_checkpoint_group/period so that no further checkpoints are done
+# automatically.
+SET @save_debug = @@GLOBAL.debug;
+SET @save_slave_checkpoint_group= @@GLOBAL.slave_checkpoint_group;
+SET @save_slave_checkpoint_period= @@GLOBAL.slave_checkpoint_period;
+SET GLOBAL slave_checkpoint_group=512;
+SET GLOBAL slave_checkpoint_period=3000000;
+
+# Do some DMLs on master.
+--source include/rpl_connection_master.inc
+--let $i=30
+while ($i)
+{
+ --eval insert into db1.t1 values ($i)
+ --eval insert into db2.t1 values ($i)
+ dec $i;
+}
+--source include/sync_slave_io_with_master.inc
+
+# Wait till all the transactions are applied on slave. This will ensure that
+# at the time of STOP SLAVE few more committited transactions are present
+# above the recent LWM.
+--source include/rpl_connection_slave.inc
+--let $table=db1.t1
+--let $count=31
+--source include/wait_until_rows_count.inc
+
+--let $table=db2.t1
+--let $count=31
+--source include/wait_until_rows_count.inc
+--source include/stop_slave_io.inc
+
+# Wait for coordinator to populate worker's queues.
+--let $show_statement= SHOW PROCESSLIST
+--let $field= State
+--let $condition= = 'Slave has read all relay log; waiting for the slave I/O thread to update it'
+--source include/wait_show_condition.inc
+
+
+# Initiate one more DML on master. While the DML is being processed by slave
+# applier it will receive a STOP SLAVE due to debug simulation. Applier will
+# execute gracefully after completing the current group in progress and print
+# appropriate exit positions.
+--source include/rpl_connection_master.inc
+BEGIN;
+INSERT INTO db1.t1 VALUES (50);
+COMMIT;
+
+--source include/rpl_connection_slave.inc
+# Debug simulation which will ensure that SLAVE STOPS as a regular exit
+# without an error. This ensures we have the same scenario as that of the bug
+# report.
+SET global debug="d,simulate_stop_when_mts_in_group";
+--source include/start_slave_io.inc
+
+--source include/wait_for_slave_sql_to_stop.inc
+--let $exec_master_log_pos= query_get_value(SHOW SLAVE STATUS, Exec_Master_Log_Pos, 1)
+--let $exec_master_log_file= query_get_value(SHOW SLAVE STATUS, Relay_Master_Log_File, 1)
+
+# Assert that the positions that are reported by the applier thread during
+# STOP SLAVE are the same as that of the most recent checkpoint in case of
+# Multi Threaded Slave.
+--let $assert_text= Assert that the expected entry is in the error log during STOP SLAVE
+--let $assert_file=$MYSQLTEST_VARDIR/log/mysqld.2.err
+--let $assert_only_after = Coordinator thread of multi-threaded slave is being stopped in the middle of assigning a group of events
+--let $assert_select= Slave SQL thread exiting, replication stopped in log '$exec_master_log_file' at position $exec_master_log_pos
+--let $assert_count= 1
+--source include/assert_grep.inc
+
+SET GLOBAL debug=@save_debug;
+SET @@GLOBAL.slave_checkpoint_group= @save_slave_checkpoint_group;
+set @@GLOBAL.slave_checkpoint_period= @save_slave_checkpoint_period;
+--source include/start_slave.inc
+
+# Assert that the positions that are reported by the applier thread during
+# START SLAVE are the same as the positions reported during STOP SLAVE.
+--let $assert_text= Assert that the expected entry is in the error log during START SLAVE
+--let $assert_file=$MYSQLTEST_VARDIR/log/mysqld.2.err
+--let $assert_only_after = Slave SQL thread exiting, replication stopped in log
+--let $assert_select= Slave SQL thread initialized, starting replication in log '$exec_master_log_file' at position $exec_master_log_pos
+--let $assert_count= 1
+--source include/assert_grep.inc
+
+--source include/rpl_connection_master.inc
+--source include/sync_slave_sql_with_master.inc
+
+--source include/rpl_connection_master.inc
+DROP DATABASE db1;
+DROP DATABASE db2;
+--source include/rpl_end.inc
let $table= worker_proc_list;
source include/wait_until_rows_count.inc;
+--let $slave_sql_errno= convert_error(ER_MTS_INCONSISTENT_DATA)
source include/wait_for_slave_sql_to_stop.inc;
#
let $table= worker_proc_list;
source include/wait_until_rows_count.inc;
+--let $slave_sql_errno= convert_error(ER_DUP_ENTRY)
source include/wait_for_slave_sql_to_stop.inc;
delete from t1 where a=3;
}
--echo # Stop the SQL thread (it should be in the middle of the transaction/group)
+--let $slave_sql_errno= convert_error(ER_MTS_INCONSISTENT_DATA)
--source include/stop_slave_sql.inc
--echo # Remove the debug point and restart the both threads
# wait for error 1593 (ER_SLAVE_FATAL_ERROR)
--let $slave_sql_errno=1593
--source include/wait_for_slave_sql_error.inc
---source include/stop_slave.inc
+--source include/stop_slave_io.inc
# clean up
SET GLOBAL debug="-d,inject_tblmap_same_id_maps_diff_table";
call mtr.add_suppression("The slave coordinator and worker threads are stopped, possibly leaving data in inconsistent state");
# in MTS case error is either of two:
-#--let $slave_sql_errno= 1146,1593
+--let $slave_sql_errno= 1146,1593
# whereas in the single-threaded case:
# 1146 = ER_NO_SUCH_TABLE
#--let $slave_sql_errno= 1146
call mtr.add_suppression("Slave SQL.*Unable to use slave.s temporary directory.* Error_code: 12");
--let $slave_sql_errno= 12
source include/wait_for_slave_sql_error.inc;
-
+--source include/wait_for_slave_io_to_start.inc
--source include/stop_slave_io.inc
RESET SLAVE;
source include/stop_slave.inc;
START SLAVE;
source include/wait_for_slave_sql_to_start.inc;
+--let $slave_io_errno= convert_error(ER_ACCESS_DENIED_ERROR)
source include/wait_for_slave_io_to_stop.inc;
--echo ==== Verify that Slave IO thread stopped with error ====
# Step 2) Wait for SQL thread to go down with the injected error.
# Before fix, SQL thread would not have released
# relay_log.log_lock.
+--let $slave_sql_errno= convert_error(ER_SLAVE_RELAY_LOG_READ_FAILURE)
--source include/wait_for_slave_sql_to_stop.inc
# Step 3) Before fix, when SQL thread is trying to acquire
start slave;
#showing that replication don't work
-connection master;
-insert into t1 values (1);
-#reasonable timeout for changes to propagate to slave
-let $wait_condition= SELECT COUNT(*) = 1 FROM t1;
-source include/wait_condition.inc;
-connection slave;
-select * from t1;
+--let $slave_io_errno= convert_error(ER_ACCESS_DENIED_ERROR)
+--source include/wait_for_slave_io_error.inc
+--source include/stop_slave_sql.inc
#showing that replication could work with ssl params
-stop slave;
---source include/wait_for_slave_to_stop.inc
--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR
--replace_column 2 ####
eval change master to master_ssl=1 , master_ssl_ca ='$MYSQL_TEST_DIR/std_data/cacert.pem', master_ssl_cert='$MYSQL_TEST_DIR/std_data/client-cert.pem', master_ssl_key='$MYSQL_TEST_DIR/std_data/client-key.pem';
#avoiding unneeded sleeps
connection master;
+insert into t1 values (1);
--source include/sync_slave_sql_with_master.inc
#checking that replication is ok
# Do not use any TAB characters for whitespace.
#
##############################################################################
+# Codership disabled tests begin here
+# Tests that have disabler=CODERSHIP will be forcefully run with "./mtr --enable-disabled" by Jenkins
+bootstrap : Issue#19 2014-11-21 CODERSHIP https://github.com/codership/mysql-wsrep/issues/19
+file_contents : Issue#4 2014-10-28 CODERSHIP https://github.com/codership/mysql-wsrep/issues/4
+range_none : Issue#330 2018-05-16 CODERSHIP https://github.com/codership/mysql-wsrep/issues/330
+# Codership disabled tests end here
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
sum_distinct-big : Bug#11764126 2010-11-15 mattiasj was not tested
ds_mrr-big @solaris : Bug#14168107 2012-04-03 Hemant disabled new test added by Olav Sandstå,since this leads to timeout on Solaris on slow sparc servers
mysql_embedded_client_test : Bug#13964673 2012-04-16 amitbha since most of the test cases are failing
mysql_client_test_embedded : Bug#16084066 2013-01-08 Disabled since this test is failing
-file_contents : Galera mysql-wsrep#4 2014-10-28 pstoev main.file_contents MTR test fails in mysql-wsrep
-bootstrap : Galera mysql-wsrep#19 2014-11-21 pstoev Crash in LOGGER::error_log_print when printing a WSREP message
mysqlhotcopy_archive @solaris : DBD-mysql perl module not available on Solaris
mysqlhotcopy_myisam @solaris : DBD-mysql perl module not available on Solaris
--- /dev/null
+#
+#Bug #27542720 SCHEMA MISMATCH - TABLE FLAGS DON'T MATCH,
+# BUT FLAGS ARE NUMBERS
+#
+
+
+--source include/have_innodb.inc
+
+--let $MYSQLD_DATADIR=`select @@datadir`
+--let $DB = `SELECT DATABASE()`
+#--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR
+
+CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE=InnoDB ROW_FORMAT=COMPACT;
+FLUSH TABLES t1 FOR EXPORT;
+--copy_file $MYSQLD_DATADIR/$DB/t1.ibd $MYSQL_TMP_DIR/t1.ibd
+--copy_file $MYSQLD_DATADIR/$DB/t1.cfg $MYSQL_TMP_DIR/t1.cfg
+
+UNLOCK TABLES;
+DROP TABLE t1;
+SET GLOBAL innodb_file_format=`Barracuda`;
+SET GLOBAL innodb_file_per_table= ON;
+CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE=InnoDB ROW_FORMAT=DYNAMIC;
+ALTER TABLE t1 DISCARD TABLESPACE;
+--move_file $MYSQL_TMP_DIR/t1.ibd $MYSQLD_DATADIR/$DB/t1.ibd
+--move_file $MYSQL_TMP_DIR/t1.cfg $MYSQLD_DATADIR/$DB/t1.cfg
+
+--error ER_TABLE_SCHEMA_MISMATCH
+ALTER TABLE t1 IMPORT TABLESPACE;
+DROP TABLE t1;
+
+SET GLOBAL innodb_file_format=`Antelope`;
+
+--remove_file $MYSQLD_DATADIR/$DB/t1.ibd
+--remove_file $MYSQLD_DATADIR/$DB/t1.cfg
select 1 as a limit 4294967296,10;
--echo End of 5.1 tests
+
+#
+# Bug #27998526 : FORCE INDEX DOESN'T TAKE EFFECT WHEN A QUERY HAS GROUP_BY,
+# ORDER_BY, AND LIMIT
+#
+
+
+CREATE TABLE t1 (id INT NOT NULL AUTO_INCREMENT,
+ k INT,
+ payload CHAR(100),
+ PRIMARY KEY(id),
+ KEY idx_k (k));
+
+INSERT INTO t1(k) VALUES (1), (2), (3), (4), (5), (6), (7), (8), (9), (10);
+ANALYZE TABLE t1;
+
+#problem query
+let query1= SELECT * FROM t1 FORCE INDEX (idx_k)
+ WHERE k BETWEEN 2 AND 5
+ GROUP BY id
+ ORDER BY id LIMIT 0,1;
+
+# no order by
+let query2= SELECT * FROM t1 FORCE INDEX (idx_k)
+ WHERE k BETWEEN 2 AND 5
+ GROUP BY id
+ LIMIT 0,1;
+
+#no group by
+let query3= SELECT * FROM t1 FORCE INDEX (idx_k)
+ WHERE k BETWEEN 2 AND 5
+ ORDER BY id LIMIT 0,1;
+
+#no limit
+let query4= SELECT * FROM t1 FORCE INDEX (idx_k)
+ WHERE k BETWEEN 2 AND 5
+ GROUP BY id
+ ORDER BY id;
+
+eval EXPLAIN $query1;
+eval EXPLAIN $query2;
+eval EXPLAIN $query3;
+eval EXPLAIN $query4;
+
+eval $query1;
+eval $query2;
+eval $query3;
+eval $query4;
+
+DROP TABLE t1;
--error 1
exec $MYSQLD --defaults-file=/path/with.ext --print-defaults 2>&1;
---replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR
+# Using $MYSQL_TEST_DIR_ABS which contains canonical path to the
+# test directory since --print-default prints the absolute path.
+--replace_result $MYSQL_TEST_DIR_ABS MYSQL_TEST_DIR
--error 1
exec $MYSQLD --defaults-file=relative/path/with.ext --print-defaults 2>&1;
---replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR
+--replace_result $MYSQL_TEST_DIR_ABS MYSQL_TEST_DIR
--error 1
exec $MYSQLD --defaults-file=relative/path/without/extension --print-defaults 2>&1;
---replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR
+--replace_result $MYSQL_TEST_DIR_ABS MYSQL_TEST_DIR
--error 1
exec $MYSQLD --defaults-file=with.ext --print-defaults 2>&1;
---replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR
+--replace_result $MYSQL_TEST_DIR_ABS MYSQL_TEST_DIR
--error 1
exec $MYSQLD --defaults-file=no_extension --print-defaults 2>&1;
--- /dev/null
+#
+--source include/have_debug.inc
+
+
+--echo #
+--echo # Bug#26040870 - ASSERT ON KILL'ING A STORED ROUTINE INVOCATION.
+--echo #
+
+CREATE TABLE t1 (a INT);
+DELIMITER |;
+CREATE FUNCTION f1() RETURNS INT
+BEGIN
+ INSERT INTO t1 VALUES (1);
+ RETURN 1;
+END|
+DELIMITER ;|
+
+--connect(con1,localhost,root)
+--let $sp_con_id= `SELECT CONNECTION_ID()`
+SET DEBUG_SYNC= "sp_lex_instr_before_exec_core SIGNAL sp_ready WAIT_FOR sp_finish";
+send SELECT f1();
+
+--connection default
+SET DEBUG_SYNC="now WAIT_FOR sp_ready";
+--replace_result $sp_con_id sp_con_id
+--eval KILL QUERY $sp_con_id
+SET DEBUG_SYNC="now SIGNAL sp_finish";
+
+--connection con1
+--echo # Diagnostics area is not set if routine statement execution is
+--echo # interrupted by the KILL operation. Accessing diagnostics area in such
+--echo # case results in the issue reported.
+--echo # Patch for the bug25586773, checks if diagnostics area is set before
+--echo # accessing it.
+--error ER_QUERY_INTERRUPTED
+reap;
+
+--connection default
+SET DEBUG_SYNC='RESET';
+DROP TABLE t1;
+DROP FUNCTION f1;
+disconnect con1;
--- /dev/null
+--ssl-ca=$MYSQL_TEST_DIR/std_data/ca-cert-verify-san.pem
+--ssl-key=$MYSQL_TEST_DIR/std_data/server-key-verify-san.pem
+--ssl-cert=$MYSQL_TEST_DIR/std_data/server-cert-verify-san.pem
--- /dev/null
+# === Purpose ===
+# This test verifies that while verifying the server certificates
+# when ssl-verify-server-cert option is provided, the DNS/IPs provided
+# in the Subject Alternative Names field (which can be provided as an
+# extension in X509) are also checked for apart from the Common Name in
+# the subject. Applicable for openssl versions 1.0.2 and greater.
+#
+# === Related bugs and/or worklogs ===
+# Bug #16211011 - SSL CERTIFICATE SUBJECT ALT NAMES WITH IPS NOT RESPECTED WITH --SSL-VERIFY-SERVER-CERT
+#
+# Note that these test cases are written keeping in mind that the openssl version used by the system will
+# be 1.0.2+. For older versions of openssl, the test will be skipped.
+
+--source include/have_openssl.inc
+--source include/have_openssl_support.inc
+--source include/check_openssl_version.inc
+--source include/not_embedded.inc
+
+--echo ### Trying to connect without ssl. This should establish an unencrypted connection.
+--exec $MYSQL --skip-ssl test -e "SHOW STATUS LIKE 'Ssl_cipher'" 2> $MYSQLTEST_VARDIR/tmp/bug24732452_stderr
+--cat_file $MYSQLTEST_VARDIR/tmp/bug24732452_stderr
+--cat_file $MYSQLTEST_VARDIR/tmp/bug24732452_stderr
+
+--echo ### Trying to connect with ssl-mode as REQUIRED. This should establish an encrypted connection.
+--replace_result ECDHE-RSA-AES128-GCM-SHA256 SSL_CIPHER DHE-RSA-AES128-GCM-SHA256 SSL_CIPHER DHE-RSA-AES256-SHA SSL_CIPHER ECDHE-RSA-AES128-SHA256 SSL_CIPHER
+--exec $MYSQL --ssl-mode=REQUIRED --ssl-ca=$MYSQL_TEST_DIR/std_data/ca-cert-verify-san.pem --ssl-cert=$MYSQL_TEST_DIR/std_data/client-cert-verify-san.pem --ssl-key=$MYSQL_TEST_DIR/std_data/client-key-verify-san.pem test -e "SHOW STATUS LIKE 'Ssl_cipher'" 2> $MYSQLTEST_VARDIR/tmp/bug24732452_stderr
+--cat_file $MYSQLTEST_VARDIR/tmp/bug24732452_stderr
+
+--echo ### Trying to connect with ssl-verify-server-cert option. This should establish an encrypted connection.
+--replace_result ECDHE-RSA-AES128-GCM-SHA256 SSL_CIPHER DHE-RSA-AES128-GCM-SHA256 SSL_CIPHER DHE-RSA-AES256-SHA SSL_CIPHER ECDHE-RSA-AES128-SHA256 SSL_CIPHER
+--exec $MYSQL --ssl-verify-server-cert --ssl-ca=$MYSQL_TEST_DIR/std_data/ca-cert-verify-san.pem --ssl-cert=$MYSQL_TEST_DIR/std_data/client-cert-verify-san.pem --ssl-key=$MYSQL_TEST_DIR/std_data/client-key-verify-san.pem test -e "SHOW STATUS LIKE 'Ssl_cipher'" 2> $MYSQLTEST_VARDIR/tmp/bug24732452_stderr
+--cat_file $MYSQLTEST_VARDIR/tmp/bug24732452_stderr
+
+--echo ### Trying to connect with ssl-verify-server-cert option and hostname as nonexistent. This should fail.
+--error 1
+--exec $MYSQL --host=nonexistent --ssl-verify-server-cert --ssl-ca=$MYSQL_TEST_DIR/std_data/ca-cert-verify-san.pem --ssl-cert=$MYSQL_TEST_DIR/std_data/client-cert-verify-san.pem --ssl-key=$MYSQL_TEST_DIR/std_data/client-key-verify-san.pem test -e "SHOW STATUS LIKE 'Ssl_cipher'" 2> $MYSQLTEST_VARDIR/tmp/bug24732452_stderr
+let SEARCH_FILE= $MYSQLTEST_VARDIR/tmp/bug24732452_stderr;
+--echo #Search for the error in the file
+--let SEARCH_PATTERN= ERROR 2005 \(HY000\): Unknown MySQL server host 'nonexistent'
+--source include/search_pattern_in_file.inc
+
+--echo ### Trying to connect with ssl-verify-server-cert option and hostname as localhost. This should establish an encrypted connection as localhost is present in Alternative Subject Name in the certificate.
+--replace_result ECDHE-RSA-AES128-GCM-SHA256 SSL_CIPHER DHE-RSA-AES128-GCM-SHA256 SSL_CIPHER DHE-RSA-AES256-SHA SSL_CIPHER ECDHE-RSA-AES128-SHA256 SSL_CIPHER
+--exec $MYSQL --host=localhost --ssl-verify-server-cert --ssl-ca=$MYSQL_TEST_DIR/std_data/ca-cert-verify-san.pem --ssl-cert=$MYSQL_TEST_DIR/std_data/client-cert-verify-san.pem --ssl-key=$MYSQL_TEST_DIR/std_data/client-key-verify-san.pem test -e "SHOW STATUS LIKE 'Ssl_cipher'" 2> $MYSQLTEST_VARDIR/tmp/bug24732452_stderr
+--cat_file $MYSQLTEST_VARDIR/tmp/bug24732452_stderr
+
+--echo ### Trying to connect with ssl-verify-server-cert option and hostname as 127.0.0.1. This should establish an encrypted connection as localhost is present in Alternative Subject Name in the certificate.
+--replace_result ECDHE-RSA-AES128-GCM-SHA256 SSL_CIPHER DHE-RSA-AES128-GCM-SHA256 SSL_CIPHER DHE-RSA-AES256-SHA SSL_CIPHER ECDHE-RSA-AES128-SHA256 SSL_CIPHER
+--exec $MYSQL --host=127.0.0.1 --ssl-verify-server-cert --ssl-ca=$MYSQL_TEST_DIR/std_data/ca-cert-verify-san.pem --ssl-cert=$MYSQL_TEST_DIR/std_data/client-cert-verify-san.pem --ssl-key=$MYSQL_TEST_DIR/std_data/client-key-verify-san.pem test -e "SHOW STATUS LIKE 'Ssl_cipher'" 2> $MYSQLTEST_VARDIR/tmp/bug24732452_stderr
+--cat_file $MYSQLTEST_VARDIR/tmp/bug24732452_stderr
+
+#Cleanup
+--remove_file $MYSQLTEST_VARDIR/tmp/bug24732452_stderr
SET @@global.log_output= @old_log_output;
SET @@global.slow_query_log= @old_slow_query_log;
+--echo #
+--echo # Bug#27197235 USER VARIABLE + UINON + DECIMAL COLUMN RETURNS
+--echo # WRONG VALUES
+--echo #
+
+let $old_charset= `SELECT @@character_set_client`;
+
+SET NAMES utf8;
+SET @advertAcctId = 1000003;
+select @advertAcctId as a from dual union all select 1.0 from dual;
+
+eval SET NAMES $old_charset;
+SET @advertAcctId = 1000003;
+select @advertAcctId as a from dual union all select 1.0 from dual;
-/* Copyright (c) 2006, 2016, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2006, 2017, 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
do { /* PTR() isn't necessary below, head is a dummy node */
cursor->curr= (LF_SLIST *)(*cursor->prev);
_lf_pin(pins, 1, cursor->curr);
- } while (*cursor->prev != (intptr)cursor->curr && LF_BACKOFF);
+ } while (my_atomic_loadptr((void**)cursor->prev) != cursor->curr &&
+ LF_BACKOFF);
for (;;)
{
if (unlikely(!cursor->curr))
cur_hashnr= cursor->curr->hashnr;
cur_key= cursor->curr->key;
cur_keylen= cursor->curr->keylen;
- if (*cursor->prev != (intptr)cursor->curr)
+ if (my_atomic_loadptr((void**)cursor->prev) != cursor->curr)
{
(void)LF_BACKOFF;
goto retry;
do { /* PTR() isn't necessary below, head is a dummy node */
cursor->curr= (LF_SLIST *)(*cursor->prev);
lf_pin(pins, 1, cursor->curr);
- } while (*cursor->prev != (intptr)cursor->curr && LF_BACKOFF);
+ } while (my_atomic_loadptr((void**)cursor->prev) != cursor->curr &&
+ LF_BACKOFF);
for (;;)
{
if (unlikely(!cursor->curr))
lf_pin(pins, 0, cursor->next);
} while (link != cursor->curr->link && LF_BACKOFF);
cur_hashnr= cursor->curr->hashnr;
- if (*cursor->prev != (intptr)cursor->curr)
+ if (my_atomic_loadptr((void**)cursor->prev) != cursor->curr)
{
(void)LF_BACKOFF;
goto retry;
-# Copyright (c) 2010, 2016, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2010, 2018, 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
RETURN()
ENDIF()
-ADD_SUBDIRECTORY(ca)
-
# mysql_server_extra.wxs.in needs DATADIR_MYSQL_FILES and DATADIR_PERFORMANCE_SCHEMA_FILES, i.e
# Wix-compatible file lists for ${builddir}\sql\data\{mysql,performance_schema}
FILE(APPEND "${CMAKE_CURRENT_BINARY_DIR}/COPYING.rtf" "\n}\n")
SET(COPYING_RTF "${CMAKE_CURRENT_BINARY_DIR}/COPYING.rtf")
ENDIF()
-GET_TARGET_PROPERTY(WIXCA_LOCATION wixca LOCATION)
SET(CPACK_WIX_CONFIG ${CMAKE_CURRENT_SOURCE_DIR}/CPackWixConfig.cmake)
SET(CPACK_WIX_INCLUDE "${CMAKE_CURRENT_BINARY_DIR}/mysql_server_extra.wxs;${CMAKE_CURRENT_SOURCE_DIR}/custom_ui.wxs")
${CONFIG_PARAM}
-P ${CMAKE_CURRENT_BINARY_DIR}/create_msi.cmake
)
-ADD_DEPENDENCIES(MSI wixca)
ADD_CUSTOM_TARGET(
MSI_ESSENTIALS
${CONFIG_PARAM}
-P ${CMAKE_CURRENT_BINARY_DIR}/create_msi.cmake
)
-ADD_DEPENDENCIES(MSI_ESSENTIALS wixca)
+++ /dev/null
-# Copyright (c) 2010, 2016, 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 Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
-IF(CMAKE_SIZEOF_VOID_P EQUAL 8)
- SET(WIX_ARCH "x64")
-ELSE()
- SET(WIX_ARCH "x86")
-ENDIF()
-
-IF(MSVC_VERSION EQUAL 1900)
- SET(WIX_MSVC_DIR "VS2015")
-ELSEIF(MSVC_VERSION EQUAL 1800)
- SET(WIX_MSVC_DIR "VS2013")
-ELSEIF(MSVC_VERSION EQUAL 1600)
- SET(WIX_MSVC_DIR "VS2010")
-ELSE()
- # When next VS is out, add the correct version here
- MESSAGE(FATAL_ERROR "Unknown VS version")
-ENDIF()
-
-INCLUDE_DIRECTORIES(${WIX_DIR}/../SDK/${WIX_MSVC_DIR}/inc)
-LINK_DIRECTORIES(${WIX_DIR}/../SDK/${WIX_MSVC_DIR}/lib/${WIX_ARCH})
-
-SET(WIXCA_SOURCES CustomAction.cpp CustomAction.def)
-
-MESSAGE(STATUS "Searching for wcautil in ${WIX_DIR}/../SDK/${WIX_MSVC_DIR}/lib/${WIX_ARCH}")
-MESSAGE(STATUS "Searching for dutil in ${WIX_DIR}/../SDK/${WIX_MSVC_DIR}/lib/${WIX_ARCH}")
-
-FIND_LIBRARY(WIX_WCAUTIL_LIBRARY
- NAMES wcautil
- PATHS ${WIX_DIR}/../SDK/${WIX_MSVC_DIR}/lib/${WIX_ARCH})
-
-FIND_LIBRARY(WIX_DUTIL_LIBRARY
- NAMES dutil
- PATHS ${WIX_DIR}/../SDK/${WIX_MSVC_DIR}/lib/${WIX_ARCH})
-
-MESSAGE(STATUS "Found: ${WIX_WCAUTIL_LIBRARY}")
-MESSAGE(STATUS "Found: ${WIX_DUTIL_LIBRARY}")
-
-ADD_VERSION_INFO(wixca SHARED WIXCA_SOURCES)
-ADD_LIBRARY(wixca SHARED EXCLUDE_FROM_ALL ${WIXCA_SOURCES})
-TARGET_LINK_LIBRARIES(wixca ${WIX_WCAUTIL_LIBRARY} ${WIX_DUTIL_LIBRARY}
- msi version )
+++ /dev/null
-/* Copyright (c) 2010, 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 Foundation; version 2 of the License.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
-
-#ifndef UNICODE
-#define UNICODE
-#endif
-
-#include <windows.h>
-#include <winreg.h>
-#include <msi.h>
-#include <msiquery.h>
-#include <wcautil.h>
-#include <string.h>
-#include <strsafe.h>
-
-/*
- * Search the registry for a service whose ImagePath starts
- * with our install directory. Stop and remove it if requested.
- */
-static TCHAR last_service_name[128];
-int remove_service(TCHAR *installdir, int check_only) {
- HKEY hKey;
- int done = 0;
-
- if(wcslen(installdir) < 3) {
- WcaLog(LOGMSG_STANDARD, "INSTALLDIR is suspiciously short, better not do anything.");
- return 0;
- }
-
- if(check_only == 0) {
- WcaLog(LOGMSG_STANDARD, "Determining number of matching services...");
- int servicecount = remove_service(installdir, 1);
- if(servicecount <= 0) {
- WcaLog(LOGMSG_STANDARD, "No services found, not removing anything.");
- return 0;
- } else if(servicecount == 1) {
- TCHAR buf[256];
- swprintf_s(buf, sizeof(buf), TEXT("There is a service called '%ls' set up to run from this installation. Do you wish me to stop and remove that service?"), last_service_name);
- int rc = MessageBox(NULL, buf, TEXT("Removing MySQL Server"), MB_ICONQUESTION|MB_YESNOCANCEL|MB_SYSTEMMODAL);
- if(rc == IDCANCEL) return -1;
- if(rc != IDYES) return 0;
- } else if(servicecount > 0) {
- TCHAR buf[256];
- swprintf_s(buf, sizeof(buf), TEXT("There appear to be %d services set up to run from this installation. Do you wish me to stop and remove those services?"), servicecount);
- int rc = MessageBox(NULL, buf, TEXT("Removing MySQL Server"), MB_ICONQUESTION|MB_YESNOCANCEL|MB_SYSTEMMODAL);
- if(rc == IDCANCEL) return -1;
- if(rc != IDYES) return 0;
- }
- }
-
- if(check_only == -1) check_only = 0;
-
- WcaLog(LOGMSG_STANDARD, "Looking for service...");
- WcaLog(LOGMSG_STANDARD, "INSTALLDIR = %ls", installdir);
- if (RegOpenKeyExW(HKEY_LOCAL_MACHINE, TEXT("SYSTEM\\CurrentControlSet\\services"), 0, KEY_READ, &hKey)==ERROR_SUCCESS) {
- DWORD index = 0;
- TCHAR keyname[1024];
- DWORD keylen = sizeof(keyname);
- FILETIME t;
- /* Go through all services in the registry */
- while(RegEnumKeyExW(hKey, index, keyname, &keylen, NULL, NULL, NULL, &t) == ERROR_SUCCESS) {
- HKEY hServiceKey = 0;
- TCHAR path[1024];
- DWORD pathlen = sizeof(path)-1;
- if (RegOpenKeyExW(hKey, keyname, NULL, KEY_READ, &hServiceKey) == ERROR_SUCCESS) {
- /* Look at the ImagePath value of each service */
- if (RegQueryValueExW(hServiceKey, TEXT("ImagePath"), NULL, NULL, (LPBYTE)path, &pathlen) == ERROR_SUCCESS) {
- path[pathlen] = 0;
- TCHAR *p = path;
- if(p[0] == '"') p += 1;
- /* See if it is similar to our install directory */
- if(wcsncmp(p, installdir, wcslen(installdir)) == 0) {
- WcaLog(LOGMSG_STANDARD, "Found service '%ls' with ImagePath '%ls'.", keyname, path);
- swprintf_s(last_service_name, sizeof(last_service_name), TEXT("%ls"), keyname);
- /* If we are supposed to stop and remove the service... */
- if(!check_only) {
- WcaLog(LOGMSG_STANDARD, "Trying to stop the service.");
- SC_HANDLE hSCM = NULL;
- hSCM = OpenSCManager(NULL, NULL, SC_MANAGER_CONNECT);
- if(hSCM != NULL) {
- SC_HANDLE hService = NULL;
- hService = OpenService(hSCM, keyname, SERVICE_STOP|SERVICE_QUERY_STATUS|DELETE);
- if(hService != NULL) {
- WcaLog(LOGMSG_STANDARD, "Waiting for the service to stop...");
- SERVICE_STATUS status;
- /* Attempt to stop the service */
- if(ControlService(hService, SERVICE_CONTROL_STOP, &status)) {
- /* Now wait until it's stopped */
- while("it's one big, mean and cruel world out there") {
- if(!QueryServiceStatus(hService, &status)) break;
- if(status.dwCurrentState == SERVICE_STOPPED) break;
- Sleep(1000);
- }
- WcaLog(LOGMSG_STANDARD, "Stopped the service.");
- }
- /* Mark the service for deletion */
- DeleteService(hService);
- CloseServiceHandle(hService);
- }
- CloseServiceHandle(hSCM);
- }
- }
- done++;
- }
- }
- RegCloseKey(hServiceKey);
- }
- index++;
- keylen = sizeof(keyname)-1;
- }
- RegCloseKey(hKey);
- } else {
- WcaLog(LOGMSG_STANDARD, "Can't seem to go through the list of installed services in the registry.");
- }
- return done;
-}
-
-UINT wrap(MSIHANDLE hInstall, char *name, int check_only) {
- HRESULT hr = S_OK;
- UINT er = ERROR_SUCCESS;
-
- hr = WcaInitialize(hInstall, name);
- ExitOnFailure(hr, "Failed to initialize");
-
- WcaLog(LOGMSG_STANDARD, "Initialized.");
-
- TCHAR INSTALLDIR[1024];
- DWORD INSTALLDIR_size = sizeof(INSTALLDIR);
- if(MsiGetPropertyW(hInstall, TEXT("CustomActionData"), INSTALLDIR, &INSTALLDIR_size) == ERROR_SUCCESS) {
- int rc = remove_service(INSTALLDIR, check_only);
- if(rc < 0) {
- er = ERROR_CANCELLED;
- }
- } else {
- er = ERROR_CANT_ACCESS_FILE;
- }
-
-LExit:
- return WcaFinalize(er);
-}
-
-UINT __stdcall RemoveServiceNoninteractive(MSIHANDLE hInstall)
-{
- return wrap(hInstall, "RemoveServiceNoninteractive", -1);
-}
-
-UINT __stdcall RemoveService(MSIHANDLE hInstall)
-{
- return wrap(hInstall, "RemoveService", 0);
-}
-
-UINT __stdcall TestService(MSIHANDLE hInstall)
-{
- return wrap(hInstall, "TestService", 1);
-}
-
-/* DllMain - Initialize and cleanup WiX custom action utils */
-extern "C" BOOL WINAPI DllMain(
- __in HINSTANCE hInst,
- __in ULONG ulReason,
- __in LPVOID
- )
-{
- switch(ulReason)
- {
- case DLL_PROCESS_ATTACH:
- WcaGlobalInitialize(hInst);
- break;
-
- case DLL_PROCESS_DETACH:
- WcaGlobalFinalize();
- break;
- }
-
- return TRUE;
-}
+++ /dev/null
-LIBRARY "wixca"
-VERSION 1.0
-
-EXPORTS
-
-RemoveService
-RemoveServiceNoninteractive
-TestService
-# Copyright (c) 2010, 2017, Oracle and/or its affiliates. All rights reserved.\r
+# Copyright (c) 2010, 2018, Oracle and/or its affiliates. All rights reserved.\r
# \r
# This program is free software; you can redistribute it and/or modify\r
# it under the terms of the GNU General Public License as published by\r
SET(PATCH_VERSION "@PATCH_VERSION@")\r
SET(CMAKE_SIZEOF_VOID_P @CMAKE_SIZEOF_VOID_P@)\r
SET(MANUFACTURER "@MANUFACTURER@")\r
-SET(WIXCA_LOCATION "@WIXCA_LOCATION@")\r
SET(COPYING_RTF "@COPYING_RTF@")\r
SET(CPACK_WIX_CONFIG "@CPACK_WIX_CONFIG@")\r
SET(CPACK_WIX_INCLUDE "@CPACK_WIX_INCLUDE@")\r
\r
\r
IF(CMAKE_INSTALL_CONFIG_NAME)\r
- STRING(REPLACE "${CMAKE_CFG_INTDIR}" "${CMAKE_INSTALL_CONFIG_NAME}" \r
- WIXCA_LOCATION "${WIXCA_LOCATION}")\r
SET(CONFIG_PARAM "-DCMAKE_INSTALL_CONFIG_NAME=${CMAKE_INSTALL_CONFIG_NAME}")\r
ENDIF()\r
\r
xmlns:util="http://schemas.microsoft.com/wix/UtilExtension">\r
\r
<!--\r
- Copyright (c) 2010, 2017, Oracle and/or its affiliates. All rights reserved.\r
+ Copyright (c) 2010, 2018, Oracle and/or its affiliates. All rights reserved.\r
\r
This program is free software; you can redistribute it and/or modify\r
it under the terms of the GNU General Public License as published by\r
Id="WixUILicenseRtf"\r
Value="@COPYING_RTF@"/>\r
\r
- <!-- How to remove the service on uninstall -->\r
- <Binary Id='wixca.dll' SourceFile='@WIXCA_LOCATION@' />\r
- <CustomAction Id="UnregisterProperty" Property="UnregisterService" Value="[INSTALLDIR]" Return="check" />\r
- <CustomAction Id="UnregisterPropertySilent" Property="UnregisterServiceSilently" Value="[INSTALLDIR]" Return="check" />\r
- <CustomAction Id="UnregisterService"\r
- BinaryKey="wixca.dll"\r
- DllEntry="RemoveService"\r
- Execute="deferred"\r
- Impersonate="no"\r
- Return="check" />\r
- <CustomAction Id="UnregisterServiceSilently"\r
- BinaryKey="wixca.dll"\r
- DllEntry="RemoveServiceNoninteractive"\r
- Execute="deferred"\r
- Impersonate="no"\r
- Return="check" />\r
- <InstallExecuteSequence>\r
- <Custom Action="UnregisterProperty" After="InstallInitialize">Installed And Not UPGRADINGPRODUCTCODE And REMOVE="ALL"</Custom>\r
- <Custom Action="UnregisterPropertySilent" After="InstallInitialize">Installed And Not UPGRADINGPRODUCTCODE And REMOVE="ALL"</Custom>\r
- <Custom Action="UnregisterService" After="UnregisterProperty">Installed And Not UPGRADINGPRODUCTCODE And REMOVE="ALL" And UILevel>4</Custom>\r
- <Custom Action="UnregisterServiceSilently" After="UnregisterPropertySilent">Installed And Not UPGRADINGPRODUCTCODE And REMOVE="ALL" And UILevel<=4</Custom>\r
- </InstallExecuteSequence>\r
-\r
<!-- Installation root-->\r
<Directory Id='TARGETDIR' Name='SourceDir'>\r
<Directory Id='@PlatformProgramFilesFolder@'>\r
SET (DEB_SERVICE_SERVER_EXECPOST "")
SET (DEB_INIT_APPARMOR "/lib/init/apparmor-profile-load usr.sbin.mysqld")
SET (DEB_STARTUP "SYSV")
+ELSEIF(DEB_CODENAME STREQUAL "sid")
+ IF (DEFINED DEB_GCC_SNAPSHOT)
+ SET (DEB_CMAKE_EXTRAS "${DEB_CMAKE_EXTRAS} -DCMAKE_C_COMPILER=/usr/lib/gcc-snapshot/bin/gcc -DCMAKE_CXX_COMPILER=/usr/lib/gcc-snapshot/bin/g++ -DMYSQL_MAINTAINER_MODE=0 -DCMAKE_CXX_COMPILER_LAUNCHER=ccache")
+ ENDIF()
+ SET (DEB_PLATFORMRELEASE "debianunstable")
+ SET (DEB_CONTROL_BDEPS "dh-systemd")
+ SET (DEB_INSTALL_SOURCE_XZ "../*.tar.xz usr/src/mysql/")
+ SET (DEB_RULES_INSTALL_SYSTEMD
+ "install -m 0755 debian/extra/mysql-systemd-start debian/tmp/usr/share/mysql/")
+ SET (DEB_RULES_INSTALL_APPARMOR "")
+ SET (DEB_RULES_APPARMOR_LOAD "")
+ SET (DEB_RULES_SYSTEMD_ENABLE "dh_systemd_enable --name=mysql")
+ SET (DEB_RULES_SYSTEMD_START "dh_systemd_start --restart-after-upgrade")
+ SET (DEB_INSTALL_SERVER_SYSTEMD "usr/share/mysql/mysql-systemd-start")
+ SET (DEB_INSTALL_SERVER_APPARMOR "")
+ SET (DEB_SERVICE_SERVER_EXECPRE
+ "ExecStartPre=/usr/share/mysql/mysql-systemd-start pre")
+ SET (DEB_INIT_APPARMOR "")
ELSEIF(DEB_CODENAME STREQUAL "trusty")
SET (DEB_PLATFORMRELEASE "ubuntu14.04")
SET (DEB_CONTROL_BDEPS "dh-apparmor")
SET (DEB_SERVICE_SERVER_EXECPRE
"ExecStartPre=/usr/share/mysql/mysql-systemd-start pre")
SET (DEB_INIT_APPARMOR "/lib/apparmor/profile-load usr.sbin.mysqld")
+ELSEIF(DEB_CODENAME STREQUAL "bionic")
+ SET (DEB_PLATFORMRELEASE "ubuntu18.04")
+ SET (DEB_CONTROL_BDEPS "dh-apparmor, dh-systemd (>=1.5)")
+ SET (DEB_INSTALL_SOURCE_XZ "../*.tar.xz usr/src/mysql/")
+ SET (DEB_RULES_INSTALL_SYSTEMD
+ "install -m 0755 debian/extra/mysql-systemd-start debian/tmp/usr/share/mysql/")
+ SET (DEB_RULES_INSTALL_APPARMOR
+ "install -g root -o root -m 0644 -D debian/extra/apparmor-profile debian/tmp/etc/apparmor.d/usr.sbin.mysqld")
+ SET (DEB_RULES_APPARMOR_LOAD
+ "dh_apparmor -pmysql-${DEB_PRODUCTNAME}-server --profile-name=usr.sbin.mysqld")
+ SET (DEB_RULES_SYSTEMD_ENABLE "dh_systemd_enable --name=mysql")
+ SET (DEB_RULES_SYSTEMD_START "dh_systemd_start --restart-after-upgrade")
+ SET (DEB_INSTALL_SERVER_SYSTEMD "usr/share/mysql/mysql-systemd-start")
+ SET (DEB_INSTALL_SERVER_APPARMOR "etc/apparmor.d/usr.sbin.mysqld")
+ SET (DEB_SERVICE_SERVER_EXECPRE
+ "ExecStartPre=/usr/share/mysql/mysql-systemd-start pre")
+ SET (DEB_INIT_APPARMOR "/lib/apparmor/profile-load usr.sbin.mysqld")
ELSE()
MESSAGE(STATUS
"Skipping deb packaging on unsupported platform ${DEB_CODENAME}.")
Source: http://dev.mysql.com/
Files: *
-Copyright: 2000, 2016, Oracle and/or its affiliates. All rights reserved.
+Copyright: 2000, 2018, Oracle and/or its affiliates. All rights reserved.
License: Commercial
This is a release of MySQL, a dual-license SQL database server.
For the avoidance of doubt, this particular copy of the software
Upstream-Contact: MySQL Release Engineering <mysql-build@oss.oracle.com>
Source: http://dev.mysql.com/
-Copyright: 2015, 2016, Oracle and/or its affiliates. All rights reserved.
+Copyright: 2000, 2018, Oracle and/or its affiliates. All rights reserved.
License:
This is a release of MySQL, a dual-license SQL database server.
For the avoidance of doubt, this particular copy of the software
usr/bin/mysql_client_test
usr/bin/mysqltest
# manpages
-usr/share/man/man1/mysql_client_test.1
-usr/share/man/man1/mysql-test-run.pl.1
-usr/share/man/man1/mysqltest.1
+#usr/share/man/man1/mysql_client_test.1
+#usr/share/man/man1/mysql-test-run.pl.1
+#usr/share/man/man1/mysqltest.1
# plugins
usr/lib/mysql/plugin/auth.so
usr/lib/mysql/plugin/auth_test_plugin.so
#!/usr/bin/make -f
-# Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2015, 2018, 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
-Xusr/share/mysql/binary-configure \
-Xusr/share/mysql/docs/mysql.info \
-Xusr/share/man/man1/mysqlman.1 \
- -Xusr/share/man/man1/mysqltest \
- -Xusr/share/man/man1/mysql_client_test \
- -Xusr/share/man/man1/mysql-stress-test.pl.1 \
- -Xusr/share/man/man1/mysql-test-run.pl.1 \
-X.h.pp
-# Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2000, 2018, 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
rm -rf %{buildroot}%{_bindir}/mysql_setpermission
rm -rf %{buildroot}%{_mandir}/man1/mysql_setpermission.1*
-# Remove obsoleted man pages
-rm -f %{buildroot}%{_mandir}/man1/mysql-stress-test.pl.1
-rm -f %{buildroot}%{_mandir}/man1/mysql-test-run.pl.1
-rm -f %{buildroot}%{_mandir}/man1/mysql_client_test.1
-rm -f %{buildroot}%{_mandir}/man1/mysql_client_test_embedded.1
-rm -f %{buildroot}%{_mandir}/man1/mysqltest.1
-rm -f %{buildroot}%{_mandir}/man1/mysqltest_embedded.1
-
%check
%if 0%{?runselftest}
pushd release
%attr(755, root, root) %{_libdir}/mysql/libmysqld.so
%changelog
+* Wed Jan 10 2018 Bjorn Munch <bjorn.munch@oracle.com> - 5.6.40-1
+- No longer need to remove obsoleted mysqltest man pages
+
* Tue Oct 31 2017 Bjorn Munch <bjorn.munch@oracle.com> - 5.6.39-1
- Remove obsoleted mysqltest man pages
-# Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2000, 2018, 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
rm -rf %{buildroot}%{_bindir}/mysql_setpermission
rm -rf %{buildroot}%{_mandir}/man1/mysql_setpermission.1*
-# Remove obsoleted man pages
-rm -f %{buildroot}%{_mandir}/man1/mysql-stress-test.pl.1
-rm -f %{buildroot}%{_mandir}/man1/mysql-test-run.pl.1
-rm -f %{buildroot}%{_mandir}/man1/mysql_client_test.1
-rm -f %{buildroot}%{_mandir}/man1/mysql_client_test_embedded.1
-rm -f %{buildroot}%{_mandir}/man1/mysqltest.1
-rm -f %{buildroot}%{_mandir}/man1/mysqltest_embedded.1
-
%check
%if 0%{?runselftest}
pushd release
%endif
%changelog
+* Wed Jan 10 2018 Bjorn Munch <bjorn.munch@oracle.com> - 5.6.40-1
+- No longer need to remove obsoleted mysqltest man pages
+
* Tue Oct 31 2017 Bjorn Munch <bjorn.munch@oracle.com> - 5.6.39-1
- Remove obsoleted mysqltest man pages
-# Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2000, 2018, 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
rm -rf %{buildroot}%{_mandir}/man1/mysql_setpermission.1*
rm -f %{buildroot}%{_datadir}/mysql/win_install_firewall.sql
-# Remove obsoleted man pages
-rm -f %{buildroot}%{_mandir}/man1/mysql-stress-test.pl.1
-rm -f %{buildroot}%{_mandir}/man1/mysql-test-run.pl.1
-rm -f %{buildroot}%{_mandir}/man1/mysql_client_test.1
-rm -f %{buildroot}%{_mandir}/man1/mysql_client_test_embedded.1
-rm -f %{buildroot}%{_mandir}/man1/mysqltest.1
-rm -f %{buildroot}%{_mandir}/man1/mysqltest_embedded.1
-
# rcmysql symlink
install -d %{buildroot}%{_sbindir}
%if 0%{?systemd}
%attr(755, root, root) %{_libdir}/mysql/libmysqld.so
%changelog
+* Wed Jan 10 2018 Bjorn Munch <bjorn.munch@oracle.com> - 5.6.40-1
+- No longer need to remove obsoleted mysqltest man pages
+
* Tue Oct 31 2017 Bjorn Munch <bjorn.munch@oracle.com> - 5.6.39-1
- Remove obsoleted mysqltest man pages
-/* Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2016, 2017 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
Successful connection.
delete entry for given account from the hash
*/
- if (user_present && m_userhost_hash.remove_entry(userhost))
+ if (user_present)
{
- char error_buffer[512];
- memset(error_buffer, 0, sizeof(error_buffer));
- my_snprintf(error_buffer, sizeof(error_buffer) - 1,
- "Failed to delete connection delay hash entry for acount : %s."
- " It might have been deleted already.",
- userhost.c_str());
- error_handler->handle_error(error_buffer);
- error= true;
+ (void) m_userhost_hash.remove_entry(userhost);
}
}
/***********************************************************************
-Copyright (c) 2011, 2017, Oracle and/or its affiliates. All rights reserved.
+Copyright (c) 2011, 2018, 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
}
}
} else {
+ bool auto_commit = (engine->read_batch_size == 1 &&
+ !(engine->cfg_status & IB_CFG_DISABLE_ROWLOCK)) ? true : false;
+
assert(conn_option == CONN_MODE_READ);
if (!read_crsr) {
/* This is read operation, start a trx
with "read_write" parameter set to false */
conn_data->crsr_trx = ib_cb_trx_begin(
- engine->trx_level, false,
- engine->read_batch_size == 1);
+ engine->trx_level, false, auto_commit);
trx_updated = true;
} else {
ib_cb_trx_start(conn_data->crsr_trx,
engine->trx_level,
- false,
- engine->read_batch_size == 1,
- NULL);
+ false, auto_commit, NULL);
}
err = innodb_api_begin(
/* This is read operation, start a trx
with "read_write" parameter set to false */
conn_data->crsr_trx = ib_cb_trx_begin(
- engine->trx_level, false,
- engine->read_batch_size == 1);
+ engine->trx_level, false, auto_commit);
trx_updated = true;
with "read_write" parameter set to false */
ib_cb_trx_start(conn_data->crsr_trx,
engine->trx_level,
- false,
- engine->read_batch_size == 1,
+ false, auto_commit,
NULL);
ib_cb_cursor_stmt_begin(conn_data->read_crsr);
# --exclude '*.[0-9][0-9][0-9][0-9][0-9][0-9]' --exclude '*.index')
# New filter - exclude everything except dirs (schemas) and innodb files
-FILTER=(-f '- /lost+found' -f '- /.fseventsd' -f '- /.Trashes'
- -f '+ /wsrep_sst_binlog.tar' -f '+ /ib_lru_dump' -f '+ /ibdata*' -f '+ /*/' -f '- /*')
+FILTER=(-f '- /lost+found'
+ -f '- /.fseventsd'
+ -f '- /.Trashes'
+ -f '+ /wsrep_sst_binlog.tar'
+ -f '+ /ib_lru_dump'
+ -f '+ /ibdata*'
+ -f '+ /undo*'
+ -f '+ /*/'
+ -f '- /*')
if [ "$WSREP_SST_OPT_ROLE" = "donor" ]
then
-/* Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2003, 2018, 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
#define SOCKET_ERROR -1
#endif
+#ifdef HAVE_OPENSSL
+#include <openssl/x509v3.h>
+#endif
+
#include "client_settings.h"
#include <sql_common.h>
#include <mysql/client_plugin.h>
} while(0)
#endif
+#if defined(HAVE_OPENSSL) && !defined(EMBEDDED_LIBRARY)
static char *set_ssl_option_unpack_path(struct st_mysql_options *options,
const char *arg)
{
}
return opt_var;
}
+#endif
void mysql_read_default_options(struct st_mysql_options *options,
{
uchar *pos;
/* fields count may be wrong */
- DBUG_ASSERT((uint) (field - result) < fields);
+ if (field < result || (uint) (field - result) >= fields)
+ DBUG_RETURN(NULL);
cli_fetch_lengths(&lengths[0], row->data, default_value ? 8 : 7);
field->catalog= strmake_root(alloc,(char*) row->data[0], lengths[0]);
field->db= strmake_root(alloc,(char*) row->data[1], lengths[1]);
if ((pkt_len= cli_safe_read(mysql)) == packet_error)
DBUG_RETURN(0);
+ if (pkt_len == 0) DBUG_RETURN(0);
if (!(result=(MYSQL_DATA*) my_malloc(sizeof(MYSQL_DATA),
MYF(MY_WME | MY_ZEROFILL))))
{
end_pos=pos+pkt_len;
for (field=0 ; field < fields ; field++)
{
- if ((len=(ulong) net_field_length(&pos)) == NULL_LENGTH)
+ len=(ulong) net_field_length_checked(&pos, (ulong)(end_pos - pos));
+ if (pos > end_pos)
+ {
+ set_mysql_error(mysql, CR_UNKNOWN_ERROR, unknown_sqlstate);
+ return -1;
+ }
+
+ if (len == NULL_LENGTH)
{ /* null field */
row[field] = 0;
*lengths++=0;
}
else
{
- if (len > (ulong) (end_pos - pos))
- {
- set_mysql_error(mysql, CR_UNKNOWN_ERROR, unknown_sqlstate);
- return -1;
- }
row[field] = (char*) pos;
pos+=len;
*lengths++=len;
{
SSL *ssl;
X509 *server_cert= NULL;
+ int ret_validation= 1;
+
+#if !(OPENSSL_VERSION_NUMBER >= 0x10002000L)
char *cn= NULL;
int cn_loc= -1;
ASN1_STRING *cn_asn1= NULL;
X509_NAME_ENTRY *cn_entry= NULL;
X509_NAME *subject= NULL;
- int ret_validation= 1;
+#endif
DBUG_ENTER("ssl_verify_server_cert");
DBUG_PRINT("enter", ("server_hostname: %s", server_hostname));
*/
/*
- Some notes for future development
- We should check host name in alternative name first and then if needed check in common name.
- Currently yssl doesn't support alternative name.
- openssl 1.0.2 support X509_check_host method for host name validation, we may need to start using
- X509_check_host in the future.
+ Use OpenSSL certificate matching functions instead of our own if we
+ have OpenSSL. The X509_check_* functions return 1 on success.
+ */
+#if OPENSSL_VERSION_NUMBER >= 0x10002000L || defined(HAVE_WOLFSSL)
+ if ((X509_check_host(server_cert, server_hostname, strlen(server_hostname),
+ 0, 0) != 1) &&
+ (X509_check_ip_asc(server_cert, server_hostname, 0) != 1)) {
+ *errptr = "Failed to verify the server certificate via X509 certificate "
+ "matching functions";
+ goto error;
+
+ } else {
+ /* Success */
+ ret_validation = 0;
+ }
+#else /* OPENSSL_VERSION_NUMBER < 0x10002000L */
+ /*
+ OpenSSL prior to 1.0.2 do not support X509_check_host() function.
+ Use deprecated X509_get_subject_name() instead.
*/
subject= X509_get_subject_name((X509 *) server_cert);
/* Success */
ret_validation= 0;
}
-
+#endif /* OPENSSL_VERSION_NUMBER >= 0x10002000L */
*errptr= "SSL certificate validation failure";
error:
#endif /* HAVE_OPENSSL && !EMBEDDED_LIBRARY */
+/**
+ Checks if any SSL option is set for libmysqld embedded server.
+
+ @param mysql the connection handle
+ @retval 0 success
+ @retval 1 failure
+*/
+#ifdef EMBEDDED_LIBRARY
+int embedded_ssl_check(MYSQL *mysql)
+{
+ if (mysql->options.ssl_key || mysql->options.ssl_cert ||
+ mysql->options.ssl_ca || mysql->options.ssl_capath ||
+ mysql->options.ssl_cipher ||
+ mysql->options.client_flag & CLIENT_SSL_VERIFY_SERVER_CERT ||
+ (mysql->options.extension &&
+ (mysql->options.extension->ssl_crl ||
+ mysql->options.extension->ssl_crlpath ||
+ mysql->options.extension->ssl_mode == SSL_MODE_REQUIRED)))
+ {
+ set_mysql_extended_error(mysql, CR_SSL_CONNECTION_ERROR, unknown_sqlstate,
+ ER(CR_SSL_CONNECTION_ERROR),
+ "Embedded server libmysqld library doesn't support "
+ "SSL connections");
+ return 1;
+ }
+ return 0;
+}
+#endif
+
+
/*
Note that the mysql argument must be initialized with mysql_init()
before calling mysql_real_connect !
mysql->client_flag= client_flag;
+#ifdef EMBEDDED_LIBRARY
+ if (embedded_ssl_check(mysql))
+ goto error;
+#endif
+
/*
Part 2: invoke the plugin to send the authentication data to the server
*/
mysql->options.ci.bind_address= my_strdup(arg, MYF(MY_WME));
break;
case MYSQL_OPT_SSL_VERIFY_SERVER_CERT:
+#if defined(HAVE_OPENSSL) && !defined(EMBEDDED_LIBRARY)
if (*(my_bool*) arg)
mysql->options.client_flag|= CLIENT_SSL_VERIFY_SERVER_CERT;
else
mysql->options.client_flag&= ~CLIENT_SSL_VERIFY_SERVER_CERT;
+#elif defined(EMBEDDED_LIBRARY)
+ DBUG_RETURN(1);
+#endif
break;
case MYSQL_PLUGIN_DIR:
EXTENSION_SET_STRING(&mysql->options, plugin_dir, arg);
EXTENSION_SET_STRING(&mysql->options, default_auth, arg);
break;
case MYSQL_OPT_SSL_KEY:
+#if defined(HAVE_OPENSSL) && !defined(EMBEDDED_LIBRARY)
if (mysql->options.ssl_key)
my_free(mysql->options.ssl_key);
mysql->options.ssl_key= set_ssl_option_unpack_path(&mysql->options, arg);
+#elif defined(EMBEDDED_LIBRARY)
+ DBUG_RETURN(1);
+#endif
break;
case MYSQL_OPT_SSL_CERT:
+#if defined(HAVE_OPENSSL) && !defined(EMBEDDED_LIBRARY)
if (mysql->options.ssl_cert)
my_free(mysql->options.ssl_cert);
mysql->options.ssl_cert= set_ssl_option_unpack_path(&mysql->options, arg);
+#elif defined(EMBEDDED_LIBRARY)
+ DBUG_RETURN(1);
+#endif
break;
case MYSQL_OPT_SSL_CA:
+#if defined(HAVE_OPENSSL) && !defined(EMBEDDED_LIBRARY)
if (mysql->options.ssl_ca)
my_free(mysql->options.ssl_ca);
mysql->options.ssl_ca= set_ssl_option_unpack_path(&mysql->options, arg);
+#elif defined(EMBEDDED_LIBRARY)
+ DBUG_RETURN(1);
+#endif
break;
case MYSQL_OPT_SSL_CAPATH:
+#if defined(HAVE_OPENSSL) && !defined(EMBEDDED_LIBRARY)
if (mysql->options.ssl_capath)
my_free(mysql->options.ssl_capath);
mysql->options.ssl_capath= set_ssl_option_unpack_path(&mysql->options, arg);
+#elif defined(EMBEDDED_LIBRARY)
+ DBUG_RETURN(1);
+#endif
+ break;
+ case MYSQL_OPT_SSL_CIPHER:
+#if defined(HAVE_OPENSSL) && !defined(EMBEDDED_LIBRARY)
+ SET_SSL_OPTION(ssl_cipher, arg);
+#elif defined(EMBEDDED_LIBRARY)
+ DBUG_RETURN(1);
+#endif
break;
- case MYSQL_OPT_SSL_CIPHER: SET_SSL_OPTION(ssl_cipher, arg); break;
case MYSQL_OPT_SSL_CRL:
+#if defined(HAVE_OPENSSL) && !defined(EMBEDDED_LIBRARY)
if (mysql->options.extension)
my_free(mysql->options.extension->ssl_crl);
else
ALLOCATE_EXTENSIONS(&mysql->options);
mysql->options.extension->ssl_crl=
set_ssl_option_unpack_path(&mysql->options, arg);
+#elif defined(EMBEDDED_LIBRARY)
+ DBUG_RETURN(1);
+#endif
break;
case MYSQL_OPT_SSL_CRLPATH:
+#if defined(HAVE_OPENSSL) && !defined(EMBEDDED_LIBRARY)
if (mysql->options.extension)
my_free(mysql->options.extension->ssl_crlpath);
else
ALLOCATE_EXTENSIONS(&mysql->options);
mysql->options.extension->ssl_crlpath=
set_ssl_option_unpack_path(&mysql->options, arg);
+#elif defined(EMBEDDED_LIBRARY)
+ DBUG_RETURN(1);
+#endif
break;
case MYSQL_SERVER_PUBLIC_KEY:
EXTENSION_SET_STRING(&mysql->options, server_public_key_path, arg);
mysql->options.client_flag&= ~CLIENT_CAN_HANDLE_EXPIRED_PASSWORDS;
break;
case MYSQL_OPT_SSL_MODE:
+#if defined(HAVE_OPENSSL) && !defined(EMBEDDED_LIBRARY)
if (*(uint *) arg == SSL_MODE_REQUIRED)
{
ENSURE_EXTENSIONS_PRESENT(&mysql->options);
mysql->options.extension->ssl_mode= SSL_MODE_REQUIRED;
}
+#elif defined(EMBEDDED_LIBRARY)
+ DBUG_RETURN(1);
+#endif
break;
default:
--- /dev/null
+/* Copyright (c) 2017, 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 Foundation; version 2 of the License.
+
+ This program is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ 02110-1301, USA */
+
+#include "my_dir.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ Check if a file/dir is world-writable (only on non-Windows platforms)
+
+ @param [in] Path of the file/dir to be checked
+
+ @returns Status of the file/dir check
+ @retval -2 Permission denied to check attributes of file/dir
+ @retval -1 Error in reading file/dir
+ @retval 0 File/dir is not world-writable
+ @retval 1 File/dir is world-writable
+ */
+
+int is_file_or_dir_world_writable(const char *path)
+{
+ MY_STAT stat_info;
+ (void)path; // avoid unused param warning when built on Windows
+#ifndef _WIN32
+ if (!my_stat(path, &stat_info, MYF(0)))
+ {
+ return (errno == EACCES) ? -2 : -1;
+ }
+ if ((stat_info.st_mode & S_IWOTH) &&
+ ((stat_info.st_mode & S_IFMT) == S_IFREG || /* file */
+ (stat_info.st_mode & S_IFMT) == S_IFDIR)) /* or dir */
+ return 1;
+#endif
+ return 0;
+}
+
+#ifdef __cplusplus
+}
+#endif
-/* Copyright (c) 2000-2003, 2007 MySQL AB
- Use is subject to license terms
+/* Copyright (c) 2000, 2018 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
return (ulong) uint4korr(pos+1);
}
+/* The same as above but with max length check */
+ulong STDCALL net_field_length_checked(uchar **packet, ulong max_length)
+{
+ ulong len;
+ uchar *pos= (uchar *)*packet;
+
+ if (*pos < 251)
+ {
+ (*packet)++;
+ len= (ulong) *pos;
+ return (len > max_length) ? max_length : len;
+ }
+ if (*pos == 251)
+ {
+ (*packet)++;
+ return NULL_LENGTH;
+ }
+ if (*pos == 252)
+ {
+ (*packet)+=3;
+ len= (ulong) uint2korr(pos+1);
+ return (len > max_length) ? max_length : len;
+ }
+ if (*pos == 253)
+ {
+ (*packet)+=4;
+ len= (ulong) uint3korr(pos+1);
+ return (len > max_length) ? max_length : len;
+ }
+ (*packet)+=9; /* Must be 254 when here */
+ len= (ulong) uint4korr(pos+1);
+ return (len > max_length) ? max_length : len;
+}
+
/* The same as above but returns longlong */
my_ulonglong net_field_length_ll(uchar **packet)
{
-# Copyright (c) 2006, 2017, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2006, 2018, 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
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-IF(WITH_WSREP)
- SET(WSREP_INCLUDES ${CMAKE_SOURCE_DIR}/wsrep)
-ENDIF()
-
INCLUDE_DIRECTORIES(
${CMAKE_SOURCE_DIR}/include
${CMAKE_SOURCE_DIR}/sql
)
SET_SOURCE_FILES_PROPERTIES(${GEN_SOURCES}
- ${CONF_SOURCES}
${GEN_DIGEST_SOURCES}
+ ${CONF_SOURCES}
PROPERTIES GENERATED 1)
# Gen_lex_token
SET(SQL_SOURCE
${WSREP_SOURCES}
${GEN_SOURCES}
- ${CONF_SOURCES}
${GEN_DIGEST_SOURCES}
+ ${CONF_SOURCES}
${MYSYS_LIBWRAP_SOURCE}
${SQL_SHARED_SOURCES}
../libmysql/errmsg.c
../sql-common/client.c
../sql-common/client_plugin.c
+ ../sql-common/my_path_permissions.cc
../sql-common/my_time.c
../sql-common/my_user.c
../sql-common/pack.c
SET(MYSQLD_SOURCE main.cc ${DTRACE_PROBES_ALL})
ENDIF()
-MYSQL_ADD_EXECUTABLE(mysqld ${MYSQLD_SOURCE} DESTINATION ${INSTALL_SBINDIR} COMPONENT Server)
+MYSQL_ADD_EXECUTABLE(mysqld
+ ${MYSQLD_SOURCE} DESTINATION ${INSTALL_SBINDIR} COMPONENT Server)
OPTION(DEBUG_EXTNAME "Build server as mysqld-debug (debug builds only)" OFF)
MARK_AS_ADVANCED(DEBUG_EXTNAME)
SET_TARGET_PROPERTIES(mysqld PROPERTIES LINK_FLAGS "${mysqld_link_flags} -Wl,--export-all-symbols")
ENDIF()
IF(MSVC)
- # Set module definition file. Also use non-incremental linker,
- # incremental appears to crash from time to time,if used with /DEF option
- SET_TARGET_PROPERTIES(mysqld PROPERTIES LINK_FLAGS "${mysqld_link_flags} /DEF:mysqld.def /INCREMENTAL:NO")
+ # Set module definition file.
+ # Also use non-incremental linker, incremental appears to crash from
+ # time to time,if used with /DEF option
+ SET_TARGET_PROPERTIES(mysqld PROPERTIES LINK_FLAGS
+ "${mysqld_link_flags} /DEF:mysqld.def /INCREMENTAL:NO")
FOREACH (CORELIB sql mysys mysys_ssl dbug strings)
GET_TARGET_PROPERTY(LOC ${CORELIB} LOCATION)
# Handle out-of-source build from source package with possibly broken
# bison. Copy bison output to from source to build directory, if not already
# there
-IF (NOT ${CMAKE_CURRENT_SOURCE_DIR} STREQUAL ${CMAKE_CURRENT_BINARY_DIR})
- IF(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/sql_yacc.cc)
- IF(NOT EXISTS ${CMAKE_CURRENT_BINARY_DIR}/sql_yacc.cc)
- CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/sql_yacc.cc
- ${CMAKE_CURRENT_BINARY_DIR}/sql_yacc.cc COPYONLY)
- CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/sql_yacc.h
- ${CMAKE_CURRENT_BINARY_DIR}/sql_yacc.h COPYONLY)
- ENDIF()
- ENDIF()
-ENDIF()
-
-
INCLUDE(${CMAKE_SOURCE_DIR}/cmake/bison.cmake)
+COPY_BISON_OUTPUT(
+ ${CMAKE_CURRENT_SOURCE_DIR}/sql_yacc.cc
+ ${CMAKE_CURRENT_SOURCE_DIR}/sql_yacc.h
+ ${CMAKE_CURRENT_BINARY_DIR}/sql_yacc.cc
+ ${CMAKE_CURRENT_BINARY_DIR}/sql_yacc.h
+)
+
RUN_BISON(
${CMAKE_CURRENT_SOURCE_DIR}/sql_yacc.yy
${CMAKE_CURRENT_BINARY_DIR}/sql_yacc.cc
${CMAKE_CURRENT_BINARY_DIR}/sql_yacc.h
)
+SET_SOURCE_FILES_PROPERTIES(
+ ${CMAKE_CURRENT_BINARY_DIR}/sql_yacc.cc
+ ${CMAKE_CURRENT_SOURCE_DIR}/sql_digest.cc
+ PROPERTIES OBJECT_DEPENDS ${GEN_DIGEST_SOURCES}
+)
+
# Gen_lex_hash
ADD_EXECUTABLE(gen_lex_hash gen_lex_hash.cc)
DEPENDS ${GEN_DIGEST_SOURCES}
)
-#Need this only for embedded
-SET_TARGET_PROPERTIES(GenServerSource PROPERTIES EXCLUDE_FROM_ALL TRUE)
IF(WIN32 OR HAVE_DLOPEN AND NOT DISABLE_SHARED)
ADD_LIBRARY(udf_example MODULE udf_example.cc)
# udf_example depends on strings
IF(WIN32)
IF(MSVC)
- SET_TARGET_PROPERTIES(udf_example PROPERTIES LINK_FLAGS "/DEF:${CMAKE_CURRENT_SOURCE_DIR}/udf_example.def")
+ SET_TARGET_PROPERTIES(udf_example
+ PROPERTIES LINK_FLAGS "/DEF:${CMAKE_CURRENT_SOURCE_DIR}/udf_example.def")
ENDIF()
TARGET_LINK_LIBRARIES(udf_example strings)
ELSE()
ADD_CUSTOM_TARGET(show-dist-name
COMMAND ${CMAKE_COMMAND} -E echo "${CPACK_PACKAGE_FILE_NAME}"
)
-
-/* Copyright (c) 2009, 2017, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2009, 2018, 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
return flags.incident;
}
+ /**
+ Sets the binlog_cache_data::Flags::flush_error flag if there
+ is an error while flushing cache to the file.
+
+ @param thd The client thread that is executing the transaction.
+ */
+ void set_flush_error(THD *thd)
+ {
+ flags.flush_error= true;
+ if(is_trx_cache())
+ {
+ /*
+ If the cache is a transactional cache and if the write
+ has failed due to ENOSPC, then my_write() would have
+ set EE_WRITE error, so clear the error and create an
+ equivalent server error.
+ */
+ if (thd->is_error())
+ thd->clear_error();
+ char errbuf[MYSYS_STRERROR_SIZE];
+ my_error(ER_ERROR_ON_WRITE, MYF(MY_WME), my_filename(cache_log.file),
+ errno, my_strerror(errbuf, sizeof(errbuf), errno));
+ }
+ }
+
+ bool get_flush_error(void) const
+ {
+ return flags.flush_error;
+ }
+
bool has_xid() const {
// There should only be an XID event if we are transactional
DBUG_ASSERT((flags.transactional && flags.with_xid) || !flags.with_xid);
flags.with_xid= false;
flags.immediate= false;
flags.finalized= false;
+ flags.flush_error= false;
/*
The truncate function calls reinit_io_cache that calls my_b_flush_io_cache
which may increase disk_writes. This breaks the disk_writes use by the
{
DBUG_PRINT("info", ("truncating to position %lu", (ulong) pos));
remove_pending_event();
- reinit_io_cache(&cache_log, WRITE_CACHE, pos, 0, 0);
+ /*
+ Whenever there is an error while flushing cache to file,
+ the local cache will not be in a normal state and the same
+ cache cannot be used without facing an assert.
+ So, clear the cache if there is a flush error.
+ */
+ reinit_io_cache(&cache_log, WRITE_CACHE, pos, 0, get_flush_error());
cache_log.end_of_file= saved_max_binlog_cache_size;
}
This indicates that the cache contain an XID event.
*/
bool with_xid:1;
+
+ /*
+ This flag is set to 'true' when there is an error while flushing the
+ I/O cache to file.
+ */
+ bool flush_error:1;
} flags;
private:
{
DBUG_EXECUTE_IF("simulate_disk_full_at_flush_pending",
{DBUG_SET("+d,simulate_file_write_error");});
+
+ DBUG_EXECUTE_IF("simulate_tmpdir_partition_full",
+ {
+ static int count= -1;
+ count++;
+ if(count % 4 == 3 && ev->get_type_code() == WRITE_ROWS_EVENT)
+ DBUG_SET("+d,simulate_temp_file_write_error");
+ });
if (ev->write(&cache_log) != 0)
{
DBUG_EXECUTE_IF("simulate_disk_full_at_flush_pending",
*/
DBUG_SET("+d,simulate_do_write_cache_failure");
});
+
+ DBUG_EXECUTE_IF("simulate_temp_file_write_error",
+ {
+ DBUG_SET("-d,simulate_temp_file_write_error");
+ });
+ /*
+ If the flush has failed due to ENOSPC error, set the
+ flush_error flag.
+ */
+ if (thd->is_error() && my_errno == ENOSPC)
+ {
+ set_flush_error(thd);
+ }
DBUG_RETURN(1);
}
if (ev->get_type_code() == XID_EVENT)
Gtid_log_event gtid_ev(thd, cache_data->is_trx_cache(),
&cached_group->spec);
bool using_file= cache_data->cache_log.pos_in_file > 0;
+
+ DBUG_EXECUTE_IF("simulate_tmpdir_partition_full",
+ {
+ DBUG_SET("+d,simulate_temp_file_write_error");
+ });
+
my_off_t saved_position= cache_data->reset_write_pos(0, using_file);
- error= gtid_ev.write(&cache_data->cache_log);
- cache_data->reset_write_pos(saved_position, using_file);
+
+ if (!cache_data->cache_log.error)
+ {
+ if (gtid_ev.write(&cache_data->cache_log))
+ goto err;
+ cache_data->reset_write_pos(saved_position, using_file);
+ }
+
+ if (cache_data->cache_log.error)
+ goto err;
}
DBUG_RETURN(error);
+
+err:
+ DBUG_EXECUTE_IF("simulate_tmpdir_partition_full",
+ {
+ DBUG_SET("-d,simulate_temp_file_write_error");
+ });
+ /*
+ If the reinit_io_cache has failed, set the flush_error flag.
+ */
+ if (cache_data->cache_log.error)
+ {
+ cache_data->set_flush_error(thd);
+ }
+ DBUG_RETURN(1);
+
}
/**
sql_print_error(ER(ER_ERROR_ON_WRITE), name,
errno, my_strerror(errbuf, sizeof(errbuf), errno));
}
+
+ /*
+ If the flush has failed due to ENOSPC, set the flush_error flag.
+ */
+ if (cache->error && thd->is_error() && my_errno == ENOSPC)
+ {
+ cache_data->set_flush_error(thd);
+ }
thd->commit_error= THD::CE_FLUSH_ERROR;
DBUG_RETURN(1);
}
close(LOG_CLOSE_INDEX|LOG_CLOSE_STOP_EVENT, false/*need_lock_log=false*/,
true/*need_lock_index=true*/);
+ /*
+ If there is a write error (flush/sync stage) and if
+ binlog_error_action=IGNORE_ERROR, clear the error
+ and allow the commit to happen in storage engine.
+ */
+ if (check_write_error(thd))
+ thd->clear_error();
+
if (need_lock_log)
mysql_mutex_unlock(&LOCK_log);
DEBUG_SYNC(thd, "after_binlog_closed_due_to_error");
/*
- Copyright (c) 2006, 2015, Oracle and/or its affiliates. All rights reserved.
+ Copyright (c) 2006, 2017, 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
error_log_print(ERROR_LEVEL, fmt, args);
va_end(args);
}
+public:
+ Event_db_intact() { has_keys= TRUE; }
};
/** In case of an error, a message is printed to the error log. */
if (open_system_tables_for_read(thd, &event_table, &open_tables_backup))
DBUG_RETURN(TRUE);
- if (!event_table.table->key_info)
- {
- close_system_tables(thd, &open_tables_backup);
- my_error(ER_TABLE_CORRUPT, MYF(0), event_table.table->s->db.str,
- event_table.table->s->table_name.str);
- DBUG_RETURN(TRUE);
- }
-
if (table_intact.check(event_table.table, &event_table_def))
{
close_system_tables(thd, &open_tables_backup);
name.length > table->field[ET_FIELD_NAME]->field_length)
DBUG_RETURN(TRUE);
- if (!table->key_info)
- {
- my_error(ER_TABLE_CORRUPT, MYF(0), table->s->db.str,
- table->s->table_name.str);
- DBUG_RETURN(TRUE);
- }
-
table->field[ET_FIELD_DB]->store(db.str, db.length, &my_charset_bin);
table->field[ET_FIELD_NAME]->store(name.str, name.length, &my_charset_bin);
Info *result= (Info *)new_item();
if (!result)
return NULL;
+ if (!m_hook)
+ return NULL;
*m_hook= result;
m_hook= &result->next;
m_n_points++;
-/* Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2000, 2018, 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
{
DBUG_ENTER("Gcalc_operation_reducer::end_couple");
res_point *rp0, *rp1;
- DBUG_ASSERT(t1->result_range);
+ if (!t1->result_range)
+ DBUG_RETURN(1);
if (!(rp0= add_res_point(p)) || !(rp1= add_res_point(p)))
DBUG_RETURN(1);
rp0->down= t0->rp;
/* Copy record to new handler */
(*copied)++;
tmp_disable_binlog(thd); /* Do not replicate the low-level changes. */
+#ifdef WITH_WSREP
+ reenable_wsrep(thd);
+#endif
result= m_new_file[new_part]->ha_write_row(m_rec0);
reenable_binlog(thd);
if (result)
start_part_bulk_insert(thd, part_id);
tmp_disable_binlog(thd); /* Do not replicate the low-level changes. */
+#ifdef WITH_WSREP
+ reenable_wsrep(thd);
+#endif
error= m_file[part_id]->ha_write_row(buf);
if (have_auto_increment && !table->s->next_number_keypart)
set_auto_increment_if_higher(table->next_number_field);
{
DBUG_PRINT("info", ("Update in partition %d", new_part_id));
tmp_disable_binlog(thd); /* Do not replicate the low-level changes. */
+#ifdef WITH_WSREP
+ reenable_wsrep(thd);
+#endif
error= m_file[new_part_id]->ha_update_row(old_data, new_data);
reenable_binlog(thd);
goto exit;
DBUG_PRINT("info", ("Update from partition %d to partition %d",
old_part_id, new_part_id));
tmp_disable_binlog(thd); /* Do not replicate the low-level changes. */
+#ifdef WITH_WSREP
+ reenable_wsrep(thd);
+#endif
error= m_file[new_part_id]->ha_write_row(new_data);
reenable_binlog(thd);
table->next_number_field= saved_next_number_field;
goto exit;
tmp_disable_binlog(thd); /* Do not replicate the low-level changes. */
+#ifdef WITH_WSREP
+ reenable_wsrep(thd);
+#endif
error= m_file[old_part_id]->ha_delete_row(old_data);
reenable_binlog(thd);
if (error)
m_last_part= part_id;
tmp_disable_binlog(thd);
+#ifdef WITH_WSREP
+ reenable_wsrep(thd);
+#endif
error= m_file[part_id]->ha_delete_row(buf);
reenable_binlog(thd);
DBUG_RETURN(error);
/*
- Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
+ Copyright (c) 2000, 2018, 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
}
if (Field::result_merge_type(fld_type) == DECIMAL_RESULT)
{
+ collation.set_numeric();
decimals= min<int>(max(decimals, item->decimals), DECIMAL_MAX_SCALE);
int item_int_part= item->decimal_int_part();
int item_prec = max(prev_decimal_int_part, item_int_part) + decimals;
/*
- Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
+ Copyright (c) 2000, 2018, 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
item->update_used_tables();
used_tables_cache|=item->used_tables();
const_item_cache&=item->const_item();
- with_subselect= item->has_subquery();
- with_stored_program= item->has_stored_program();
+ with_subselect|= item->has_subquery();
+ with_stored_program|= item->has_stored_program();
}
/*
- Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
+ Copyright (c) 2000, 2018, 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
bool Log_event::wrapper_my_b_safe_write(IO_CACHE* file, const uchar* buf, ulong size)
{
+ DBUG_EXECUTE_IF("simulate_temp_file_write_error",
+ {
+ file->write_pos = file->write_end;
+ DBUG_SET("+d,simulate_file_write_error");
+ });
if (need_checksum() && size != 0)
crc= my_checksum(crc, buf, size);
-
- return my_b_safe_write(file, buf, size);
+ bool ret = my_b_safe_write(file, buf, size);
+ DBUG_EXECUTE_IF("simulate_temp_file_write_error",
+ {
+ DBUG_SET("-d,simulate_file_write_error");
+ });
+ return ret;
}
bool Log_event::write_footer(IO_CACHE* file)
db= (char *)start;
query= (char *)(start + db_len + 1);
q_len= data_len - db_len -1;
+
+ if (data_len && (data_len < db_len ||
+ data_len < q_len ||
+ data_len != (db_len + q_len + 1)))
+ {
+ q_len= 0;
+ query= NULL;
+ DBUG_VOID_RETURN;
+ }
+
+ unsigned int max_length;
+ max_length= (event_len - ((const char*)(end + db_len + 1) -
+ (buf - common_header_len)));
+ if (q_len != max_length)
+ {
+ q_len= 0;
+ query= NULL;
+ DBUG_VOID_RETURN;
+ }
/**
Append the db length at the end of the buffer. This will be used by
Query_cache::send_result_to_client() in case the query cache is On.
you.
*/
thd->catalog= catalog_len ? (char *) catalog : (char *)"";
+
+ size_t valid_len;
+ bool len_error;
+ bool is_invalid_db_name= validate_string(system_charset_info, db, db_len,
+ &valid_len, &len_error);
+
+ DBUG_PRINT("debug",("is_invalid_db_name= %s, valid_len=%zu, len_error=%s",
+ is_invalid_db_name ? "true" : "false",
+ valid_len,
+ len_error ? "true" : "false"));
+
+ if (is_invalid_db_name || len_error)
+ {
+ rli->report(ERROR_LEVEL, ER_SLAVE_FATAL_ERROR,
+ ER_THD(thd, ER_SLAVE_FATAL_ERROR),
+ "Invalid database name in Query event.");
+ thd->is_slave_error= true;
+ goto end;
+ }
+
set_thd_db(thd, db, db_len);
/*
}
else
thd->variables.collation_database= thd->db_charset;
-
+
+ {
+ const CHARSET_INFO *cs= thd->charset();
+ /*
+ We cannot ask for parsing a statement using a character set
+ without state_maps (parser internal data).
+ */
+ if (!cs->state_map)
+ {
+ rli->report(ERROR_LEVEL, ER_SLAVE_FATAL_ERROR,
+ ER_THD(thd, ER_SLAVE_FATAL_ERROR),
+ "character_set cannot be parsed");
+ thd->is_slave_error= true;
+ goto end;
+ }
+ }
+
thd->table_map_for_update= (table_map)table_map_for_update;
thd->set_invoker(&user, &host);
/*
*/
break;
default:
- /* this case is impossible */
+ /*
+ This case is not expected. It can be either an event corruption or an
+ unsupported binary log version.
+ */
+ rli->report(ERROR_LEVEL, ER_SLAVE_FATAL_ERROR,
+ ER_THD(thd, ER_SLAVE_FATAL_ERROR),
+ "Binlog version not supported");
DBUG_RETURN(1);
}
DBUG_RETURN(error);
fields = (char*)field_lens + num_fields;
table_name = fields + field_block_len;
+ if (strlen(table_name) > NAME_LEN)
+ goto err;
+
db = table_name + table_name_len + 1;
DBUG_EXECUTE_IF ("simulate_invalid_address",
db_len = data_len;);
buf+= description_event->common_header_len +
description_event->post_header_len[USER_VAR_EVENT-1];
name_len= uint4korr(buf);
+ /* Avoid reading out of buffer */
+ if ((buf - buf_start) + UV_NAME_LEN_SIZE + name_len > event_len)
+ {
+ error= true;
+ goto err;
+ }
+
name= (char *) buf + UV_NAME_LEN_SIZE;
/*
we keep the flags set to UNDEF_F.
*/
uint bytes_read= ((val + val_len) - start);
+ if (bytes_read > event_len)
+ {
+ error= true;
+ goto err;
+ }
#ifndef DBUG_OFF
bool old_pre_checksum_fd= description_event->is_version_before_checksum();
#endif
}
if (!(charset= get_charset(charset_number, MYF(MY_WME))))
+ {
+ rli->report(ERROR_LEVEL, ER_SLAVE_FATAL_ERROR,
+ ER_THD(thd, ER_SLAVE_FATAL_ERROR),
+ "Invalid character set for User var event");
return 1;
+ }
double real_val;
longlong int_val;
{
switch (type) {
case REAL_RESULT:
+ if (val_len != 8)
+ {
+ rli->report(ERROR_LEVEL, ER_SLAVE_FATAL_ERROR,
+ ER_THD(thd, ER_SLAVE_FATAL_ERROR),
+ "Invalid variable length at User var event");
+ return 1;
+ }
float8get(real_val, val);
it= new Item_float(real_val, 0);
val= (char*) &real_val; // Pointer to value in native format
val_len= 8;
break;
case INT_RESULT:
+ if (val_len != 8)
+ {
+ rli->report(ERROR_LEVEL, ER_SLAVE_FATAL_ERROR,
+ ER_THD(thd, ER_SLAVE_FATAL_ERROR),
+ "Invalid variable length at User var event");
+ return 1;
+ }
int_val= (longlong) uint8korr(val);
it= new Item_int(int_val);
val= (char*) &int_val; // Pointer to value in native format
break;
case DECIMAL_RESULT:
{
+ if (val_len < 3)
+ {
+ rli->report(ERROR_LEVEL, ER_SLAVE_FATAL_ERROR,
+ ER_THD(thd, ER_SLAVE_FATAL_ERROR),
+ "Invalid variable length at User var event");
+ return 1;
+ }
Item_decimal *dec= new Item_decimal((uchar*) val+2, val[0], val[1]);
it= dec;
val= (char *)dec->val_decimal(NULL);
which includes length bytes
*/
var_header_len= uint2korr(post_start);
- assert(var_header_len >= 2);
+ /* Check length and also avoid out of buffer read */
+ if (var_header_len < 2 ||
+ event_len < static_cast<unsigned int>(var_header_len +
+ (post_start - buf)))
+ {
+ m_cols.bitmap= NULL;
+ DBUG_VOID_RETURN;
+ }
+
var_header_len-= 2;
/* Iterate over var-len header, extracting 'chunks' */
DBUG_PRINT("debug", ("Reading from %p", ptr_after_width));
m_width = net_field_length(&ptr_after_width);
DBUG_PRINT("debug", ("m_width=%lu", m_width));
+ /* Avoid reading out of buffer */
+ if (static_cast<unsigned int>((ptr_after_width +
+ (m_width + 7) / 8) -
+ (uchar*)buf) > event_len)
+ {
+ m_cols.bitmap= NULL;
+ DBUG_VOID_RETURN;
+ }
+
/* if bitmap_init fails, catched in is_valid() */
if (likely(!bitmap_init(&m_cols,
m_width <= sizeof(m_bitbuf)*8 ? m_bitbuf : NULL,
const uchar* const ptr_rows_data= (const uchar*) ptr_after_width;
- size_t const data_size= event_len - (ptr_rows_data - (const uchar *) buf);
+ size_t const read_size= ptr_rows_data - (const unsigned char *) buf;
+ if (read_size > event_len)
+ {
+ DBUG_VOID_RETURN;
+ }
+
+ size_t const data_size= event_len - read_size;
DBUG_PRINT("info",("m_table_id: %llu m_flags: %d m_width: %lu data_size: %lu",
m_table_id.id(), m_flags, m_width, (ulong) data_size));
if (!m_curr_row_end && !error)
{
+ const uchar *previous_m_curr_row= m_curr_row;
error= unpack_current_row(rli, &m_cols);
+
+ if (!error && previous_m_curr_row == m_curr_row)
+ {
+ error= 1;
+ }
}
// at this moment m_curr_row_end should be set
(ulong) m_tbllen, (long) (ptr_tbllen-(const uchar*)vpart),
m_colcnt, (long) (ptr_colcnt-(const uchar*)vpart)));
+ bytes_read= (unsigned int) (ptr_after_colcnt - (unsigned char *)buf);
+ /* Avoid reading out of buffer */
+ if (event_len <= bytes_read || event_len - bytes_read < m_colcnt)
+ {
+ m_coltype= NULL;
+ m_memory= NULL;
+ DBUG_VOID_RETURN;
+ }
+
/* Allocate mem for all fields in one go. If fails, caught in is_valid() */
m_memory= (uchar*) my_multi_malloc(MYF(MY_WME),
&m_dbnam, (uint) m_dblen + 1,
if (bytes_read < event_len)
{
m_field_metadata_size= net_field_length(&ptr_after_colcnt);
- DBUG_ASSERT(m_field_metadata_size <= (m_colcnt * 2));
- uint num_null_bytes= (m_colcnt + 7) / 8;
- m_meta_memory= (uchar *)my_multi_malloc(MYF(MY_WME),
- &m_null_bits, num_null_bytes,
- &m_field_metadata, m_field_metadata_size,
- NULL);
- memcpy(m_field_metadata, ptr_after_colcnt, m_field_metadata_size);
- ptr_after_colcnt= (uchar*)ptr_after_colcnt + m_field_metadata_size;
- memcpy(m_null_bits, ptr_after_colcnt, num_null_bytes);
+ if (m_field_metadata_size <= (m_colcnt * 2))
+ {
+ uint num_null_bytes= (m_colcnt + 7) / 8;
+ m_meta_memory= (uchar *)my_multi_malloc(MYF(MY_WME),
+ &m_null_bits, num_null_bytes,
+ &m_field_metadata, m_field_metadata_size,
+ NULL);
+ memcpy(m_field_metadata, ptr_after_colcnt, m_field_metadata_size);
+ ptr_after_colcnt= (uchar*)ptr_after_colcnt + m_field_metadata_size;
+ memcpy(m_null_bits, ptr_after_colcnt, num_null_bytes);
+ }
+ else
+ {
+ m_coltype= NULL;
+ my_free(m_memory);
+ m_memory= NULL;
+ DBUG_VOID_RETURN;
+ }
}
}
Table_map_log_event::~Table_map_log_event()
{
- my_free(m_meta_memory);
- my_free(m_memory);
+ if (m_meta_memory != NULL)
+ my_free(m_meta_memory);
+ if (m_memory != NULL)
+ my_free(m_memory);
}
/*
if ((error= unpack_current_row(rli, &m_cols)))
DBUG_RETURN(error);
+ /*
+ When m_curr_row == m_curr_row_end, it means a row that contains nothing,
+ so all the pointers shall be pointing to the same address, or else
+ we have corrupt data and shall throw the error.
+ */
+ DBUG_PRINT("debug",("m_rows_buf= %p, m_rows_cur= %p, m_rows_end= %p",
+ m_rows_buf, m_rows_cur, m_rows_end));
+ DBUG_PRINT("debug",("m_curr_row= %p, m_curr_row_end= %p",
+ m_curr_row, m_curr_row_end));
+ if (m_curr_row == m_curr_row_end &&
+ !((m_rows_buf == m_rows_cur) && (m_rows_cur == m_rows_end)))
+ {
+ my_error(ER_SLAVE_CORRUPT_EVENT, MYF(0));
+ DBUG_RETURN(ER_SLAVE_CORRUPT_EVENT);
+ }
+
if (m_curr_row == m_rows_buf)
{
/* this is the first row to be inserted, we estimate the rows with
uint8 const post_header_len=
descr_event->post_header_len[ROWS_QUERY_LOG_EVENT-1];
+ m_rows_query= NULL;
+
DBUG_PRINT("info",("event_len: %u; common_header_len: %d; post_header_len: %d",
event_len, common_header_len, post_header_len));
m_rows_query length is stored using only one byte, but that length is
ignored and the complete query is read.
*/
- int offset= common_header_len + post_header_len + 1;
- int len= event_len - offset;
+ unsigned int offset= common_header_len + post_header_len + 1;
+ /* Avoid reading out of buffer */
+ if (offset > event_len)
+ DBUG_VOID_RETURN;
+
+ unsigned int len= event_len - offset;
if (!(m_rows_query= (char*) my_malloc(len+1, MYF(MY_WME))))
return;
strmake(m_rows_query, buf + offset, len);
-/* Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2000, 2018, 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
virtual Log_event_type get_type_code() { return ROWS_QUERY_LOG_EVENT; }
+ virtual bool is_valid() const { return m_rows_query != NULL; }
+
virtual int get_data_size()
{
return IGNORABLE_HEADER_LEN + 1 + (uint) strlen(m_rows_query);
-/* Copyright (c) 2007, 2016, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2007, 2018, 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
DBUG_PRINT("debug", ("Reading from %p", ptr_after_width));
m_width = net_field_length(&ptr_after_width);
DBUG_PRINT("debug", ("m_width=%lu", m_width));
+ /* Avoid reading out of buffer */
+ if (static_cast<unsigned int>(m_width +
+ (ptr_after_width -
+ (const uchar *)buf)) > event_len)
+ {
+ m_cols.bitmap= NULL;
+ DBUG_VOID_RETURN;
+ }
+
/* if bitmap_init fails, catched in is_valid() */
if (likely(!bitmap_init(&m_cols,
m_width <= sizeof(m_bitbuf)*8 ? m_bitbuf : NULL,
static void create_pid_file()
{
File file;
+ bool check_parent_path= 1, is_path_accessible= 1;
+ char pid_filepath[FN_REFLEN], *pos= NULL;
+ /* Copy pid file name to get pid file path */
+ strcpy(pid_filepath, pidfile_name);
+
+ /* Iterate through the entire path to check if even one of the sub-dirs
+ is world-writable */
+ while (check_parent_path && (pos= strrchr(pid_filepath, FN_LIBCHAR))
+ && (pos != pid_filepath)) /* shouldn't check root */
+ {
+ *pos= '\0'; /* Trim the inner-most dir */
+ switch (is_file_or_dir_world_writable(pid_filepath))
+ {
+ case -2:
+ is_path_accessible= 0;
+ break;
+ case -1:
+ sql_perror("Can't start server: can't check PID filepath");
+ exit(1);
+ case 1:
+ sql_print_warning("Insecure configuration for --pid-file: Location "
+ "'%s' in the path is accessible to all OS users. "
+ "Consider choosing a different directory.",
+ pid_filepath);
+ check_parent_path= 0;
+ break;
+ case 0:
+ continue; /* Keep checking the parent dir */
+ }
+ }
+ if(!is_path_accessible)
+ {
+ sql_print_warning("Few location(s) are inaccessible while checking PID filepath.");
+ }
if ((file= mysql_file_create(key_file_pid, pidfile_name, 0664,
O_WRONLY | O_TRUNC, MYF(MY_WME))) >= 0)
{
-/* Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2000, 2018, 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
DBUG_ASSERT(rli->slave_running == 1);
if (rli->sql_thread_kill_accepted)
DBUG_RETURN(true);
+ DBUG_EXECUTE_IF("stop_when_mts_in_group", rli->abort_slave = 1;
+ DBUG_SET("-d,stop_when_mts_in_group");
+ DBUG_SET("-d,simulate_stop_when_mts_in_group");
+ DBUG_RETURN(false););
if (abort_loop || thd->killed || rli->abort_slave)
{
rli->sql_thread_kill_accepted= true;
DBUG_RETURN(SLAVE_APPLY_EVENT_AND_UPDATE_POS_OK);
exec_res= ev->apply_event(rli);
+ DBUG_EXECUTE_IF("simulate_stop_when_mts_in_group",
+ if (rli->mts_group_status == Relay_log_info::MTS_IN_GROUP
+ && rli->curr_group_seen_begin)
+ DBUG_SET("+d,stop_when_mts_in_group"););
#ifdef WITH_WSREP
if (exec_res && thd->wsrep_conflict_state != NO_CONFLICT)
{
Relay_log_info* rli = ((Master_info*)arg)->rli;
const char *errmsg;
+ const char *error_string;
bool mts_inited= false;
// needs to call my_thread_init(), otherwise we get a coredump in DBUG_ stuff
mysql_mutex_lock(&rli->run_lock);
DBUG_ASSERT(!rli->slave_running);
errmsg= 0;
+ error_string= 0;
#ifndef DBUG_OFF
rli->events_until_exit = abort_slave_event_count;
#endif
sql_print_warning("Slave: %s Error_code: %d", err->get_message_text(), err->get_sql_errno());
}
if (udf_error)
- sql_print_error("Error loading user-defined library, slave SQL "
- "thread aborted. Install the missing library, and restart the "
- "slave SQL thread with \"SLAVE START\". We stopped at log '%s' "
- "position %s", rli->get_rpl_log_name(),
- llstr(rli->get_group_master_log_pos(), llbuff));
+ error_string= "Error loading user-defined library, slave SQL "
+ "thread aborted. Install the missing library, and restart the"
+ " slave SQL thread with \"SLAVE START\".";
else
- sql_print_error("\
-Error running query, slave SQL thread aborted. Fix the problem, and restart \
-the slave SQL thread with \"SLAVE START\". We stopped at log \
-'%s' position %s", rli->get_rpl_log_name(),
-llstr(rli->get_group_master_log_pos(), llbuff));
+ error_string= "Error running query, slave SQL thread aborted."
+ " Fix the problem, and restart the slave SQL thread with "
+ "\"SLAVE START\".";
+
#ifdef WITH_WSREP
if (WSREP_ON && last_errno == ER_UNKNOWN_COM_ERROR)
{
}
}
- /* Thread stopped. Print the current replication position to the log */
- sql_print_information("Slave SQL thread exiting, replication stopped in log "
- "'%s' at position %s",
- rli->get_rpl_log_name(),
- llstr(rli->get_group_master_log_pos(), llbuff));
-
err:
slave_stop_workers(rli, &mts_inited); // stopping worker pool
+ /* Thread stopped. Print the current replication position to the log */
+ if (error_string)
+ sql_print_error("%s We stopped at log '%s' position %s.", error_string,
+ rli->get_rpl_log_name(),
+ llstr(rli->get_group_master_log_pos(), llbuff));
+ else
+ sql_print_information("Slave SQL thread exiting, replication stopped in log"
+ " '%s' at position %s",
+ rli->get_rpl_log_name(),
+ llstr(rli->get_group_master_log_pos(), llbuff));
rli->clear_mts_recovery_groups();
#ifdef WITH_WSREP
ER_SLAVE_HAS_MORE_GTIDS_THAN_MASTER
eng "Slave has more GTIDs than the master has, using the master's SERVER_UUID. This may indicate that the end of the binary log was truncated or that the last binary log file was lost, e.g., after a power or disk failure when sync_binlog != 1. The master may or may not have rolled back transactions that were already replicated to the slave. Suggest to replicate any transactions that master has rolled back from slave to master, and/or commit empty transactions on master to account for transactions that have been committed on master but are not included in GTID_EXECUTED."
+
+ER_MISSING_KEY
+ eng "The table '%s.%s' does not have the necessary key(s) defined on it. Please check the table definition and create index(s) accordingly."
#
# End of 5.6 error messages.
#
/*
- Copyright (c) 2002, 2016, Oracle and/or its affiliates. All rights reserved.
+ Copyright (c) 2002, 2017, 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
bool m_print_once;
public:
- Proc_table_intact() : m_print_once(TRUE) {}
+ Proc_table_intact() : m_print_once(TRUE) { has_keys= TRUE; }
protected:
void report_error(uint code, const char *fmt, ...);
if (open_system_tables_for_read(thd, &table, backup))
DBUG_RETURN(NULL);
- if (!table.table->key_info)
- {
- my_error(ER_TABLE_CORRUPT, MYF(0), table.table->s->db.str,
- table.table->s->table_name.str);
- goto err;
- }
-
if (!proc_table_intact.check(table.table, &proc_table_def))
DBUG_RETURN(table.table);
-err:
close_system_tables(thd, backup);
DBUG_RETURN(NULL);
}
-/* Copyright (c) 2012, 2017, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2012, 2018, 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
#include "sql_parse.h" // check_table_access
#include "sql_prepare.h" // reinit_stmt_before_use
#include "transaction.h" // trans_commit_stmt
+#include "debug_sync.h" // DEBUG_SYNC
#include <algorithm>
}
else
{
+ DEBUG_SYNC(thd, "sp_lex_instr_before_exec_core");
rc= exec_core(thd, nextp);
DBUG_PRINT("info",("exec_core returned: %d", rc));
}
-/* Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2000, 2018, 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
va_end(args);
}
+public:
+ Acl_table_intact() { has_keys= TRUE; }
};
#define IP_ADDR_STRLEN (3 + 1 + 3 + 1 + 3 + 1 + 3)
if (table_intact.check(table, &mysql_user_table_def))
DBUG_RETURN(1);
- if (!table->key_info)
- {
- my_error(ER_TABLE_CORRUPT, MYF(0), table->s->db.str,
- table->s->table_name.str);
- DBUG_RETURN(1);
- }
-
/*
This statement will be replicated as a statement, even when using
row-based replication. The flag will be reset at the end of the
}
mysql_mutex_assert_owner(&acl_cache->lock);
table->use_all_columns();
- DBUG_ASSERT(host != '\0');
+ DBUG_ASSERT(host != 0);
table->field[MYSQL_USER_FIELD_HOST]->store(host, strlen(host),
system_charset_info);
table->field[MYSQL_USER_FIELD_USER]->store(user, strlen(user),
if (!is_user_table_positioned)
{
table->use_all_columns();
- DBUG_ASSERT(host != '\0');
+ DBUG_ASSERT(host != 0);
table->field[MYSQL_USER_FIELD_HOST]->store(host, (uint) strlen(host),
system_charset_info);
table->field[MYSQL_USER_FIELD_USER]->store(user, (uint) strlen(user),
if (table_intact.check(table, &mysql_user_table_def))
goto end;
- if (!table->key_info)
- {
- my_error(ER_TABLE_CORRUPT, MYF(0), table->s->db.str,
- table->s->table_name.str);
- goto end;
- }
-
table->use_all_columns();
- DBUG_ASSERT(combo->host.str != '\0');
+ DBUG_ASSERT(combo->host.str != 0);
table->field[MYSQL_USER_FIELD_HOST]->store(combo->host.str,combo->host.length,
system_charset_info);
table->field[MYSQL_USER_FIELD_USER]->store(combo->user.str,combo->user.length,
old_row_exists = 0;
restore_record(table,s->default_values);
- DBUG_ASSERT(combo->host.str != '\0');
+ DBUG_ASSERT(combo->host.str != 0);
table->field[MYSQL_USER_FIELD_HOST]->store(combo->host.str,combo->host.length,
system_charset_info);
table->field[MYSQL_USER_FIELD_USER]->store(combo->user.str,combo->user.length,
if (table_intact.check(table, &mysql_columns_priv_table_def))
DBUG_RETURN(-1);
- if (!table->key_info)
- {
- my_error(ER_TABLE_CORRUPT, MYF(0), table->s->db.str,
- table->s->table_name.str);
- DBUG_RETURN(-1);
- }
-
key_part= table->key_info->key_part;
table->use_all_columns();
host_field->store(host_str, user_from->host.length, system_charset_info);
user_field->store(user_str, user_from->user.length, system_charset_info);
- if (!table->key_info)
- {
- my_error(ER_TABLE_CORRUPT, MYF(0), table->s->db.str,
- table->s->table_name.str);
- DBUG_RETURN(-1);
- }
-
key_prefix_length= (table->key_info->key_part[0].store_length +
table->key_info->key_part[1].store_length);
key_copy(user_key, table->record[0], table->key_info, key_prefix_length);
if (table_intact.check(table, &mysql_user_table_def))
DBUG_RETURN(true);
- if (!table->key_info)
- {
- my_error(ER_TABLE_CORRUPT, MYF(0), table->s->db.str,
- table->s->table_name.str);
- DBUG_RETURN(true);
- }
-
/*
This statement will be replicated as a statement, even when using
row-based replication. The flag will be reset at the end of the
if (!(combo=(LEX_USER*) thd->alloc(sizeof(st_lex_user))))
DBUG_RETURN(TRUE);
- combo->user.str= sctx->user;
+ combo->user.str= (char *) sctx->priv_user;
mysql_mutex_lock(&acl_cache->lock);
- if ((au= find_acl_user(combo->host.str=(char*)sctx->host_or_ip,combo->user.str,FALSE)))
- goto found_acl;
- if ((au= find_acl_user(combo->host.str=(char*)sctx->get_host()->ptr(),
- combo->user.str,FALSE)))
- goto found_acl;
- if ((au= find_acl_user(combo->host.str=(char*)sctx->get_ip()->ptr(),
- combo->user.str,FALSE)))
- goto found_acl;
- if((au= find_acl_user(combo->host.str=(char*)"%", combo->user.str, FALSE)))
+ if ((au= find_acl_user(combo->host.str= (char *) sctx->priv_host,
+ combo->user.str, FALSE)))
goto found_acl;
mysql_mutex_unlock(&acl_cache->lock);
-/* Copyright (c) 2010, 2012, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2010, 2018, 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
#include "wsrep_mysqld.h"
#endif /* WITH_WSREP */
+bool has_external_data_or_index_dir(partition_info &pi);
Alter_info::Alter_info(const Alter_info &rhs, MEM_ROOT *mem_root)
:drop_list(rhs.drop_list, mem_root),
if (thd->is_fatal_error) /* out of memory creating a copy of alter_info */
DBUG_RETURN(TRUE);
+
+#ifdef WITH_PARTITION_STORAGE_ENGINE
+ {
+ partition_info *part_info= thd->lex->part_info;
+ if (part_info != NULL && has_external_data_or_index_dir(*part_info) &&
+ check_access(thd, FILE_ACL, any_db, NULL, NULL, FALSE, FALSE))
+
+ DBUG_RETURN(TRUE);
+ }
+#endif
/*
We also require DROP priv for ALTER TABLE ... DROP PARTITION, as well
as for RENAME TO, as being done by SQLCOM_RENAME_TABLE
if ((!thd->is_current_stmt_binlog_format_row() ||
!find_temporary_table(thd, first_table)))
{
- WSREP_TO_ISOLATION_BEGIN(((lex->name.str) ? select_lex->db : NULL),
- ((lex->name.str) ? lex->name.str : NULL),
- first_table);
+ WSREP_TO_ISOLATION_BEGIN_ALTER(((lex->name.str) ? select_lex->db : NULL),
+ ((lex->name.str) ? lex->name.str : NULL),
+ first_table,
+ &alter_info);
}
#endif /* WITH_WSREP */
result= mysql_alter_table(thd, select_lex->db, lex->name.str,
DBUG_RETURN(result);
#ifdef WITH_WSREP
- error:
+error:
{
WSREP_WARN("ALTER TABLE isolation failure");
DBUG_RETURN(TRUE);
-/* Copyright (c) 2007, 2016, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2007, 2018, 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
return (mysql_global_audit_mask[0] & MYSQL_AUDIT_GENERAL_CLASSMASK);
}
+/**
+ @brief Checks presence of active audit plugin
+
+ @retval TRUE At least one audit plugin is present
+ @retval FALSE No audit plugin is present
+*/
+bool is_global_audit_mask_set()
+{
+ for (int i= MYSQL_AUDIT_GENERAL_CLASS; i < MYSQL_AUDIT_CLASS_MASK_SIZE; i++)
+ {
+ if (mysql_global_audit_mask[i] != 0)
+ return true;
+ }
+ return false;
+}
+
#else /* EMBEDDED_LIBRARY */
-/* Copyright (c) 2007, 2016, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2007, 2018, 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
extern void mysql_audit_notify(THD *thd, uint event_class,
uint event_subtype, ...);
bool is_any_audit_plugin_active(THD *thd MY_ATTRIBUTE((unused)));
+bool is_global_audit_mask_set();
#else
#define mysql_audit_notify(...)
#endif
thd->get_stmt_da()->set_eof_status(thd);
}
-#define tmp_disable_binlog(A) \
- {ulonglong tmp_disable_binlog__save_options= (A)->variables.option_bits; \
- (A)->variables.option_bits&= ~OPTION_BIN_LOG
+#ifdef WITH_WSREP
+
+ #define tmp_disable_binlog(A) \
+ {ulonglong tmp_disable_binlog__save_options= (A)->variables.option_bits; \
+ my_bool tmp_disable_binlog__save_wsrep_on= (A)->variables.wsrep_on; \
+ (A)->variables.wsrep_on= 0; \
+ (A)->variables.option_bits&= ~OPTION_BIN_LOG
+
+ #define reenable_binlog(A) \
+ (A)->variables.wsrep_on= tmp_disable_binlog__save_wsrep_on; \
+ (A)->variables.option_bits= tmp_disable_binlog__save_options;}
-#define reenable_binlog(A) (A)->variables.option_bits= tmp_disable_binlog__save_options;}
+ #define reenable_wsrep(A) (A)->variables.wsrep_on= tmp_disable_binlog__save_wsrep_on;
+
+#else
+
+ #define tmp_disable_binlog(A) \
+ {ulonglong tmp_disable_binlog__save_options= (A)->variables.option_bits; \
+ (A)->variables.option_bits&= ~OPTION_BIN_LOG
+
+ #define reenable_binlog(A) (A)->variables.option_bits= tmp_disable_binlog__save_options;}
+
+#endif
LEX_STRING *
-/* Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2000, 2018, 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
sel->cond->quick_fix_field();
key_map usable_keys= tab->keys;
+ if (tab->table->force_index)
+ usable_keys.intersect(tab->table->keys_in_use_for_order_by);
+
ORDER::enum_order interesting_order= ORDER::ORDER_NOT_RELEVANT;
if (recheck_reason == LOW_LIMIT)
-/* Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2000, 2018, 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
@param thd Thread handle.
@param db Database name used while evaluating the filtering
rules.
-
+ @param sql_cmd Represents the current query that needs to be
+ verified against the database filter rules.
+ @return TRUE Query should not be filtered out from the execution.
+ FALSE Query should be filtered out from the execution.
+
*/
-inline bool db_stmt_db_ok(THD *thd, char* db)
+inline bool check_database_filters(THD *thd, char* db, enum_sql_command sql_cmd)
{
- DBUG_ENTER("db_stmt_db_ok");
-
- if (!thd->slave_thread)
+ DBUG_ENTER("check_database_filters");
+ DBUG_ASSERT(thd->slave_thread);
+ if (!db)
DBUG_RETURN(TRUE);
-
+ switch (sql_cmd)
+ {
+ case SQLCOM_BEGIN:
+ case SQLCOM_COMMIT:
+ case SQLCOM_SAVEPOINT:
+ case SQLCOM_ROLLBACK:
+ case SQLCOM_ROLLBACK_TO_SAVEPOINT:
+ DBUG_RETURN(TRUE);
+ default:
+ break;
+ }
+ bool db_ok= rpl_filter->db_ok(db);
/*
No filters exist in ignore/do_db ? Then, just check
- wild_do_table filtering. Otherwise, check the do_db
- rules.
+ wild_do_table filtering for 'DATABASE' related
+ statements (CREATE/DROP/ALTER DATABASE)
*/
- bool db_ok= (rpl_filter->get_do_db()->is_empty() &&
- rpl_filter->get_ignore_db()->is_empty()) ?
- rpl_filter->db_ok_with_wild_table(db) :
- rpl_filter->db_ok(db);
-
+ if (db_ok &&
+ (rpl_filter->get_do_db()->is_empty() &&
+ rpl_filter->get_ignore_db()->is_empty()))
+ {
+ switch (sql_cmd)
+ {
+ case SQLCOM_CREATE_DB:
+ case SQLCOM_ALTER_DB:
+ case SQLCOM_ALTER_DB_UPGRADE:
+ case SQLCOM_DROP_DB:
+ db_ok= rpl_filter->db_ok_with_wild_table(db);
+ default:
+ break;
+ }
+ }
DBUG_RETURN(db_ok);
}
#endif
#ifdef HAVE_REPLICATION
if (unlikely(thd->slave_thread))
{
- // Database filters.
- if (lex->sql_command != SQLCOM_BEGIN &&
- lex->sql_command != SQLCOM_COMMIT &&
- lex->sql_command != SQLCOM_SAVEPOINT &&
- lex->sql_command != SQLCOM_ROLLBACK &&
- lex->sql_command != SQLCOM_ROLLBACK_TO_SAVEPOINT &&
- !rpl_filter->db_ok(thd->db))
+ if (!check_database_filters(thd, thd->db, lex->sql_command))
DBUG_RETURN(0);
if (lex->sql_command == SQLCOM_DROP_TRIGGER)
if (!(alias=thd->strmake(lex->name.str, lex->name.length)) ||
(check_and_convert_db_name(&lex->name, FALSE) != IDENT_NAME_OK))
break;
- /*
- If in a slave thread :
- CREATE DATABASE DB was certainly not preceded by USE DB.
- For that reason, db_ok() in sql/slave.cc did not check the
- do_db/ignore_db. And as this query involves no tables, tables_ok()
- above was not called. So we have to check rules again here.
- */
-#ifdef HAVE_REPLICATION
- if (!db_stmt_db_ok(thd, lex->name.str))
- {
- my_message(ER_SLAVE_IGNORED_TABLE, ER(ER_SLAVE_IGNORED_TABLE), MYF(0));
- break;
- }
-#endif
if (check_access(thd, CREATE_ACL, lex->name.str, NULL, NULL, 1, 0))
break;
WSREP_TO_ISOLATION_BEGIN(lex->name.str, NULL, NULL)
{
if (check_and_convert_db_name(&lex->name, FALSE) != IDENT_NAME_OK)
break;
- /*
- If in a slave thread :
- DROP DATABASE DB may not be preceded by USE DB.
- For that reason, maybe db_ok() in sql/slave.cc did not check the
- do_db/ignore_db. And as this query involves no tables, tables_ok()
- above was not called. So we have to check rules again here.
- */
-#ifdef HAVE_REPLICATION
- if (!db_stmt_db_ok(thd, lex->name.str))
- {
- my_message(ER_SLAVE_IGNORED_TABLE, ER(ER_SLAVE_IGNORED_TABLE), MYF(0));
- break;
- }
-#endif
if (check_access(thd, DROP_ACL, lex->name.str, NULL, NULL, 1, 0))
break;
WSREP_TO_ISOLATION_BEGIN(lex->name.str, NULL, NULL)
case SQLCOM_ALTER_DB_UPGRADE:
{
LEX_STRING *db= & lex->name;
-#ifdef HAVE_REPLICATION
- if (!db_stmt_db_ok(thd, lex->name.str))
- {
- res= 1;
- my_message(ER_SLAVE_IGNORED_TABLE, ER(ER_SLAVE_IGNORED_TABLE), MYF(0));
- break;
- }
-#endif
if (check_and_convert_db_name(db, FALSE) != IDENT_NAME_OK)
break;
if (check_access(thd, ALTER_ACL, db->str, NULL, NULL, 1, 0) ||
HA_CREATE_INFO create_info(lex->create_info);
if (check_and_convert_db_name(db, FALSE) != IDENT_NAME_OK)
break;
- /*
- If in a slave thread :
- ALTER DATABASE DB may not be preceded by USE DB.
- For that reason, maybe db_ok() in sql/slave.cc did not check the
- do_db/ignore_db. And as this query involves no tables, tables_ok()
- above was not called. So we have to check rules again here.
- */
-#ifdef HAVE_REPLICATION
- if (!db_stmt_db_ok(thd, lex->name.str))
- {
- my_message(ER_SLAVE_IGNORED_TABLE, ER(ER_SLAVE_IGNORED_TABLE), MYF(0));
- break;
- }
-#endif
if (check_access(thd, ALTER_ACL, db->str, NULL, NULL, 1, 0))
break;
WSREP_TO_ISOLATION_BEGIN(db->str, NULL, NULL)
{
if (all_tables_not_ok(thd, lex->select_lex.table_list.first))
ignorable= true;
- else if (lex->sql_command != SQLCOM_BEGIN &&
- lex->sql_command != SQLCOM_COMMIT &&
- lex->sql_command != SQLCOM_SAVEPOINT &&
- lex->sql_command != SQLCOM_ROLLBACK &&
- lex->sql_command != SQLCOM_ROLLBACK_TO_SAVEPOINT &&
- !rpl_filter->db_ok(thd->db))
+ else if (!check_database_filters(thd, thd->db, lex->sql_command))
ignorable= true;
}
thd->m_digest= parent_digest;
#define WSREP_TO_ISOLATION_BEGIN(db_, table_, table_list_) \
if (WSREP(thd) && wsrep_to_isolation_begin(thd, db_, table_, table_list_)) goto error;
+#define WSREP_TO_ISOLATION_BEGIN_ALTER(db_, table_, table_list_, alter_info_) \
+ if (WSREP(thd) && wsrep_to_isolation_begin(thd, db_, table_, \
+ table_list_, alter_info_)) \
+ goto error;
+
#define WSREP_TO_ISOLATION_END \
if (WSREP(thd) || (thd && thd->wsrep_exec_mode==TOTAL_ORDER)) \
wsrep_to_isolation_end(thd);
/*
- Copyright (c) 2005, 2016, Oracle and/or its affiliates. All rights reserved.
+ Copyright (c) 2005, 2017, 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
if (!table->key_info)
{
- my_error(ER_TABLE_CORRUPT, MYF(0), table->s->db.str,
+ my_error(ER_MISSING_KEY, MYF(0), table->s->db.str,
table->s->table_name.str);
DBUG_RETURN(TRUE);
}
-/* Copyright (c) 2002, 2017, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2002, 2018, 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
because we want to look it up in the query cache) or not.
*/
if ((mysql_bin_log.is_open() && is_update_query(lex->sql_command)) ||
- opt_log || opt_slow_log ||
- query_cache_is_cacheable_query(lex))
+ opt_log || opt_slow_log || query_cache_is_cacheable_query(lex)
+#ifndef EMBEDDED_LIBRARY
+ || is_global_audit_mask_set()
+#endif
+ )
{
set_params_from_vars= insert_params_from_vars_with_log;
#ifndef EMBEDDED_LIBRARY
-/* Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2000, 2018, 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
const char* buf_current,
T buf_len)
{
+ /* Sanity check */
+ if (buf_current < buf_start ||
+ buf_len < static_cast<T>(buf_current - buf_start))
+ return static_cast<T>(0);
+
return buf_len - (buf_current - buf_start);
}
GLOBAL_VAR(wsrep_certify_nonPK),
CMD_LINE(OPT_ARG), DEFAULT(TRUE));
+static const char *wsrep_certification_rules_names[]= { "strict", "optimized", NullS };
+static Sys_var_enum Sys_wsrep_certification_rules(
+ "wsrep_certification_rules",
+ "Certification rules to use in the cluster. Possible values are: "
+ "\"strict\": stricter rules that could result in more certification "
+ "failures. "
+ "\"optimized\": relaxed rules that allow more concurrency and "
+ "cause less certification failures.",
+ GLOBAL_VAR(wsrep_certification_rules), CMD_LINE(REQUIRED_ARG),
+ wsrep_certification_rules_names, DEFAULT(WSREP_CERTIFICATION_RULES_STRICT),
+ NO_MUTEX_GUARD, NOT_IN_BINLOG, ON_CHECK(0),
+ ON_UPDATE(0));
+
static Sys_var_mybool Sys_wsrep_causal_reads(
"wsrep_causal_reads", "(DEPRECATED) setting this variable is equivalent to setting wsrep_sync_wait READ flag",
SESSION_VAR(wsrep_causal_reads),
/* Whether the table definition has already been validated. */
if (table->s->table_field_def_cache == table_def)
- DBUG_RETURN(FALSE);
+ goto end;
if (table->s->fields != table_def->count)
{
if (! error)
table->s->table_field_def_cache= table_def;
+end:
+
+ if (has_keys && !error && !table->key_info)
+ {
+ my_error(ER_MISSING_KEY, MYF(0), table->s->db.str,
+ table->s->table_name.str);
+ error= TRUE;
+ }
+
DBUG_RETURN(error);
}
#ifndef TABLE_INCLUDED
#define TABLE_INCLUDED
-/* Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2000, 2017, 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
class Table_check_intact
{
protected:
+ bool has_keys;
virtual void report_error(uint code, const char *fmt, ...)= 0;
public:
- Table_check_intact() {}
+ Table_check_intact() : has_keys(FALSE) {}
virtual ~Table_check_intact() {}
/** Checks whether a table is intact. */
#ifndef WSREP_APPLIER_H
#define WSREP_APPLIER_H
-#include "../wsrep/wsrep_api.h"
+#include "wsrep_api.h"
/* wsrep callback prototypes */
*/
WSREP_DEBUG("cleanup transaction for LOCAL_STATE: %s",
WSREP_QUERY(thd));
+ /*
+ Run post-rollback hook to clean up in the case if
+ some keys were populated for the transaction in provider
+ but during commit time there was no write set to replicate.
+ This may happen when client sets the SAVEPOINT and immediately
+ rolls back to savepoint after first operation.
+ */
+ if (all && thd->wsrep_conflict_state != MUST_REPLAY &&
+ wsrep->post_rollback(wsrep, &thd->wsrep_ws_handle))
+ {
+ WSREP_WARN("post_rollback fail: %llu %d",
+ (long long)thd->thread_id, thd->get_stmt_da()->status());
+ }
wsrep_cleanup_transaction(thd);
break;
}
ulong wsrep_max_ws_rows = 65536; // max number of rows in ws
int wsrep_to_isolation = 0; // # of active TO isolation threads
my_bool wsrep_certify_nonPK = 1; // certify, even when no primary key
+ulong wsrep_certification_rules = WSREP_CERTIFICATION_RULES_STRICT;
long wsrep_max_protocol_version = 3; // maximum protocol version to use
ulong wsrep_forced_binlog_format = BINLOG_FORMAT_UNSPEC;
my_bool wsrep_recovery = 0; // recovery
wsrep_buf_t* key,
size_t* key_len)
{
- if (*key_len < 2) return false;
+ if (*key_len < 2) return false;
- switch (wsrep_protocol_version)
- {
- case 0:
- *key_len= 0;
- break;
- case 1:
- case 2:
- case 3:
+ switch (wsrep_protocol_version)
+ {
+ case 0:
+ *key_len= 0;
+ break;
+ case 1:
+ case 2:
+ case 3:
+ {
+ *key_len= 0;
+ if (db)
{
- *key_len= 0;
- if (db)
- {
- // sql_print_information("%s.%s", db, table);
- if (db)
- {
- key[*key_len].ptr= db;
- key[*key_len].len= strlen(db);
- ++(*key_len);
- if (table)
- {
- key[*key_len].ptr= table;
- key[*key_len].len= strlen(table);
- ++(*key_len);
- }
- }
- }
- break;
+ // sql_print_information("%s.%s", db, table);
+ key[*key_len].ptr= db;
+ key[*key_len].len= strlen(db);
+ ++(*key_len);
+ if (table)
+ {
+ key[*key_len].ptr= table;
+ key[*key_len].len= strlen(table);
+ ++(*key_len);
+ }
}
- default:
+ break;
+ }
+ default:
+ return false;
+ }
+ return true;
+}
+
+
+static bool wsrep_prepare_key_for_isolation(const char* db,
+ const char* table,
+ wsrep_key_arr_t* ka)
+{
+ wsrep_key_t* tmp;
+ tmp= (wsrep_key_t*)my_realloc(ka->keys,
+ (ka->keys_len + 1) * sizeof(wsrep_key_t),
+ MYF(0));
+ if (!tmp)
+ {
+ WSREP_ERROR("Can't allocate memory for key_array");
+ return false;
+ }
+ ka->keys= tmp;
+ if (!(ka->keys[ka->keys_len].key_parts= (wsrep_buf_t*)
+ my_malloc(sizeof(wsrep_buf_t)*2, MYF(0))))
+ {
+ WSREP_ERROR("Can't allocate memory for key_parts");
+ return false;
+ }
+ ka->keys[ka->keys_len].key_parts_num= 2;
+ ++ka->keys_len;
+ if (!wsrep_prepare_key_for_isolation(db, table,
+ (wsrep_buf_t*)ka->keys[ka->keys_len - 1].key_parts,
+ &ka->keys[ka->keys_len - 1].key_parts_num))
+ {
+ WSREP_ERROR("Preparing keys for isolation failed");
+ return false;
+ }
+
+ return true;
+}
+
+
+static bool wsrep_prepare_keys_for_alter_add_fk(char* child_table_db,
+ Alter_info* alter_info,
+ wsrep_key_arr_t* ka)
+{
+ Key *key;
+ List_iterator<Key> key_iterator(alter_info->key_list);
+ while ((key= key_iterator++))
+ {
+ if (key->type == Key::FOREIGN_KEY)
+ {
+ Foreign_key *fk_key= (Foreign_key *)key;
+ const char *db_name= fk_key->ref_db.str;
+ const char *table_name= fk_key->ref_table.str;
+ if (!db_name)
+ {
+ db_name= child_table_db;
+ }
+ if (!wsrep_prepare_key_for_isolation(db_name, table_name, ka))
+ {
return false;
+ }
}
-
- return true;
+ }
+ return true;
}
-/* Prepare key list from db/table and table_list */
-bool wsrep_prepare_keys_for_isolation(THD* thd,
- const char* db,
- const char* table,
- const TABLE_LIST* table_list,
- wsrep_key_arr_t* ka)
+
+static bool wsrep_prepare_keys_for_isolation(THD* thd,
+ const char* db,
+ const char* table,
+ const TABLE_LIST* table_list,
+ Alter_info* alter_info,
+ wsrep_key_arr_t* ka)
{
ka->keys= 0;
ka->keys_len= 0;
if (db || table)
{
- if (!(ka->keys= (wsrep_key_t*)my_malloc(sizeof(wsrep_key_t), MYF(0))))
- {
- WSREP_ERROR("Can't allocate memory for key_array");
- goto err;
- }
- ka->keys_len= 1;
- if (!(ka->keys[0].key_parts= (wsrep_buf_t*)
- my_malloc(sizeof(wsrep_buf_t)*2, MYF(0))))
- {
- WSREP_ERROR("Can't allocate memory for key_parts");
- goto err;
- }
- ka->keys[0].key_parts_num= 2;
- if (!wsrep_prepare_key_for_isolation(
- db, table,
- (wsrep_buf_t*)ka->keys[0].key_parts,
- &ka->keys[0].key_parts_num))
- {
- WSREP_ERROR("Preparing keys for isolation failed (1)");
+ if (!wsrep_prepare_key_for_isolation(db, table, ka))
goto err;
- }
}
for (const TABLE_LIST* table= table_list; table; table= table->next_global)
{
- wsrep_key_t* tmp;
- tmp= (wsrep_key_t*)my_realloc(ka->keys,
- (ka->keys_len + 1) * sizeof(wsrep_key_t),
- MYF(0));
- if (!tmp)
- {
- WSREP_ERROR("Can't allocate memory for key_array");
+ if (!wsrep_prepare_key_for_isolation(table->db, table->table_name, ka))
goto err;
- }
- ka->keys= tmp;
- if (!(ka->keys[ka->keys_len].key_parts= (wsrep_buf_t*)
- my_malloc(sizeof(wsrep_buf_t)*2, MYF(0))))
- {
- WSREP_ERROR("Can't allocate memory for key_parts");
- goto err;
- }
- ka->keys[ka->keys_len].key_parts_num= 2;
- ++ka->keys_len;
- if (!wsrep_prepare_key_for_isolation(table->db, table->table_name,
- (wsrep_buf_t*)ka->keys[ka->keys_len - 1].key_parts,
- &ka->keys[ka->keys_len - 1].key_parts_num))
- {
- WSREP_ERROR("Preparing keys for isolation failed (2)");
+ }
+
+ if (alter_info && (alter_info->flags & Alter_info::ADD_FOREIGN_KEY))
+ {
+ if (!wsrep_prepare_keys_for_alter_add_fk(table_list->db, alter_info, ka))
goto err;
- }
}
- return 0;
+
+ return false;
+
err:
- wsrep_keys_free(ka);
- return 1;
+ wsrep_keys_free(ka);
+ return true;
+}
+
+
+/* Prepare key list from db/table and table_list */
+bool wsrep_prepare_keys_for_isolation(THD* thd,
+ const char* db,
+ const char* table,
+ const TABLE_LIST* table_list,
+ wsrep_key_arr_t* ka)
+{
+ return wsrep_prepare_keys_for_isolation(thd, db, table, table_list, NULL, ka);
}
-1: TOI replication failed
*/
static int wsrep_TOI_begin(THD *thd, char *db_, char *table_,
- const TABLE_LIST* table_list)
+ const TABLE_LIST* table_list,
+ Alter_info* alter_info)
{
wsrep_status_t ret(WSREP_WARNING);
uchar* buf(0);
wsrep_key_arr_t key_arr= {0, 0};
struct wsrep_buf buff = { buf, buf_len };
if (!buf_err &&
- !wsrep_prepare_keys_for_isolation(thd, db_, table_, table_list, &key_arr) &&
+ !wsrep_prepare_keys_for_isolation(thd, db_, table_,
+ table_list, alter_info, &key_arr) &&
key_arr.keys_len > 0 &&
WSREP_OK == (ret = wsrep->to_execute_start(wsrep, thd->thread_id,
key_arr.keys, key_arr.keys_len,
}
int wsrep_to_isolation_begin(THD *thd, char *db_, char *table_,
- const TABLE_LIST* table_list)
+ const TABLE_LIST* table_list,
+ Alter_info* alter_info)
{
-
/*
No isolation for applier or replaying threads.
*/
{
switch (thd->variables.wsrep_OSU_method) {
case WSREP_OSU_TOI:
- ret = wsrep_TOI_begin(thd, db_, table_, table_list);
+ ret= wsrep_TOI_begin(thd, db_, table_, table_list, alter_info);
break;
case WSREP_OSU_RSU:
- ret = wsrep_RSU_begin(thd, db_, table_);
+ ret= wsrep_RSU_begin(thd, db_, table_);
break;
default:
WSREP_ERROR("Unsupported OSU method: %lu",
#define WSREP_MYSQLD_H
#include "mysqld.h"
+#include "wsrep_api.h"
typedef struct st_mysql_show_var SHOW_VAR;
#include <sql_priv.h>
#include "rpl_gtid.h"
-#include "../wsrep/wsrep_api.h"
#define WSREP_UNDEFINED_TRX_ID ULONGLONG_MAX
CONSISTENCY_CHECK_RUNNING,
};
+enum enum_wsrep_certification_rules {
+ WSREP_CERTIFICATION_RULES_STRICT,
+ WSREP_CERTIFICATION_RULES_OPTIMIZED
+};
// Global wsrep parameters
extern wsrep_t* wsrep;
extern ulong wsrep_max_ws_rows;
extern const char* wsrep_notify_cmd;
extern my_bool wsrep_certify_nonPK;
+extern ulong wsrep_certification_rules;
extern long wsrep_max_protocol_version;
extern long wsrep_protocol_version;
extern ulong wsrep_forced_binlog_format;
extern PSI_mutex_key key_LOCK_wsrep_desync;
#endif /* HAVE_PSI_INTERFACE */
struct TABLE_LIST;
+class Alter_info;
int wsrep_to_isolation_begin(THD *thd, char *db_, char *table_,
- const TABLE_LIST* table_list);
+ const TABLE_LIST* table_list,
+ Alter_info* alter_info = NULL);
void wsrep_to_isolation_end(THD *thd);
void wsrep_cleanup_transaction(THD *thd);
int wsrep_to_buf_helper(
#ifndef WSREP_PRIV_H
#define WSREP_PRIV_H
+#include "wsrep_api.h"
#include "wsrep_mysqld.h"
-#include "../wsrep/wsrep_api.h"
#include <log.h>
#include <pthread.h>
if (sst_needed)
{
WSREP_INFO("Signalling provider to continue.");
- wsrep_sst_received (wsrep, local_uuid, local_seqno, NULL, 0);
+ // local_uuid and local_seqno are global variables and are volatile
+ wsrep_uuid_t const sst_uuid = local_uuid;
+ wsrep_seqno_t const sst_seqno = local_seqno;
+ wsrep_sst_received (wsrep, sst_uuid, sst_seqno, NULL, 0);
}
}
#ifndef WSREP_XID_H
#define WSREP_XID_H
-#include "../wsrep/wsrep_api.h"
#include "handler.h" // XID typedef
+#include "wsrep_api.h"
void wsrep_xid_init(xid_t*, const wsrep_uuid_t&, wsrep_seqno_t);
int wsrep_is_wsrep_xid(const void* xid);
/*****************************************************************************
-Copyright (c) 1996, 2017, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1996, 2018, 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
&& dict_foreign_qualify_index(
table, col_names, columns, n_cols,
index, types_idx,
- check_charsets, check_null)) {
+ check_charsets, check_null)
+ && (!(index->online_status ==
+ ONLINE_INDEX_ABORTED_DROPPED
+ ||index->online_status == ONLINE_INDEX_ABORTED))) {
return(index);
}
/*****************************************************************************
-Copyright (c) 2011, 2017, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 2011, 2018, 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
err = fts_drop_index_tables(trx, index);
- for(;;) {
- bool retry = false;
- if (index->index_fts_syncing) {
- retry = true;
- }
- if (!retry){
- fts_free(table);
- break;
- }
- DICT_BG_YIELD(trx);
- }
+ while (index->index_fts_syncing
+ && !trx_is_interrupted(trx)) {
+ DICT_BG_YIELD(trx);
+ }
+
+ fts_free(table);
+
return(err);
}
- for(;;) {
- bool retry = false;
- if (index->index_fts_syncing) {
- retry = true;
- }
- if (!retry){
- current_doc_id = table->fts->cache->next_doc_id;
- first_doc_id = table->fts->cache->first_doc_id;
- fts_cache_clear(table->fts->cache);
- fts_cache_destroy(table->fts->cache);
- table->fts->cache = fts_cache_create(table);
- table->fts->cache->next_doc_id = current_doc_id;
- table->fts->cache->first_doc_id = first_doc_id;
- break;
- }
- DICT_BG_YIELD(trx);
- }
+ while (index->index_fts_syncing
+ && !trx_is_interrupted(trx)) {
+ DICT_BG_YIELD(trx);
+ }
+
+ current_doc_id = table->fts->cache->next_doc_id;
+ first_doc_id = table->fts->cache->first_doc_id;
+ fts_cache_clear(table->fts->cache);
+ fts_cache_destroy(table->fts->cache);
+ table->fts->cache = fts_cache_create(table);
+ table->fts->cache->next_doc_id = current_doc_id;
+ table->fts->cache->first_doc_id = first_doc_id;
} else {
fts_cache_t* cache = table->fts->cache;
fts_index_cache_t* index_cache;
index_cache = fts_find_index_cache(cache, index);
if (index_cache != NULL) {
- for(;;) {
- bool retry = false;
- if (index->index_fts_syncing) {
- retry = true;
- }
- if (!retry && index_cache->words) {
- fts_words_free(index_cache->words);
- rbt_free(index_cache->words);
- break;
- }
- DICT_BG_YIELD(trx);
+ while (index->index_fts_syncing
+ && !trx_is_interrupted(trx)) {
+ DICT_BG_YIELD(trx);
+ }
+ if (index_cache->words) {
+ fts_words_free(index_cache->words);
+ rbt_free(index_cache->words);
}
ib_vector_remove(cache->indexes, *(void**) index_cache);
/*****************************************************************************
-Copyright (c) 2000, 2017, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 2000, 2018, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2008, 2009 Google Inc.
Copyright (c) 2009, Percona Inc.
Copyright (c) 2012, Facebook Inc.
# endif /* MYSQL_PLUGIN_IMPORT */
#ifdef WITH_WSREP
#include "../storage/innobase/include/ut0byte.h"
+#include "wsrep_api.h"
#include <wsrep_mysqld.h>
#include <my_md5.h>
extern my_bool wsrep_certify_nonPK;
(sql_command != SQLCOM_LOAD ||
thd_binlog_format(user_thd) == BINLOG_FORMAT_ROW)) {
- if (wsrep_append_keys(user_thd, false, record, NULL)) {
+ if (wsrep_append_keys(user_thd, WSREP_KEY_EXCLUSIVE, record,
+ NULL)) {
DBUG_PRINT("wsrep", ("row key failed"));
error_result = HA_ERR_INTERNAL_ERROR;
goto wsrep_error;
DBUG_PRINT("wsrep", ("update row key"));
- if (wsrep_append_keys(user_thd, false, old_row, new_row)) {
+ if (wsrep_append_keys(user_thd, WSREP_KEY_EXCLUSIVE, old_row,
+ new_row)) {
DBUG_PRINT("wsrep", ("row key failed"));
err = HA_ERR_INTERNAL_ERROR;
goto wsrep_error;
if (error == DB_SUCCESS && wsrep_thd_exec_mode(user_thd) == LOCAL_STATE &&
wsrep_on(user_thd)) {
- if (wsrep_append_keys(user_thd, false, record, NULL)) {
+ if (wsrep_append_keys(user_thd, WSREP_KEY_EXCLUSIVE, record,
+ NULL)) {
DBUG_PRINT("wsrep", ("delete fail"));
error = DB_ERROR;
goto wsrep_error;
ibool check_charsets,
ulint check_null);
+inline
+const char*
+wsrep_key_type_to_str(wsrep_key_type type)
+{
+ switch (type) {
+ case WSREP_KEY_SHARED:
+ return "shared";
+ case WSREP_KEY_SEMI:
+ return "semi";
+ case WSREP_KEY_EXCLUSIVE:
+ return "exclusive";
+ };
+ return "unknown";
+}
+
extern
dberr_t
wsrep_append_foreign_key(
const rec_t* rec, /*!< in: clustered index record */
dict_index_t* index, /*!< in: clustered index */
ibool referenced, /*!< in: is check for referenced table */
- ibool shared) /*!< in: is shared access */
+ wsrep_key_type key_type) /*!< in: access type of this key
+ (shared, exclusive, semi...) */
{
THD* thd = (THD*)trx->mysql_thd;
int rcode = 0;
wsrep_protocol_version > 1);
if (rcode != DB_SUCCESS) {
WSREP_ERROR(
- "FK key set failed: %d (%lu %lu), index: %s %s, %s",
- rcode, referenced, shared,
+ "FK key set failed: %d (%lu %s), index: %s %s, %s",
+ rcode, referenced, wsrep_key_type_to_str(key_type),
(index && index->name) ? index->name :
"void index",
(index && index->table_name) ? index->table_name :
#ifdef WSREP_DEBUG_PRINT
ulint j;
fprintf(stderr, "FK parent key, table: %s %s len: %lu ",
- cache_key, (shared) ? "shared" : "exclusive", len+1);
+ cache_key, wsrep_key_type_to_str(key_type), len+1);
for (j=0; j<len+1; j++) {
fprintf(stderr, " %hhX, ", key[j]);
}
wsrep_ws_handle(thd, trx),
&wkey,
1,
- shared ? WSREP_KEY_SHARED : WSREP_KEY_EXCLUSIVE,
+ key_type,
copy);
if (rcode) {
DBUG_PRINT("wsrep", ("row key failed: %d", rcode));
TABLE *table,
const char* key,
uint16_t key_len,
- bool shared
+ wsrep_key_type key_type /*!< in: access type of this key
+ (shared, exclusive, semi...) */
)
{
DBUG_ENTER("wsrep_append_key");
bool const copy = true;
#ifdef WSREP_DEBUG_PRINT
fprintf(stderr, "%s conn %ld, trx %llu, keylen %d, table %s\n SQL: %s ",
- (shared) ? "Shared" : "Exclusive",
+ wsrep_key_type_to_str(key_type),
wsrep_thd_thread_id(thd), (long long)trx->id, key_len,
table_share->table_name.str, wsrep_thd_query(thd));
for (int i=0; i<key_len; i++) {
wsrep_ws_handle(thd, trx),
&wkey,
1,
- shared ? WSREP_KEY_SHARED : WSREP_KEY_EXCLUSIVE,
+ key_type,
copy);
if (rcode) {
DBUG_PRINT("wsrep", ("row key failed: %d", rcode));
int
ha_innobase::wsrep_append_keys(
THD *thd,
- bool shared,
+ wsrep_key_type key_type, /*!< in: access type of this key
+ (shared, exclusive, semi...) */
const uchar* record0, /* in: row in MySQL format */
const uchar* record1) /* in: row in MySQL format */
{
if (!is_null) {
rcode = wsrep_append_key(
thd, trx, table_share, table, keyval,
- len, shared);
+ len, key_type);
if (rcode) DBUG_RETURN(rcode);
}
else
if (!is_null) {
rcode = wsrep_append_key(
thd, trx, table_share, table,
- keyval0, len+1, shared);
+ keyval0, len+1, key_type);
if (rcode) DBUG_RETURN(rcode);
- if (key_info->flags & HA_NOSAME || shared)
+ if (key_info->flags & HA_NOSAME ||
+ key_type == WSREP_KEY_SHARED)
key_appended = true;
}
else
rcode = wsrep_append_key(
thd, trx, table_share,
table,
- keyval1, len+1, shared);
+ keyval1, len+1, key_type);
if (rcode) DBUG_RETURN(rcode);
}
}
wsrep_calc_row_hash(digest, record0, table, prebuilt, thd);
if ((rcode = wsrep_append_key(thd, trx, table_share, table,
(const char*) digest, 16,
- shared))) {
+ key_type))) {
DBUG_RETURN(rcode);
}
if ((rcode = wsrep_append_key(thd, trx, table_share,
table,
(const char*) digest,
- 16, shared))) {
+ 16, key_type))) {
DBUG_RETURN(rcode);
}
}
dberr_t
innobase_rename_table(
/*==================*/
+ THD* thd, /*!< Connection thread handle */
trx_t* trx, /*!< in: transaction */
const char* from, /*!< in: old name of the table */
const char* to) /*!< in: new name of the table */
row_mysql_lock_data_dictionary(trx);
+ dict_table_t* table = NULL;
+ table = dict_table_open_on_name(norm_from, TRUE, FALSE,
+ DICT_ERR_IGNORE_NONE);
+
+ /* Since DICT_BG_YIELD has sleep for 250 milliseconds,
+ Convert lock_wait_timeout unit from second to 250 milliseconds */
+ long int lock_wait_timeout = thd_lock_wait_timeout(thd) * 4;
+ if (table != NULL) {
+ for (dict_index_t* index = dict_table_get_first_index(table);
+ index != NULL;
+ index = dict_table_get_next_index(index)) {
+
+ if (index->type & DICT_FTS) {
+ /* Found */
+ while (index->index_fts_syncing
+ && !trx_is_interrupted(trx)
+ && (lock_wait_timeout--) > 0) {
+ DICT_BG_YIELD(trx);
+ }
+ }
+ }
+ dict_table_close(table, TRUE, FALSE);
+ }
+
+ /* FTS sync is in progress. We shall timeout this operation */
+ if (lock_wait_timeout < 0) {
+ error = DB_LOCK_WAIT_TIMEOUT;
+ row_mysql_unlock_data_dictionary(trx);
+ DBUG_RETURN(error);
+ }
+
/* Transaction must be flagged as a locking transaction or it hasn't
been started yet. */
++trx->will_lock;
trx_set_dict_operation(trx, TRX_DICT_OP_INDEX);
- error = innobase_rename_table(trx, from, to);
+ error = innobase_rename_table(thd, trx, from, to);
DEBUG_SYNC(thd, "after_innobase_rename_table");
error = DB_ERROR;
}
+ else if (error == DB_LOCK_WAIT_TIMEOUT) {
+ my_error(ER_LOCK_WAIT_TIMEOUT, MYF(0), to);
+
+ error = DB_LOCK_WAIT;
+ }
+
DBUG_RETURN(convert_error_code_to_mysql(error, 0, NULL));
}
case SQLCOM_INSERT:
case SQLCOM_UPDATE:
case SQLCOM_DELETE:
+ case SQLCOM_REPLACE:
init_table_handle_for_HANDLER();
prebuilt->select_lock_type = LOCK_X;
prebuilt->stored_select_lock_type = LOCK_X;
#include "dict0stats.h"
+#ifdef WITH_WSREP
+#include "wsrep_api.h"
+#endif /* WITH_WSREP */
+
/* Structure defines translation table between mysql index and innodb
index structures */
struct innodb_idx_translate_t {
dict_index_t* innobase_get_index(uint keynr);
#ifdef WITH_WSREP
- int wsrep_append_keys(THD *thd, bool shared,
- const uchar* record0, const uchar* record1);
+ int wsrep_append_keys(
+ THD *thd,
+ wsrep_key_type key_type,
+ const uchar* record0,
+ const uchar* record1);
#endif
/* Init values for the class: */
public:
/*****************************************************************************
-Copyright (c) 2005, 2017, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 2005, 2018, 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
}
/** Get the auto-increment value of the table on commit.
-@param ha_alter_info Data used during in-place alter
-@param ctx In-place ALTER TABLE context
-@param altered_table MySQL table that is being altered
-@param old_table MySQL table as it is before the ALTER operation
-@return the next auto-increment value (0 if not present) */
+@param[in] ha_alter_info Data used during in-place alter
+@param[in,out] ctx In-place ALTER TABLE context
+ return autoinc value in ctx->max_autoinc
+@param altered_table[in] MySQL table that is being altered
+@param old_table[in] MySQL table as it is before the ALTER operation
+retval true Failure
+@retval false Success*/
static MY_ATTRIBUTE((nonnull, warn_unused_result))
-ulonglong
+bool
commit_get_autoinc(
/*===============*/
Alter_inplace_info* ha_alter_info,
const TABLE* altered_table,
const TABLE* old_table)
{
- ulonglong max_autoinc;
DBUG_ENTER("commit_get_autoinc");
if (!altered_table->found_next_number_field) {
/* There is no AUTO_INCREMENT column in the table
after the ALTER operation. */
- max_autoinc = 0;
+ ctx->max_autoinc = 0;
} else if (ctx->add_autoinc != ULINT_UNDEFINED) {
/* An AUTO_INCREMENT column was added. Get the last
value from the sequence, which may be based on a
supplied AUTO_INCREMENT value. */
- max_autoinc = ctx->sequence.last();
+ ctx->max_autoinc = ctx->sequence.last();
} else if ((ha_alter_info->handler_flags
& Alter_inplace_info::CHANGE_CREATE_OPTION)
&& (ha_alter_info->create_info->used_fields
& HA_CREATE_USED_AUTO)) {
+
+ /* Check if the table is discarded */
+ if(dict_table_is_discarded(ctx->old_table)) {
+ DBUG_RETURN(true);
+ }
+
/* An AUTO_INCREMENT value was supplied, but the table was not
rebuilt. Get the user-supplied value or the last value from the
sequence. */
dict_index_t* index = dict_table_get_index_on_first_col(
ctx->old_table, autoinc_field->field_index);
- max_autoinc = ha_alter_info->create_info->auto_increment_value;
+ ctx->max_autoinc =
+ ha_alter_info->create_info->auto_increment_value;
dict_table_autoinc_lock(ctx->old_table);
if (err != DB_SUCCESS) {
ut_ad(0);
- max_autoinc = 0;
- } else if (max_autoinc <= max_value_table) {
+ ctx->max_autoinc = 0;
+ } else if (ctx->max_autoinc <= max_value_table) {
ulonglong col_max_value;
ulonglong offset;
old_table->found_next_number_field);
offset = ctx->prebuilt->autoinc_offset;
- max_autoinc = innobase_next_autoinc(
+ ctx->max_autoinc = innobase_next_autoinc(
max_value_table, 1, 1, offset,
col_max_value);
}
Read the old counter value from the table. */
ut_ad(old_table->found_next_number_field);
dict_table_autoinc_lock(ctx->old_table);
- max_autoinc = ctx->old_table->autoinc;
+ ctx->max_autoinc = ctx->old_table->autoinc;
dict_table_autoinc_unlock(ctx->old_table);
}
- DBUG_RETURN(max_autoinc);
+ DBUG_RETURN(false);
}
/** Add or drop foreign key constraints to the data dictionary tables,
DBUG_ASSERT(new_clustered == ctx->need_rebuild());
- ctx->max_autoinc = commit_get_autoinc(
- ha_alter_info, ctx, altered_table, table);
+ if (commit_get_autoinc(ha_alter_info, ctx, altered_table,
+ table)) {
+ fail = true;
+ my_error(ER_TABLESPACE_DISCARDED, MYF(0),
+ table->s->table_name.str);
+ goto rollback_trx;
+ }
if (ctx->need_rebuild()) {
ctx->tmp_name = dict_mem_create_temporary_tablename(
#endif
}
+rollback_trx:
+
/* Commit or roll back the changes to the data dictionary. */
if (fail) {
/*****************************************************************************
-Copyright (c) 2012, 2016, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 2012, 2018, 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
/* Do some simple checks. */
if (m_flags != m_table->flags) {
- ib_errf(thd, IB_LOG_LEVEL_ERROR, ER_TABLE_SCHEMA_MISMATCH,
- "Table flags don't match, server table has 0x%lx "
- "and the meta-data file has 0x%lx",
- (ulong) m_table->n_cols, (ulong) m_flags);
-
+ if (dict_tf_to_row_format_string(m_flags) !=
+ dict_tf_to_row_format_string(m_table->flags)) {
+ ib_errf(thd, IB_LOG_LEVEL_ERROR,
+ ER_TABLE_SCHEMA_MISMATCH,
+ "Table flags don't match,"
+ "server table has %s "
+ "and the meta-data file has %s",
+ dict_tf_to_row_format_string(m_table->flags),
+ dict_tf_to_row_format_string(m_flags));
+ } else {
+ ib_errf(thd, IB_LOG_LEVEL_ERROR,
+ ER_TABLE_SCHEMA_MISMATCH,
+ "Table flags don't match");
+ }
return(DB_ERROR);
} else if (m_table->n_cols != m_n_cols) {
ib_errf(thd, IB_LOG_LEVEL_ERROR, ER_TABLE_SCHEMA_MISMATCH,
rec_t* rec = m_rec_iter.current();
- /* FIXME: Move out of the loop */
-
- if (rec_get_status(rec) == REC_STATUS_NODE_PTR) {
- break;
- }
-
ibool deleted = rec_get_deleted_flag(rec, comp);
/* For the clustered index we have to adjust the BLOB
return(DB_SUCCESS);
}
+ if (!page_is_leaf(block->frame)) {
+ return (DB_SUCCESS);
+ }
+
return(update_records(block));
}
#include "fts0types.h"
#include "m_string.h"
+#ifdef WITH_WSREP
+#include "wsrep_api.h"
+#include "wsrep_mysqld.h"
+#endif /* WITH_WSREP */
+
/*************************************************************************
IMPORTANT NOTE: Any operation that generates redo MUST check that there
is enough space in the redo log before for that operation. This is
const rec_t* clust_rec,
dict_index_t* clust_index,
ibool referenced,
- ibool shared);
+ wsrep_key_type key_type);
#endif /* WITH_WSREP */
/*********************************************************************//**
foreign,
clust_rec,
clust_index,
- FALSE, FALSE);
+ FALSE, WSREP_KEY_EXCLUSIVE);
if (err != DB_SUCCESS) {
fprintf(stderr,
"WSREP: foreign key append failed: %d\n", err);
if (check_ref) {
err = DB_SUCCESS;
#ifdef WITH_WSREP
+ wsrep_key_type key_type = WSREP_KEY_EXCLUSIVE;
+ if (upd_node != NULL) {
+ key_type = WSREP_KEY_SHARED;
+ } else {
+ switch (wsrep_certification_rules) {
+ case WSREP_CERTIFICATION_RULES_STRICT:
+ key_type = WSREP_KEY_EXCLUSIVE;
+ break;
+ case WSREP_CERTIFICATION_RULES_OPTIMIZED:
+ key_type = WSREP_KEY_SEMI;
+ break;
+ }
+ }
err = wsrep_append_foreign_key(
thr_get_trx(thr),
foreign,
rec,
check_index,
check_ref,
- (upd_node) ? TRUE : FALSE);
+ key_type);
#endif /* WITH_WSREP */
goto end_scan;
} else if (foreign->type != 0) {
/*****************************************************************************
-Copyright (c) 2011, 2016, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 2011, 2018, 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
while (!trx_is_interrupted(trx)) {
mrec = next_mrec;
- ut_ad(mrec < mrec_end);
+ ut_ad(mrec <= mrec_end);
+
+ if (mrec == mrec_end) {
+ /* We are at the end of the log.
+ Mark the replay all_done. */
+ if (has_index_lock) {
+ goto all_done;
+ }
+ }
if (!has_index_lock) {
/* We are applying operations from a different
/*****************************************************************************
-Copyright (c) 2000, 2017, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 2000, 2018, 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
doc_ids difference should not exceed
FTS_DOC_ID_MAX_STEP value. */
- if (next_doc_id > 1
- && doc_id - next_doc_id >= FTS_DOC_ID_MAX_STEP) {
+ if (doc_id - next_doc_id >= FTS_DOC_ID_MAX_STEP) {
fprintf(stderr,
"InnoDB: Doc ID " UINT64PF " is too"
" big. Its difference with largest"
}
}
- if (dict_table_has_fts_index(table)
+ if ((dict_table_has_fts_index(table)
+ || DICT_TF2_FLAG_IS_SET(table, DICT_TF2_FTS_HAS_DOC_ID))
&& !dict_tables_have_same_db(old_name, new_name)) {
err = fts_rename_aux_tables(table, new_name, trx);
if (err != DB_TABLE_NOT_FOUND) {
/*
- Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
+ Copyright (c) 2000, 2018, 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
if (file->s->base.auto_key)
update_auto_increment_key(¶m, file, 1);
if (optimize_done)
+ {
+ mysql_mutex_lock(&share->intern_lock);
error = update_state_info(¶m, file,
UPDATE_TIME | UPDATE_OPEN_COUNT |
(local_testflag &
T_STATISTICS ? UPDATE_STAT : 0));
+ mysql_mutex_unlock(&share->intern_lock);
+ }
info(HA_STATUS_NO_LOCK | HA_STATUS_TIME | HA_STATUS_VARIABLE |
HA_STATUS_CONST);
if (rows != file->state->records && ! (param.testflag & T_VERY_SILENT))
/*
- Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
+ Copyright (c) 2000, 2018, 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
int error;
uint r_locks=share->r_locks,w_locks=share->w_locks;
share->r_locks= share->w_locks= share->tot_locks= 0;
+
+ DBUG_EXECUTE_IF("simulate_incorrect_share_wlock_value",
+ DEBUG_SYNC_C("after_share_wlock_set_to_0"););
+
error=_mi_writeinfo(info,WRITEINFO_NO_UNLOCK);
share->r_locks=r_locks;
share->w_locks=w_locks;
-/* Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2000, 2018, 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
info->invalidator=info->s->invalidator;
share->w_locks++;
share->tot_locks++;
+
+ DBUG_EXECUTE_IF("simulate_incorrect_share_wlock_value",
+ DEBUG_SYNC_C("after_share_wlock_increment"););
+
info->s->in_use= list_add(info->s->in_use, &info->in_use);
break;
default:
-/* Copyright (c) 2008, 2017, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2008, 2018, 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
psi->create_file(file_key_A, "foo-instrumented", (File) 12);
file_A1= lookup_file_by_name("foo-instrumented");
ok(file_A1 != NULL, "file_A1 instrumented");
+ destroy_file(reinterpret_cast<PFS_thread*>(psi->get_thread()), file_A1);
/* broken key + enabled T-1: no instrumentation */
psi->create_file(file_key_A, "foo", (File) 12);
file_A1= (PSI_file*) lookup_file_by_name("foo");
ok(file_A1 != NULL, "instrumented");
+ destroy_file(reinterpret_cast<PFS_thread*>(psi->get_thread()),
+ reinterpret_cast<PFS_file*>(file_A1));
socket_class_A->m_enabled= true;
socket_A1= psi->init_socket(socket_key_A, NULL, NULL, 0);
# Prevent Debian's init scripts from calling systemctl
+SYSTEMCTL_SKIP_REDIRECT=true
_SYSTEMCTL_SKIP_REDIRECT=true
# If you install MySQL on some other places than @prefix@, then you
-# Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2000, 2018, 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
# Remove man pages we explicitly do not want to package, avoids 'unpackaged
# files' warning.
# This has become obsolete: rm -f $RBR%{_mandir}/man1/make_win_bin_dist.1*
-rm -f $RBR%{_mandir}/man1/mysql-stress-test.pl.1
-rm -f $RBR%{_mandir}/man1/mysql-test-run.pl.1
-rm -f $RBR%{_mandir}/man1/mysql_client_test.1
-rm -f $RBR%{_mandir}/man1/mysql_client_test_embedded.1
-rm -f $RBR%{_mandir}/man1/mysqltest.1
-rm -f $RBR%{_mandir}/man1/mysqltest_embedded.1
%check
# merging BK trees)
##############################################################################
%changelog
+* Wed Jan 10 2018 Bjorn Munch <bjorn.munch@oracle.com>
+- No longer need to remove obsoleted mysqltest man pages
+
* Tue Oct 31 2017 Bjorn Munch <bjorn.munch@oracle.com>
- Remove obsoleted mysqltest man pages
-# Copyright (c) 2012, Codership Oy. All rights reserved.
+# Copyright (c) 2012, 2018, Codership Oy. 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
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-INCLUDE_DIRECTORIES( "." )
-
-SET(WSREP_SOURCES wsrep_gtid.c wsrep_uuid.c wsrep_loader.c wsrep_dummy.c)
+SET(WSREP_SOURCES src/wsrep_gtid.c src/wsrep_uuid.c src/wsrep_loader.c src/wsrep_dummy.c)
ADD_CONVENIENCE_LIBRARY(wsrep ${WSREP_SOURCES})
DTRACE_INSTRUMENT(wsrep)
+++ /dev/null
-noinst_LIBRARIES = libwsrep.a
-libwsrep_a_SOURCES = wsrep_api.h wsrep_loader.c wsrep_dummy.c wsrep_uuid.c wsrep_gtid.c
-noinst_PROGRAMS = wsrep_listener
-wsrep_listener_SOURCES = wsrep_listener.c
-wsrep_listener_LDADD = $(noinst_LIBRARIES)
-wsrep_listener_LDFLAGS = -static -ldl
-
--- /dev/null
+# Copyright (c) 2018, Codership Oy. 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 Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
+
+INCLUDE_DIRECTORIES(".")
+
+SET(WSREP_SOURCES wsrep_gtid.c wsrep_uuid.c wsrep_loader.c wsrep_dummy.c)
+
+ADD_LIBRARY(wsrep ${WSREP_SOURCES})
+
+#ADD_EXECUTABLE(listener wsrep_listener.c ${WSREP_SOURCES})
+#TARGET_LINK_LIBRARIES(listener ${LIBDL})
--- /dev/null
+ GNU GENERAL PUBLIC LICENSE
+ Version 2, June 1991
+
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+ Preamble
+
+ The licenses for most software are designed to take away your
+freedom to share and change it. By contrast, the GNU General Public
+License is intended to guarantee your freedom to share and change free
+software--to make sure the software is free for all its users. This
+General Public License applies to most of the Free Software
+Foundation's software and to any other program whose authors commit to
+using it. (Some other Free Software Foundation software is covered by
+the GNU Lesser General Public License instead.) You can apply it to
+your programs, too.
+
+ When we speak of free software, we are referring to freedom, not
+price. Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+this service if you wish), that you receive source code or can get it
+if you want it, that you can change the software or use pieces of it
+in new free programs; and that you know you can do these things.
+
+ To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if you
+distribute copies of the software, or if you modify it.
+
+ For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must give the recipients all the rights that
+you have. You must make sure that they, too, receive or can get the
+source code. And you must show them these terms so they know their
+rights.
+
+ We protect your rights with two steps: (1) copyright the software, and
+(2) offer you this license which gives you legal permission to copy,
+distribute and/or modify the software.
+
+ Also, for each author's protection and ours, we want to make certain
+that everyone understands that there is no warranty for this free
+software. If the software is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original, so
+that any problems introduced by others will not reflect on the original
+authors' reputations.
+
+ Finally, any free program is threatened constantly by software
+patents. We wish to avoid the danger that redistributors of a free
+program will individually obtain patent licenses, in effect making the
+program proprietary. To prevent this, we have made it clear that any
+patent must be licensed for everyone's free use or not licensed at all.
+
+ The precise terms and conditions for copying, distribution and
+modification follow.
+
+ GNU GENERAL PUBLIC LICENSE
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+ 0. This License applies to any program or other work which contains
+a notice placed by the copyright holder saying it may be distributed
+under the terms of this General Public License. The "Program", below,
+refers to any such program or work, and a "work based on the Program"
+means either the Program or any derivative work under copyright law:
+that is to say, a work containing the Program or a portion of it,
+either verbatim or with modifications and/or translated into another
+language. (Hereinafter, translation is included without limitation in
+the term "modification".) Each licensee is addressed as "you".
+
+Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope. The act of
+running the Program is not restricted, and the output from the Program
+is covered only if its contents constitute a work based on the
+Program (independent of having been made by running the Program).
+Whether that is true depends on what the Program does.
+
+ 1. You may copy and distribute verbatim copies of the Program's
+source code as you receive it, in any medium, provided that you
+conspicuously and appropriately publish on each copy an appropriate
+copyright notice and disclaimer of warranty; keep intact all the
+notices that refer to this License and to the absence of any warranty;
+and give any other recipients of the Program a copy of this License
+along with the Program.
+
+You may charge a fee for the physical act of transferring a copy, and
+you may at your option offer warranty protection in exchange for a fee.
+
+ 2. You may modify your copy or copies of the Program or any portion
+of it, thus forming a work based on the Program, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+ a) You must cause the modified files to carry prominent notices
+ stating that you changed the files and the date of any change.
+
+ b) You must cause any work that you distribute or publish, that in
+ whole or in part contains or is derived from the Program or any
+ part thereof, to be licensed as a whole at no charge to all third
+ parties under the terms of this License.
+
+ c) If the modified program normally reads commands interactively
+ when run, you must cause it, when started running for such
+ interactive use in the most ordinary way, to print or display an
+ announcement including an appropriate copyright notice and a
+ notice that there is no warranty (or else, saying that you provide
+ a warranty) and that users may redistribute the program under
+ these conditions, and telling the user how to view a copy of this
+ License. (Exception: if the Program itself is interactive but
+ does not normally print such an announcement, your work based on
+ the Program is not required to print an announcement.)
+
+These requirements apply to the modified work as a whole. If
+identifiable sections of that work are not derived from the Program,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works. But when you
+distribute the same sections as part of a whole which is a work based
+on the Program, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Program.
+
+In addition, mere aggregation of another work not based on the Program
+with the Program (or with a work based on the Program) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+ 3. You may copy and distribute the Program (or a work based on it,
+under Section 2) in object code or executable form under the terms of
+Sections 1 and 2 above provided that you also do one of the following:
+
+ a) Accompany it with the complete corresponding machine-readable
+ source code, which must be distributed under the terms of Sections
+ 1 and 2 above on a medium customarily used for software interchange; or,
+
+ b) Accompany it with a written offer, valid for at least three
+ years, to give any third party, for a charge no more than your
+ cost of physically performing source distribution, a complete
+ machine-readable copy of the corresponding source code, to be
+ distributed under the terms of Sections 1 and 2 above on a medium
+ customarily used for software interchange; or,
+
+ c) Accompany it with the information you received as to the offer
+ to distribute corresponding source code. (This alternative is
+ allowed only for noncommercial distribution and only if you
+ received the program in object code or executable form with such
+ an offer, in accord with Subsection b above.)
+
+The source code for a work means the preferred form of the work for
+making modifications to it. For an executable work, complete source
+code means all the source code for all modules it contains, plus any
+associated interface definition files, plus the scripts used to
+control compilation and installation of the executable. However, as a
+special exception, the source code distributed need not include
+anything that is normally distributed (in either source or binary
+form) with the major components (compiler, kernel, and so on) of the
+operating system on which the executable runs, unless that component
+itself accompanies the executable.
+
+If distribution of executable or object code is made by offering
+access to copy from a designated place, then offering equivalent
+access to copy the source code from the same place counts as
+distribution of the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+ 4. You may not copy, modify, sublicense, or distribute the Program
+except as expressly provided under this License. Any attempt
+otherwise to copy, modify, sublicense or distribute the Program is
+void, and will automatically terminate your rights under this License.
+However, parties who have received copies, or rights, from you under
+this License will not have their licenses terminated so long as such
+parties remain in full compliance.
+
+ 5. You are not required to accept this License, since you have not
+signed it. However, nothing else grants you permission to modify or
+distribute the Program or its derivative works. These actions are
+prohibited by law if you do not accept this License. Therefore, by
+modifying or distributing the Program (or any work based on the
+Program), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Program or works based on it.
+
+ 6. Each time you redistribute the Program (or any work based on the
+Program), the recipient automatically receives a license from the
+original licensor to copy, distribute or modify the Program subject to
+these terms and conditions. You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties to
+this License.
+
+ 7. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Program at all. For example, if a patent
+license would not permit royalty-free redistribution of the Program by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Program.
+
+If any portion of this section is held invalid or unenforceable under
+any particular circumstance, the balance of the section is intended to
+apply and the section as a whole is intended to apply in other
+circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system, which is
+implemented by public license practices. Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+ 8. If the distribution and/or use of the Program is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Program under this License
+may add an explicit geographical distribution limitation excluding
+those countries, so that distribution is permitted only in or among
+countries not thus excluded. In such case, this License incorporates
+the limitation as if written in the body of this License.
+
+ 9. The Free Software Foundation may publish revised and/or new versions
+of the General Public License from time to time. Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+Each version is given a distinguishing version number. If the Program
+specifies a version number of this License which applies to it and "any
+later version", you have the option of following the terms and conditions
+either of that version or of any later version published by the Free
+Software Foundation. If the Program does not specify a version number of
+this License, you may choose any version ever published by the Free Software
+Foundation.
+
+ 10. If you wish to incorporate parts of the Program into other free
+programs whose distribution conditions are different, write to the author
+to ask for permission. For software which is copyrighted by the Free
+Software Foundation, write to the Free Software Foundation; we sometimes
+make exceptions for this. Our decision will be guided by the two goals
+of preserving the free status of all derivatives of our free software and
+of promoting the sharing and reuse of software generally.
+
+ NO WARRANTY
+
+ 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
+PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
+REPAIR OR CORRECTION.
+
+ 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
+OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
+PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGES.
+
+ END OF TERMS AND CONDITIONS
+
+ How to Apply These Terms to Your New Programs
+
+ If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+ To do so, attach the following notices to the program. It is safest
+to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+ <one line to give the program's name and a brief idea of what it does.>
+ Copyright (C) <year> <name of author>
+
+ 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 Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with this program; if not, write to the Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+Also add information on how to contact you by electronic and paper mail.
+
+If the program is interactive, make it output a short notice like this
+when it starts in an interactive mode:
+
+ Gnomovision version 69, Copyright (C) year name of author
+ Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+ This is free software, and you are welcome to redistribute it
+ under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License. Of course, the commands you use may
+be called something other than `show w' and `show c'; they could even be
+mouse-clicks or menu items--whatever suits your program.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the program, if
+necessary. Here is a sample; alter the names:
+
+ Yoyodyne, Inc., hereby disclaims all copyright interest in the program
+ `Gnomovision' (which makes passes at compilers) written by James Hacker.
+
+ <signature of Ty Coon>, 1 April 1989
+ Ty Coon, President of Vice
+
+This General Public License does not permit incorporating your program into
+proprietary programs. If your program is a subroutine library, you may
+consider it more useful to permit linking proprietary applications with the
+library. If this is what you want to do, use the GNU Lesser General
+Public License instead of this License.
--- /dev/null
+Write Set Replication API specification
\ No newline at end of file
--- /dev/null
+/* Copyright (C) 2012 Codership Oy <info@codersihp.com>
+
+ 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 Foundation; version 2 of the License.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/*! @file Example of wsrep event listener. Outputs description of received
+ * events to stdout. To get a general picture you should start with
+ * main() function. */
+
+#include <wsrep_api.h>
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <errno.h>
+#include <signal.h>
+#include <pthread.h>
+
+/*! This is global application context, it will be used by wsrep callbacks */
+struct application_context
+{};
+
+static struct application_context global_ctx;
+
+/*! This is receiving thread context, it will be used by wsrep callbacks */
+struct receiver_context
+{
+ char msg[4096];
+};
+
+/*! This is a logger callback which library will be using to log events. */
+static void
+logger_cb (wsrep_log_level_t level __attribute__((unused)), const char* msg)
+{
+ fprintf (stderr, "WSREP: %s\n", msg);
+}
+
+/*! This will be called on cluster view change (nodes joining, leaving, etc.).
+ * Each view change is the point where application may be pronounced out of
+ * sync with the current cluster view and need state transfer.
+ * It is guaranteed that no other callbacks are called concurrently with it. */
+static wsrep_cb_status_t
+view_cb (void* app_ctx __attribute__((unused)),
+ void* recv_ctx __attribute__((unused)),
+ const wsrep_view_info_t* view,
+ const char* state __attribute__((unused)),
+ size_t state_len __attribute__((unused)),
+ void** sst_req,
+ size_t* sst_req_len)
+{
+ printf ("New cluster membership view: %d nodes, my index is %d, "
+ "global seqno: %lld\n",
+ view->memb_num, view->my_idx, (long long)view->state_id.seqno);
+
+ if (view->state_gap) /* we need to receive new state from the cluster */
+ {
+ /* For simplicity we're skipping state transfer by using magic string
+ * as a state transfer request.
+ * This node will not be considered JOINED (having full state)
+ * by other cluster members. */
+ *sst_req = strdup(WSREP_STATE_TRANSFER_NONE);
+
+ if (*sst_req)
+ *sst_req_len = strlen(*sst_req) + 1;
+ else
+ *sst_req_len = -ENOMEM;
+ }
+
+ return WSREP_CB_SUCCESS;
+}
+
+/*! This is called to "apply" writeset.
+ * If writesets don't conflict on keys, it may be called concurrently to
+ * utilize several CPU cores. */
+static wsrep_cb_status_t
+apply_cb (void* recv_ctx,
+ const void* ws_data __attribute__((unused)),
+ size_t ws_size,
+ uint32_t flags __attribute__((unused)),
+ const wsrep_trx_meta_t* meta)
+{
+ struct receiver_context* ctx = (struct receiver_context*)recv_ctx;
+
+ snprintf (ctx->msg, sizeof(ctx->msg),
+ "Got writeset %lld, size %zu", (long long)meta->gtid.seqno,
+ ws_size);
+
+ return WSREP_CB_SUCCESS;
+}
+
+/*! This is called to "commit" or "rollback" previously applied writeset,
+ * depending on commit parameter.
+ * By default this callback is called synchronously in the order determined
+ * by seqno. */
+static wsrep_cb_status_t
+commit_cb (void* recv_ctx,
+ uint32_t flags __attribute((unused)),
+ const wsrep_trx_meta_t* meta __attribute__((unused)),
+ wsrep_bool_t* exit __attribute__((unused)),
+ wsrep_bool_t commit)
+{
+ struct receiver_context* ctx = (struct receiver_context*)recv_ctx;
+
+ /* Here we just print it to stdout. Since this callback is synchronous
+ * we don't need to worry about exclusive access to stdout. */
+ if (commit) puts(ctx->msg);
+
+ return WSREP_CB_SUCCESS;
+}
+
+/* The following callbacks are stubs and not used in this example. */
+static wsrep_cb_status_t
+sst_donate_cb (void* app_ctx __attribute__((unused)),
+ void* recv_ctx __attribute__((unused)),
+ const void* msg __attribute__((unused)),
+ size_t msg_len __attribute__((unused)),
+ const wsrep_gtid_t* state_id __attribute__((unused)),
+ const char* state __attribute__((unused)),
+ size_t state_len __attribute__((unused)),
+ wsrep_bool_t bypass __attribute__((unused)))
+{
+ return WSREP_CB_SUCCESS;
+}
+
+static void synced_cb (void* app_ctx __attribute__((unused))) {}
+
+/* wsrep provider handle (global for simplicty) */
+static wsrep_t* wsrep = NULL;
+
+/* This is the listening thread. It blocks in wsrep::recv() call until
+ * disconnect from cluster. It will apply and commit writesets through the
+ * callbacks defined avbove. */
+static void*
+recv_thread (void* arg)
+{
+ struct receiver_context* ctx = (struct receiver_context*)arg;
+
+ wsrep_status_t rc = wsrep->recv(wsrep, ctx);
+
+ fprintf (stderr, "Receiver exited with code %d", rc);
+
+ return NULL;
+}
+
+/* This is a signal handler to demonstrate graceful cluster leave. */
+static void
+graceful_leave (int signum)
+{
+ printf ("Got signal %d, exiting...\n", signum);
+ wsrep->disconnect(wsrep);
+}
+
+int main (int argc, char* argv[])
+{
+ if (argc != 4)
+ {
+ fprintf (stderr, "Usage: %s </path/to/wsrep/provider> <wsrep URI> "
+ "<cluster name>\n", argv[0]);
+ exit (EXIT_FAILURE);
+ }
+
+ const char* const wsrep_provider = argv[1];
+ const char* const wsrep_uri = argv[2];
+ const char* const cluster_name = argv[3];
+
+ /* Now let's load and initialize provider */
+ wsrep_status_t rc = wsrep_load (wsrep_provider, &wsrep, logger_cb);
+ if (WSREP_OK != rc)
+ {
+ fprintf (stderr, "Failed to load wsrep provider '%s'\n",wsrep_provider);
+ exit (EXIT_FAILURE);
+ }
+
+ wsrep_gtid_t state_id = { WSREP_UUID_UNDEFINED, WSREP_SEQNO_UNDEFINED };
+
+ /* wsrep provider initialization arguments */
+ struct wsrep_init_args wsrep_args =
+ {
+ .app_ctx = &global_ctx,
+
+ .node_name = "example listener",
+ .node_address = "",
+ .node_incoming = "",
+ .data_dir = ".", // working directory
+ .options = "",
+ .proto_ver = 127, // maximum supported application event protocol
+
+ .state_id = &state_id,
+ .state = NULL,
+ .state_len = 0,
+
+ .logger_cb = logger_cb,
+ .view_handler_cb = view_cb,
+ .apply_cb = apply_cb,
+ .commit_cb = commit_cb,
+ .sst_donate_cb = sst_donate_cb,
+ .synced_cb = synced_cb
+ };
+
+ rc = wsrep->init(wsrep, &wsrep_args);
+ if (WSREP_OK != rc)
+ {
+ fprintf (stderr, "wsrep::init() failed: %d\n", rc);
+ exit (EXIT_FAILURE);
+ }
+
+ /* Connect to cluster */
+ rc = wsrep->connect (wsrep, cluster_name, wsrep_uri, "", 0);
+ if (0 != rc)
+ {
+ fprintf (stderr,
+ "wsrep::connect() failed: %d (%s)\n", rc, strerror(-rc));
+ exit (EXIT_FAILURE);
+ }
+
+ /* Now let's start several listening threads*/
+ int const num_threads = 4;
+ struct receiver_context thread_ctx[num_threads];
+ pthread_t threads[num_threads];
+
+ int i;
+ for (i = 0; i < num_threads; i++)
+ {
+ int err = pthread_create (
+ &threads[i], NULL, recv_thread, &thread_ctx[i]);
+
+ if (err)
+ {
+ fprintf (stderr, "Failed to start thread %d: %d (%s)",
+ i, err, strerror(err));
+ exit (EXIT_FAILURE);
+ }
+ }
+
+ signal (SIGTERM, graceful_leave);
+ signal (SIGINT, graceful_leave);
+
+ /* Listening threads are now running and receiving writesets. Wait for them
+ * to join. Threads will join after signal handler closes wsrep connection*/
+ for (i = 0; i < num_threads; i++)
+ {
+ pthread_join (threads[i], NULL);
+ }
+
+ /* Unload provider after nobody uses it any more. */
+ wsrep_unload (wsrep);
+
+ return 0;
+}
static int verify(const wsrep_t *wh, const char *iface_ver)
{
- const size_t msg_len = 128;
char msg[128];
+ const size_t msg_len = sizeof(msg);
#define VERIFY(_p) if (!(_p)) { \
snprintf(msg, msg_len, "wsrep_load(): verify(): %s\n", # _p); \
int ret = 0;
void *dlh = NULL;
wsrep_loader_fun dlfun;
- const size_t msg_len = 1024;
- char msg[1024 + 1];
+ char msg[1024];
+ const size_t msg_len = sizeof(msg) - 1;
msg[msg_len] = 0;
if (NULL != log_cb)