+mysql-wsrep-5.6 (5.6.33-0~u14.04+mos1) mos; urgency=low
+
+ * Rebuilt for MOS
+ * Galera 25.17
+ * MySQL-wsrep from [0]
+
+ [0] https://github.com/codership/mysql-wsrep/tree/wsrep_5.6.33-25.17
+
+ -- Ivan Suzdal <mos-linux@mirantis.com> Fri, 16 Sep 2016 14:34:04 +0000
+
mysql-wsrep-5.6 (5.6.30-0~u14.04+mos1) mos; urgency=high
* SECURITY UPDATE: Update to 5.6.30 to fix security issues (LP: #1572559)
ENABLE_TESTING()
ENDIF()
+OPTION(WITH_SYMVER16
+ "Export libmysqlclient_16 and libmysqlclient_18 symbol versions" OFF)
+
+IF(WITH_SYMVER16)
+ ADD_DEFINITIONS(-DEXPORT_SYMVER16)
+ENDIF()
+
IF(NOT WITHOUT_SERVER)
SET (MYSQLD_STATIC_PLUGIN_LIBS "" CACHE INTERNAL "")
# Add storage engines and plugins.
ENDIF()
IF(WITH_UNIT_TESTS)
- ADD_SUBDIRECTORY(unittest)
- ADD_SUBDIRECTORY(unittest/examples)
- ADD_SUBDIRECTORY(unittest/mytap)
- ADD_SUBDIRECTORY(unittest/mytap/t)
# Visual Studio 11 needs this extra flag in order to compile gmock.
IF(WIN32)
ADD_DEFINITIONS( /D _VARIADIC_MAX=10 )
IF(HAVE_LLVM_LIBCPP)
ADD_DEFINITIONS(-DGTEST_USE_OWN_TR1_TUPLE=1)
ENDIF()
- ADD_SUBDIRECTORY(unittest/gunit)
+ ADD_SUBDIRECTORY(unittest)
+ ADD_SUBDIRECTORY(unittest/examples)
+ ADD_SUBDIRECTORY(unittest/mytap)
+ ADD_SUBDIRECTORY(unittest/mytap/t)
ENDIF()
ADD_SUBDIRECTORY(extra)
--- /dev/null
+All contributors are required to add their name and [Github username/email]
+to this file in connection with their first contribution. If you are making
+a contribution on behalf of a company, you should add the said company name.
+
+By adding your name and [Github username/email] to this file you agree that
+your contribution is a contribution under a contributior agreement between
+you and Codership Oy. To the extent that you are an employee of a company and
+contribute in that role, you confirm that your contribution is a contribution
+under the contribution license agreement between your employer and Codership
+Oy; and that you have the authorization to give such confirmation. You confirm
+that you have read, understood and signed the contributor license agreement
+applicable to you.
+
+For the individual contributor agreement see file CONTRIBUTOR_AGREEMENT.txt
+in the same directory as this file.
+
+Authors from Codership Oy:
+
+ *
+ [Codership employees, add name and email/username above this line, but leave this line intact]
+
+Other contributors:
+
+ *
+ [add name and email/username above this line, but leave this line intact]
--- /dev/null
+Codership Individual Contributor License Agreement
+
+Thank you for your interest in contributing to Galera Cluster, a project
+managed by Codership Oy, a legal entity established under Finnish laws, with
+its principal address at Pohjolankatu 64 A, 00600 Helsinki Finland (“We”, “Us”
+or “Our”).
+
+This contributor agreement (“Agreement”) documents the rights granted by
+contributors to Us. To make this document effective, please either accept it
+in an electronic service such as clahub.com or sign and scan it and send it
+to Us by email. This is a legally binding document, so please read it
+carefully before agreeing to it. This Agreement covers the Galera Cluster
+project: the Galera library, the Wsrep patch for MySQL and other eventual
+patches to MySQL or other technologies.
+
+(1) Definitions
+
+“You” means the individual who Submits a Contribution to Us.
+
+“Contribution” means any work of authorship that is Submitted by You to Us in
+which You own or assert ownership of the Copyright. If You do not own the
+Copyright in the entire work of authorship, you need to have a separate
+permission from Us.
+
+“Copyright” means all rights protecting works of authorship owned or
+controlled by You, including copyright, moral and neighboring rights,
+as appropriate, for the full term of their existence including any extensions
+by You.
+
+“Material” means the work of authorship which is made available by Us to third
+parties, i.e. the Galera library, the Wsrep patch for MySQL; other eventual
+patches to MySQL; other eventual patches to other database technologies; all
+these together with a database technology, such as MySQL, or its derivatives.
+After You Submit the Contribution, it may be included in the Material.
+
+“Submit” means any form of electronic, verbal, or written communication sent
+to Us or our representatives, including but not limited to electronic mailing
+lists, source code control systems, and issue tracking systems that are
+managed by, or on behalf of, Us for the purpose of discussing and improving
+the Material, provided that such communication is (i) conspicuously marked or
+otherwise designated in writing by You or Your employee as a “Contribution” or
+(ii) submitted in source code control system pursuant to Section 3 (e).
+
+“Submission Date” means the date on which You Submit a Contribution to Us.
+
+“Effective Date” means the date You execute this Agreement or the date You
+first Submit a Contribution to Us, whichever is earlier.
+
+“Media” means any portion of a Contribution which is not software.
+
+(2) Grant of Rights
+
+2.1 Copyright License
+
+(a) You retain ownership of the Copyright in Your Contribution and have the
+same rights to use or license the Contribution which You would have had
+without entering into the Agreement. In case we have in writing permitted
+submitting a sublicense to licensed rights, You will not transfer the original
+license, but grant us a sublicense in accordance with this Agreement.
+
+(b) To the maximum extent permitted by the relevant law, You grant to Us
+a perpetual, worldwide, non-exclusive, transferable, royalty-free, irrevocable
+license under the Copyright covering the Contribution, with the right
+to sublicense such rights through multiple tiers of sublicensees, to reproduce,
+modify, display, perform and distribute the Contribution as part
+of the Material; provided that this license is conditioned upon compliance
+with Section 2.3.
+
+2.2 Patent License
+
+For patent claims including, without limitation, method, process, and
+apparatus claims which You own, control or have the right to grant, now or
+in the future, You grant to Us a perpetual, worldwide, non-exclusive,
+transferable, royalty-free, irrevocable patent license, with the right
+to sublicense these rights to multiple tiers of sublicensees, to make, have
+made, use, sell, offer for sale, import and otherwise transfer
+the Contribution and the Contribution in combination with the Material
+(and portions of such combination). This license is granted only to the extent
+ that the exercise of the licensed rights infringes such patent claims;
+and provided that this license is conditioned upon compliance with Section 2.3.
+
+2.3 Outbound License
+
+As a condition on the grant of rights in Sections 2.1 and 2.2, to the extent
+we include Your Contribution or a part of it in a Material, we agree to
+license the Contribution only under the terms of the license or licenses which
+We are using on the Submission Date for the Material or any licenses which are
+approved by the Open Source Initiative (“OSI”) on or after the Effective Date,
+including both permissive and copyleft licenses, whether or not such licenses
+are subsequently disapproved (including any right to adopt any future version
+of a license if approved by the OSI). In addition to above defined licenses,
+We may use the following licenses for Media in the Contribution: Creative
+Commons BY 3.0 or Creative Commons BY-SA 3.0 (including the right to adopt any
+future version of a license).
+
+2.4 Moral Rights.
+
+If moral rights apply to the Contribution, to the maximum extent permitted by
+law, You waive and agree not to assert such moral rights against Us or our
+successors in interest, or any of our licensees, either direct or indirect.
+
+2.5 Enforcement.
+
+You, as a copyright holder to Your Contribution, hereby authorize us
+to enforce the OSI approved license applied by Us to a Material, but only
+to the extent Your Contribution has been included in a Material and always
+subject to Our free discretion on whether such enforcement is necessary or not.
+
+2.6 Our Rights.
+
+You acknowledge that We are not obligated to use Your Contribution as part of
+the Material and may decide to include any Contribution We consider
+appropriate.
+
+2.7 Reservation of Rights.
+
+Any rights not expressly licensed under this section are expressly reserved
+by You.
+
+(3) Agreement
+
+You confirm that:
+
+(a) You have the legal authority to enter into this Agreement.
+
+(b) You own the Copyright and patent claims covering the Contribution which
+ are required to grant the rights under Section 2.
+
+(c) The grant of rights under Section 2 does not violate any grant of rights
+ which You have made to third parties, including Your employer. If You are
+ an employee, You have had Your employer approve this Agreement or sign the
+ Entity version of this document. If You are less than eighteen years old,
+ please have Your parents or guardian sign the Agreement.
+
+(d) You have not Submitted any Code You do not own without written permission
+ from US.
+
+(e) All pull or merge requests issued under usernames confirmed by You
+ in writing are issued by You; and all such pull or merge requests contain
+ Your Contributions under this Agreement. You will notify Us in writing
+ in the event of You no longer control such usernames.
+
+(4) Disclaimer
+
+EXCEPT FOR THE EXPRESS WARRANTIES IN SECTION 3, THE CONTRIBUTION IS PROVIDED
+“AS IS”. MORE PARTICULARLY, ALL EXPRESS OR IMPLIED WARRANTIES INCLUDING,
+WITHOUT LIMITATION, ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE EXPRESSLY DISCLAIMED BY YOU TO US. TO THE EXTENT THAT ANY SUCH WARRANTIES CANNOT BE DISCLAIMED, SUCH WARRANTY IS LIMITED IN DURATION TO THE MINIMUM PERIOD PERMITTED BY LAW.
+
+(5) Consequential Damage Waiver
+
+TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, IN NO EVENT WILL YOU BE
+LIABLE FOR ANY LOSS OF PROFITS, LOSS OF ANTICIPATED SAVINGS, LOSS OF DATA,
+INDIRECT, SPECIAL, INCIDENTAL, CONSEQUENTIAL AND EXEMPLARY DAMAGES ARISING
+OUT OF THIS AGREEMENT REGARDLESS OF THE LEGAL OR EQUITABLE THEORY (CONTRACT,
+TORT OR OTHERWISE) UPON WHICH THE CLAIM IS BASED. THIS WAIVER DOES NOT APPLY
+TO GROSS NEGLIGENT OR MALICIOUS ACTS OR FRAUD.
+
+(6) Miscellaneous
+
+6.1 This Agreement will be governed by and construed in accordance with the
+laws of Finland excluding its conflicts of law provisions. Under certain
+circumstances, the governing law in this section might be superseded by the
+United Nations Convention on Contracts for the International Sale of Goods
+(“UN Convention”) and the parties intend to avoid the application of the
+UN Convention to this Agreement and, thus, exclude the application of the
+UN Convention in its entirety to this Agreement.
+
+6.2 Any and all Submissions done by You prior to execution of this Agreement
+shall be nonetheless covered by this Agreement.
+
+6.3 This Agreement sets out the entire agreement between You and Us for Your
+Contributions to Us and overrides all other agreements or understandings.
+
+6.4 If You or We assign the rights or obligations received through this
+Agreement to a third party, as a condition of the assignment, that third party
+must agree in writing to abide by all the rights and obligations in the
+Agreement.
+
+6.5 The failure of either party to require performance by the other party of
+any provision of this Agreement in one situation shall not affect the right
+of a party to require such performance at any time in the future. A waiver of
+performance under a provision in one situation shall not be considered a
+waiver of the performance of the provision in the future or a waiver of the
+provision in its entirety.
+
+6.6 If any provision of this Agreement is found void and unenforceable, such
+provision will be replaced to the extent possible with a provision that comes
+closest to the meaning of the original provision and which is enforceable.
+The terms and conditions set forth in this Agreement shall apply
+notwithstanding any failure of essential purpose of this Agreement or any
+limited remedy to the maximum extent possible under law.
+
+This document has been drafted based on Harmony Inividual Contributor License
+Agreement (HA-CLA-I) Version 1.0 July 4, 2011. HA- CLA-I is available from
+harmonyagreements.org and is licensed by under Creative Commons Attribution
+3.0 Unported License.
MYSQL_VERSION_MAJOR=5
MYSQL_VERSION_MINOR=6
-MYSQL_VERSION_PATCH=30
+MYSQL_VERSION_PATCH=33
MYSQL_VERSION_EXTRA=
const char *user, const char *passwd,
const char *db, uint port,
const char *unix_socket, ulong client_flag,
- my_bool ssl_required __attribute__((unused)))
+ my_bool ssl_required MY_ATTRIBUTE((unused)))
{
MYSQL *mysql= mysql_real_connect(mysql_arg, host, user, passwd, db, port,
unix_socket, client_flag);
my_bool
-get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
+get_one_option(int optid, const struct my_option *opt MY_ATTRIBUTE((unused)),
char *argument)
{
switch(optid) {
*/
static char **new_mysql_completion(const char *text,
- int start __attribute__((unused)),
- int end __attribute__((unused)))
+ int start MY_ATTRIBUTE((unused)),
+ int end MY_ATTRIBUTE((unused)))
{
if (!status.batch && !quick)
#if defined(USE_NEW_READLINE_INTERFACE)
}
-static int com_server_help(String *buffer __attribute__((unused)),
- char *line __attribute__((unused)), char *help_arg)
+static int com_server_help(String *buffer MY_ATTRIBUTE((unused)),
+ char *line MY_ATTRIBUTE((unused)), char *help_arg)
{
MYSQL_ROW cur;
const char *server_cmd;
}
static int
-com_help(String *buffer __attribute__((unused)),
- char *line __attribute__((unused)))
+com_help(String *buffer MY_ATTRIBUTE((unused)),
+ char *line MY_ATTRIBUTE((unused)))
{
reg1 int i, j;
char * help_arg= strchr(line,' '), buff[32], *end;
/* ARGSUSED */
static int
-com_clear(String *buffer,char *line __attribute__((unused)))
+com_clear(String *buffer,char *line MY_ATTRIBUTE((unused)))
{
#ifdef HAVE_READLINE
if (status.add_to_history)
/* ARGSUSED */
static int
-com_charset(String *buffer __attribute__((unused)), char *line)
+com_charset(String *buffer MY_ATTRIBUTE((unused)), char *line)
{
char buff[256], *param;
const CHARSET_INFO *new_cs;
static int
-com_go(String *buffer,char *line __attribute__((unused)))
+com_go(String *buffer,char *line MY_ATTRIBUTE((unused)))
{
char buff[200]; /* about 110 chars used so far */
char time_buff[52+3+1]; /* time max + space&parens + NUL */
}
static int
-com_tee(String *buffer __attribute__((unused)),
- char *line __attribute__((unused)))
+com_tee(String *buffer MY_ATTRIBUTE((unused)),
+ char *line MY_ATTRIBUTE((unused)))
{
char file_name[FN_REFLEN], *end, *param;
static int
-com_notee(String *buffer __attribute__((unused)),
- char *line __attribute__((unused)))
+com_notee(String *buffer MY_ATTRIBUTE((unused)),
+ char *line MY_ATTRIBUTE((unused)))
{
if (opt_outfile)
end_tee();
#ifdef USE_POPEN
static int
-com_pager(String *buffer __attribute__((unused)),
- char *line __attribute__((unused)))
+com_pager(String *buffer MY_ATTRIBUTE((unused)),
+ char *line MY_ATTRIBUTE((unused)))
{
char pager_name[FN_REFLEN], *end, *param;
static int
-com_nopager(String *buffer __attribute__((unused)),
- char *line __attribute__((unused)))
+com_nopager(String *buffer MY_ATTRIBUTE((unused)),
+ char *line MY_ATTRIBUTE((unused)))
{
strmov(pager, "stdout");
opt_nopager=1;
#ifdef USE_POPEN
static int
-com_edit(String *buffer,char *line __attribute__((unused)))
+com_edit(String *buffer,char *line MY_ATTRIBUTE((unused)))
{
char filename[FN_REFLEN],buff[160];
int fd,tmp;
/* If arg is given, exit without errors. This happens on command 'quit' */
static int
-com_quit(String *buffer __attribute__((unused)),
- char *line __attribute__((unused)))
+com_quit(String *buffer MY_ATTRIBUTE((unused)),
+ char *line MY_ATTRIBUTE((unused)))
{
status.exit_status=0;
return 1;
}
static int
-com_rehash(String *buffer __attribute__((unused)),
- char *line __attribute__((unused)))
+com_rehash(String *buffer MY_ATTRIBUTE((unused)),
+ char *line MY_ATTRIBUTE((unused)))
{
#ifdef HAVE_READLINE
build_completion_hash(1, 0);
#ifdef USE_POPEN
static int
-com_shell(String *buffer __attribute__((unused)),
- char *line __attribute__((unused)))
+com_shell(String *buffer MY_ATTRIBUTE((unused)),
+ char *line MY_ATTRIBUTE((unused)))
{
char *shell_cmd;
static int
-com_print(String *buffer,char *line __attribute__((unused)))
+com_print(String *buffer,char *line MY_ATTRIBUTE((unused)))
{
tee_puts("--------------", stdout);
(void) tee_fputs(buffer->c_ptr(), stdout);
}
-static int com_source(String *buffer __attribute__((unused)),
+static int com_source(String *buffer MY_ATTRIBUTE((unused)),
char *line)
{
char source_name[FN_REFLEN], *end, *param;
/* ARGSUSED */
static int
-com_delimiter(String *buffer __attribute__((unused)), char *line)
+com_delimiter(String *buffer MY_ATTRIBUTE((unused)), char *line)
{
char buff[256], *tmp;
/* ARGSUSED */
static int
-com_use(String *buffer __attribute__((unused)), char *line)
+com_use(String *buffer MY_ATTRIBUTE((unused)), char *line)
{
char *tmp, buff[FN_REFLEN + 1];
int select_db;
}
static int
-com_warnings(String *buffer __attribute__((unused)),
- char *line __attribute__((unused)))
+com_warnings(String *buffer MY_ATTRIBUTE((unused)),
+ char *line MY_ATTRIBUTE((unused)))
{
show_warnings = 1;
put_info("Show warnings enabled.",INFO_INFO);
}
static int
-com_nowarnings(String *buffer __attribute__((unused)),
- char *line __attribute__((unused)))
+com_nowarnings(String *buffer MY_ATTRIBUTE((unused)),
+ char *line MY_ATTRIBUTE((unused)))
{
show_warnings = 0;
put_info("Show warnings disabled.",INFO_INFO);
static int
-com_status(String *buffer __attribute__((unused)),
- char *line __attribute__((unused)))
+com_status(String *buffer MY_ATTRIBUTE((unused)),
+ char *line MY_ATTRIBUTE((unused)))
{
const char *status_str;
char buff[40];
}
}
-static int com_prompt(String *buffer __attribute__((unused)),
+static int com_prompt(String *buffer MY_ATTRIBUTE((unused)),
char *line)
{
char *ptr=strchr(line, ' ');
/*
- Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved.
+ Copyright (c) 2012, 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
my_bool
my_program_get_one_option(int optid,
- const struct my_option *opt __attribute__((unused)),
+ const struct my_option *opt MY_ATTRIBUTE((unused)),
char *argument)
{
switch(optid) {
my_bool
my_set_command_get_one_option(int optid,
- const struct my_option *opt __attribute__((unused)),
+ const struct my_option *opt MY_ATTRIBUTE((unused)),
char *argument)
{
switch(optid) {
my_bool
my_remove_command_get_one_option(int optid,
- const struct my_option *opt __attribute__((unused)),
+ const struct my_option *opt MY_ATTRIBUTE((unused)),
char *argument)
{
switch(optid) {
my_bool
my_print_command_get_one_option(int optid,
- const struct my_option *opt __attribute__((unused)),
+ const struct my_option *opt MY_ATTRIBUTE((unused)),
char *argument)
{
switch(optid) {
my_bool
my_reset_command_get_one_option(int optid,
- const struct my_option *opt __attribute__((unused)),
+ const struct my_option *opt MY_ATTRIBUTE((unused)),
char *argument)
{
switch(optid) {
/*
- Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
+ Copyright (c) 2011, 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
static void usage(void)
{
PRINT_VERSION;
- puts("Copyright (c) 2011, 2015, Oracle and/or its affiliates. "
+ puts("Copyright (c) 2011, 2016, Oracle and/or its affiliates. "
"All rights reserved.\n");
puts("Enable or disable plugins.");
printf("\nUsage: %s [options] <plugin> ENABLE|DISABLE\n\nOptions:\n",
static my_bool
get_one_option(int optid,
- const struct my_option *opt __attribute__((unused)),
+ const struct my_option *opt MY_ATTRIBUTE((unused)),
char *argument)
{
switch(optid) {
static const char *load_default_groups[]= { "mysqladmin","client",0 };
my_bool
-get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
+get_one_option(int optid, const struct my_option *opt MY_ATTRIBUTE((unused)),
char *argument)
{
int error = 0;
}
-sig_handler endprog(int signal_number __attribute__((unused)))
+sig_handler endprog(int signal_number MY_ATTRIBUTE((unused)))
{
interrupted=1;
}
int offset= sprintf(buffer, "ALTER USER USER() IDENTIFIED BY '");
int length= (int)mysql_real_escape_string(mysql, buffer + offset,
- typed_password,
+ typed_password, (ulong)
strlen(typed_password));
if (length == -1)
{
/* 3.rd argument, uint row, is not in use. Don't remove! */
static void print_row(MYSQL_RES *result, MYSQL_ROW cur,
- uint row __attribute__((unused)))
+ uint row MY_ATTRIBUTE((unused)))
{
uint i,length;
MYSQL_FIELD *field;
}
-static void print_relative_row_vert(MYSQL_RES *result __attribute__((unused)),
+static void print_relative_row_vert(MYSQL_RES *result MY_ATTRIBUTE((unused)),
MYSQL_ROW cur,
- uint row __attribute__((unused)))
+ uint row MY_ATTRIBUTE((unused)))
{
uint length;
ulonglong tmp;
/*
- Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
+ Copyright (c) 2000, 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
extern "C" my_bool
-get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
+get_one_option(int optid, const struct my_option *opt MY_ATTRIBUTE((unused)),
char *argument)
{
bool tty_password=0;
*/
static Exit_status safe_connect()
{
+ /*
+ A possible old connection's resources are reclaimed now
+ at new connect attempt. The final safe_connect resources
+ are mysql_closed at the end of program, explicitly.
+ */
+ mysql_close(mysql);
mysql= mysql_init(NULL);
if (!mysql)
static int process_all_tables_in_db(char *database);
static int process_one_db(char *database);
static int use_db(char *database);
-static int handle_request_for_tables(char *tables, uint length);
+static int handle_request_for_tables(char *tables, size_t length);
static int dbConnect(char *host, char *user,char *passwd);
static void dbDisconnect(char *host);
static void DBerror(MYSQL *mysql, const char *when);
static void safe_exit(int error);
static void print_result();
-static uint fixed_name_length(const char *name);
+static size_t fixed_name_length(const char *name);
static char *fix_table_name(char *dest, char *src);
int what_to_do = 0;
static my_bool
-get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
+get_one_option(int optid, const struct my_option *opt MY_ATTRIBUTE((unused)),
char *argument)
{
int orig_what_to_do= what_to_do;
*end++= ',';
}
*--end = 0;
- handle_request_for_tables(table_names_comma_sep + 1, (uint) (tot_length - 1));
+ handle_request_for_tables(table_names_comma_sep + 1, tot_length - 1);
my_free(table_names_comma_sep);
}
else
} /* process_selected_tables */
-static uint fixed_name_length(const char *name)
+static size_t fixed_name_length(const char *name)
{
const char *p;
- uint extra_length= 2; /* count the first/last backticks */
+ size_t extra_length= 2; /* count the first/last backticks */
for (p= name; *p; p++)
{
else if (*p == '.')
extra_length+= 2;
}
- return (uint) ((p - name) + extra_length);
+ return (size_t) ((p - name) + extra_length);
}
*/
char *tables, *end;
- uint tot_length = 0;
+ size_t tot_length = 0;
while ((row = mysql_fetch_row(res)))
tot_length+= fixed_name_length(row[0]) + 2;
int rc= 0;
if (strncmp(name, "#mysql50#", 9))
return 1;
- sprintf(qbuf, "RENAME TABLE `%s` TO `%s`", name, name + 9);
+ my_snprintf(qbuf, sizeof(qbuf), "RENAME TABLE `%s` TO `%s`",
+ name, name + 9);
+
rc= run_query(qbuf);
if (verbose)
printf("%-50s %s\n", name, rc ? "FAILED" : "OK");
int rc= 0;
if (strncmp(name, "#mysql50#", 9))
return 1;
- sprintf(qbuf, "ALTER DATABASE `%s` UPGRADE DATA DIRECTORY NAME", name);
+ my_snprintf(qbuf, sizeof(qbuf), "ALTER DATABASE `%s` UPGRADE DATA DIRECTORY "
+ "NAME", name);
rc= run_query(qbuf);
if (verbose)
printf("%-50s %s\n", name, rc ? "FAILED" : "OK");
ptr= strmov(query, "ALTER TABLE ");
ptr= fix_table_name(ptr, name);
ptr= strxmov(ptr, " FORCE", NullS);
- if (mysql_real_query(sock, query, (uint)(ptr - query)))
+ if (mysql_real_query(sock, query, (ulong)(ptr - query)))
{
fprintf(stderr, "Failed to %s\n", query);
fprintf(stderr, "Error: %s\n", mysql_error(sock));
return run_query(stmt);
}
-static int handle_request_for_tables(char *tables, uint length)
+static int handle_request_for_tables(char *tables, size_t length)
{
char *query, *end, options[100], message[100];
- uint query_length= 0;
+ size_t query_length= 0, query_size= sizeof(char)*(length+110);
const char *op = 0;
options[0] = 0;
return fix_table_storage_name(tables);
}
- if (!(query =(char *) my_malloc((sizeof(char)*(length+110)), MYF(MY_WME))))
+ if (!(query =(char *) my_malloc(query_size, MYF(MY_WME))))
+ {
return 1;
+ }
if (opt_all_in_1)
{
+ DBUG_ASSERT(strlen(op)+strlen(tables)+strlen(options)+8+1 <= query_size);
+
/* No backticks here as we added them before */
query_length= sprintf(query, "%s TABLE %s %s", op, tables, options);
}
ptr= strmov(strmov(query, op), " TABLE ");
ptr= fix_table_name(ptr, tables);
ptr= strxmov(ptr, " ", options, NullS);
- query_length= (uint) (ptr - query);
+ query_length= (size_t) (ptr - query);
}
if (mysql_real_query(sock, query, query_length))
{
prev_alter[0]= 0;
}
else
- strcpy(prev_alter, alter_txt);
+ {
+ strncpy(prev_alter, alter_txt, MAX_ALTER_STR_SIZE-1);
+ prev_alter[MAX_ALTER_STR_SIZE-1]= 0;
+ }
}
}
}
process_databases(argv);
if (opt_auto_repair)
{
- uint i;
+ size_t i;
if (!opt_silent && (tables4repair.elements || tables4rebuild.elements))
puts("\nRepairing tables");
static void add_load_option(DYNAMIC_STRING *str, const char *option,
const char *option_value);
-static ulong find_set(TYPELIB *lib, const char *x, uint length,
+static ulong find_set(TYPELIB *lib, const char *x, size_t length,
char **err_pos, uint *err_len);
static char *alloc_query_str(ulong size);
uchar* get_table_key(const char *entry, size_t *length,
- my_bool not_used __attribute__((unused)))
+ my_bool not_used MY_ATTRIBUTE((unused)))
{
*length= strlen(entry);
return (uchar*) entry;
static my_bool
-get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
+get_one_option(int optid, const struct my_option *opt MY_ATTRIBUTE((unused)),
char *argument)
{
switch (optid) {
opt_set_charset= 0;
opt_compatible_mode_str= argument;
opt_compatible_mode= find_set(&compatible_mode_typelib,
- argument, (uint) strlen(argument),
+ argument, strlen(argument),
&err_ptr, &err_len);
if (err_len)
{
}
#if !defined(DBUG_OFF)
{
- uint size_for_sql_mode= 0;
+ size_t size_for_sql_mode= 0;
const char **ptr;
for (ptr= compatible_mode_names; *ptr; ptr++)
size_for_sql_mode+= strlen(*ptr);
break;
}
- strncpy(db_cl_name, db_cl_row[0], db_cl_size);
- db_cl_name[db_cl_size - 1]= 0; /* just in case. */
+ strncpy(db_cl_name, db_cl_row[0], db_cl_size-1);
+ db_cl_name[db_cl_size - 1]= 0;
} while (FALSE);
static char *my_case_str(const char *str,
- uint str_len,
+ size_t str_len,
const char *token,
uint token_len)
{
*/
static char *cover_definer_clause(const char *stmt_str,
- uint stmt_length,
+ size_t stmt_length,
const char *definer_version_str,
uint definer_version_length,
const char *stmt_version_str,
} /* dbDisconnect */
-static void unescape(FILE *file,char *pos,uint length)
+static void unescape(FILE *file,char *pos, size_t length)
{
char *tmp;
DBUG_ENTER("unescape");
if (!(tmp=(char*) my_malloc(length*2+1, MYF(MY_WME))))
die(EX_MYSQLERR, "Couldn't allocate memory");
- mysql_real_escape_string(&mysql_connection, tmp, pos, length);
+ mysql_real_escape_string(&mysql_connection, tmp, pos, (ulong)length);
fputc('\'', file);
fputs(tmp, file);
fputc('\'', file);
Quote '<' '>' '&' '\"' chars and print a string to the xml_file.
*/
-static void print_quoted_xml(FILE *xml_file, const char *str, ulong len,
+static void print_quoted_xml(FILE *xml_file, const char *str, size_t len,
my_bool is_attribute_name)
{
const char *end;
const char *str_create)
{
uint i;
- my_bool body_found __attribute__((unused)) = 0;
+ my_bool body_found MY_ATTRIBUTE((unused)) = 0;
char *create_stmt_ptr= NULL;
ulong create_stmt_len= 0;
MYSQL_FIELD *field;
squeezed to a single hyphen.
*/
-static void print_xml_comment(FILE *xml_file, ulong len,
+static void print_xml_comment(FILE *xml_file, size_t len,
const char *comment_string)
{
const char* end;
DBUG_ENTER("dump_events_for_db");
DBUG_PRINT("enter", ("db: '%s'", db));
- mysql_real_escape_string(mysql, db_name_buff, db, strlen(db));
+ mysql_real_escape_string(mysql, db_name_buff, db, (ulong)strlen(db));
/* nice comments */
print_comment(sql_file, 0,
(const char *) (query_str != NULL ? query_str : row[3]),
(const char *) delimiter);
+ if(query_str)
+ {
+ my_free(query_str);
+ query_str= NULL;
+ }
restore_time_zone(sql_file, delimiter);
restore_sql_mode(sql_file, delimiter);
DBUG_ENTER("dump_routines_for_db");
DBUG_PRINT("enter", ("db: '%s'", db));
- mysql_real_escape_string(mysql, db_name_buff, db, strlen(db));
+ mysql_real_escape_string(mysql, db_name_buff, db, (ulong)strlen(db));
/* nice comments */
print_comment(sql_file, 0,
if the user has EXECUTE privilege he see routine names, but NOT the
routine body of other routines that are not the creator of!
*/
- DBUG_PRINT("info",("length of body for %s row[2] '%s' is %d",
+ DBUG_PRINT("info",("length of body for %s row[2] '%s' is %zu",
routine_name, row[2] ? row[2] : "(null)",
- row[2] ? (int) strlen(row[2]) : 0));
+ row[2] ? strlen(row[2]) : 0));
if (row[2] == NULL)
{
print_comment(sql_file, 1, "\n-- insufficient privileges to %s\n",
int i;
char name_buff[NAME_LEN*2+3];
- mysql_real_escape_string(mysql, name_buff, db, strlen(db));
+ mysql_real_escape_string(mysql, name_buff, db, (ulong)strlen(db));
init_dynamic_string_checked(&where, " AND TABLESPACE_NAME IN ("
"SELECT DISTINCT TABLESPACE_NAME FROM"
for (i=0 ; i<tables ; i++)
{
mysql_real_escape_string(mysql, name_buff,
- table_names[i], strlen(table_names[i]));
+ table_names[i], (ulong)strlen(table_names[i]));
dynstr_append_checked(&where, "'");
dynstr_append_checked(&where, name_buff);
{
char db_name_buff[NAME_LEN*2+3];
mysql_real_escape_string(mysql, db_name_buff,
- databases[i], strlen(databases[i]));
+ databases[i], (ulong)strlen(databases[i]));
dynstr_append_checked(&where, "'");
dynstr_append_checked(&where, db_name_buff);
dynstr_append_checked(&where, "',");
0 Success.
1 Failure.
*/
-int init_dumping_views(char *qdatabase __attribute__((unused)))
+int init_dumping_views(char *qdatabase MY_ATTRIBUTE((unused)))
{
return 0;
} /* init_dumping_views */
}
-static ulong find_set(TYPELIB *lib, const char *x, uint length,
+static ulong find_set(TYPELIB *lib, const char *x, size_t length,
char **err_pos, uint *err_len)
{
const char *end= x + length;
fputc(' ',file);
fputs(prefix, file);
if (string_value)
- unescape(file,row[0],(uint) strlen(row[0]));
+ unescape(file,row[0], strlen(row[0]));
else
fputs(row[0], file);
check_io(file);
verbose_msg("-- Retrieving view structure for table %s...\n", table);
#ifdef NOT_REALLY_USED_YET
- sprintf(insert_pat,"SET SQL_QUOTE_SHOW_CREATE=%d",
- (opt_quoted || opt_keywords));
+ dynstr_append_checked(&insert_pat, "SET SQL_QUOTE_SHOW_CREATE=");
+ dynstr_append_checked(&insert_pat, (opt_quoted || opt_keywords)? "1":"0");
#endif
result_table= quote_name(table, table_buff, 1);
if (flush_logs || opt_delete_master_logs)
{
if (mysql_refresh(mysql, REFRESH_LOG))
+ {
+ DB_error(mysql, "when doing refresh");
goto err;
+ }
verbose_msg("-- main : logs flushed successfully!\n");
}
/* Global Thread counter */
uint counter;
+pthread_mutex_t init_mutex;
pthread_mutex_t counter_mutex;
pthread_cond_t count_threshhold;
static my_bool
-get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
+get_one_option(int optid, const struct my_option *opt MY_ATTRIBUTE((unused)),
char *argument)
{
switch(optid) {
MYSQL *mysql;
if (verbose)
fprintf(stdout, "Connecting to %s\n", host ? host : "localhost");
- if (!(mysql= mysql_init(NULL)))
- return 0;
+ if (opt_use_threads && !lock_tables)
+ {
+ pthread_mutex_lock(&init_mutex);
+ if (!(mysql= mysql_init(NULL)))
+ {
+ pthread_mutex_unlock(&init_mutex);
+ return 0;
+ }
+ pthread_mutex_unlock(&init_mutex);
+ }
+ else
+ if (!(mysql= mysql_init(NULL)))
+ return 0;
if (opt_compress)
mysql_options(mysql,MYSQL_OPT_COMPRESS,NullS);
if (opt_local_file)
pthread_cond_signal(&count_threshhold);
pthread_mutex_unlock(&counter_mutex);
mysql_thread_end();
-
+ pthread_exit(0);
return 0;
}
if (opt_use_threads && !lock_tables)
{
- pthread_t mainthread; /* Thread descriptor */
- pthread_attr_t attr; /* Thread attributes */
+ char **save_argv;
+ uint worker_thread_count= 0, table_count= 0, i= 0;
+ pthread_t *worker_threads; /* Thread descriptor */
+ pthread_attr_t attr; /* Thread attributes */
pthread_attr_init(&attr);
pthread_attr_setdetachstate(&attr,
- PTHREAD_CREATE_DETACHED);
+ PTHREAD_CREATE_JOINABLE);
+ pthread_mutex_init(&init_mutex, NULL);
pthread_mutex_init(&counter_mutex, NULL);
pthread_cond_init(&count_threshhold, NULL);
+ /* Count the number of tables. This number denotes the total number
+ of threads spawn.
+ */
+ save_argv= argv;
+ for (table_count= 0; *argv != NULL; argv++)
+ table_count++;
+ argv= save_argv;
+
+ if (!(worker_threads= (pthread_t*) my_malloc(table_count *
+ sizeof(*worker_threads),
+ MYF(0))))
+ return -2;
+
for (counter= 0; *argv != NULL; argv++) /* Loop through tables */
{
pthread_mutex_lock(&counter_mutex);
counter++;
pthread_mutex_unlock(&counter_mutex);
/* now create the thread */
- if (pthread_create(&mainthread, &attr, worker_thread,
- (void *)*argv) != 0)
+ if (pthread_create(&worker_threads[worker_thread_count], &attr,
+ worker_thread, (void *)*argv) != 0)
{
pthread_mutex_lock(&counter_mutex);
counter--;
pthread_mutex_unlock(&counter_mutex);
- fprintf(stderr,"%s: Could not create thread\n",
- my_progname);
+ fprintf(stderr,"%s: Could not create thread\n", my_progname);
+ continue;
}
+ worker_thread_count++;
}
/*
pthread_cond_timedwait(&count_threshhold, &counter_mutex, &abstime);
}
pthread_mutex_unlock(&counter_mutex);
+ pthread_mutex_destroy(&init_mutex);
pthread_mutex_destroy(&counter_mutex);
pthread_cond_destroy(&count_threshhold);
pthread_attr_destroy(&attr);
+
+ for(i= 0; i < worker_thread_count; i++)
+ {
+ if (pthread_join(worker_threads[i], NULL))
+ fprintf(stderr,"%s: Could not join worker thread.\n", my_progname);
+ }
+
+ my_free(worker_threads);
}
else
{
static int list_table_status(MYSQL *mysql,const char *db,const char *table);
static int list_fields(MYSQL *mysql,const char *db,const char *table,
const char *field);
-static void print_header(const char *header,uint head_length,...);
-static void print_row(const char *header,uint head_length,...);
-static void print_trailer(uint length,...);
+static void print_header(const char *header,size_t head_length,...);
+static void print_row(const char *header,size_t head_length,...);
+static void print_trailer(size_t length,...);
static void print_res_header(MYSQL_RES *result);
static void print_res_top(MYSQL_RES *result);
static void print_res_row(MYSQL_RES *result,MYSQL_ROW cur);
static my_bool
-get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
+get_one_option(int optid, const struct my_option *opt MY_ATTRIBUTE((unused)),
char *argument)
{
switch(optid) {
list_dbs(MYSQL *mysql,const char *wild)
{
const char *header;
- uint length, counter = 0;
+ size_t length = 0;
+ uint counter = 0;
ulong rowcount = 0L;
char tables[NAME_LEN+1], rows[NAME_LEN+1];
char query[NAME_LEN + 100];
printf("Wildcard: %s\n",wild);
header="Databases";
- length=(uint) strlen(header);
+ length= strlen(header);
field=mysql_fetch_field(result);
if (length < field->max_length)
length=field->max_length;
list_tables(MYSQL *mysql,const char *db,const char *table)
{
const char *header;
- uint head_length, counter = 0;
+ size_t head_length;
+ uint counter = 0;
char query[NAME_LEN + 100], rows[NAME_LEN], fields[16];
MYSQL_FIELD *field;
MYSQL_RES *result;
putchar('\n');
header="Tables";
- head_length=(uint) strlen(header);
+ head_length= strlen(header);
field=mysql_fetch_field(result);
if (head_length < field->max_length)
head_length=field->max_length;
len= sizeof(query);
len-= my_snprintf(query, len, "show table status from `%s`", db);
if (wild && wild[0] && len)
- strxnmov(query + strlen(query), len, " like '", wild, "'", NullS);
+ strxnmov(query + strlen(query), len - 1, " like '", wild, "'", NullS);
if (mysql_query(mysql,query) || !(result=mysql_store_result(mysql)))
{
fprintf(stderr,"%s: Cannot get status for db: %s, table: %s: %s\n",
const char *wild)
{
char query[NAME_LEN + 100];
- int len;
+ size_t len;
MYSQL_RES *result;
MYSQL_ROW row;
ulong UNINIT_VAR(rows);
len-= my_snprintf(query, len, "show /*!32332 FULL */ columns from `%s`",
table);
if (wild && wild[0] && len)
- strxnmov(query + strlen(query), len, " like '", wild, "'", NullS);
+ strxnmov(query + strlen(query), len - 1, " like '", wild, "'", NullS);
if (mysql_query(mysql,query) || !(result=mysql_store_result(mysql)))
{
fprintf(stderr,"%s: Cannot list columns in db: %s, table: %s: %s\n",
*****************************************************************************/
static void
-print_header(const char *header,uint head_length,...)
+print_header(const char *header,size_t head_length,...)
{
va_list args;
- uint length,i,str_length,pre_space;
+ size_t length,i,str_length,pre_space;
const char *field;
va_start(args,head_length);
putchar('|');
for (;;)
{
- str_length=(uint) strlen(field);
+ str_length= strlen(field);
if (str_length > length)
str_length=length+1;
- pre_space=(uint) (((int) length-(int) str_length)/2)+1;
+ pre_space= ((length- str_length)/2)+1;
for (i=0 ; i < pre_space ; i++)
putchar(' ');
for (i = 0 ; i < str_length ; i++)
static void
-print_row(const char *header,uint head_length,...)
+print_row(const char *header,size_t head_length,...)
{
va_list args;
const char *field;
- uint i,length,field_length;
+ size_t i,length,field_length;
va_start(args,head_length);
field=header; length=head_length;
putchar('|');
putchar(' ');
fputs(field,stdout);
- field_length=(uint) strlen(field);
+ field_length= strlen(field);
for (i=field_length ; i <= length ; i++)
putchar(' ');
if (!(field=va_arg(args,char *)))
static void
-print_trailer(uint head_length,...)
+print_trailer(size_t head_length,...)
{
va_list args;
- uint length,i;
+ size_t length,i;
va_start(args,head_length);
length=head_length;
mysql_field_seek(result,0);
while((field = mysql_fetch_field(result)))
{
- if ((length=(uint) strlen(field->name)) > field->max_length)
+ if ((length= strlen(field->name)) > field->max_length)
field->max_length=length;
else
length=field->max_length;
static my_bool
-get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
+get_one_option(int optid, const struct my_option *opt MY_ATTRIBUTE((unused)),
char *argument)
{
DBUG_ENTER("get_one_option");
void replace_strings_append(struct st_replace *rep, DYNAMIC_STRING* ds,
const char *from, int len);
-static void cleanup_and_exit(int exit_code) __attribute__((noreturn));
+static void cleanup_and_exit(int exit_code) MY_ATTRIBUTE((noreturn));
void die(const char *fmt, ...)
- ATTRIBUTE_FORMAT(printf, 1, 2) __attribute__((noreturn));
+ ATTRIBUTE_FORMAT(printf, 1, 2) MY_ATTRIBUTE((noreturn));
void abort_not_supported_test(const char *fmt, ...)
- ATTRIBUTE_FORMAT(printf, 1, 2) __attribute__((noreturn));
+ ATTRIBUTE_FORMAT(printf, 1, 2) MY_ATTRIBUTE((noreturn));
void verbose_msg(const char *fmt, ...)
ATTRIBUTE_FORMAT(printf, 1, 2);
void log_msg(const char *fmt, ...)
C_MODE_START
static uchar *get_var_key(const uchar* var, size_t *len,
- my_bool __attribute__((unused)) t)
+ my_bool MY_ATTRIBUTE((unused)) t)
{
register char* key;
key = ((VAR*)var)->name;
init_dynamic_string(&ds_query, 0, (end - query) + 32, 256);
do_eval(&ds_query, query, end, FALSE);
- if (mysql_real_query(mysql, ds_query.str, ds_query.length))
+ if (mysql_real_query(mysql, ds_query.str, ds_query.length) || !(res= mysql_store_result(mysql)))
{
handle_error (curr_command, mysql_errno(mysql), mysql_error(mysql),
mysql_sqlstate(mysql), &ds_res);
DBUG_VOID_RETURN;
}
- if (!(res= mysql_store_result(mysql)))
- die("Query '%s' didn't return a result set", ds_query.str);
dynstr_free(&ds_query);
if ((row= mysql_fetch_row(res)) && row[0])
}
-void do_wait_for_slave_to_stop(struct st_command *c __attribute__((unused)))
+void do_wait_for_slave_to_stop(struct st_command *c MY_ATTRIBUTE((unused)))
{
static int SLAVE_POLL_INTERVAL= 300000;
MYSQL* mysql = &cur_con->mysql;
*/
-void mark_progress(struct st_command* command __attribute__((unused)),
+void mark_progress(struct st_command* command MY_ATTRIBUTE((unused)),
int line)
{
static ulonglong progress_start= 0; // < Beware
void replace_strings_append(REPLACE *rep, DYNAMIC_STRING* ds,
const char *str,
- int len __attribute__((unused)))
+ int len MY_ATTRIBUTE((unused)))
{
reg1 REPLACE *rep_pos;
reg2 REPLACE_STRING *rep_str;
-# Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2012, 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
SET(SUNPRO_CXX_LIBRARY "stlport4" CACHE STRING
"What C++ library to use. The server needs stlport4. It is possible to build the client libraries with -DWITHOUT_SERVER=1 -DSUNPRO_CXX_LIBRARY=Cstd")
- MESSAGE(STATUS "SUNPRO_CXX_LIBRARY ${SUNPRO_CXX_LIBRARY}")
-
IF(CMAKE_SYSTEM_PROCESSOR MATCHES "i386")
SET(COMMON_C_FLAGS "-g -mt -fsimple=1 -ftrap=%none -nofstore -xbuiltin=%all -xlibmil -xlibmopt -xtarget=generic")
- SET(COMMON_CXX_FLAGS "-g0 -mt -fsimple=1 -ftrap=%none -nofstore -xbuiltin=%all -xlibmil -xlibmopt -xtarget=generic -library=${SUNPRO_CXX_LIBRARY}")
+ SET(COMMON_CXX_FLAGS "-g0 -mt -fsimple=1 -ftrap=%none -nofstore -xbuiltin=%all -xlibmil -xlibmopt -xtarget=generic")
# We have to specify "-xO1" for DEBUG flags here,
# see http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6879978
SET(CMAKE_C_FLAGS_DEBUG "-xO1 ${COMMON_C_FLAGS}")
ENDIF()
ELSE()
# Assume !x86 is SPARC
- SET(COMMON_C_FLAGS "-g -Xa -xstrconst -mt")
- SET(COMMON_CXX_FLAGS "-g0 -mt -library=${SUNPRO_CXX_LIBRARY}")
+ SET(COMMON_C_FLAGS "-g -xstrconst -mt")
+ SET(COMMON_CXX_FLAGS "-g0 -mt")
IF(32BIT)
SET(COMMON_C_FLAGS "${COMMON_C_FLAGS} -xarch=sparc")
SET(COMMON_CXX_FLAGS "${COMMON_CXX_FLAGS} -xarch=sparc")
# so WSREP_VERSION is produced regardless
# Set the patch version
-SET(WSREP_PATCH_VERSION "15")
+SET(WSREP_PATCH_VERSION "17")
# Obtain patch revision number
SET(WSREP_REVISION $ENV{WSREP_REV})
# The default C++ library for SunPro is really old, and not standards compliant.
# http://www.oracle.com/technetwork/server-storage/solaris10/cmp-stlport-libcstd-142559.html
-# Use stlport rather than Rogue Wave.
+# Use stlport rather than Rogue Wave,
+# unless otherwise specified on command line.
IF(CMAKE_SYSTEM_NAME MATCHES "SunOS")
IF(CMAKE_CXX_COMPILER_ID MATCHES "SunPro")
- IF(SUNPRO_CXX_LIBRARY)
- SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -library=${SUNPRO_CXX_LIBRARY}")
- IF(SUNPRO_CXX_LIBRARY STREQUAL "stdcxx4")
- ADD_DEFINITIONS(-D__MATHERR_RENAME_EXCEPTION)
- SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -template=extdef")
- ENDIF()
+ IF(CMAKE_CXX_FLAGS MATCHES "-std=")
+ ADD_DEFINITIONS(-D__MATHERR_RENAME_EXCEPTION)
+ SET(CMAKE_SHARED_LIBRARY_C_FLAGS
+ "${CMAKE_SHARED_LIBRARY_C_FLAGS} -lc")
+ SET(CMAKE_SHARED_LIBRARY_CXX_FLAGS
+ "${CMAKE_SHARED_LIBRARY_CXX_FLAGS} -lstdc++ -lgcc_s -lCrunG3 -lc")
+ SET(QUOTED_CMAKE_CXX_LINK_FLAGS "-lstdc++ -lgcc_s -lCrunG3 -lc")
ELSE()
- SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -library=stlport4")
+ IF(SUNPRO_CXX_LIBRARY)
+ SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -library=${SUNPRO_CXX_LIBRARY}")
+ IF(SUNPRO_CXX_LIBRARY STREQUAL "stdcxx4")
+ ADD_DEFINITIONS(-D__MATHERR_RENAME_EXCEPTION)
+ SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -template=extdef")
+ ENDIF()
+ ELSE()
+ SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -library=stlport4")
+ ENDIF()
ENDIF()
ENDIF()
ENDIF()
GET_FILENAME_COMPONENT(CXX_REALPATH ${CMAKE_CXX_COMPILER} REALPATH)
# CC -V yields
+ # CC: Studio 12.5 Sun C++ 5.14 SunOS_sparc Dodona 2016/04/04
# CC: Sun C++ 5.13 SunOS_sparc Beta 2014/03/11
# CC: Sun C++ 5.11 SunOS_sparc 2010/08/13
ENDIF()
STRING(REGEX MATCH "CC: Sun C\\+\\+ 5\\.([0-9]+)" VERSION_STRING ${stderr})
+ IF (NOT CMAKE_MATCH_1 OR CMAKE_MATCH_1 STREQUAL "")
+ STRING(REGEX MATCH "CC: Studio 12\\.5 Sun C\\+\\+ 5\\.([0-9]+)"
+ VERSION_STRING ${stderr})
+ ENDIF()
SET(CC_MINOR_VERSION ${CMAKE_MATCH_1})
- IF(${CC_MINOR_VERSION} EQUAL 13)
+ IF(${CC_MINOR_VERSION} GREATER 12)
SET(STLPORT_SUFFIX "lib/compilers/stlport4")
IF(SIZEOF_VOIDP EQUAL 8 AND CMAKE_SYSTEM_PROCESSOR MATCHES "sparc")
SET(STLPORT_SUFFIX "lib/compilers/stlport4/sparcv9")
DBUG_EVALUATE_IF("evaluate_if", "ON", "OFF"));
DBUG_EXECUTE_IF("pop", DBUG_POP(); );
{
- char s[1000] __attribute__((unused));
+ char s[1000] MY_ATTRIBUTE((unused));
DBUG_EXPLAIN(s, sizeof(s)-1);
DBUG_PRINT("explain", ("dbug explained: %s", s));
}
/*
- Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
+ Copyright (c) 2000, 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
static my_bool
-get_one_option(int optid, const struct my_option *opt __attribute__ ((unused)),
- char *argument __attribute__ ((unused)))
+get_one_option(int optid, const struct my_option *opt MY_ATTRIBUTE ((unused)),
+ char *argument MY_ATTRIBUTE ((unused)))
{
DBUG_ENTER("get_one_option");
switch (optid) {
/*
- Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
+ Copyright (c) 2005, 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
innochecksum_get_one_option(
/*========================*/
int optid,
- const struct my_option *opt __attribute__((unused)),
- char *argument __attribute__((unused)))
+ const struct my_option *opt MY_ATTRIBUTE((unused)),
+ char *argument MY_ATTRIBUTE((unused)))
{
switch (optid) {
case 'd':
/*
- Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
+ Copyright (c) 2000, 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
static my_bool
-get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
- char *argument __attribute__((unused)))
+get_one_option(int optid, const struct my_option *opt MY_ATTRIBUTE((unused)),
+ char *argument MY_ATTRIBUTE((unused)))
{
switch (optid) {
case 'c':
org_argv= argv;
args_used= get_defaults_options(argc, argv, &defaults, &extra_defaults,
- &group_suffix, &login_path);
+ &group_suffix, &login_path, FALSE);
/* Copy defaults-xxx arguments & program name */
count=args_used+1;
-/* Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2003, 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
};
static my_bool
-get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
- char *argument __attribute__((unused)))
+get_one_option(int optid, const struct my_option *opt MY_ATTRIBUTE((unused)),
+ char *argument MY_ATTRIBUTE((unused)))
{
switch(optid) {
case 'V':
/*
- Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
+ Copyright (c) 2000, 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
static my_bool
-get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
- char *argument __attribute__((unused)))
+get_one_option(int optid, const struct my_option *opt MY_ATTRIBUTE((unused)),
+ char *argument MY_ATTRIBUTE((unused)))
{
switch (optid) {
case 's':
-/* Copyright (c) 2001, 2015, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2001, 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
static std::vector<sym_entry> sym_table;
static FILE* fp_dump, *fp_sym = 0, *fp_out;
static void die(const char* fmt, ...)
- __attribute__((noreturn)) __attribute__((format(printf, 1, 2)));
+ MY_ATTRIBUTE((noreturn)) MY_ATTRIBUTE((format(printf, 1, 2)));
static struct my_option my_long_options[] =
{
static my_bool
-get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
- char *argument __attribute__((unused)))
+get_one_option(int optid, const struct my_option *opt MY_ATTRIBUTE((unused)),
+ char *argument MY_ATTRIBUTE((unused)))
{
switch(optid) {
case 'V':
-/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2000, 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
static my_bool
-get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
- char *argument __attribute__((unused)))
+get_one_option(int optid, const struct my_option *opt MY_ATTRIBUTE((unused)),
+ char *argument MY_ATTRIBUTE((unused)))
{
switch (optid) {
case 'V': print_version(); exit(0);
/*
- Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
+ Copyright (c) 2000, 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
time_t clicks = time(0);
char timeStr[32];
+ memset(timeStr, 0, sizeof(timeStr));
// get rid of newline
strncpy(timeStr, ctime(&clicks), sizeof(timeStr));
unsigned int len = strlen(timeStr);
-# Copyright (c) 2006, 2014, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2006, 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
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+INCLUDE(${MYSQL_CMAKE_SCRIPT_DIR}/compile_flags.cmake)
+
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/extra/yassl/taocrypt/mySTL
${CMAKE_SOURCE_DIR}/extra/yassl/taocrypt/include)
include/random.hpp include/ripemd.hpp include/rsa.hpp include/sha.hpp
include/rabbit.hpp include/hc128.hpp)
+# Segfaults with SIGILL at high optimization levels in:
+# ModularArithmetic::SimultaneousExponentiate
+IF(CMAKE_CXX_COMPILER_ID MATCHES "SunPro")
+ IF(CMAKE_CXX_FLAGS MATCHES "-std=")
+ ADD_COMPILE_FLAGS(src/integer.cpp COMPILE_FLAGS "-xO1")
+ ENDIF()
+ENDIF()
+
IF(HAVE_EXPLICIT_TEMPLATE_INSTANTIATION)
SET(TAOCRYPT_SOURCES ${TAOCRYPT_SOURCES} src/template_instnt.cpp)
ENDIF()
#ifndef ATOMIC_NOLOCK_INCLUDED
#define ATOMIC_NOLOCK_INCLUDED
-/* Copyright (c) 2006, 2014, Oracle and/or its affiliates. All rights reserved. reserved.
+/* Copyright (c) 2006, 2016, Oracle and/or its affiliates. All rights reserved. reserved.
reserved.
This program is free software; you can redistribute it and/or modify
Type not used so minimal size (emptry struct has different size between C
and C++, zero-length array is gcc-specific).
*/
-typedef char my_atomic_rwlock_t __attribute__ ((unused));
+typedef char my_atomic_rwlock_t MY_ATTRIBUTE ((unused));
#define my_atomic_rwlock_destroy(name)
#define my_atomic_rwlock_init(name)
#define my_atomic_rwlock_rdlock(name)
-/* Copyright (c) 2007, 2015, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2007, 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
#if defined(__GNUC__) && defined(MY_LF_EXTRA_DEBUG)
#define LF_REQUIRE_PINS(N) \
static const char require_pins[LF_PINBOX_PINS-N] \
- __attribute__ ((unused)); \
+ MY_ATTRIBUTE ((unused)); \
static const int LF_NUM_PINS_IN_THIS_FILE= N;
#define _lf_pin(PINS, PIN, ADDR) \
( \
-/* Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2000, 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
const char *wildstr,const char *wildend,
int escape, int w_one, int w_many);
-int my_strcasecmp_mb_bin(const CHARSET_INFO * cs __attribute__((unused)),
+int my_strcasecmp_mb_bin(const CHARSET_INFO * cs MY_ATTRIBUTE((unused)),
const char *s, const char *t);
-void my_hash_sort_mb_bin(const CHARSET_INFO *cs __attribute__((unused)),
+void my_hash_sort_mb_bin(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)),
const uchar *key, size_t len,ulong *nr1, ulong *nr2);
size_t my_strnxfrm_mb(const CHARSET_INFO *,
#ifndef MY_ATOMIC_INCLUDED
#define MY_ATOMIC_INCLUDED
-/* Copyright (c) 2006, 2012, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2006, 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
typedef union { \
int ## S i; \
uint ## S u; \
- } U_ ## S __attribute__ ((transparent_union)); \
+ } U_ ## S MY_ATTRIBUTE ((transparent_union)); \
typedef union { \
int ## S volatile *i; \
uint ## S volatile *u; \
- } Uv_ ## S __attribute__ ((transparent_union));
+ } Uv_ ## S MY_ATTRIBUTE ((transparent_union));
#define uintptr intptr
make_transparent_unions(8)
make_transparent_unions(16)
-/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2000, 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
#endif
/*
- Disable __attribute__() on gcc < 2.7, g++ < 3.4, and non-gcc compilers.
+ Disable MY_ATTRIBUTE() on g++ < 3.4, and non-gcc compilers.
Some forms of __attribute__ are actually supported in earlier versions of
g++, but we just disable them all because we only use them to generate
compilation warnings.
*/
-#ifndef __attribute__
-# if !defined(__GNUC__)
-# define __attribute__(A)
-# elif GCC_VERSION < 2008
-# define __attribute__(A)
-# elif defined(__cplusplus) && GCC_VERSION < 3004
-# define __attribute__(A)
-# endif
+#ifndef MY_ATTRIBUTE
+#if defined(__GNUC__) && GCC_VERSION > 3003
+# define MY_ATTRIBUTE(A) __attribute__(A)
+#else
+# define MY_ATTRIBUTE(A)
+#endif
#endif
/*
- __attribute__((format(...))) is only supported in gcc >= 2.8 and g++ >= 3.4
- But that's already covered by the __attribute__ tests above, so this is
+ __attribute__((format(...))) is only supported in g++ >= 3.4
+ But that's already covered by the MY_ATTRIBUTE tests above, so this is
just a convenience macro.
*/
#ifndef ATTRIBUTE_FORMAT
-# define ATTRIBUTE_FORMAT(style, m, n) __attribute__((format(style, m, n)))
+# define ATTRIBUTE_FORMAT(style, m, n) MY_ATTRIBUTE((format(style, m, n)))
#endif
-/*
-
- __attribute__((format(...))) on a function pointer is not supported
- until gcc 3.1
-*/
#ifndef ATTRIBUTE_FORMAT_FPTR
-# if (GCC_VERSION >= 3001)
# define ATTRIBUTE_FORMAT_FPTR(style, m, n) ATTRIBUTE_FORMAT(style, m, n)
-# else
-# define ATTRIBUTE_FORMAT_FPTR(style, m, n)
-# endif /* GNUC >= 3.1 */
#endif
-/* Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2012, 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
my_bool my_getopt_is_args_separator(const char* arg);
int get_defaults_options(int argc, char **argv,
char **defaults, char **extra_defaults,
- char **group_suffix, char **login_path);
+ char **group_suffix, char **login_path,
+ my_bool found_no_defaults);
int my_load_defaults(const char *conf_file, const char **groups,
int *argc, char ***argv, const char ***);
-int check_file_permissions(const char *file_name);
+int check_file_permissions(const char *file_name, my_bool is_login_file);
int load_defaults(const char *conf_file, const char **groups,
int *argc, char ***argv);
int my_search_option_files(const char *conf_file, int *argc,
char ***argv, uint *args_used,
Process_option_func func, void *func_ctx,
- const char **default_directories);
+ const char **default_directories,
+ my_bool is_login_file, my_bool found_no_defaults);
void free_defaults(char **argv);
void my_print_default_files(const char *conf_file);
void print_defaults(const char *conf_file, const char **groups);
/*
- Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved.
+ Copyright (c) 2001, 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
other reason to use them is for documentation
*/
-#if !defined(__GNUC__) || (__GNUC__ == 2 && __GNUC_MINOR__ < 96)
+#if !defined(__builtin_expect)
#define __builtin_expect(x, expected_value) (x)
#endif
#define compile_time_assert(X) \
do \
{ \
- typedef char compile_time_assert[(X) ? 1 : -1] __attribute__((unused)); \
+ typedef char compile_time_assert[(X) ? 1 : -1] MY_ATTRIBUTE((unused)); \
} while(0)
#endif
#endif
};
-extern struct st_my_thread_var *_my_thread_var(void) __attribute__ ((const));
+extern struct st_my_thread_var *_my_thread_var(void) MY_ATTRIBUTE ((const));
extern int set_mysys_var(struct st_my_thread_var *mysys_var);
extern void **my_thread_var_dbug();
extern uint my_thread_end_wait_time;
-/* Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2000, 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
#define MY_RESOLVE_LINK 128 /* my_realpath(); Only resolve links */
#define MY_HOLD_ORIGINAL_MODES 128 /* my_copy() holds to file modes */
#define MY_REDEL_MAKE_BACKUP 256
+#define MY_REDEL_NO_COPY_STAT 512 /* my_redel() doesn't call my_copystat() */
#define MY_SEEK_NOT_DONE 32 /* my_lock may have to do a seek */
#define MY_DONT_WAIT 64 /* my_lock() don't wait if can't lock */
#define MY_ZEROFILL 32 /* my_malloc(), fill array with zero */
-/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2000, 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
} TREE;
/* Functions on whole tree */
-void init_tree(TREE *tree, ulong default_alloc_size, ulong memory_limit,
+void init_tree(TREE *tree, size_t default_alloc_size, ulong memory_limit,
int size, qsort_cmp2 compare, my_bool with_delete,
tree_element_free free_element, const void *custom_arg);
void delete_tree(TREE*);
/*
- Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
+ Copyright (c) 2000, 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
int chk_key(MI_CHECK *param, MI_INFO *info);
int chk_data_link(MI_CHECK *param, MI_INFO *info,int extend);
int mi_repair(MI_CHECK *param, register MI_INFO *info,
- char * name, int rep_quick);
-int mi_sort_index(MI_CHECK *param, register MI_INFO *info, char * name);
+ char * name, int rep_quick, my_bool no_copy_stat);
+int mi_sort_index(MI_CHECK *param, register MI_INFO *info, char * name,
+ my_bool no_copy_stat);
int mi_repair_by_sort(MI_CHECK *param, register MI_INFO *info,
- const char * name, int rep_quick);
+ const char * name, int rep_quick, my_bool no_copy_stat);
int mi_repair_parallel(MI_CHECK *param, register MI_INFO *info,
- const char * name, int rep_quick);
+ const char * name, int rep_quick, my_bool no_copy_stat);
int change_to_newfile(const char * filename, const char * old_ext,
const char * new_ext, myf myflags);
int lock_file(MI_CHECK *param, File file, my_off_t start, int lock_type,
-/* Copyright (c) 2008, 2012, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2008, 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
PSI_file_info *info,
int count
#else
- const char *category __attribute__ ((unused)),
- void *info __attribute__ ((unused)),
- int count __attribute__ ((unused))
+ const char *category MY_ATTRIBUTE ((unused)),
+ void *info MY_ATTRIBUTE ((unused)),
+ int count MY_ATTRIBUTE ((unused))
#endif
)
{
-/* Copyright (c) 2010, 2012, Oracle and/or its affiliates. All rights reserved.
+/* 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
const struct sockaddr *addr,
socklen_t addr_len
#else
- MYSQL_SOCKET socket __attribute__ ((unused)),
- const struct sockaddr *addr __attribute__ ((unused)),
- socklen_t addr_len __attribute__ ((unused))
+ MYSQL_SOCKET socket MY_ATTRIBUTE ((unused)),
+ const struct sockaddr *addr MY_ATTRIBUTE ((unused)),
+ socklen_t addr_len MY_ATTRIBUTE ((unused))
#endif
)
{
#ifdef HAVE_PSI_SOCKET_INTERFACE
MYSQL_SOCKET socket
#else
-MYSQL_SOCKET socket __attribute__ ((unused))
+MYSQL_SOCKET socket MY_ATTRIBUTE ((unused))
#endif
)
{
-/* Copyright (c) 2008, 2013, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2008, 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
PSI_mutex_info *info,
int count
#else
- const char *category __attribute__ ((unused)),
- void *info __attribute__ ((unused)),
- int count __attribute__ ((unused))
+ const char *category MY_ATTRIBUTE ((unused)),
+ void *info MY_ATTRIBUTE ((unused)),
+ int count MY_ATTRIBUTE ((unused))
#endif
)
{
PSI_rwlock_info *info,
int count
#else
- const char *category __attribute__ ((unused)),
- void *info __attribute__ ((unused)),
- int count __attribute__ ((unused))
+ const char *category MY_ATTRIBUTE ((unused)),
+ void *info MY_ATTRIBUTE ((unused)),
+ int count MY_ATTRIBUTE ((unused))
#endif
)
{
PSI_cond_info *info,
int count
#else
- const char *category __attribute__ ((unused)),
- void *info __attribute__ ((unused)),
- int count __attribute__ ((unused))
+ const char *category MY_ATTRIBUTE ((unused)),
+ void *info MY_ATTRIBUTE ((unused)),
+ int count MY_ATTRIBUTE ((unused))
#endif
)
{
PSI_thread_info *info,
int count
#else
- const char *category __attribute__ ((unused)),
- void *info __attribute__ ((unused)),
- int count __attribute__ ((unused))
+ const char *category MY_ATTRIBUTE ((unused)),
+ void *info MY_ATTRIBUTE ((unused)),
+ int count MY_ATTRIBUTE ((unused))
#endif
)
{
OUTPUT_NAME mysqlclient
VERSION "${OS_SHARED_LIB_VERSION}"
SOVERSION "${SHARED_LIB_MAJOR_VERSION}")
- CONFIGURE_FILE(libmysql.ver.in ${CMAKE_CURRENT_BINARY_DIR}/libmysql.ver)
+ IF(WITH_SYMVER16)
+ CONFIGURE_FILE(libmysql.ver16.in ${CMAKE_CURRENT_BINARY_DIR}/libmysql.ver)
+ ELSE()
+ CONFIGURE_FILE(libmysql.ver.in ${CMAKE_CURRENT_BINARY_DIR}/libmysql.ver)
+ ENDIF()
GET_TARGET_PROPERTY(libmysql_link_flags libmysql LINK_FLAGS)
IF(NOT libmysql_link_flag)
-/* Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2000, 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
1 could not initialize environment (out of memory or thread keys)
*/
-int STDCALL mysql_server_init(int argc __attribute__((unused)),
- char **argv __attribute__((unused)),
- char **groups __attribute__((unused)))
+int STDCALL mysql_server_init(int argc MY_ATTRIBUTE((unused)),
+ char **argv MY_ATTRIBUTE((unused)),
+ char **groups MY_ATTRIBUTE((unused)))
{
int result= 0;
if (!mysql_client_init)
if (!mysql_port)
{
char *env;
- struct servent *serv_ptr __attribute__((unused));
+ struct servent *serv_ptr MY_ATTRIBUTE((unused));
mysql_port = MYSQL_PORT;
**************************************************************************/
void STDCALL
-mysql_debug(const char *debug __attribute__((unused)))
+mysql_debug(const char *debug MY_ATTRIBUTE((unused)))
{
#ifndef DBUG_OFF
char *env;
**************************************************************************/
sig_handler
-my_pipe_sig_handler(int sig __attribute__((unused)))
+my_pipe_sig_handler(int sig MY_ATTRIBUTE((unused)))
{
DBUG_PRINT("info",("Hit by signal %d",sig));
#ifdef SIGNAL_HANDLER_RESET_ON_DELIVERY
*/
static int default_local_infile_init(void **ptr, const char *filename,
- void *userdata __attribute__ ((unused)))
+ void *userdata MY_ATTRIBUTE ((unused)))
{
default_local_infile_data *data;
char tmp_name[FN_REFLEN];
*/
static int
-stmt_read_row_no_data(MYSQL_STMT *stmt __attribute__((unused)),
- unsigned char **row __attribute__((unused)))
+stmt_read_row_no_data(MYSQL_STMT *stmt MY_ATTRIBUTE((unused)),
+ unsigned char **row MY_ATTRIBUTE((unused)))
{
return MYSQL_NO_DATA;
}
static int
-stmt_read_row_no_result_set(MYSQL_STMT *stmt __attribute__((unused)),
- unsigned char **row __attribute__((unused)))
+stmt_read_row_no_result_set(MYSQL_STMT *stmt MY_ATTRIBUTE((unused)),
+ unsigned char **row MY_ATTRIBUTE((unused)))
{
set_stmt_error(stmt, CR_NO_RESULT_SET, unknown_sqlstate, NULL);
return 1;
}
static void fetch_result_int32(MYSQL_BIND *param,
- MYSQL_FIELD *field __attribute__((unused)),
+ MYSQL_FIELD *field MY_ATTRIBUTE((unused)),
uchar **row)
{
my_bool field_is_unsigned= MY_TEST(field->flags & UNSIGNED_FLAG);
}
static void fetch_result_int64(MYSQL_BIND *param,
- MYSQL_FIELD *field __attribute__((unused)),
+ MYSQL_FIELD *field MY_ATTRIBUTE((unused)),
uchar **row)
{
my_bool field_is_unsigned= MY_TEST(field->flags & UNSIGNED_FLAG);
}
static void fetch_result_float(MYSQL_BIND *param,
- MYSQL_FIELD *field __attribute__((unused)),
+ MYSQL_FIELD *field MY_ATTRIBUTE((unused)),
uchar **row)
{
float value;
}
static void fetch_result_double(MYSQL_BIND *param,
- MYSQL_FIELD *field __attribute__((unused)),
+ MYSQL_FIELD *field MY_ATTRIBUTE((unused)),
uchar **row)
{
double value;
}
static void fetch_result_time(MYSQL_BIND *param,
- MYSQL_FIELD *field __attribute__((unused)),
+ MYSQL_FIELD *field MY_ATTRIBUTE((unused)),
uchar **row)
{
MYSQL_TIME *tm= (MYSQL_TIME *)param->buffer;
}
static void fetch_result_date(MYSQL_BIND *param,
- MYSQL_FIELD *field __attribute__((unused)),
+ MYSQL_FIELD *field MY_ATTRIBUTE((unused)),
uchar **row)
{
MYSQL_TIME *tm= (MYSQL_TIME *)param->buffer;
}
static void fetch_result_datetime(MYSQL_BIND *param,
- MYSQL_FIELD *field __attribute__((unused)),
+ MYSQL_FIELD *field MY_ATTRIBUTE((unused)),
uchar **row)
{
MYSQL_TIME *tm= (MYSQL_TIME *)param->buffer;
}
static void fetch_result_bin(MYSQL_BIND *param,
- MYSQL_FIELD *field __attribute__((unused)),
+ MYSQL_FIELD *field MY_ATTRIBUTE((unused)),
uchar **row)
{
ulong length= net_field_length(row);
}
static void fetch_result_str(MYSQL_BIND *param,
- MYSQL_FIELD *field __attribute__((unused)),
+ MYSQL_FIELD *field MY_ATTRIBUTE((unused)),
uchar **row)
{
ulong length= net_field_length(row);
*/
static void skip_result_fixed(MYSQL_BIND *param,
- MYSQL_FIELD *field __attribute__((unused)),
+ MYSQL_FIELD *field MY_ATTRIBUTE((unused)),
uchar **row)
{
}
-static void skip_result_with_length(MYSQL_BIND *param __attribute__((unused)),
- MYSQL_FIELD *field __attribute__((unused)),
+static void skip_result_with_length(MYSQL_BIND *param MY_ATTRIBUTE((unused)),
+ MYSQL_FIELD *field MY_ATTRIBUTE((unused)),
uchar **row)
{
}
-static void skip_result_string(MYSQL_BIND *param __attribute__((unused)),
+static void skip_result_string(MYSQL_BIND *param MY_ATTRIBUTE((unused)),
MYSQL_FIELD *field,
uchar **row)
return (*mysql->methods->read_query_result)(mysql);
}
+#if defined(EXPORT_SYMVER16)
+#ifndef EMBEDDED_LIBRARY
+
+// Hack to provide both libmysqlclient_16 and libmysqlclient_18 symbol versions
+
+#define SYM_16(_exportedsym) __asm__(".symver symver16_" #_exportedsym "," #_exportedsym "@libmysqlclient_16")
+
+void STDCALL symver16_myodbc_remove_escape(MYSQL *mysql,char *name)
+{
+ return myodbc_remove_escape(mysql, name);
+}
+SYM_16(myodbc_remove_escape);
+
+
+my_ulonglong STDCALL symver16_mysql_affected_rows(MYSQL *mysql)
+{
+ return mysql_affected_rows(mysql);
+}
+SYM_16(mysql_affected_rows);
+
+
+my_bool STDCALL symver16_mysql_autocommit(MYSQL * mysql, my_bool auto_mode)
+{
+ return mysql_autocommit(mysql, auto_mode);
+}
+SYM_16(mysql_autocommit);
+
+
+my_bool STDCALL symver16_mysql_change_user(MYSQL *mysql, const char *user, const char *passwd, const char *db)
+{
+ return mysql_change_user(mysql, user, passwd, db);
+}
+SYM_16(mysql_change_user);
+
+
+const char * STDCALL symver16_mysql_character_set_name(MYSQL *mysql)
+{
+ return mysql_character_set_name(mysql);
+}
+SYM_16(mysql_character_set_name);
+
+
+my_bool STDCALL symver16_mysql_commit(MYSQL * mysql)
+{
+ return mysql_commit(mysql);
+}
+SYM_16(mysql_commit);
+
+
+void STDCALL symver16_mysql_data_seek(MYSQL_RES *result, my_ulonglong row)
+{
+ return mysql_data_seek(result, row);
+}
+SYM_16(mysql_data_seek);
+
+
+void STDCALL symver16_mysql_debug(const char *debug __attribute__((unused)))
+{
+ return mysql_debug(debug);
+}
+SYM_16(mysql_debug);
+
+
+int STDCALL symver16_mysql_dump_debug_info(MYSQL *mysql)
+{
+ return mysql_dump_debug_info(mysql);
+}
+SYM_16(mysql_dump_debug_info);
+
+
+my_bool STDCALL symver16_mysql_embedded(void)
+{
+ return mysql_embedded();
+}
+SYM_16(mysql_embedded);
+
+
+my_bool STDCALL symver16_mysql_eof(MYSQL_RES *res)
+{
+ return mysql_eof(res);
+}
+SYM_16(mysql_eof);
+
+
+ulong STDCALL symver16_mysql_escape_string(char *to,const char *from,ulong length)
+{
+ return mysql_escape_string(to, from, length);
+}
+SYM_16(mysql_escape_string);
+
+
+MYSQL_FIELD * STDCALL symver16_mysql_fetch_field(MYSQL_RES *result)
+{
+ return mysql_fetch_field(result);
+}
+SYM_16(mysql_fetch_field);
+
+
+MYSQL_FIELD * STDCALL symver16_mysql_fetch_field_direct(MYSQL_RES *res,uint fieldnr)
+{
+ return mysql_fetch_field_direct(res, fieldnr);
+}
+SYM_16(mysql_fetch_field_direct);
+
+
+MYSQL_FIELD * STDCALL symver16_mysql_fetch_fields(MYSQL_RES *res)
+{
+ return mysql_fetch_fields(res);
+}
+SYM_16(mysql_fetch_fields);
+
+
+unsigned int STDCALL symver16_mysql_field_count(MYSQL *mysql)
+{
+ return mysql_field_count(mysql);
+}
+SYM_16(mysql_field_count);
+
+
+MYSQL_FIELD_OFFSET STDCALL symver16_mysql_field_seek(MYSQL_RES *result, MYSQL_FIELD_OFFSET field_offset)
+{
+ return mysql_field_seek(result, field_offset);
+}
+SYM_16(mysql_field_seek);
+
+
+MYSQL_FIELD_OFFSET STDCALL symver16_mysql_field_tell(MYSQL_RES *res)
+{
+ return mysql_field_tell(res);
+}
+SYM_16(mysql_field_tell);
+
+
+void STDCALL symver16_mysql_get_character_set_info(MYSQL *mysql, MY_CHARSET_INFO *csinfo)
+{
+ return mysql_get_character_set_info(mysql, csinfo);
+}
+SYM_16(mysql_get_character_set_info);
+
+
+const char * STDCALL symver16_mysql_get_client_info(void)
+{
+ return mysql_get_client_info();
+}
+SYM_16(mysql_get_client_info);
+
+ulong STDCALL symver16_mysql_get_client_version(void)
+{
+ return mysql_get_client_version();
+}
+SYM_16(mysql_get_client_version);
+
+
+const char * STDCALL symver16_mysql_get_host_info(MYSQL *mysql)
+{
+ return mysql_get_host_info(mysql);
+}
+SYM_16(mysql_get_host_info);
+
+
+MYSQL_PARAMETERS *STDCALL symver16_mysql_get_parameters(void)
+{
+ return mysql_get_parameters();
+}
+SYM_16(mysql_get_parameters);
+
+
+uint STDCALL symver16_mysql_get_proto_info(MYSQL *mysql)
+{
+ return mysql_get_proto_info(mysql);
+}
+SYM_16(mysql_get_proto_info);
+
+
+const char * STDCALL symver16_mysql_get_server_info(MYSQL *mysql)
+{
+ return mysql_get_server_info(mysql);
+}
+SYM_16(mysql_get_server_info);
+
+
+ulong STDCALL symver16_mysql_hex_string(char *to, const char *from, ulong length)
+{
+ return mysql_hex_string(to, from, length);
+}
+SYM_16(mysql_hex_string);
+
+
+const char *STDCALL symver16_mysql_info(MYSQL *mysql)
+{
+ return mysql_info(mysql);
+}
+SYM_16(mysql_info);
+
+
+my_ulonglong STDCALL symver16_mysql_insert_id(MYSQL *mysql)
+{
+ return mysql_insert_id(mysql);
+}
+SYM_16(mysql_insert_id);
+
+
+int STDCALL symver16_mysql_kill(MYSQL *mysql,ulong pid)
+{
+ return mysql_kill(mysql, pid);
+}
+SYM_16(mysql_kill);
+
+
+MYSQL_RES * STDCALL symver16_mysql_list_dbs(MYSQL *mysql, const char *wild)
+{
+ return mysql_list_dbs(mysql, wild);
+}
+SYM_16(mysql_list_dbs);
+
+
+MYSQL_RES * STDCALL symver16_mysql_list_fields(MYSQL *mysql, const char *table, const char *wild)
+{
+ return mysql_list_fields(mysql, table, wild);
+}
+SYM_16(mysql_list_fields);
+
+
+MYSQL_RES * STDCALL symver16_mysql_list_processes(MYSQL *mysql)
+{
+ return mysql_list_processes(mysql);
+}
+SYM_16(mysql_list_processes);
+
+
+MYSQL_RES * STDCALL symver16_mysql_list_tables(MYSQL *mysql, const char *wild)
+{
+ return mysql_list_tables(mysql, wild);
+}
+SYM_16(mysql_list_tables);
+
+
+my_bool STDCALL symver16_mysql_more_results(MYSQL *mysql)
+{
+ return mysql_more_results(mysql);
+}
+SYM_16(mysql_more_results);
+
+
+int STDCALL symver16_mysql_next_result(MYSQL *mysql)
+{
+ return mysql_next_result(mysql);
+}
+SYM_16(mysql_next_result);
+
+
+int STDCALL symver16_mysql_ping(MYSQL *mysql)
+{
+ return mysql_ping(mysql);
+}
+SYM_16(mysql_ping);
+
+
+int STDCALL symver16_mysql_query(MYSQL *mysql, const char *query)
+{
+ return mysql_query(mysql, query);
+}
+SYM_16(mysql_query);
+
+
+my_bool STDCALL symver16_mysql_read_query_result(MYSQL *mysql)
+{
+ return mysql_read_query_result(mysql);
+}
+SYM_16(mysql_read_query_result);
+
+
+ulong STDCALL symver16_mysql_real_escape_string(MYSQL *mysql, char *to,const char *from, ulong length)
+{
+ return mysql_real_escape_string(mysql, to, from, length);
+}
+SYM_16(mysql_real_escape_string);
+
+
+int STDCALL symver16_mysql_refresh(MYSQL *mysql,uint options)
+{
+ return mysql_refresh(mysql, options);
+}
+SYM_16(mysql_refresh);
+
+
+my_bool STDCALL symver16_mysql_rollback(MYSQL * mysql)
+{
+ return mysql_rollback(mysql);
+}
+SYM_16(mysql_rollback);
+
+
+MYSQL_ROW_OFFSET STDCALL symver16_mysql_row_seek(MYSQL_RES *result, MYSQL_ROW_OFFSET row)
+{
+ return mysql_row_seek(result, row);
+}
+SYM_16(mysql_row_seek);
+
+
+MYSQL_ROW_OFFSET STDCALL symver16_mysql_row_tell(MYSQL_RES *res)
+{
+ return mysql_row_tell(res);
+}
+SYM_16(mysql_row_tell);
+
+
+void STDCALL symver16_mysql_server_end()
+{
+ return mysql_server_end();
+}
+SYM_16(mysql_server_end);
+
+
+int STDCALL symver16_mysql_server_init(int argc __attribute__((unused)), char **argv __attribute__((unused)), char **groups __attribute__((unused)))
+{
+ return mysql_server_init(argc, argv, groups);
+}
+SYM_16(mysql_server_init);
+
+
+void symver16_mysql_set_local_infile_default(MYSQL *mysql)
+{
+ return mysql_set_local_infile_default(mysql);
+}
+SYM_16(mysql_set_local_infile_default);
+
+
+void symver16_mysql_set_local_infile_handler(MYSQL *mysql, int (*local_infile_init)(void **, const char *, void *), int (*local_infile_read)(void *, char *, uint), void (*local_infile_end)(void *), int (*local_infile_error)(void *, char *, uint), void *userdata)
+{
+ return mysql_set_local_infile_handler(mysql, local_infile_init, local_infile_read, local_infile_end, local_infile_error, userdata);
+}
+SYM_16(mysql_set_local_infile_handler);
+
+
+int STDCALL symver16_mysql_set_server_option(MYSQL *mysql, enum enum_mysql_set_option option)
+{
+ return mysql_set_server_option(mysql, option);
+}
+SYM_16(mysql_set_server_option);
+
+
+int STDCALL symver16_mysql_shutdown(MYSQL *mysql, enum mysql_enum_shutdown_level shutdown_level)
+{
+ return mysql_shutdown(mysql, shutdown_level);
+}
+SYM_16(mysql_shutdown);
+
+
+const char *STDCALL symver16_mysql_sqlstate(MYSQL *mysql)
+{
+ return mysql_sqlstate(mysql);
+}
+SYM_16(mysql_sqlstate);
+
+
+const char * STDCALL symver16_mysql_stat(MYSQL *mysql)
+{
+ return mysql_stat(mysql);
+}
+SYM_16(mysql_stat);
+
+
+my_ulonglong STDCALL symver16_mysql_stmt_affected_rows(MYSQL_STMT *stmt)
+{
+ return mysql_stmt_affected_rows(stmt);
+}
+SYM_16(mysql_stmt_affected_rows);
+
+
+my_bool STDCALL symver16_mysql_stmt_attr_get(MYSQL_STMT *stmt, enum enum_stmt_attr_type attr_type, void *value)
+{
+ return mysql_stmt_attr_get(stmt, attr_type, value);
+}
+SYM_16(mysql_stmt_attr_get);
+
+
+my_bool STDCALL symver16_mysql_stmt_attr_set(MYSQL_STMT *stmt, enum enum_stmt_attr_type attr_type, const void *value)
+{
+ return mysql_stmt_attr_set(stmt, attr_type, value);
+}
+SYM_16(mysql_stmt_attr_set);
+
+
+my_bool STDCALL symver16_mysql_stmt_bind_param(MYSQL_STMT *stmt, MYSQL_BIND *my_bind)
+{
+ return mysql_stmt_bind_param(stmt, my_bind);
+}
+SYM_16(mysql_stmt_bind_param);
+
+
+my_bool STDCALL symver16_mysql_stmt_bind_result(MYSQL_STMT *stmt, MYSQL_BIND *my_bind)
+{
+ return mysql_stmt_bind_result(stmt, my_bind);
+}
+SYM_16(mysql_stmt_bind_result);
+
+
+my_bool STDCALL symver16_mysql_stmt_close(MYSQL_STMT *stmt)
+{
+ return mysql_stmt_close(stmt);
+}
+SYM_16(mysql_stmt_close);
+
+
+void STDCALL symver16_mysql_stmt_data_seek(MYSQL_STMT *stmt, my_ulonglong row)
+{
+ return mysql_stmt_data_seek(stmt, row);
+}
+SYM_16(mysql_stmt_data_seek);
+
+
+uint STDCALL symver16_mysql_stmt_errno(MYSQL_STMT * stmt)
+{
+ return mysql_stmt_errno(stmt);
+}
+SYM_16(mysql_stmt_errno);
+
+
+const char *STDCALL symver16_mysql_stmt_error(MYSQL_STMT * stmt)
+{
+ return mysql_stmt_error(stmt);
+}
+SYM_16(mysql_stmt_error);
+
+
+int STDCALL symver16_mysql_stmt_execute(MYSQL_STMT *stmt)
+{
+ return mysql_stmt_execute(stmt);
+}
+SYM_16(mysql_stmt_execute);
+
+
+int STDCALL symver16_mysql_stmt_fetch(MYSQL_STMT *stmt)
+{
+ return mysql_stmt_fetch(stmt);
+}
+SYM_16(mysql_stmt_fetch);
+
+
+int STDCALL symver16_mysql_stmt_fetch_column(MYSQL_STMT *stmt, MYSQL_BIND *my_bind, uint column, ulong offset)
+{
+ return mysql_stmt_fetch_column(stmt, my_bind, column, offset);
+}
+SYM_16(mysql_stmt_fetch_column);
+
+
+unsigned int STDCALL symver16_mysql_stmt_field_count(MYSQL_STMT *stmt)
+{
+ return mysql_stmt_field_count(stmt);
+}
+SYM_16(mysql_stmt_field_count);
+
+
+my_bool STDCALL symver16_mysql_stmt_free_result(MYSQL_STMT *stmt)
+{
+ return mysql_stmt_free_result(stmt);
+}
+SYM_16(mysql_stmt_free_result);
+
+
+MYSQL_STMT * STDCALL symver16_mysql_stmt_init(MYSQL *mysql)
+{
+ return mysql_stmt_init(mysql);
+}
+SYM_16(mysql_stmt_init);
+
+
+my_ulonglong STDCALL symver16_mysql_stmt_insert_id(MYSQL_STMT *stmt)
+{
+ return mysql_stmt_insert_id(stmt);
+}
+SYM_16(mysql_stmt_insert_id);
+
+
+my_ulonglong STDCALL symver16_mysql_stmt_num_rows(MYSQL_STMT *stmt)
+{
+ return mysql_stmt_num_rows(stmt);
+}
+SYM_16(mysql_stmt_num_rows);
+
+
+ulong STDCALL symver16_mysql_stmt_param_count(MYSQL_STMT * stmt)
+{
+ return mysql_stmt_param_count(stmt);
+}
+SYM_16(mysql_stmt_param_count);
+
+
+MYSQL_RES * STDCALL symver16_mysql_stmt_param_metadata(MYSQL_STMT *stmt)
+{
+ return mysql_stmt_param_metadata(stmt);
+}
+SYM_16(mysql_stmt_param_metadata);
+
+
+int STDCALL symver16_mysql_stmt_prepare(MYSQL_STMT *stmt, const char *query, ulong length)
+{
+ return mysql_stmt_prepare(stmt, query, length);
+}
+SYM_16(mysql_stmt_prepare);
+
+
+my_bool STDCALL symver16_mysql_stmt_reset(MYSQL_STMT *stmt)
+{
+ return mysql_stmt_reset(stmt);
+}
+SYM_16(mysql_stmt_reset);
+
+
+MYSQL_RES * STDCALL symver16_mysql_stmt_result_metadata(MYSQL_STMT *stmt)
+{
+ return mysql_stmt_result_metadata(stmt);
+}
+SYM_16(mysql_stmt_result_metadata);
+
+
+MYSQL_ROW_OFFSET STDCALL symver16_mysql_stmt_row_seek(MYSQL_STMT *stmt, MYSQL_ROW_OFFSET row)
+{
+ return mysql_stmt_row_seek(stmt, row);
+}
+SYM_16(mysql_stmt_row_seek);
+
+
+MYSQL_ROW_OFFSET STDCALL symver16_mysql_stmt_row_tell(MYSQL_STMT *stmt)
+{
+ return mysql_stmt_row_tell(stmt);
+}
+SYM_16(mysql_stmt_row_tell);
+
+
+my_bool STDCALL symver16_mysql_stmt_send_long_data(MYSQL_STMT *stmt, uint param_number, const char *data, ulong length)
+{
+ return mysql_stmt_send_long_data(stmt, param_number, data, length);
+}
+SYM_16(mysql_stmt_send_long_data);
+
+
+const char *STDCALL symver16_mysql_stmt_sqlstate(MYSQL_STMT * stmt)
+{
+ return mysql_stmt_sqlstate(stmt);
+}
+SYM_16(mysql_stmt_sqlstate);
+
+
+int STDCALL symver16_mysql_stmt_store_result(MYSQL_STMT *stmt)
+{
+ return mysql_stmt_store_result(stmt);
+}
+SYM_16(mysql_stmt_store_result);
+
+
+void STDCALL symver16_mysql_thread_end()
+{
+ return mysql_thread_end();
+}
+SYM_16(mysql_thread_end);
+
+
+ulong STDCALL symver16_mysql_thread_id(MYSQL *mysql)
+{
+ return mysql_thread_id(mysql);
+}
+SYM_16(mysql_thread_id);
+
+
+my_bool STDCALL symver16_mysql_thread_init()
+{
+ return mysql_thread_init();
+}
+SYM_16(mysql_thread_init);
+
+
+uint STDCALL symver16_mysql_thread_safe(void)
+{
+ return mysql_thread_safe();
+}
+SYM_16(mysql_thread_safe);
+
+
+MYSQL_RES * STDCALL symver16_mysql_use_result(MYSQL *mysql)
+{
+ return mysql_use_result(mysql);
+}
+SYM_16(mysql_use_result);
+
+
+uint STDCALL symver16_mysql_warning_count(MYSQL *mysql)
+{
+ return mysql_warning_count(mysql);
+}
+SYM_16(mysql_warning_count);
+
+/*****/
+
+MYSQL * STDCALL symver16_mysql_real_connect(MYSQL *mysql,const char *host, const char *user, const char *passwd, const char *db, uint port, const char *unix_socket,ulong client_flag)
+{
+ return mysql_real_connect(mysql, host, user, passwd, db, port, unix_socket, client_flag);
+}
+SYM_16(mysql_real_connect);
+
+/*****/
+
+my_bool symver16_my_init(void)
+{
+ return my_init();
+}
+SYM_16(my_init);
+
+
+#endif
+#endif /* EXPORT_SYMVER16 */
+/* Copyright (c) 2006, 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 */
+
libmysqlclient_@SHARED_LIB_MAJOR_VERSION@ { global: *; };
--- /dev/null
+/* Copyright (c) 2014, 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 */
+
+libmysqlclient_16
+{
+ local:
+ symver16_*;
+};
+
+libmysqlclient_18
+{
+ global:
+ my_init;
+ myodbc_remove_escape;
+ mysql_affected_rows;
+ mysql_autocommit;
+ mysql_change_user;
+ mysql_character_set_name;
+ mysql_close;
+ mysql_commit;
+ mysql_data_seek;
+ mysql_debug;
+ mysql_dump_debug_info;
+ mysql_embedded;
+ mysql_eof;
+ mysql_errno;
+ mysql_error;
+ mysql_escape_string;
+ mysql_fetch_field;
+ mysql_fetch_field_direct;
+ mysql_fetch_fields;
+ mysql_fetch_lengths;
+ mysql_fetch_row;
+ mysql_field_count;
+ mysql_field_seek;
+ mysql_field_tell;
+ mysql_free_result;
+ mysql_get_character_set_info;
+ mysql_get_client_info;
+ mysql_get_client_version;
+ mysql_get_host_info;
+ mysql_get_parameters;
+ mysql_get_proto_info;
+ mysql_get_server_info;
+ mysql_get_server_version;
+ mysql_get_ssl_cipher;
+ mysql_hex_string;
+ mysql_info;
+ mysql_init;
+ mysql_insert_id;
+ mysql_kill;
+ mysql_list_dbs;
+ mysql_list_fields;
+ mysql_list_processes;
+ mysql_list_tables;
+ mysql_more_results;
+ mysql_next_result;
+ mysql_num_fields;
+ mysql_num_rows;
+ mysql_options;
+ mysql_ping;
+ mysql_query;
+ mysql_read_query_result;
+ mysql_real_connect;
+ mysql_real_escape_string;
+ mysql_real_query;
+ mysql_refresh;
+ mysql_rollback;
+ mysql_row_seek;
+ mysql_row_tell;
+ mysql_select_db;
+ mysql_send_query;
+ mysql_server_end;
+ mysql_server_init;
+ mysql_set_character_set;
+ mysql_set_local_infile_default;
+ mysql_set_local_infile_handler;
+ mysql_set_server_option;
+ mysql_shutdown;
+ mysql_sqlstate;
+ mysql_ssl_set;
+ mysql_stat;
+ mysql_stmt_affected_rows;
+ mysql_stmt_attr_get;
+ mysql_stmt_attr_set;
+ mysql_stmt_bind_param;
+ mysql_stmt_bind_result;
+ mysql_stmt_close;
+ mysql_stmt_data_seek;
+ mysql_stmt_errno;
+ mysql_stmt_error;
+ mysql_stmt_execute;
+ mysql_stmt_fetch;
+ mysql_stmt_fetch_column;
+ mysql_stmt_field_count;
+ mysql_stmt_free_result;
+ mysql_stmt_init;
+ mysql_stmt_insert_id;
+ mysql_stmt_num_rows;
+ mysql_stmt_param_count;
+ mysql_stmt_param_metadata;
+ mysql_stmt_prepare;
+ mysql_stmt_reset;
+ mysql_stmt_result_metadata;
+ mysql_stmt_row_seek;
+ mysql_stmt_row_tell;
+ mysql_stmt_send_long_data;
+ mysql_stmt_sqlstate;
+ mysql_stmt_store_result;
+ mysql_store_result;
+ mysql_thread_end;
+ mysql_thread_id;
+ mysql_thread_init;
+ mysql_thread_safe;
+ mysql_use_result;
+ mysql_warning_count;
+
+ free_defaults;
+ handle_options;
+ load_defaults;
+ my_print_help;
+
+ #my_make_scrambled_password;
+ THR_KEY_mysys;
+
+ mysql_client_find_plugin;
+ mysql_client_register_plugin;
+ mysql_load_plugin;
+ mysql_load_plugin_v;
+ mysql_plugin_options;
+ mysql_stmt_next_result;
+
+ #mysql_default_charset_info;
+ mysql_get_charset;
+ mysql_get_charset_by_csname;
+ mysql_net_realloc;
+ #mysql_client_errors;
+ *;
+} libmysqlclient_16;
* Copyright (c) 2000
* SWsoft company
*
- * Modifications copyright (c) 2001, 2015. Oracle and/or its affiliates.
+ * Modifications copyright (c) 2001, 2016. Oracle and/or its affiliates.
* All rights reserved.
*
* This material is provided "as is", with absolutely no warranty expressed
*/
static MYSQL_DATA *
-emb_read_rows(MYSQL *mysql, MYSQL_FIELD *mysql_fields __attribute__((unused)),
- unsigned int fields __attribute__((unused)))
+emb_read_rows(MYSQL *mysql, MYSQL_FIELD *mysql_fields MY_ATTRIBUTE((unused)),
+ unsigned int fields MY_ATTRIBUTE((unused)))
{
MYSQL_DATA *result= ((THD*)mysql->thd)->cur_data;
((THD*)mysql->thd)->cur_data= 0;
#define vsnprintf _vsnprintf
#endif
-int vprint_msg_to_log(enum loglevel level __attribute__((unused)),
+int vprint_msg_to_log(enum loglevel level MY_ATTRIBUTE((unused)),
const char *format, va_list argsi)
{
my_vsnprintf(mysql_server_last_error, sizeof(mysql_server_last_error),
'\" t
.\" Title: \fBcomp_err\fR
.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author]
-.\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\" Date: 03/02/2016
+.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
+.\" Date: 08/25/2016
.\" Manual: MySQL Database System
.\" Source: MySQL 5.6
.\" Language: English
.\"
-.TH "\FBCOMP_ERR\FR" "1" "03/02/2016" "MySQL 5\&.6" "MySQL Database System"
+.TH "\FBCOMP_ERR\FR" "1" "08/25/2016" "MySQL 5\&.6" "MySQL Database System"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
-.\" comp_err
.SH "NAME"
comp_err \- compile MySQL error message file
.SH "SYNOPSIS"
normally is run automatically when MySQL is built\&. It compiles the
errmsg\&.sys
file from the text file located at
-sql/share/errmsg\&.txt
+sql/share/errmsg\-utf8\&.txt
in MySQL source distributions\&.
.PP
\fBcomp_err\fR
.sp -1
.IP \(bu 2.3
.\}
-.\" comp_err: help option
-.\" help option: comp_err
\fB\-\-help\fR,
\fB\-?\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" comp_err: charset option
-.\" charset option: comp_err
\fB\-\-charset=\fR\fB\fIdir_name\fR\fR,
\fB\-C \fR\fB\fIdir_name\fR\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" comp_err: debug option
-.\" debug option: comp_err
\fB\-\-debug=\fR\fB\fIdebug_options\fR\fR,
\fB\-# \fR\fB\fIdebug_options\fR\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" comp_err: debug-info option
-.\" debug-info option: comp_err
\fB\-\-debug\-info\fR,
\fB\-T\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" comp_err: header_file option
-.\" header_file option: comp_err
\fB\-\-header_file=\fR\fB\fIfile_name\fR\fR,
\fB\-H \fR\fB\fIfile_name\fR\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" comp_err: in_file option
-.\" in_file option: comp_err
\fB\-\-in_file=\fR\fB\fIfile_name\fR\fR,
\fB\-F \fR\fB\fIfile_name\fR\fR
.sp
The name of the input file\&. The default is
-\&.\&./sql/share/errmsg\&.txt\&.
+\&.\&./sql/share/errmsg\-utf8\&.txt\&.
.RE
.sp
.RS 4
.sp -1
.IP \(bu 2.3
.\}
-.\" comp_err: name_file option
-.\" name_file option: comp_err
\fB\-\-name_file=\fR\fB\fIfile_name\fR\fR,
\fB\-N \fR\fB\fIfile_name\fR\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" comp_err: out_dir option
-.\" out_dir option: comp_err
\fB\-\-out_dir=\fR\fB\fIdir_name\fR\fR,
\fB\-D \fR\fB\fIdir_name\fR\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" comp_err: out_file option
-.\" out_file option: comp_err
\fB\-\-out_file=\fR\fB\fIfile_name\fR\fR,
\fB\-O \fR\fB\fIfile_name\fR\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" comp_err: statefile option
-.\" statefile option: comp_err
\fB\-\-statefile=\fR\fB\fIfile_name\fR\fR,
\fB\-S \fR\fB\fIfile_name\fR\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" comp_err: version option
-.\" version option: comp_err
\fB\-\-version\fR,
\fB\-V\fR
.sp
'\" t
.\" Title: \fBinnochecksum\fR
.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author]
-.\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\" Date: 03/02/2016
+.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
+.\" Date: 08/25/2016
.\" Manual: MySQL Database System
.\" Source: MySQL 5.6
.\" Language: English
.\"
-.TH "\FBINNOCHECKSUM\FR" "1" "03/02/2016" "MySQL 5\&.6" "MySQL Database System"
+.TH "\FBINNOCHECKSUM\FR" "1" "08/25/2016" "MySQL 5\&.6" "MySQL Database System"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
-.\" innochecksum
.SH "NAME"
innochecksum \- offline InnoDB file checksum utility
.SH "SYNOPSIS"
'\" t
.\" Title: \fBmsql2mysql\fR
.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author]
-.\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\" Date: 03/02/2016
+.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
+.\" Date: 08/25/2016
.\" Manual: MySQL Database System
.\" Source: MySQL 5.6
.\" Language: English
.\"
-.TH "\FBMSQL2MYSQL\FR" "1" "03/02/2016" "MySQL 5\&.6" "MySQL Database System"
+.TH "\FBMSQL2MYSQL\FR" "1" "08/25/2016" "MySQL 5\&.6" "MySQL Database System"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
-.\" msql2mysql
.SH "NAME"
msql2mysql \- convert mSQL programs for use with MySQL
.SH "SYNOPSIS"
'\" t
.\" Title: \fBmy_print_defaults\fR
.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author]
-.\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\" Date: 03/02/2016
+.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
+.\" Date: 08/25/2016
.\" Manual: MySQL Database System
.\" Source: MySQL 5.6
.\" Language: English
.\"
-.TH "\FBMY_PRINT_DEFAULTS" "1" "03/02/2016" "MySQL 5\&.6" "MySQL Database System"
+.TH "\FBMY_PRINT_DEFAULTS" "1" "08/25/2016" "MySQL 5\&.6" "MySQL Database System"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
-.\" my_print_defaults
.SH "NAME"
my_print_defaults \- display options from option files
.SH "SYNOPSIS"
.sp -1
.IP \(bu 2.3
.\}
-.\" my_print_defaults: help option
-.\" help option: my_print_defaults
\fB\-\-help\fR,
\fB\-?\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" my_print_defaults: config-file option
-.\" config-file option: my_print_defaults
\fB\-\-config\-file=\fR\fB\fIfile_name\fR\fR,
-.\" my_print_defaults: defaults-file option
-.\" defaults-file option: my_print_defaults
\fB\-\-defaults\-file=\fR\fB\fIfile_name\fR\fR,
\fB\-c \fR\fB\fIfile_name\fR\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" my_print_defaults: debug option
-.\" debug option: my_print_defaults
\fB\-\-debug=\fR\fB\fIdebug_options\fR\fR,
\fB\-# \fR\fB\fIdebug_options\fR\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" my_print_defaults: defaults-extra-file option
-.\" defaults-extra-file option: my_print_defaults
\fB\-\-defaults\-extra\-file=\fR\fB\fIfile_name\fR\fR,
-.\" my_print_defaults: extra-file option
-.\" extra-file option: my_print_defaults
\fB\-\-extra\-file=\fR\fB\fIfile_name\fR\fR,
\fB\-e \fR\fB\fIfile_name\fR\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" my_print_defaults: defaults-group-suffix option
-.\" defaults-group-suffix option: my_print_defaults
\fB\-\-defaults\-group\-suffix=\fR\fB\fIsuffix\fR\fR,
\fB\-g \fR\fB\fIsuffix\fR\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" login-path option
\fB\-\-login\-path=\fR\fB\fIname\fR\fR,
\fB\-l \fR\fB\fIname\fR\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" my_print_defaults: no-defaults option
-.\" no-defaults option: my_print_defaults
\fB\-\-no\-defaults\fR,
\fB\-n\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" my_print_defaults: show option
-.\" show option: my_print_defaults
\fB\-\-show\fR,
\fB\-s\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" my_print_defaults: verbose option
-.\" verbose option: my_print_defaults
\fB\-\-verbose\fR,
\fB\-v\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" my_print_defaults: version option
-.\" version option: my_print_defaults
\fB\-\-version\fR,
\fB\-V\fR
.sp
'\" t
.\" Title: \fBmyisam_ftdump\fR
.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author]
-.\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\" Date: 03/02/2016
+.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
+.\" Date: 08/25/2016
.\" Manual: MySQL Database System
.\" Source: MySQL 5.6
.\" Language: English
.\"
-.TH "\FBMYISAM_FTDUMP\FR" "1" "03/02/2016" "MySQL 5\&.6" "MySQL Database System"
+.TH "\FBMYISAM_FTDUMP\FR" "1" "08/25/2016" "MySQL 5\&.6" "MySQL Database System"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
-.\" myisam_ftdump
.SH "NAME"
myisam_ftdump \- display full\-text index information
.SH "SYNOPSIS"
.sp -1
.IP \(bu 2.3
.\}
-.\" myisam_ftdump: help option
-.\" help option: myisam_ftdump
\fB\-\-help\fR,
\fB\-h\fR
\fB\-?\fR
.sp -1
.IP \(bu 2.3
.\}
-.\" myisam_ftdump: count option
-.\" count option: myisam_ftdump
\fB\-\-count\fR,
\fB\-c\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" myisam_ftdump: dump option
-.\" dump option: myisam_ftdump
\fB\-\-dump\fR,
\fB\-d\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" myisam_ftdump: length option
-.\" length option: myisam_ftdump
\fB\-\-length\fR,
\fB\-l\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" myisam_ftdump: stats option
-.\" stats option: myisam_ftdump
\fB\-\-stats\fR,
\fB\-s\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" myisam_ftdump: verbose option
-.\" verbose option: myisam_ftdump
\fB\-\-verbose\fR,
\fB\-v\fR
.sp
'\" t
.\" Title: \fBmyisamchk\fR
.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author]
-.\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\" Date: 03/02/2016
+.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
+.\" Date: 08/25/2016
.\" Manual: MySQL Database System
.\" Source: MySQL 5.6
.\" Language: English
.\"
-.TH "\FBMYISAMCHK\FR" "1" "03/02/2016" "MySQL 5\&.6" "MySQL Database System"
+.TH "\FBMYISAMCHK\FR" "1" "08/25/2016" "MySQL 5\&.6" "MySQL Database System"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
-.\" myisamchk
.SH "NAME"
myisamchk \- MyISAM table\-maintenance utility
.SH "SYNOPSIS"
group of an option file\&. For information about option files used by MySQL programs, see
Section\ \&4.2.6, \(lqUsing Option Files\(rq\&.
.SH "MYISAMCHK GENERAL OPTIONS"
-.\" options: myisamchk
-.\" myisamchk: options
.PP
The options described in this section can be used for any type of table maintenance operation performed by
\fBmyisamchk\fR\&. The sections following this one describe options that pertain only to specific operations, such as table checking or repairing\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" myisamchk: help option
-.\" help option: myisamchk
\fB\-\-help\fR,
\fB\-?\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" myisamchk: HELP option
-.\" HELP option: myisamchk
\fB\-\-HELP\fR,
\fB\-H\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" myisamchk: debug option
-.\" debug option: myisamchk
\fB\-\-debug=\fR\fB\fIdebug_options\fR\fR,
\fB\-# \fR\fB\fIdebug_options\fR\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" myisamchk: defaults-extra-file option
-.\" defaults-extra-file option: myisamchk
\fB\-\-defaults\-extra\-file=\fR\fB\fIfile_name\fR\fR
.sp
Read this option file after the global option file but (on Unix) before the user option file\&. If the file does not exist or is otherwise inaccessible, an error occurs\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" myisamchk: defaults-file option
-.\" defaults-file option: myisamchk
\fB\-\-defaults\-file=\fR\fB\fIfile_name\fR\fR
.sp
Use only the given option file\&. If the file does not exist or is otherwise inaccessible, an error occurs\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" myisamchk: defaults-group-suffix option
-.\" defaults-group-suffix option: myisamchk
\fB\-\-defaults\-group\-suffix=\fR\fB\fIstr\fR\fR
.sp
Read not only the usual option groups, but also groups with the usual names and a suffix of
.sp -1
.IP \(bu 2.3
.\}
-.\" myisamchk: no-defaults option
-.\" no-defaults option: myisamchk
\fB\-\-no\-defaults\fR
.sp
Do not read any option files\&. If program startup fails due to reading unknown options from an option file,
.sp -1
.IP \(bu 2.3
.\}
-.\" myisamchk: print-defaults option
-.\" print-defaults option: myisamchk
\fB\-\-print\-defaults\fR
.sp
Print the program name and all options that it gets from option files\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" myisamchk: silent option
-.\" silent option: myisamchk
\fB\-\-silent\fR,
\fB\-s\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" myisamchk: verbose option
-.\" verbose option: myisamchk
\fB\-\-verbose\fR,
\fB\-v\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" myisamchk: version option
-.\" version option: myisamchk
\fB\-\-version\fR,
\fB\-V\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" myisamchk: wait option
-.\" wait option: myisamchk
\fB\-\-wait\fR,
\fB\-w\fR
.sp
You can also set the following variables by using
\fB\-\-\fR\fB\fIvar_name\fR\fR\fB=\fR\fB\fIvalue\fR\fR
syntax:
-.\" decode_bits myisamchk variable
-.\" ft_max_word_len myisamchk variable
-.\" ft_min_word_len myisamchk variable
-.\" ft_stopword_file myisamchk variable
-.\" key_buffer_size myisamchk variable
-.\" myisam_block_size myisamchk variable
-.\" read_buffer_size myisamchk variable
-.\" sort_buffer_size myisamchk variable
-.\" myisam_sort_buffer_size myisamchk variable
-.\" sort_key_blocks myisamchk variable
-.\" stats_method myisamchk variable
-.\" write_buffer_size myisamchk variable
.TS
allbox tab(:);
lB lB.
OPTIMIZE TABLE, or
ALTER TABLE\&. These statements are performed by the server, which knows the proper full\-text parameter values to use\&.
.SH "MYISAMCHK CHECK OPTIONS"
-.\" check options: myisamchk
-.\" tables: checking
.PP
\fBmyisamchk\fR
supports the following options for table checking operations:
.sp -1
.IP \(bu 2.3
.\}
-.\" myisamchk: check option
-.\" check option: myisamchk
\fB\-\-check\fR,
\fB\-c\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" myisamchk: check-only-changed option
-.\" check-only-changed option: myisamchk
\fB\-\-check\-only\-changed\fR,
\fB\-C\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" myisamchk: extend-check option
-.\" extend-check option: myisamchk
\fB\-\-extend\-check\fR,
\fB\-e\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" myisamchk: fast option
-.\" fast option: myisamchk
\fB\-\-fast\fR,
\fB\-F\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" myisamchk: force option
-.\" force option: myisamchk
\fB\-\-force\fR,
\fB\-f\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" myisamchk: information option
-.\" information option: myisamchk
\fB\-\-information\fR,
\fB\-i\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" myisamchk: medium-check option
-.\" medium-check option: myisamchk
\fB\-\-medium\-check\fR,
\fB\-m\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" myisamchk: read-only option
-.\" read-only option: myisamchk
\fB\-\-read\-only\fR,
\fB\-T\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" myisamchk: update-state option
-.\" update-state option: myisamchk
\fB\-\-update\-state\fR,
\fB\-U\fR
.sp
server is using the table and you are running it with external locking disabled\&.
.RE
.SH "MYISAMCHK REPAIR OPTIONS"
-.\" repair options: myisamchk
-.\" files: repairing
.PP
\fBmyisamchk\fR
supports the following options for table repair operations (operations performed when an option such as
.sp -1
.IP \(bu 2.3
.\}
-.\" myisamchk: backup option
-.\" backup option: myisamchk
\fB\-\-backup\fR,
\fB\-B\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" myisamchk: character-sets-dir option
-.\" character-sets-dir option: myisamchk
\fB\-\-character\-sets\-dir=\fR\fB\fIdir_name\fR\fR
.sp
The directory where character sets are installed\&. See
.sp -1
.IP \(bu 2.3
.\}
-.\" myisamchk: correct-checksum option
-.\" correct-checksum option: myisamchk
\fB\-\-correct\-checksum\fR
.sp
Correct the checksum information for the table\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" myisamchk: data-file-length option
-.\" data-file-length option: myisamchk
\fB\-\-data\-file\-length=\fR\fB\fIlen\fR\fR,
\fB\-D \fR\fB\fIlen\fR\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" myisamchk: extend-check option
-.\" extend-check option: myisamchk
\fB\-\-extend\-check\fR,
\fB\-e\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" myisamchk: force option
-.\" force option: myisamchk
\fB\-\-force\fR,
\fB\-f\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" myisamchk: keys-used option
-.\" keys-used option: myisamchk
\fB\-\-keys\-used=\fR\fB\fIval\fR\fR,
\fB\-k \fR\fB\fIval\fR\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" myisamchk: no-symlinks option
-.\" no-symlinks option: myisamchk
\fB\-\-no\-symlinks\fR,
\fB\-l\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" myisamchk: max-record-length option
-.\" max-record-length option: myisamchk
\fB\-\-max\-record\-length=\fR\fB\fIlen\fR\fR
.sp
Skip rows larger than the given length if
.sp -1
.IP \(bu 2.3
.\}
-.\" myisamchk: parallel-recover option
-.\" parallel-recover option: myisamchk
\fB\-\-parallel\-recover\fR,
\fB\-p\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" myisamchk: quick option
-.\" quick option: myisamchk
\fB\-\-quick\fR,
\fB\-q\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" myisamchk: recover option
-.\" recover option: myisamchk
\fB\-\-recover\fR,
\fB\-r\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" myisamchk: safe-recover option
-.\" safe-recover option: myisamchk
\fB\-\-safe\-recover\fR,
\fB\-o\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" myisamchk: set-collation option
-.\" set-collation option: myisamchk
\fB\-\-set\-collation=\fR\fB\fIname\fR\fR
.sp
Specify the collation to use for sorting table indexes\&. The character set name is implied by the first part of the collation name\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" myisamchk: sort-recover option
-.\" sort-recover option: myisamchk
\fB\-\-sort\-recover\fR,
\fB\-n\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" myisamchk: tmpdir option
-.\" tmpdir option: myisamchk
\fB\-\-tmpdir=\fR\fB\fIdir_name\fR\fR,
\fB\-t \fR\fB\fIdir_name\fR\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" myisamchk: unpack option
-.\" unpack option: myisamchk
\fB\-\-unpack\fR,
\fB\-u\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" myisamchk: analyze option
-.\" analyze option: myisamchk
\fB\-\-analyze\fR,
\fB\-a\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" myisamchk: block-search option
-.\" block-search option: myisamchk
\fB\-\-block\-search=\fR\fB\fIoffset\fR\fR,
\fB\-b \fR\fB\fIoffset\fR\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" myisamchk: description option
-.\" description option: myisamchk
\fB\-\-description\fR,
\fB\-d\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" myisamchk: set-auto-increment[ option
-.\" set-auto-increment[ option: myisamchk
\fB\-\-set\-auto\-increment[=\fR\fB\fIvalue\fR\fR\fB]\fR,
\fB\-A[\fR\fB\fIvalue\fR\fR\fB]\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" myisamchk: sort-index option
-.\" sort-index option: myisamchk
\fB\-\-sort\-index\fR,
\fB\-S\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" myisamchk: sort-records option
-.\" sort-records option: myisamchk
\fB\-\-sort\-records=\fR\fB\fIN\fR\fR,
\fB\-R \fR\fB\fIN\fR\fR
.sp
must unpack key blocks first, then re\-create indexes and pack the key blocks again\&. (In this case, re\-creating indexes is faster than updating offsets for each index\&.)
.RE
.SH "OBTAINING TABLE INFORMATION WITH MYISAMCHK"
-.\" table description: myisamchk
-.\" tables: information
-.\" examples: myisamchk output
-.\" myisamchk: example output
.PP
To obtain a description of a
MyISAM
is the sum of the amount of storage used by all such pointers\&.
.RE
.SH "MYISAMCHK MEMORY USAGE"
-.\" memory usage: myisamchk
.PP
Memory allocation is important when you run
\fBmyisamchk\fR\&.
'\" t
.\" Title: \fBmyisamlog\fR
.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author]
-.\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\" Date: 03/02/2016
+.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
+.\" Date: 08/25/2016
.\" Manual: MySQL Database System
.\" Source: MySQL 5.6
.\" Language: English
.\"
-.TH "\FBMYISAMLOG\FR" "1" "03/02/2016" "MySQL 5\&.6" "MySQL Database System"
+.TH "\FBMYISAMLOG\FR" "1" "08/25/2016" "MySQL 5\&.6" "MySQL Database System"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
-.\" myisamlog
.SH "NAME"
myisamlog \- display MyISAM log file contents
.SH "SYNOPSIS"
'\" t
.\" Title: \fBmyisampack\fR
.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author]
-.\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\" Date: 03/02/2016
+.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
+.\" Date: 08/25/2016
.\" Manual: MySQL Database System
.\" Source: MySQL 5.6
.\" Language: English
.\"
-.TH "\FBMYISAMPACK\FR" "1" "03/02/2016" "MySQL 5\&.6" "MySQL Database System"
+.TH "\FBMYISAMPACK\FR" "1" "08/25/2016" "MySQL 5\&.6" "MySQL Database System"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
-.\" myisampack
-.\" compressed tables
-.\" tables: compressed
-.\" MyISAM: compressed tables
.SH "NAME"
myisampack \- generate compressed, read\-only MyISAM tables
.SH "SYNOPSIS"
.sp -1
.IP \(bu 2.3
.\}
-.\" myisampack: help option
-.\" help option: myisampack
\fB\-\-help\fR,
\fB\-?\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" myisampack: backup option
-.\" backup option: myisampack
\fB\-\-backup\fR,
\fB\-b\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" myisampack: character-sets-dir option
-.\" character-sets-dir option: myisampack
\fB\-\-character\-sets\-dir=\fR\fB\fIdir_name\fR\fR
.sp
The directory where character sets are installed\&. See
.sp -1
.IP \(bu 2.3
.\}
-.\" myisampack: debug option
-.\" debug option: myisampack
\fB\-\-debug[=\fR\fB\fIdebug_options\fR\fR\fB]\fR,
\fB\-# [\fR\fB\fIdebug_options\fR\fR\fB]\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" myisampack: force option
-.\" force option: myisampack
\fB\-\-force\fR,
\fB\-f\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" myisampack: join option
-.\" join option: myisampack
\fB\-\-join=\fR\fB\fIbig_tbl_name\fR\fR,
\fB\-j \fR\fB\fIbig_tbl_name\fR\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" myisampack: silent option
-.\" silent option: myisampack
\fB\-\-silent\fR,
\fB\-s\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" myisampack: test option
-.\" test option: myisampack
\fB\-\-test\fR,
\fB\-t\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" myisampack: tmpdir option
-.\" tmpdir option: myisampack
\fB\-\-tmpdir=\fR\fB\fIdir_name\fR\fR,
\fB\-T \fR\fB\fIdir_name\fR\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" myisampack: verbose option
-.\" verbose option: myisampack
\fB\-\-verbose\fR,
\fB\-v\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" myisampack: version option
-.\" version option: myisampack
\fB\-\-version\fR,
\fB\-V\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" myisampack: wait option
-.\" wait option: myisampack
\fB\-\-wait\fR,
\fB\-w\fR
.sp
\fBmyisampack\fR
if the table might be updated by the server during the packing process\&.
.RE
-.\" examples: compressed tables
.PP
The following sequence of commands illustrates a typical table compression session:
.sp
'\" t
.\" Title: \fBmysql-stress-test.pl\fR
.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author]
-.\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\" Date: 03/02/2016
+.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
+.\" Date: 08/25/2016
.\" Manual: MySQL Database System
.\" Source: MySQL
.\" Language: English
.\"
-.TH "\FBMYSQL\-STRESS\-TE" "1" "03/02/2016" "MySQL" "MySQL Database System"
+.TH "\FBMYSQL\-STRESS\-TE" "1" "08/25/2016" "MySQL" "MySQL Database System"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
-.\" mysql-stress-test.pl
.SH "NAME"
mysql-stress-test.pl \- server stress test program
.SH "SYNOPSIS"
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-stress-test.pl: help option
-.\" help option: mysql-stress-test.pl
\fB\-\-help\fR
.sp
Display a help message and exit\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-stress-test.pl: abort-on-error option
-.\" abort-on-error option: mysql-stress-test.pl
\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\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-stress-test.pl: check-tests-file option
-.\" check-tests-file option: mysql-stress-test.pl
\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\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-stress-test.pl: cleanup option
-.\" cleanup option: mysql-stress-test.pl
\fB\-\-cleanup\fR
.sp
Force cleanup of the working directory\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-stress-test.pl: log-error-details option
-.\" log-error-details option: mysql-stress-test.pl
\fB\-\-log\-error\-details\fR
.sp
Log error details in the global error log file\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-stress-test.pl: loop-count option
-.\" loop-count option: mysql-stress-test.pl
\fB\-\-loop\-count=\fR\fB\fIN\fR\fR
.sp
In sequential test mode, the number of loops to execute before exiting\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-stress-test.pl: mysqltest option
-.\" mysqltest option: mysql-stress-test.pl
\fB\-\-mysqltest=\fR\fB\fIpath\fR\fR
.sp
The path name to the
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-stress-test.pl: server-database option
-.\" server-database option: mysql-stress-test.pl
\fB\-\-server\-database=\fR\fB\fIdb_name\fR\fR
.sp
The database to use for the tests\&. The default is
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-stress-test.pl: server-host option
-.\" server-host option: mysql-stress-test.pl
\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
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-stress-test.pl: server-logs-dir option
-.\" server-logs-dir option: mysql-stress-test.pl
\fB\-\-server\-logs\-dir=\fR\fB\fIpath\fR\fR
.sp
This option is required\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-stress-test.pl: server-password option
-.\" server-password option: mysql-stress-test.pl
\fB\-\-server\-password=\fR\fB\fIpassword\fR\fR
.sp
The password to use when connecting to the server\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-stress-test.pl: server-port option
-.\" server-port option: mysql-stress-test.pl
\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\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-stress-test.pl: server-socket option
-.\" server-socket option: mysql-stress-test.pl
\fB\-\-server\-socket=\fR\fB\fIfile_name\fR\fR
.sp
For connections to
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-stress-test.pl: server-user option
-.\" server-user option: mysql-stress-test.pl
\fB\-\-server\-user=\fR\fB\fIuser_name\fR\fR
.sp
The MySQL user name to use when connecting to the server\&. The default is
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-stress-test.pl: sleep-time option
-.\" sleep-time option: mysql-stress-test.pl
\fB\-\-sleep\-time=\fR\fB\fIN\fR\fR
.sp
The delay in seconds between test executions\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-stress-test.pl: stress-basedir option
-.\" stress-basedir option: mysql-stress-test.pl
\fB\-\-stress\-basedir=\fR\fB\fIpath\fR\fR
.sp
This option is required\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-stress-test.pl: stress-datadir option
-.\" stress-datadir option: mysql-stress-test.pl
\fB\-\-stress\-datadir=\fR\fB\fIpath\fR\fR
.sp
The directory of data files to be used during testing\&. The default location is the
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-stress-test.pl: stress-init-file option
-.\" stress-init-file option: mysql-stress-test.pl
\fB\-\-stress\-init\-file[=\fR\fB\fIpath\fR\fR\fB]\fR
.sp
\fIfile_name\fR
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-stress-test.pl: stress-mode option
-.\" stress-mode option: mysql-stress-test.pl
\fB\-\-stress\-mode=\fR\fB\fImode\fR\fR
.sp
This option indicates the test order in stress\-test mode\&. The
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-stress-test.pl: stress-suite-basedir option
-.\" stress-suite-basedir option: mysql-stress-test.pl
\fB\-\-stress\-suite\-basedir=\fR\fB\fIpath\fR\fR
.sp
This option is required\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-stress-test.pl: stress-tests-file option
-.\" stress-tests-file option: mysql-stress-test.pl
\fB\-\-stress\-tests\-file[=\fR\fB\fIfile_name\fR\fR\fB]\fR
.sp
Use this option to run the stress tests\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-stress-test.pl: suite option
-.\" suite option: mysql-stress-test.pl
\fB\-\-suite=\fR\fB\fIsuite_name\fR\fR
.sp
Run the named test suite\&. The default name is
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-stress-test.pl: test-count option
-.\" test-count option: mysql-stress-test.pl
\fB\-\-test\-count=\fR\fB\fIN\fR\fR
.sp
The number of tests to execute before exiting\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-stress-test.pl: test-duration option
-.\" test-duration option: mysql-stress-test.pl
\fB\-\-test\-duration=\fR\fB\fIN\fR\fR
.sp
The duration of stress testing in seconds\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-stress-test.pl: threads option
-.\" threads option: mysql-stress-test.pl
\fB\-\-threads=\fR\fB\fIN\fR\fR
.sp
The number of threads\&. The default is 1\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-stress-test.pl: verbose option
-.\" verbose option: mysql-stress-test.pl
\fB\-\-verbose\fR
.sp
Verbose mode\&. Print more information about what the program does\&.
'\" t
.\" Title: \fBmysql-test-run.pl\fR
.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author]
-.\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\" Date: 03/02/2016
+.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
+.\" Date: 08/25/2016
.\" Manual: MySQL Database System
.\" Source: MySQL
.\" Language: English
.\"
-.TH "\FBMYSQL\-TEST\-RUN\" "1" "03/02/2016" "MySQL" "MySQL Database System"
+.TH "\FBMYSQL\-TEST\-RUN\" "1" "08/25/2016" "MySQL" "MySQL Database System"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
-.\" mysql-test-run.pl
.SH "NAME"
mysql-test-run.pl \- run MySQL test suite
.SH "SYNOPSIS"
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
-From MySQL 5\&.7 it is possible to put a list of test names in a file and have
+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
#
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
\fBmysql\-test\-run\&.pl\fR, others are set by
\fBmysql\-test\-run\&.pl\fR
instead, and may be referred to in tests\&.
-.\" MTR_MEM environment variable
-.\" environment variable: MTR_MEM
-.\" MTR_PARALLEL environment variable
-.\" environment variable: MTR_PARALLEL
-.\" MTR_BUILD_THREAD environment variable
-.\" environment variable: MTR_BUILD_THREAD
-.\" MTR_PORT_BASE environment variable
-.\" environment variable: MTR_PORT_BASE
-.\" MTR_TESTCASE_TIMEOUT environment variable
-.\" environment variable: MTR_TESTCASE_TIMEOUT
-.\" MTR_SUITE_TIMEOUT environment variable
-.\" environment variable: MTR_SUITE_TIMEOUT
-.\" MTR_START_TIMEOUT environment variable
-.\" environment variable: MTR_START_TIMEOUT
-.\" MTR_SHUTDOWN_TIMEOUT environment variable
-.\" environment variable: MTR_SHUTDOWN_TIMEOUT
-.\" MTR_CTEST_TIMEOUT environment variable
-.\" environment variable: MTR_CTEST_TIMEOUT
-.\" MYSQL_CONFIG_EDITOR environment variable
-.\" environment variable: MYSQL_CONFIG_EDITOR
-.\" MYSQL_TEST environment variable
-.\" environment variable: MYSQL_TEST
-.\" MYSQL_TEST_LOGIN_FILE environment variable
-.\" environment variable: MYSQL_TEST_LOGIN_FILE
-.\" MYSQLD_BOOTSTRAP environment variable
-.\" environment variable: MYSQLD_BOOTSTRAP
-.\" MYSQLD_BOOTSTRAP_CMD environment variable
-.\" environment variable: MYSQLD_BOOTSTRAP_CMD
-.\" MYSQLD environment variable
-.\" environment variable: MYSQLD
-.\" MYSQLD_CMD environment variable
-.\" environment variable: MYSQLD_CMD
-.\" MYSQLTEST_VARDIR environment variable
-.\" environment variable: MYSQLTEST_VARDIR
-.\" MYSQL_TEST_DIR environment variable
-.\" environment variable: MYSQL_TEST_DIR
-.\" MYSQL_TMP_DIR environment variable
-.\" environment variable: MYSQL_TMP_DIR
.TS
allbox tab(:);
lB lB.
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
\fB\-\-mem\fR option
T}
T{
-MTR_PARALLEL
-T}:T{
-If set, defines number of parallel threads executing tests\&. Same as
- \fB\-\-parallel\fR option
-T}
-T{
-MTR_BUILD_THREAD
-T}:T{
-If set, defines which port number range is used for the server
-T}
-T{
-MTR_PORT_BASE
+MTR_MAX_PARALLEL
T}:T{
-If set, defines which port number range is used for the server
+If set, defines maximum number of parallel threads if
+ \fB\-\-parallel=auto\fR is given
T}
T{
MTR_\fINAME\fR_TIMEOUT
MySQL 5\&.8\&.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
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\&.
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
Full command line used for initial database setup for this test batch
T}
T{
-MYSQLD
-T}:T{
-Full path to server executable used in tests\&. Supported as of MySQL
- 5\&.5\&.17\&.
-T}
-T{
MYSQLD_CMD
T}:T{
Command line for starting server as used in tests, with the minimum set
Path name to the var directory that is used for
logs, temporary files, and so forth
T}
-T{
-MYSQL_TEST_DIR
-T}:T{
-Full path to the mysql\-test directory where tests
- are being run from
-T}
-T{
-MYSQL_TMP_DIR
-T}:T{
-Path to temp directory used for temporary files during tests
-T}
.TE
.sp 1
.PP
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-test-run.pl: help option
-.\" help option: mysql-test-run.pl
\fB\-\-help\fR,
\fB\-h\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-test-run.pl: big-test option
-.\" big-test option: mysql-test-run.pl
\fB\-\-big\-test\fR
.sp
Allow tests marked as "big" to run\&. Tests can be thus marked by including the line
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-test-run.pl: boot-dbx option
-.\" boot-dbx option: mysql-test-run.pl
\fB\-\-boot\-dbx\fR
.sp
Run the
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-test-run.pl: boot-ddd option
-.\" boot-ddd option: mysql-test-run.pl
\fB\-\-boot\-ddd\fR
.sp
Run the
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-test-run.pl: boot-gdb option
-.\" boot-gdb option: mysql-test-run.pl
\fB\-\-boot\-gdb\fR
.sp
Run the
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
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-test-run.pl: build-thread option
-.\" build-thread option: mysql-test-run.pl
\fB\-\-build\-thread=\fR\fB\fInumber\fR\fR
.sp
Specify a number to calculate port numbers from\&. The formula is 10 *
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-test-run.pl: callgrind option
-.\" callgrind option: mysql-test-run.pl
\fB\-\-callgrind\fR
.sp
Instructs
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-test-run.pl: check-testcases option
-.\" check-testcases option: mysql-test-run.pl
\fB\-\-check\-testcases\fR
.sp
Check test cases for side effects\&. This is done by checking system state before and after each test case; if there is any difference, a warning to that effect will be written, but the test case will not be marked as failed because of it\&. This check is enabled by default\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-test-run.pl: clean-vardir option
-.\" clean-vardir option: mysql-test-run.pl
\fB\-\-clean\-vardir\fR
.sp
Clean up the
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-test-run.pl: client-bindir option
-.\" client-bindir option: mysql-test-run.pl
\fB\-\-client\-bindir=\fR\fB\fIpath\fR\fR
.sp
The path to the directory where client binaries are located\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-test-run.pl: client-dbx option
-.\" client-dbx option: mysql-test-run.pl
\fB\-\-client\-dbx\fR
.sp
Start
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-test-run.pl: client-ddd option
-.\" client-ddd option: mysql-test-run.pl
\fB\-\-client\-ddd\fR
.sp
Start
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-test-run.pl: client-debugger option
-.\" client-debugger option: mysql-test-run.pl
\fB\-\-client\-debugger=\fR\fB\fIdebugger\fR\fR
.sp
Start
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-test-run.pl: client-gdb option
-.\" client-gdb option: mysql-test-run.pl
\fB\-\-client\-gdb\fR
.sp
Start
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-test-run.pl: client-libdir option
-.\" client-libdir option: mysql-test-run.pl
\fB\-\-client\-libdir=\fR\fB\fIpath\fR\fR
.sp
The path to the directory where client libraries are located\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-test-run.pl: combination option
-.\" combination option: mysql-test-run.pl
\fB\-\-combination=\fR\fB\fIvalue\fR\fR
.sp
Extra option to pass to
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-test-run.pl: comment option
-.\" comment option: mysql-test-run.pl
\fB\-\-comment=\fR\fB\fIstr\fR\fR
.sp
Write
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-test-run.pl: compress option
-.\" compress option: mysql-test-run.pl
\fB\-\-compress\fR
.sp
Compress all information sent between the client and the server if both support compression\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-test-run.pl: cursor-protocol option
-.\" cursor-protocol option: mysql-test-run.pl
\fB\-\-cursor\-protocol\fR
.sp
Pass the
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-test-run.pl: dbx option
-.\" gdb option: mysql-test-run.pl
\fB\-\-dbx\fR
.sp
Start
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-test-run.pl: ddd option
-.\" ddd option: mysql-test-run.pl
\fB\-\-ddd\fR
.sp
Start
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-test-run.pl: debug option
-.\" debug option: mysql-test-run.pl
\fB\-\-debug\fR
.sp
Dump trace output for all clients and servers\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-test-run.pl: debugger option
-.\" debugger option: mysql-test-run.pl
\fB\-\-debugger=\fR\fB\fIdebugger\fR\fR
.sp
Start
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-test-run.pl: debug-common option
-.\" debug-common option: mysql-test-run.pl
\fB\-\-debug\-common\fR
.sp
This option works similar to
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-test-run.pl: debug-server option
-.\" debug-server option: mysql-test-run.pl
\fB\-\-debug\-server\fR
.sp
Runs
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-test-run.pl: debug-sync-timeout option
-.\" debug-sync-timeout option: mysql-test-run.pl
\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 -1
.IP \(bu 2.3
.\}
-.\" mysql-test-run.pl: default-myisam option
-.\" default-myisam option: mysql-test-run.pl
\fB\-\-default\-myisam\fR
.sp
Use MyISAM as default engine for all except InnoDB\-specific tests\&. This option is on by default in MySQL 5\&.5 and 5\&.6 but it off by default from MySQL 5\&.7\&. See also
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-test-run.pl: defaults-file option
-.\" default-file option: mysql-test-run.pl
\fB\-\-defaults\-file=\fR\fB\fIfile_name\fR\fR
.sp
Use the named file as fixed config file template for all tests\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-test-run.pl: defaults_extra_file option
-.\" default_extra_file option: mysql-test-run.pl
\fB\-\-defaults_extra_file=\fR\fB\fIfile_name\fR\fR
.sp
Add setting from the named file to all generated configs\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-test-run.pl: do-test option
-.\" do-test option: mysql-test-run.pl
-\fB\-\-do\-test=\fR\fB\fIprefix\fR\fR
+\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\&. This option provides a convenient way to run a family of similarly named tests\&.
+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 also 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,
+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,
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-test-run.pl: do-test-list option
-.\" do-test-list option: mysql-test-run.pl
\fB\-\-do\-testlist=\fR\fB\fIfile\fR\fR
.sp
Run all tests listed in the file
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-test-run.pl: embedded-server option
-.\" embedded-server option: mysql-test-run.pl
\fB\-\-embedded\-server\fR
.sp
Use a version of
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-test-run.pl: enable-disabled option
-.\" enable-disabled option: mysql-test-run.pl
\fB\-\-enable\-disabled\fR
.sp
Ignore any
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-test-run.pl: experimental option
-.\" experimental option: mysql-test-run.pl
\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
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-test-run.pl: explain-protocol option
-.\" explain-protocol option: mysql-test-run.pl
\fB\-\-explain\-protocol\fR,
.sp
Run
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-test-run.pl: extern option
-.\" extern option: mysql-test-run.pl
\fB\-\-extern\fR
\fIoption\fR=\fIvalue\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-test-run.pl: fast option
-.\" fast option: mysql-test-run.pl
\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
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-test-run.pl: force option
-.\" force option: mysql-test-run.pl
\fB\-\-force\fR
.sp
Normally,
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-test-run.pl: force-restart option
-.\" force-restart option: mysql-test-run.pl
\fB\-\-force\-restart\fR
.sp
Always restart 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\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-test-run.pl: gcov option
-.\" gcov option: mysql-test-run.pl
\fB\-\-gcov\fR
.sp
Run tests with the
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-test-run.pl: gdb option
-.\" gdb option: mysql-test-run.pl
\fB\-\-gdb\fR
.sp
Start
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-test-run.pl: gprof option
-.\" gprof option: mysql-test-run.pl
\fB\-\-gprof\fR
.sp
Run tests with the
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-test-run.pl: include-ndbcluster option
-.\" include-ndbcluster option: mysql-test-run.pl
\fB\-\-include\-ndbcluster\fR,
-.\" mysql-test-run.pl: include-ndb option
-.\" include-ndb option: mysql-test-run.pl
\fB\-\-include\-ndb\fR
.sp
Run also tests that need Cluster\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-test-run.pl: json-explain-protocol option
-.\" json-explain-protocol option: mysql-test-run.pl
\fB\-\-json\-explain\-protocol\fR,
.sp
Run
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-test-run.pl: manual-dbx option
-.\" manual-dbx option: mysql-test-run.pl
+\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
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-test-run.pl: manual-ddd option
-.\" manual-ddd option: mysql-test-run.pl
\fB\-\-manual\-ddd\fR
.sp
Use a server that has already been started by the user in the
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-test-run.pl: manual-debug option
-.\" manual-debug option: mysql-test-run.pl
\fB\-\-manual\-debug\fR
.sp
Use a server that has already been started by the user in a debugger\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-test-run.pl: manual-gdb option
-.\" manual-gdb option: mysql-test-run.pl
\fB\-\-manual\-gdb\fR
.sp
Use a server that has already been started by the user in the
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-test-run.pl: mark-progress option
-.\" mark-progress option: mysql-test-run.pl
\fB\-\-mark\-progress\fR
.sp
Marks progress with timing (in milliseconds) and line number in
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-test-run.pl: max-connections option
-.\" max-connections option: mysql-test-run.pl
\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
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-test-run.pl: max-save-core option
-.\" max-save-core option: mysql-test-run.pl
\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
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-test-run.pl: max-save-datadir option
-.\" max-save-datadir option: mysql-test-run.pl
\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
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-test-run.pl: max-test-fail option
-.\" max-test-fail option: mysql-test-run.pl
\fB\-\-max\-test\-fail=\fR\fB\fIN\fR\fR
.sp
Stop execution after the specified number of tests have failed, to avoid using up resources (and time) in case of massive failures\&. retries are noe counted, nor are failures of tests marked experimental\&. Defaults to 10, set to 0 for no limit\&. May also be set with the environment variable
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-test-run.pl: mem option
-.\" mem option: mysql-test-run.pl
\fB\-\-mem\fR
.sp
This option is not supported on Windows\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-test-run.pl: mysqld option
-.\" mysqld option: mysql-test-run.pl
\fB\-\-mysqld=\fR\fB\fIvalue\fR\fR
.sp
Extra option to pass to
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-test-run.pl: mysqld-env option
-.\" mysqld-env option: mysql-test-run.pl
\fB\-\-mysqld\-env=\fR\fB\fIvariable\fR\fR\fB=\fR\fB\fIvalue\fR\fR
.sp
Sets (or changes) an environment variable before starting
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-test-run.pl: mysqltest option
-.\" mysqltest option: mysql-test-run.pl
\fB\-\-mysqltest=\fR\fB\fIoptions\fR\fR
.sp
Extra options to pass to
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-test-run.pl: ndb-connectstring option
-.\" ndb-connectstring option: mysql-test-run.pl
\fB\-\-ndb\-connectstring=\fR\fB\fIstr\fR\fR
.sp
Pass
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-test-run.pl: nocheck-testcases option
-.\" nocheck-testcases option: mysql-test-run.pl
\fB\-\-nocheck\-testcases\fR
.sp
Disable the check for test case side effects; see
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-test-run.pl: nodefault-myisam option
-.\" nodefault-myisam option: mysql-test-run.pl
\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 -1
.IP \(bu 2.3
.\}
-.\" mysql-test-run.pl: noreorder option
-.\" noreorder option: mysql-test-run.pl
\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\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-test-run.pl: notimer option
-.\" notimer option: mysql-test-run.pl
\fB\-\-notimer\fR
.sp
Cause
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-test-run.pl: nounit-tests option
-.\" nounit-tests option: mysql-test-run.pl
\fB\-\-nounit\-tests\fR
.sp
Do not run unit tests, overriding default behavior or setting of the
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-test-run.pl: nowarnings option
-.\" nowarnings option: mysql-test-run.pl
\fB\-\-nowarnings\fR
.sp
Do not look for and report errors and warning in the server logs\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-test-run.pl: parallel option
-.\" parallel option: mysql-test-run.pl
\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
-for auto\-setting of
-\fIN\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
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-test-run.pl: port-base option
-.\" port-base option: mysql-test-run.pl
\fB\-\-port\-base=\fR\fB\fIP\fR\fR
.sp
Specify base of port numbers to be used; a block of 10 will be allocated\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-test-run.pl: print-testcases option
-.\" print-testcases option: mysql-test-run.pl
\fB\-\-print\-testcases\fR
.sp
Do not run any tests, but print details about all tests, in the order they would have been run\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-test-run.pl: ps-protocol option
-.\" ps-protocol option: mysql-test-run.pl
\fB\-\-ps\-protocol\fR
.sp
Pass the
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-test-run.pl: record option
-.\" record option: mysql-test-run.pl
\fB\-\-record\fR
.sp
Pass the
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-test-run.pl: reorder option
-.\" reorder option: mysql-test-run.pl
\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\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-test-run.pl: repeat option
-.\" repeat option: mysql-test-run.pl
\fB\-\-repeat=\fR\fB\fIN\fR\fR
.sp
Run each test
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-test-run.pl: report-features option
-.\" report-features option: mysql-test-run.pl
\fB\-\-report\-features\fR
.sp
Display the output of
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-test-run.pl: report-times option
-.\" report-times option: mysql-test-run.pl
\fB\-\-report\-times\fR
.sp
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
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-test-run.pl: retry option
-.\" retry option: mysql-test-run.pl
\fB\-\-retry=\fR\fB\fIN\fR\fR
.sp
If a test fails, it is retried up to a maximum of
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-test-run.pl: retry-failure option
-.\" retry-failure option: mysql-test-run.pl
\fB\-\-retry\-failure=\fR\fB\fIN\fR\fR
.sp
Allow a failed and retried test to fail more than the default 2 times before giving it up\&. Setting it to 0 or 1 effectively turns off retries
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-test-run.pl: shutdown-timeout option
-.\" shutdown-timeout option: mysql-test-run.pl
\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\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-test-run.pl: skip-combinations option
-.\" skip-combinations option: mysql-test-run.pl
\fB\-\-skip\-combinations\fR
.sp
Do not apply combinations; ignore combinations file or option\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-test-run.pl: skip-ndbcluster option
-.\" skip-ndbcluster option: mysql-test-run.pl
\fB\-\-skip\-ndbcluster\fR,
-.\" mysql-test-run.pl: skip-ndb option
-.\" skip-ndb option: mysql-test-run.pl
\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\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-test-run.pl: skip-ndbcluster-slave option
-.\" skip-ndbcluster-slave option: mysql-test-run.pl
\fB\-\-skip\-ndbcluster\-slave\fR,
-.\" mysql-test-run.pl: skip-ndb-slave option
-.\" skip-ndb-slave option: mysql-test-run.pl
\fB\-\-skip\-ndb\-slave\fR
.sp
Do not start an NDB Cluster slave\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-test-run.pl: skip-rpl option
-.\" skip-rpl option: mysql-test-run.pl
\fB\-\-skip\-rpl\fR
.sp
Skip replication test cases\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-test-run.pl: skip-ssl option
-.\" skip-ssl option: mysql-test-run.pl
\fB\-\-skip\-ssl\fR
.sp
Do not start
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-test-run.pl: skip-test option
-.\" skip-test option: mysql-test-run.pl
\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 -1
.IP \(bu 2.3
.\}
-.\" mysql-test-run.pl: skip-test-list option
-.\" skip-test-list option: mysql-test-run.pl
\fB\-\-skip\-test\-list=\fR\fB\fIfile\fR\fR
.sp
Specify a file listing tests that should be skipped (disabled)\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-test-run.pl: sleep option
-.\" sleep option: mysql-test-run.pl
\fB\-\-sleep=\fR\fB\fIN\fR\fR
.sp
Pass
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-test-run.pl: sp-protocol option
-.\" sp-protocol option: mysql-test-run.pl
\fB\-\-sp\-protocol\fR
.sp
Pass the
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-test-run.pl: ssl option
-.\" ssl option: mysql-test-run.pl
\fB\-\-ssl\fR
.sp
If
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-test-run.pl: start option
-.\" start option: mysql-test-run.pl
\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
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-test-run.pl: start-and-exit option
-.\" start-and-exit option: mysql-test-run.pl
\fB\-\-start\-and\-exit\fR
.sp
This is similar to
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-test-run.pl: start-dirty option
-.\" start-dirty option: mysql-test-run.pl
\fB\-\-start\-dirty\fR
.sp
This is similar to
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-test-run.pl: start-from option
-.\" start-from option: mysql-test-run.pl
\fB\-\-start\-from=\fR\fB\fItest_name\fR\fR
.sp
\fBmysql\-test\-run\&.pl\fR
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-test-run.pl: strace-client option
-.\" strace-client option: mysql-test-run.pl
\fB\-\-strace\-client\fR
.sp
Create
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-test-run.pl: strace-server option
-.\" strace-server option: mysql-test-run.pl
\fB\-\-strace\-server\fR
.sp
Create
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-test-run.pl: stress option
-.\" stress option: mysql-test-run.pl
\fB\-\-stress=\fR\fB\fIstress options\fR\fR
.sp
Start a server, but instead of running a test, run
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-test-run.pl: suite option
-.\" suite option: mysql-test-run.pl
\fB\-\-suite=\fR\fB\fIsuite_name\fR\fR
.sp
Run the named test suite\&. The default name is
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-test-run.pl: suite-timeout option
-.\" suite-timeout option: mysql-test-run.pl
\fB\-\-suite\-timeout=\fR\fB\fIminutes\fR\fR
.sp
Specify the maximum test suite runtime in minutes\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-test-run.pl: testcase-timeout option
-.\" testcase-timeout option: mysql-test-run.pl
\fB\-\-testcase\-timeout=\fR\fB\fIminutes\fR\fR
.sp
Specify the maximum test case runtime in minutes\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-test-run.pl: timediff option
-.\" timediff option: mysql-test-run.pl
\fB\-\-timediff\fR
.sp
Adds to each test report for a test case, the total time in sconds and milliseconds passed since the preceding test ended\&. This option can only be used together with
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-test-run.pl: timer option
-.\" timer option: mysql-test-run.pl
\fB\-\-timer\fR
.sp
Cause
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-test-run.pl: timestamp option
-.\" timestamp option: mysql-test-run.pl
\fB\-\-timestamp\fR
.sp
Prints a timestamp before the test case name in each test report line, showing when the test ended\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-test-run.pl: tmpdir option
-.\" tmpdir option: mysql-test-run.pl
\fB\-\-tmpdir=\fR\fB\fIpath\fR\fR
.sp
The directory where temporary file are stored\&. The default location is
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-test-run.pl: unit-tests option
-.\" unit-tests option: mysql-test-run.pl
\fB\-\-unit\-tests\fR
.sp
Force running of unit tests, overriding default behavior or setting of the
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-test-run.pl: unit-tests-report option
-.\" unit-tests-report option: mysql-test-run.pl
\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
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-test-run.pl: user option
-.\" user option: mysql-test-run.pl
\fB\-\-user=\fR\fB\fIuser_name\fR\fR
.sp
The MySQL user name to use when connecting to the server\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-test-run.pl: user-args option
-.\" user-args option: mysql-test-run.pl
\fB\-\-user\-args\fR
.sp
Drops all non\-essential command line arguments to the
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-test-run.pl: valgrind option
-.\" valgrind option: mysql-test-run.pl
\fB\-\-valgrind\fR
.sp
Run
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-test-run.pl: valgrind-clients option
-.\" valgrind-clients option: mysql-test-run.pl
\fB\-\-valgrind\-clients\fR
.sp
Run all clients started by
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-test-run.pl: valgrind-mysqld option
-.\" valgrind-mysqld option: mysql-test-run.pl
\fB\-\-valgrind\-mysqld\fR
.sp
Run the
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-test-run.pl: valgrind-mysqltest option
-.\" valgrind-mysqltest option: mysql-test-run.pl
\fB\-\-valgrind\-mysqltest\fR
.sp
Run
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-test-run.pl: valgrind-options option
-.\" valgrind-options option: mysql-test-run.pl
\fB\-\-valgrind\-option=\fR\fB\fIstr\fR\fR
.sp
Extra options to pass to
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-test-run.pl: valgrind-path option
-.\" valgrind-path option: mysql-test-run.pl
\fB\-\-valgrind\-path=\fR\fB\fIpath\fR\fR
.sp
Specify the path name to the
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-test-run.pl: vardir option
-.\" vardir option: mysql-test-run.pl
\fB\-\-vardir=\fR\fB\fIpath\fR\fR
.sp
Specify the path where files generated during the test run are stored\&. The default location is
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-test-run.pl: verbose option
-.\" verbose option: mysql-test-run.pl
\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\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-test-run.pl: verbose-restart option
-.\" verbose-restart option: mysql-test-run.pl
\fB\-\-verbose\-restart\fR
.sp
Write when and why servers are restarted between test cases\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-test-run.pl: view-protocol option
-.\" view-protocol option: mysql-test-run.pl
\fB\-\-view\-protocol\fR
.sp
Pass the
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-test-run.pl: vs-config option
-.\" vs-config option: mysql-test-run.pl
\fB\-\-vs\-config=\fR\fB\fIconfig_val\fR\fR
.sp
Specify the configuration used to build MySQL (for example,
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-test-run.pl: wait-all option
-.\" wait-all option: mysql-test-run.pl
\fB\-\-wait\-all\fR
.sp
If
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-test-run.pl: warnings option
-.\" warnings option: mysql-test-run.pl
\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
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-test-run.pl: with-ndbcluster-only option
-.\" with-ndbcluster-only option: mysql-test-run.pl
\fB\-\-with\-ndbcluster\-only\fR
.sp
Run only test cases that have
'\" t
.\" Title: \fBmysql\fR
.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author]
-.\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\" Date: 03/02/2016
+.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
+.\" Date: 08/25/2016
.\" Manual: MySQL Database System
.\" Source: MySQL 5.6
.\" Language: English
.\"
-.TH "\FBMYSQL\FR" "1" "03/02/2016" "MySQL 5\&.6" "MySQL Database System"
+.TH "\FBMYSQL\FR" "1" "08/25/2016" "MySQL 5\&.6" "MySQL Database System"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
-.\" mysql
-.\" command-line tool
-.\" tools: command-line
-.\" scripts: SQL
-.\" SQL scripts
-.\" batch SQL files
.SH "NAME"
mysql \- the MySQL command\-line tool
.SH "SYNOPSIS"
client logs statements executed interactively to a history file\&. See
the section called \(lqMYSQL LOGGING\(rq\&.
.SH "MYSQL OPTIONS"
-.\" mysql command options
-.\" command options: mysql
-.\" options: command-line: mysql
-.\" startup parameters: mysql
.PP
\fBmysql\fR
supports the following options, which can be specified on the command line or in the
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql: help option
-.\" help option: mysql
\fB\-\-help\fR,
\fB\-?\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql: auto-rehash option
-.\" auto-rehash option: mysql
\fB\-\-auto\-rehash\fR
.sp
Enable automatic rehashing\&. This option is on by default, which enables database, table, and column name completion\&. Use
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql: auto-vertical-output option
-.\" auto-vertical-output option: mysql
\fB\-\-auto\-vertical\-output\fR
.sp
Cause result sets to be displayed vertically if they are too wide for the current window, and using normal tabular format otherwise\&. (This applies to statements terminated by
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql: batch option
-.\" batch option: mysql
\fB\-\-batch\fR,
\fB\-B\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql: binary-mode option
-.\" binary-mode option: mysql
\fB\-\-binary\-mode\fR
.sp
This option helps when processing
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql: bind-address option
-.\" bind-address option: mysql
\fB\-\-bind\-address=\fR\fB\fIip_address\fR\fR
.sp
On a computer having multiple network interfaces, use this option to select which interface to use for connecting to the MySQL server\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql: character-sets-dir option
-.\" character-sets-dir option: mysql
\fB\-\-character\-sets\-dir=\fR\fB\fIdir_name\fR\fR
.sp
The directory where character sets are installed\&. See
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql: column-names option
-.\" column-names option: mysql
\fB\-\-column\-names\fR
.sp
Write column names in results\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql: column-type-info option
-.\" column-type-info option: mysql
\fB\-\-column\-type\-info\fR
.sp
Display result set metadata\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql: comments option
-.\" comments option: mysql
\fB\-\-comments\fR,
\fB\-c\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql: compress option
-.\" compress option: mysql
\fB\-\-compress\fR,
\fB\-C\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql: connect-expired-password option
-.\" connect-expired-password option: mysql
\fB\-\-connect\-expired\-password\fR
.sp
Indicate to the server that the client can handle sandbox mode if the account used to connect has an expired password\&. This can be useful for noninteractive invocations of
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql: database option
-.\" database option: mysql
\fB\-\-database=\fR\fB\fIdb_name\fR\fR,
\fB\-D \fR\fB\fIdb_name\fR\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql: debug option
-.\" debug option: mysql
\fB\-\-debug[=\fR\fB\fIdebug_options\fR\fR\fB]\fR,
\fB\-# [\fR\fB\fIdebug_options\fR\fR\fB]\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql: debug-check option
-.\" debug-check option: mysql
\fB\-\-debug\-check\fR
.sp
Print some debugging information when the program exits\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql: debug-info option
-.\" debug-info option: mysql
\fB\-\-debug\-info\fR,
\fB\-T\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql: default-auth option
-.\" default-auth option: mysql
\fB\-\-default\-auth=\fR\fB\fIplugin\fR\fR
.sp
A hint about the client\-side authentication plugin to use\&. See
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql: default-character-set option
-.\" default-character-set option: mysql
\fB\-\-default\-character\-set=\fR\fB\fIcharset_name\fR\fR
.sp
Use
\fIcharset_name\fR
as the default character set for the client and connection\&.
.sp
-A common issue that can occur when the operating system uses
-utf8
-or another multibyte character set is that output from the
+This option can be useful if the operating system uses one character set and the
\fBmysql\fR
-client is formatted incorrectly, due to the fact that the MySQL client uses the
-latin1
-character set by default\&. You can usually fix such issues by using this option to force the client to use the system character set instead\&.
+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
-See
-Section\ \&10.5, \(lqCharacter Set Configuration\(rq, for more information\&.
+For more information, see
+Section\ \&10.1.5, \(lqConnection Character Sets and Collations\(rq, and
+Section\ \&10.5, \(lqCharacter Set Configuration\(rq\&.
.RE
.sp
.RS 4
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql: defaults-extra-file option
-.\" defaults-extra-file option: mysql
\fB\-\-defaults\-extra\-file=\fR\fB\fIfile_name\fR\fR
.sp
Read this option file after the global option file but (on Unix) before the user option file\&. If the file does not exist or is otherwise inaccessible, an error occurs\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql: defaults-file option
-.\" defaults-file option: mysql
\fB\-\-defaults\-file=\fR\fB\fIfile_name\fR\fR
.sp
Use only the given option file\&. If the file does not exist or is otherwise inaccessible, an error occurs\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql: defaults-group-suffix option
-.\" defaults-group-suffix option: mysql
\fB\-\-defaults\-group\-suffix=\fR\fB\fIstr\fR\fR
.sp
Read not only the usual option groups, but also groups with the usual names and a suffix of
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql: delimiter option
-.\" delimiter option: mysql
\fB\-\-delimiter=\fR\fB\fIstr\fR\fR
.sp
Set the statement delimiter\&. The default is the semicolon character (\(lq;\(rq)\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql: disable named commands
-.\" disable named command: mysql
\fB\-\-disable\-named\-commands\fR
.sp
Disable named commands\&. Use the
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql: enable-cleartext-plugin option
-.\" enable-cleartext-plugin option: mysql
\fB\-\-enable\-cleartext\-plugin\fR
.sp
Enable the
mysql_clear_password
cleartext authentication plugin\&. (See
-Section\ \&6.4.1.7, \(lqThe Cleartext Client-Side Authentication Plugin\(rq\&.) This option was added in MySQL 5\&.6\&.7\&.
+Section\ \&6.5.1.7, \(lqThe Cleartext Client-Side Authentication Plugin\(rq\&.) This option was added in MySQL 5\&.6\&.7\&.
.RE
.sp
.RS 4
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql: execute option
-.\" execute option: mysql
\fB\-\-execute=\fR\fB\fIstatement\fR\fR,
\fB\-e \fR\fB\fIstatement\fR\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql: force option
-.\" force option: mysql
\fB\-\-force\fR,
\fB\-f\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql: histignore option
-.\" histignore option: mysql
\fB\-\-histignore\fR
.sp
A colon\-separated list of one or more patterns specifying statements to ignore for logging purposes\&. These patterns are added to the default pattern list ("*IDENTIFIED*:*PASSWORD*")\&. The value specified for this option affects logging of statements written to the history file\&. For more information, see
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql: host option
-.\" host option: mysql
\fB\-\-host=\fR\fB\fIhost_name\fR\fR,
\fB\-h \fR\fB\fIhost_name\fR\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql: html option
-.\" html option: mysql
\fB\-\-html\fR,
\fB\-H\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql: ignore-spaces option
-.\" ignore-spaces option: mysql
\fB\-\-ignore\-spaces\fR,
\fB\-i\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql: init-command option
-.\" init-command option: mysql
\fB\-\-init\-command=str\fR
.sp
SQL statement to execute after connecting to the server\&. If auto\-reconnect is enabled, the statement is executed again after reconnection occurs\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql: line-numbers option
-.\" line-numbers option: mysql
\fB\-\-line\-numbers\fR
.sp
Write line numbers for errors\&. Disable this with
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql: local-infile option
-.\" local-infile option: mysql
\fB\-\-local\-infile[={0|1}]\fR
.sp
Enable or disable
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql: login-path option
-.\" login-path option: mysql
\fB\-\-login\-path=\fR\fB\fIname\fR\fR
.sp
Read options from the named login path in the
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql: named-commands option
-.\" named-commands option: mysql
\fB\-\-named\-commands\fR,
\fB\-G\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql: no-auto-rehash option
-.\" no-auto-rehash option: mysql
\fB\-\-no\-auto\-rehash\fR,
\fB\-A\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql: no-beep option
-.\" no-beep option: mysql
\fB\-\-no\-beep\fR,
\fB\-b\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql: no-defaults option
-.\" no-defaults option: mysql
\fB\-\-no\-defaults\fR
.sp
Do not read any option files\&. If program startup fails due to reading unknown options from an option file,
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql: one-database option
-.\" one-database option: mysql
\fB\-\-one\-database\fR,
\fB\-o\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql: pager option
-.\" pager option: mysql
\fB\-\-pager[=\fR\fB\fIcommand\fR\fR\fB]\fR
.sp
Use the given command for paging query output\&. If the command is omitted, the default pager is the value of your
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql: password option
-.\" password option: mysql
\fB\-\-password[=\fR\fB\fIpassword\fR\fR\fB]\fR,
\fB\-p[\fR\fB\fIpassword\fR\fR\fB]\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql: pipe option
-.\" pipe option: mysql
\fB\-\-pipe\fR,
\fB\-W\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql: plugin-dir option
-.\" plugin-dir option: mysql
\fB\-\-plugin\-dir=\fR\fB\fIdir_name\fR\fR
.sp
The directory in which to look for plugins\&. Specify this option if the
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql: port option
-.\" port option: mysql
-.\" TCP/IP
\fB\-\-port=\fR\fB\fIport_num\fR\fR,
\fB\-P \fR\fB\fIport_num\fR\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql: print-defaults option
-.\" print-defaults option: mysql
\fB\-\-print\-defaults\fR
.sp
Print the program name and all options that it gets from option files\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql: prompt option
-.\" prompt option: mysql
\fB\-\-prompt=\fR\fB\fIformat_str\fR\fR
.sp
Set the prompt to the specified format\&. The default is
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql: protocol option
-.\" protocol option: mysql
\fB\-\-protocol={TCP|SOCKET|PIPE|MEMORY}\fR
.sp
The connection protocol to use for connecting to the server\&. It is useful when the other connection parameters normally would cause a protocol to be used other than the one you want\&. For details on the permissible values, see
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql: quick option
-.\" quick option: mysql
\fB\-\-quick\fR,
\fB\-q\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql: raw option
-.\" raw option: mysql
\fB\-\-raw\fR,
\fB\-r\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql: reconnect option
-.\" reconnect option: mysql
\fB\-\-reconnect\fR
.sp
If the connection to the server is lost, automatically try to reconnect\&. A single reconnect attempt is made each time the connection is lost\&. To suppress reconnection behavior, use
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql: safe-updates option
-.\" safe-updates option: mysql
-.\" mysql: i-am-a-dummy option
-.\" i-am-a-dummy option: mysql
\fB\-\-safe\-updates\fR,
\fB\-\-i\-am\-a\-dummy\fR,
\fB\-U\fR
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql: secure-auth option
-.\" secure-auth option: mysql
\fB\-\-secure\-auth\fR
.sp
Do not send passwords to the server in old (pre\-4\&.1) format\&. This prevents connections except for servers that use the newer password format\&. As of MySQL 5\&.6\&.7, this option is enabled by default; use
.ps -1
.br
Passwords that use the pre\-4\&.1 hashing method are less secure than passwords that use the native password hashing method and should be avoided\&. Pre\-4\&.1 passwords are deprecated and support for them will be removed in a future MySQL release\&. For account upgrade instructions, see
-Section\ \&6.4.1.3, \(lqMigrating Away from Pre-4.1 Password Hashing and the mysql_old_password Plugin\(rq\&.
+Section\ \&6.5.1.3, \(lqMigrating Away from Pre-4.1 Password Hashing and the mysql_old_password Plugin\(rq\&.
+.sp .5v
+.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
+This option is deprecated and will be removed in a future release\&. As of MySQL 5\&.7\&.5, it is always enabled and attempting to disable it produces an error\&.
.sp .5v
.RE
.RE
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql: server-public-key-path option
-.\" server-public-key-path option: mysql
\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
For additional discussion regarding use of the
sha256_password
plugin, including how to get the RSA public key, see
-Section\ \&6.4.1.4, \(lqThe SHA-256 Authentication Plugin\(rq\&.
+Section\ \&6.5.1.4, \(lqThe SHA-256 Authentication Plugin\(rq\&.
.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
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql: shared-memory-base-name option
-.\" shared-memory-base-name option: mysql
\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
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql: show-warnings option
-.\" show-warnings option: mysql
\fB\-\-show\-warnings\fR
.sp
Cause warnings to be shown after each statement if there are any\&. This option applies to interactive and batch mode\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql: sigint-ignore option
-.\" sigint-ignore option: mysql
\fB\-\-sigint\-ignore\fR
.sp
Ignore
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql: silent option
-.\" silent option: mysql
\fB\-\-silent\fR,
\fB\-s\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql: skip-column-names option
-.\" skip-column-names option: mysql
\fB\-\-skip\-column\-names\fR,
\fB\-N\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql: skip-line-numbers option
-.\" skip-line-numbers option: mysql
\fB\-\-skip\-line\-numbers\fR,
\fB\-L\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql: socket option
-.\" socket option: mysql
\fB\-\-socket=\fR\fB\fIpath\fR\fR,
\fB\-S \fR\fB\fIpath\fR\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql: SSL options
-.\" SSL options: mysql
\fB\-\-ssl*\fR
.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.3.9.5, \(lqCommand Options for Secure Connections\(rq\&.
+Section\ \&6.4.5, \(lqCommand Options for Secure Connections\(rq\&.
.RE
.sp
.RS 4
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql: table option
-.\" table option: mysql
\fB\-\-table\fR,
\fB\-t\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql: tee option
-.\" tee option: mysql
\fB\-\-tee=\fR\fB\fIfile_name\fR\fR
.sp
Append a copy of output to the given file\&. This option works only in interactive mode\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql: unbuffered option
-.\" unbuffered option: mysql
\fB\-\-unbuffered\fR,
\fB\-n\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql: user option
-.\" user option: mysql
\fB\-\-user=\fR\fB\fIuser_name\fR\fR,
\fB\-u \fR\fB\fIuser_name\fR\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql: verbose option
-.\" verbose option: mysql
\fB\-\-verbose\fR,
\fB\-v\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql: version option
-.\" version option: mysql
\fB\-\-version\fR,
\fB\-V\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql: vertical option
-.\" vertical option: mysql
\fB\-\-vertical\fR,
\fB\-E\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql: wait option
-.\" wait option: mysql
\fB\-\-wait\fR,
\fB\-w\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql: xml option
-.\" xml option: mysql
\fB\-\-xml\fR,
\fB\-X\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" timeout: connect_timeout variable
-.\" connect_timeout variable
connect_timeout
.sp
The number of seconds before connection timeout\&. (Default value is
.sp -1
.IP \(bu 2.3
.\}
-.\" max_allowed_packet variable
max_allowed_packet
.sp
The maximum size of the buffer for client/server communication\&. The default is 16MB, the maximum is 1GB\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" max_join_size variable
max_join_size
.sp
The automatic limit for rows in a join when using
.sp -1
.IP \(bu 2.3
.\}
-.\" net_buffer_length variable
net_buffer_length
.sp
The buffer size for TCP/IP and socket communication\&. (Default value is 16KB\&.)
.sp -1
.IP \(bu 2.3
.\}
-.\" select_limit variable
select_limit
.sp
The automatic limit for
at the
mysql>
prompt:
-.\" mysql commands: list of
.sp
.if n \{\
.RS 4
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql: help command
-.\" help command: mysql
help [\fIarg\fR],
\eh [\fIarg\fR],
\e? [\fIarg\fR],
command,
\fBmysql\fR
uses it as a search string to access server\-side help from the contents of the MySQL Reference Manual\&. For more information, see
-the section called \(lqMYSQL SERVER-SIDE HELP\(rq\&.
+the section called \(lqMYSQL SERVER\-SIDE HELP\(rq\&.
.RE
.sp
.RS 4
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql: charset command
-.\" charset command: mysql
charset \fIcharset_name\fR,
\eC \fIcharset_name\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql: clear command
-.\" clear command: mysql
clear,
\ec
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql: connect command
-.\" connect command: mysql
connect [\fIdb_name\fR \fIhost_name\fR]],
\er [\fIdb_name\fR \fIhost_name\fR]]
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql: delimiter command
-.\" delimiter command: mysql
delimiter \fIstr\fR,
\ed \fIstr\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql: edit command
-.\" edit command: mysql
edit,
\ee
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql: ego command
-.\" ego command: mysql
ego,
\eG
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql: exit command
-.\" exit command: mysql
exit,
\eq
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql: go command
-.\" go command: mysql
go,
\eg
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql: nopager command
-.\" nopager command: mysql
nopager,
\en
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql: notee command
-.\" notee command: mysql
notee,
\et
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql: nowarning command
-.\" nowarning command: mysql
nowarning,
\ew
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql: pager command
-.\" pager command: mysql
pager [\fIcommand\fR],
\eP [\fIcommand\fR]
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql: print command
-.\" print command: mysql
print,
\ep
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql: prompt command
-.\" prompt command: mysql
prompt [\fIstr\fR],
\eR [\fIstr\fR]
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql: quit command
-.\" quit command: mysql
quit,
\eq
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql: rehash command
-.\" rehash command: mysql
rehash,
\e#
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql: source command
-.\" source command: mysql
source \fIfile_name\fR,
\e\&. \fIfile_name\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql: status command
-.\" status command: mysql
status,
\es
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql: system command
-.\" system command: mysql
system \fIcommand\fR,
\e! \fIcommand\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql: tee command
-.\" tee command: mysql
tee [\fIfile_name\fR],
\eT [\fIfile_name\fR]
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql: use command
-.\" use command: mysql
use \fIdb_name\fR,
\eu \fIdb_name\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql: warnings command
-.\" warnings command: mysql
warnings,
\eW
.sp
tee
file logging can be turned on and off interactively from within
\fBmysql\fR\&. This is useful when you want to log some queries to a file, but not others\&.
-.\" mysql prompt command
.PP
The
prompt
.\}
.RE
.SH "MYSQL LOGGING"
-.\" MYSQL_HISTFILE environment variable
-.\" environment variable: MYSQL_HISTFILE
-.\" MYSQL_HISTIGNORE environment variable
-.\" environment variable: MYSQL_HISTIGNORE
-.\" HOME environment variable
-.\" environment variable: HOME
-.\" mysql history file
-.\" command-line history: mysql
-.\" .mysql_history file
.PP
On Unix, the
\fBmysql\fR
.RE
.\}
.RE
-.SH "MYSQL SERVER-SIDE HELP"
+.SH "MYSQL SERVER\-SIDE HELP"
.sp
.if n \{\
.RS 4
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.9, \(lqServer-Side Help\(rq)\&.
.PP
If there is no match for the search string, the search fails:
.sp
.RE
.\}
.SH "EXECUTING SQL STATEMENTS FROM A TEXT FILE"
-.\" executing SQL statements from text files
-.\" importing: data
-.\" data: importing
-.\" files: text
-.\" text files: importing
-.\" source (mysql client command)
-.\" \. (mysql client command)
-.\" mysql source (command for reading from text files)
-.\" mysql \. (command for reading from text files)
.PP
The
\fBmysql\fR
.RE
.\}
.SS "Using the \-\-safe\-updates Option"
-.\" safe-updates option
.PP
For beginners, a useful startup option is
\fB\-\-safe\-updates\fR
'\" t
.\" Title: \fBmysql.server\fR
.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author]
-.\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\" Date: 03/02/2016
+.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
+.\" Date: 08/25/2016
.\" Manual: MySQL Database System
.\" Source: MySQL 5.6
.\" Language: English
.\"
-.TH "\FBMYSQL\&.SERVER\FR" "1" "03/02/2016" "MySQL 5\&.6" "MySQL Database System"
+.TH "\FBMYSQL\&.SERVER\FR" "1" "08/25/2016" "MySQL 5\&.6" "MySQL Database System"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
-.\" mysql.server
.SH "NAME"
mysql.server \- MySQL server startup script
.SH "SYNOPSIS"
[mysql_server]
sections, but to be current you should rename such sections to
[mysql\&.server]\&.
-.\" changing: socket location
.PP
You can add options for
\fBmysql\&.server\fR
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql.server: basedir option
-.\" basedir option: mysql.server
\fB\-\-basedir=\fR\fB\fIdir_name\fR\fR
.sp
The path to the MySQL installation directory\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql.server: datadir option
-.\" datadir option: mysql.server
\fB\-\-datadir=\fR\fB\fIdir_name\fR\fR
.sp
The path to the MySQL data directory\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql.server: pid-file option
-.\" pid-file option: mysql.server
\fB\-\-pid\-file=\fR\fB\fIfile_name\fR\fR
.sp
The path name of the file in which the server should write its process ID\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql.server: service-startup-timeout option
-.\" service-startup-timeout option: mysql.server
\fB\-\-service\-startup\-timeout=\fR\fB\fIseconds\fR\fR
.sp
How long in seconds to wait for confirmation of server startup\&. If the server does not start within this time,
'\" t
.\" Title: \fBmysql_client_test\fR
.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author]
-.\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\" Date: 03/02/2016
+.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
+.\" Date: 08/25/2016
.\" Manual: MySQL Database System
.\" Source: MySQL
.\" Language: English
.\"
-.TH "\FBMYSQL_CLIENT_TEST" "1" "03/02/2016" "MySQL" "MySQL Database System"
+.TH "\FBMYSQL_CLIENT_TEST" "1" "08/25/2016" "MySQL" "MySQL Database System"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
-.\" mysql_client_test
-.\" mysql_client_test_embedded
.SH "NAME"
mysql_client_test \- test client API
.br
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql_client_test: help option
-.\" help option: mysql_client_test
\fB\-\-help\fR,
\fB\-?\fR
.sp
.IP \(bu 2.3
.\}
\fB\-\-basedir=\fR\fB\fIdir_name\fR\fR,
-.\" mysql_client_test: basedir option
-.\" basedir option: mysql_client_test
\fB\-b \fR\fB\fIdir_name\fR\fR
.sp
The base directory for the tests\&.
.IP \(bu 2.3
.\}
\fB\-\-count=\fR\fB\fIcount\fR\fR,
-.\" mysql_client_test: count option
-.\" count option: mysql_client_test
\fB\-t \fR\fB\fIcount\fR\fR
.sp
The number of times to execute the tests\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql_client_test: database option
-.\" database option: mysql_client_test
\fB\-\-database=\fR\fB\fIdb_name\fR\fR,
\fB\-D \fR\fB\fIdb_name\fR\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql_client_test: debug option
-.\" debug option: mysql_client_test
\fB\-\-debug[=\fR\fB\fIdebug_options\fR\fR\fB]\fR,
\fB\-#[\fR\fB\fIdebug_options\fR\fR\fB]\fR
.sp
.IP \(bu 2.3
.\}
\fB\-\-getopt\-ll\-test=\fR\fB\fIoption\fR\fR,
-.\" mysql_client_test: getopt-ll-test option
-.\" getopt-ll-test option: mysql_client_test
\fB\-g \fR\fB\fIoption\fR\fR
.sp
Option to use for testing bugs in the
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql_client_test: host option
-.\" host option: mysql_client_test
\fB\-\-host=\fR\fB\fIhost_name\fR\fR,
\fB\-h \fR\fB\fIhost_name\fR\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql_client_test: password option
-.\" password option: mysql_client_test
\fB\-\-password[=\fR\fB\fIpassword\fR\fR\fB]\fR,
\fB\-p[\fR\fB\fIpassword\fR\fR\fB]\fR
.sp
have a space between the option and the password\&. If you omit the
\fIpassword\fR
value following the
-.\" mysql_client_test: password option
-.\" password option: mysql_client_test
\fB\-\-password\fR
or
\fB\-p\fR
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql_client_test: port option
-.\" port option: mysql_client_test
\fB\-\-port=\fR\fB\fIport_num\fR\fR,
\fB\-P \fR\fB\fIport_num\fR\fR
.sp
.IP \(bu 2.3
.\}
\fB\-\-server\-arg=\fR\fB\fIarg\fR\fR,
-.\" mysql_client_test: server-arg option
-.\" server-arg option: mysql_client_test
\fB\-A \fR\fB\fIarg\fR\fR
.sp
Argument to send to the embedded server\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql_client_test: silent option
-.\" silent option: mysql_client_test
\fB\-\-silent\fR,
\fB\-s\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql_client_test: socket option
-.\" socket option: mysql_client_test
\fB\-\-socket=\fR\fB\fIpath\fR\fR,
\fB\-S \fR\fB\fIpath\fR\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql_client_test: user option
-.\" user option: mysql_client_test
\fB\-\-user=\fR\fB\fIuser_name\fR\fR,
\fB\-u \fR\fB\fIuser_name\fR\fR
.sp
.IP \(bu 2.3
.\}
\fB\-v \fR\fB\fIdir_name\fR\fR,
-.\" mysql_client_test: vardir option
-.\" vardir option: mysql_client_test
\fB\-\-vardir=\fR\fB\fIdir_name\fR\fR
.sp
The data directory for tests\&. The default is
-.so man/mysql_client_test.1
+.so mysql_client_test.1
'\" t
.\" Title: \fBmysql_config\fR
.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author]
-.\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\" Date: 03/02/2016
+.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
+.\" Date: 08/25/2016
.\" Manual: MySQL Database System
.\" Source: MySQL 5.6
.\" Language: English
.\"
-.TH "\FBMYSQL_CONFIG\FR" "1" "03/02/2016" "MySQL 5\&.6" "MySQL Database System"
+.TH "\FBMYSQL_CONFIG\FR" "1" "08/25/2016" "MySQL 5\&.6" "MySQL Database System"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
-.\" mysql_config
.SH "NAME"
mysql_config \- display options for compiling clients
.SH "SYNOPSIS"
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql_config: cflags option
-.\" cflags option: mysql_config
\fB\-\-cflags\fR
.sp
C Compiler flags to find include files and critical compiler flags and defines used when compiling the
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql_config: cxxflags option
-.\" cxxflags option: mysql_config
\fB\-\-cxxflags\fR
.sp
Like
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql_config: include option
-.\" include option: mysql_config
\fB\-\-include\fR
.sp
Compiler options to find MySQL include files\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql_config: libmysqld-libs option
-.\" libmysqld-libs option: mysql_config
-.\" mysql_config: embedded option
-.\" embedded option: mysql_config
\fB\-\-libmysqld\-libs\fR,
\fB\-\-embedded\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql_config: libs option
-.\" libs option: mysql_config
\fB\-\-libs\fR
.sp
Libraries and options required to link with the MySQL client library\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql_config: libs_r option
-.\" libs_r option: mysql_config
\fB\-\-libs_r\fR
.sp
Libraries and options required to link with the thread\-safe MySQL client library\&. In MySQL 5\&.6, all client libraries are thread\-safe, so this option need not be used\&. The
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql_config: plugindir option
-.\" plugindir option: mysql_config
\fB\-\-plugindir\fR
.sp
The default plugin directory path name, defined when configuring MySQL\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql_config: port option
-.\" port option: mysql_config
-.\" TCP/IP
\fB\-\-port\fR
.sp
The default TCP/IP port number, defined when configuring MySQL\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql_config: socket option
-.\" socket option: mysql_config
\fB\-\-socket\fR
.sp
The default Unix socket file, defined when configuring MySQL\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql_config: variable option
-.\" variable option: mysql_config
\fB\-\-variable=\fR\fB\fIvar_name\fR\fR
.sp
Display the value of the named configuration variable\&. Permitted
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql_config: version option
-.\" version option: mysql_config
\fB\-\-version\fR
.sp
Version number for the MySQL distribution\&.
'\" t
.\" Title: \fBmysql_config_editor\fR
.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author]
-.\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\" Date: 03/02/2016
+.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
+.\" Date: 08/25/2016
.\" Manual: MySQL Database System
.\" Source: MySQL 5.6
.\" Language: English
.\"
-.TH "\FBMYSQL_CONFIG_EDIT" "1" "03/02/2016" "MySQL 5\&.6" "MySQL Database System"
+.TH "\FBMYSQL_CONFIG_EDIT" "1" "08/25/2016" "MySQL 5\&.6" "MySQL Database System"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
-.\" mysql_config_editor
-.\" .mylogin.cnf file
.SH "NAME"
mysql_config_editor \- configure authentication information for connecting to MySQL server
.SH "SYNOPSIS"
\&.mylogin\&.cnf
in conjunction with other option files\&. Its precedence is higher than other option files, but less than options specified explicitly on the client command line\&. For information about the order in which option files are used, see
Section\ \&4.2.6, \(lqUsing Option Files\(rq\&.
-.\" MYSQL_TEST_LOGIN_FILE environment variable
-.\" environment variable: MYSQL_TEST_LOGIN_FILE
.PP
To specify an alternate login path file name, set the
MYSQL_TEST_LOGIN_FILE
.\}
With a
\fB\-\-login\-path\fR
-option, client programs additionally read the named login path from the login path ile\&. The option groups read from other option files remain the same\&. Consider this command:
+option, client programs additionally read the named login path from the login path file\&. The option groups read from other option files remain the same\&. Consider this command:
.sp
.if n \{\
.RS 4
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql_config_editor: help option
-.\" help option: mysql_config_editor
\fB\-\-help\fR,
\fB\-?\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql_config_editor: debug option
-.\" debug option: mysql_config_editor
\fB\-\-debug[=\fR\fB\fIdebug_options\fR\fR\fB]\fR,
\fB\-# \fR\fB\fIdebug_options\fR\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql_config_editor: verbose option
-.\" verbose option: mysql_config_editor
\fB\-\-verbose\fR,
\fB\-v\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql_config_editor: version option
-.\" version option: mysql_config_editor
\fB\-\-version\fR,
\fB\-V\fR
.sp
'\" t
.\" Title: \fBmysql_convert_table_format\fR
.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author]
-.\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\" Date: 03/02/2016
+.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
+.\" Date: 08/25/2016
.\" Manual: MySQL Database System
.\" Source: MySQL 5.6
.\" Language: English
.\"
-.TH "\FBMYSQL_CONVERT_TAB" "1" "03/02/2016" "MySQL 5\&.6" "MySQL Database System"
+.TH "\FBMYSQL_CONVERT_TAB" "1" "08/25/2016" "MySQL 5\&.6" "MySQL Database System"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
-.\" mysql_convert_table_format
.SH "NAME"
mysql_convert_table_format \- convert tables to use a given storage engine
.SH "SYNOPSIS"
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql_convert_table_format: help option
-.\" help option: mysql_convert_table_format
\fB\-\-help\fR
.sp
Display a help message and exit\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql_convert_table_format: force option
-.\" force option: mysql_convert_table_format
\fB\-\-force\fR
.sp
Continue even if errors occur\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql_convert_table_format: host option
-.\" host option: mysql_convert_table_format
\fB\-\-host=\fR\fB\fIhost_name\fR\fR
.sp
Connect to the MySQL server on the given host\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql_convert_table_format: password option
-.\" password option: mysql_convert_table_format
\fB\-\-password=\fR\fB\fIpassword\fR\fR
.sp
The password to use when connecting to the server\&. Note that the password value is not optional for this option, unlike for other MySQL programs\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql_convert_table_format: port option
-.\" port option: mysql_convert_table_format
\fB\-\-port=\fR\fB\fIport_num\fR\fR
.sp
The TCP/IP port number to use for the connection\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql_convert_table_format: socket option
-.\" socket option: mysql_convert_table_format
\fB\-\-socket=\fR\fB\fIpath\fR\fR
.sp
For connections to
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql_convert_table_format: type option
-.\" type option: mysql_convert_table_format
\fB\-\-type=\fR\fB\fIengine_name\fR\fR
.sp
Specify the storage engine that the tables should be converted to use\&. The default is
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql_convert_table_format: user option
-.\" user option: mysql_convert_table_format
\fB\-\-user=\fR\fB\fIuser_name\fR\fR
.sp
The MySQL user name to use when connecting to the server\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql_convert_table_format: verbose option
-.\" verbose option: mysql_convert_table_format
\fB\-\-verbose\fR
.sp
Verbose mode\&. Print more information about what the program does\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql_convert_table_format: version option
-.\" version option: mysql_convert_table_format
\fB\-\-version\fR
.sp
Display version information and exit\&.
'\" t
.\" Title: \fBmysql_find_rows\fR
.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author]
-.\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\" Date: 03/02/2016
+.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
+.\" Date: 08/25/2016
.\" Manual: MySQL Database System
.\" Source: MySQL 5.6
.\" Language: English
.\"
-.TH "\FBMYSQL_FIND_ROWS\F" "1" "03/02/2016" "MySQL 5\&.6" "MySQL Database System"
+.TH "\FBMYSQL_FIND_ROWS\F" "1" "08/25/2016" "MySQL 5\&.6" "MySQL Database System"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
-.\" mysql_find_rows
.SH "NAME"
mysql_find_rows \- extract SQL statements from files
.SH "SYNOPSIS"
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql_find_rows: help option
-.\" help option: mysql_find_rows
\fB\-\-help\fR,
\fB\-\-Information\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql_find_rows: regexp option
-.\" regexp option: mysql_find_rows
\fB\-\-regexp=\fR\fB\fIpattern\fR\fR
.sp
Display queries that match the pattern\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql_find_rows: rows option
-.\" rows option: mysql_find_rows
\fB\-\-rows=\fR\fB\fIN\fR\fR
.sp
Quit after displaying
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql_find_rows: skip-use-db option
-.\" skip-use-db option: mysql_find_rows
\fB\-\-skip\-use\-db\fR
.sp
Do not include
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql_find_rows: start_row option
-.\" start_row option: mysql_find_rows
\fB\-\-start_row=\fR\fB\fIN\fR\fR
.sp
Start output from this row\&.
'\" t
.\" Title: \fBmysql_fix_extensions\fR
.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author]
-.\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\" Date: 03/02/2016
+.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
+.\" Date: 08/25/2016
.\" Manual: MySQL Database System
.\" Source: MySQL 5.6
.\" Language: English
.\"
-.TH "\FBMYSQL_FIX_EXTENSI" "1" "03/02/2016" "MySQL 5\&.6" "MySQL Database System"
+.TH "\FBMYSQL_FIX_EXTENSI" "1" "08/25/2016" "MySQL 5\&.6" "MySQL Database System"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
-.\" mysql_fix_extensions
.SH "NAME"
mysql_fix_extensions \- normalize table file name extensions
.SH "SYNOPSIS"
'\" t
.\" Title: \fBmysql_install_db\fR
.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author]
-.\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\" Date: 03/02/2016
+.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
+.\" Date: 08/25/2016
.\" Manual: MySQL Database System
.\" Source: MySQL 5.6
.\" Language: English
.\"
-.TH "\FBMYSQL_INSTALL_DB\" "1" "03/02/2016" "MySQL 5\&.6" "MySQL Database System"
+.TH "\FBMYSQL_INSTALL_DB\" "1" "08/25/2016" "MySQL 5\&.6" "MySQL Database System"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
-.\" mysql_install_db
.SH "NAME"
mysql_install_db \- initialize MySQL data directory
.SH "SYNOPSIS"
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql_install_db: help option
-.\" help option: mysql_install_db
\fB\-\-help\fR
.sp
Display a help message and exit\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql_install_db: basedir option
-.\" basedir option: mysql_install_db
\fB\-\-basedir=\fR\fB\fIdir_name\fR\fR
.sp
The path to the MySQL installation directory\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql_install_db: builddir option
-.\" builddir option: mysql_install_db
\fB\-\-builddir=\fR\fB\fIdir_name\fR\fR
.sp
For use with
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql_install_db: cross-bootstrap option
-.\" cross-bootstrap option: mysql_install_db
\fB\-\-cross\-bootstrap\fR
.sp
For internal use\&. This option is used for building system tables on one host intended for another\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql_install_db: datadir option
-.\" datadir option: mysql_install_db
\fB\-\-datadir=\fR\fB\fIdir_name\fR\fR
.sp
The path to the MySQL data directory\&. Beginning with MySQL 5\&.6\&.8,
.sp -1
.IP \(bu 2.3
.\}
-.\" defaults-extra-file option
\fB\-\-defaults\-extra\-file=\fR\fB\fIfile_name\fR\fR
.sp
Read this option file after the global option file but (on Unix) before the user option file\&. If the file does not exist or is otherwise inaccessible, an error occurs\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" defaults-file option
\fB\-\-defaults\-file=\fR\fB\fIfile_name\fR\fR
.sp
Use only the given option file\&. If the file does not exist or is otherwise inaccessible, an error occurs\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql_install_db: force option
-.\" force option: mysql_install_db
\fB\-\-force\fR
.sp
Cause
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql_install_db: keep-my-cnf option
-.\" keep-my-cnf option: mysql_install_db
\fB\-\-keep\-my\-cnf\fR
.sp
Tell
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql_install_db: ldata option
-.\" ldata option: mysql_install_db
\fB\-\-ldata=\fR\fB\fIdir_name\fR\fR
.sp
A synonym for
.sp -1
.IP \(bu 2.3
.\}
-.\" no-defaults option
\fB\-\-no\-defaults\fR
.sp
Do not read any option files\&. If program startup fails due to reading unknown options from an option file,
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql_install_db: random-passwords option
-.\" random-passwords option: mysql_install_db
\fB\-\-random\-passwords\fR
.sp
On Unix platforms, this option provides for more secure MySQL installation\&. Invoking
.sp -1
.IP \(bu 2.3
.\}
-.\" .mysql_secret file
The initial random
root
password is written to the
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql_install_db: rpm option
-.\" rpm option: mysql_install_db
\fB\-\-rpm\fR
.sp
For internal use\&. This option is used during the MySQL installation process for install operations performed using RPM packages\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql_install_db: skip-name-resolve option
-.\" skip-name-resolve option: mysql_install_db
\fB\-\-skip\-name\-resolve\fR
.sp
Use IP addresses rather than host names when creating grant table entries\&. This option can be useful if your DNS does not work\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql_install_db: srcdir option
-.\" srcdir option: mysql_install_db
\fB\-\-srcdir=\fR\fB\fIdir_name\fR\fR
.sp
For internal use\&. This option specifies the directory under which
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql_install_db: user option
-.\" user option: mysql_install_db
\fB\-\-user=\fR\fB\fIuser_name\fR\fR
.sp
The system (login) user name to use for running
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql_install_db: verbose option
-.\" verbose option: mysql_install_db
\fB\-\-verbose\fR
.sp
Verbose mode\&. Print more information about what the program does\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql_install_db: windows option
-.\" windows option: mysql_install_db
\fB\-\-windows\fR
.sp
For internal use\&. This option is used for creating Windows distributions\&.
'\" t
.\" Title: \fBmysql_plugin\fR
.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author]
-.\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\" Date: 03/02/2016
+.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
+.\" Date: 08/25/2016
.\" Manual: MySQL Database System
.\" Source: MySQL 5.6
.\" Language: English
.\"
-.TH "\FBMYSQL_PLUGIN\FR" "1" "03/02/2016" "MySQL 5\&.6" "MySQL Database System"
+.TH "\FBMYSQL_PLUGIN\FR" "1" "08/25/2016" "MySQL 5\&.6" "MySQL Database System"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
-.\" mysql_plugin
.SH "NAME"
mysql_plugin \- configure MySQL server plugins
.SH "SYNOPSIS"
automatically\&. For additional control over plugin activation, use
\fB\-\-\fR\fB\fIplugin_name\fR\fR
options named for specific plugins, as described in
-Section\ \&5.1.8.1, \(lqInstalling and Uninstalling Plugins\(rq\&.
+Section\ \&5.5.2, \(lqInstalling and Uninstalling Plugins\(rq\&.
.PP
Each invocation of
\fBmysql_plugin\fR
-reads a configuration file to determine how to configure the plugins contained in a single plugin library object file\&. To invoke
+reads a configuration file to determine how to configure the plugins contained in a single plugin library file\&. To invoke
\fBmysql_plugin\fR, use this syntax:
.sp
.if n \{\
.PP
The first line in the
myplugins\&.ini
-file is the name of the library object file, without any extension such as
+file is the name of the library file, without any extension such as
\&.so
or
\&.dll\&. The remaining lines are the names of the components to be enabled or disabled\&. Each value in the file should be on a separate line\&. Lines on which the first character is
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql_plugin: help option
-.\" help option: mysql_plugin
\fB\-\-help\fR,
\fB\-?\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql_plugin: basedir option
-.\" basedir option: mysql_plugin
\fB\-\-basedir=\fR\fB\fIdir_name\fR\fR,
\fB\-b \fR\fB\fIdir_name\fR\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql_plugin: datadir option
-.\" datadir option: mysql_plugin
\fB\-\-datadir=\fR\fB\fIdir_name\fR\fR,
\fB\-d \fR\fB\fIdir_name\fR\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql_plugin: my-print-defaults option
-.\" my-print-defaults option: mysql_plugin
\fB\-\-my\-print\-defaults=\fR\fB\fIfile_name\fR\fR,
\fB\-b \fR\fB\fIfile_name\fR\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql_plugin: mysqld option
-.\" mysqld option: mysql_plugin
\fB\-\-mysqld=\fR\fB\fIfile_name\fR\fR,
\fB\-b \fR\fB\fIfile_name\fR\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql_plugin: no-defaults option
-.\" no-defaults option: mysql_plugin
\fB\-\-no\-defaults\fR,
\fB\-p\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql_plugin: plugin-dir option
-.\" plugin-dir option: mysql_plugin
\fB\-\-plugin\-dir=\fR\fB\fIdir_name\fR\fR,
\fB\-p \fR\fB\fIdir_name\fR\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql_plugin: plugin-ini option
-.\" plugin-ini option: mysql_plugin
\fB\-\-plugin\-ini=\fR\fB\fIfile_name\fR\fR,
\fB\-i \fR\fB\fIfile_name\fR\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql_plugin: print-defaults option
-.\" print-defaults option: mysql_plugin
\fB\-\-print\-defaults\fR,
\fB\-P\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql_plugin: verbose option
-.\" verbose option: mysql_plugin
\fB\-\-verbose\fR,
\fB\-v\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql_plugin: version option
-.\" version option: mysql_plugin
\fB\-\-version\fR,
\fB\-V\fR
.sp
'\" t
.\" Title: \fBmysql_secure_installation\fR
.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author]
-.\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\" Date: 03/02/2016
+.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
+.\" Date: 08/25/2016
.\" Manual: MySQL Database System
.\" Source: MySQL 5.6
.\" Language: English
.\"
-.TH "\FBMYSQL_SECURE_INST" "1" "03/02/2016" "MySQL 5\&.6" "MySQL Database System"
+.TH "\FBMYSQL_SECURE_INST" "1" "08/25/2016" "MySQL 5\&.6" "MySQL Database System"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
-.\" mysql_secure_installation
.SH "NAME"
mysql_secure_installation \- improve MySQL installation security
.SH "SYNOPSIS"
'\" t
.\" Title: \fBmysql_setpermission\fR
.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author]
-.\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\" Date: 03/02/2016
+.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
+.\" Date: 08/25/2016
.\" Manual: MySQL Database System
.\" Source: MySQL 5.6
.\" Language: English
.\"
-.TH "\FBMYSQL_SETPERMISSI" "1" "03/02/2016" "MySQL 5\&.6" "MySQL Database System"
+.TH "\FBMYSQL_SETPERMISSI" "1" "08/25/2016" "MySQL 5\&.6" "MySQL Database System"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
-.\" mysql_setpermission
.SH "NAME"
mysql_setpermission \- interactively set permissions in grant tables
.SH "SYNOPSIS"
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql_setpermission: help option
-.\" help option: mysql_setpermission
\fB\-\-help\fR
.sp
Display a help message and exit\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql_setpermission: host option
-.\" host option: mysql_setpermission
\fB\-\-host=\fR\fB\fIhost_name\fR\fR
.sp
Connect to the MySQL server on the given host\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql_setpermission: password option
-.\" password option: mysql_setpermission
\fB\-\-password=\fR\fB\fIpassword\fR\fR
.sp
The password to use when connecting to the server\&. Note that the password value is not optional for this option, unlike for other MySQL programs\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql_setpermission: port option
-.\" port option: mysql_setpermission
\fB\-\-port=\fR\fB\fIport_num\fR\fR
.sp
The TCP/IP port number to use for the connection\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql_setpermission: socket option
-.\" socket option: mysql_setpermission
\fB\-\-socket=\fR\fB\fIpath\fR\fR
.sp
For connections to
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql_setpermission: user option
-.\" user option: mysql_setpermission
\fB\-\-user=\fR\fB\fIuser_name\fR\fR
.sp
The MySQL user name to use when connecting to the server\&.
'\" t
.\" Title: \fBmysql_tzinfo_to_sql\fR
.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author]
-.\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\" Date: 03/02/2016
+.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
+.\" Date: 08/25/2016
.\" Manual: MySQL Database System
.\" Source: MySQL 5.6
.\" Language: English
.\"
-.TH "\FBMYSQL_TZINFO_TO_S" "1" "03/02/2016" "MySQL 5\&.6" "MySQL Database System"
+.TH "\FBMYSQL_TZINFO_TO_S" "1" "08/25/2016" "MySQL 5\&.6" "MySQL Database System"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
-.\" mysql_tzinfo_to_sql
-.\" time zone tables
.SH "NAME"
mysql_tzinfo_to_sql \- load the time zone tables
.SH "SYNOPSIS"
'\" t
.\" Title: \fBmysql_upgrade\fR
.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author]
-.\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\" Date: 03/02/2016
+.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
+.\" Date: 08/25/2016
.\" Manual: MySQL Database System
.\" Source: MySQL 5.6
.\" Language: English
.\"
-.TH "\FBMYSQL_UPGRADE\FR" "1" "03/02/2016" "MySQL 5\&.6" "MySQL Database System"
+.TH "\FBMYSQL_UPGRADE\FR" "1" "08/25/2016" "MySQL 5\&.6" "MySQL Database System"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
-.\" mysql_upgrade
-.\" upgrading MySQL
-.\" MySQL: upgrading
.SH "NAME"
mysql_upgrade \- check and upgrade MySQL tables
.SH "SYNOPSIS"
All checked and repaired tables are marked with the current MySQL version number\&. This ensures that next time you run
\fBmysql_upgrade\fR
with the same version of the server, it can tell whether there is any need to check or repair the table again\&.
-.\" mysql_upgrade_info file: mysql_upgrade
-.\" mysql_upgrade: mysql_upgrade_info file
-.\" data directory: mysql_upgrade_info file
.PP
\fBmysql_upgrade\fR
also saves the MySQL version number in a file named
.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.9, \(lqServer-Side Help\(rq\&.
.PP
By default,
\fBmysql_upgrade\fR
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql_upgrade: help option
-.\" help option: mysql_upgrade
\fB\-\-help\fR
.sp
Display a short help message and exit\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql_upgrade: basedir option
-.\" basedir option: mysql_upgrade
\fB\-\-basedir=\fR\fB\fIdir_name\fR\fR
.sp
The path to the MySQL installation directory\&. This option is accepted for backward compatibility but ignored\&. It is removed in MySQL 5\&.7\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql_upgrade: character-sets-dir option
-.\" character-sets-dir option: mysql_upgrade
\fB\-\-character\-sets\-dir=\fR\fB\fIdir_name\fR\fR
.sp
The directory where character sets are installed\&. See
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql_upgrade: compress option
-.\" compress option: mysql_upgrade
\fB\-\-compress\fR
.sp
Compress all information sent between the client and the server if both support compression\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql_upgrade: datadir option
-.\" datadir option: mysql_upgrade
\fB\-\-datadir=\fR\fB\fIdir_name\fR\fR
.sp
The path to the data directory\&. This option is accepted for backward compatibility but ignored\&. It is removed in MySQL 5\&.7\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql_upgrade: debug option
-.\" debug option: mysql_upgrade
\fB\-\-debug[=\fR\fB\fIdebug_options\fR\fR\fB]\fR,
\fB\-# [\fR\fB\fIdebug_options\fR\fR\fB]\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql_upgrade: debug-check option
-.\" debug-check option: mysql_upgrade
\fB\-\-debug\-check\fR
.sp
Print some debugging information when the program exits\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql_upgrade: debug-info option
-.\" debug-info option: mysql_upgrade
\fB\-\-debug\-info\fR,
\fB\-T\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql_upgrade: default-auth option
-.\" default-auth option: mysql_upgrade
\fB\-\-default\-auth=\fR\fB\fIplugin\fR\fR
.sp
A hint about the client\-side authentication plugin to use\&. See
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql_upgrade: default-character-set option
-.\" default-character-set option: mysql_upgrade
\fB\-\-default\-character\-set=\fR\fB\fIcharset_name\fR\fR
.sp
Use
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql_upgrade: defaults-extra-file option
-.\" defaults-extra-file option: mysql_upgrade
\fB\-\-defaults\-extra\-file=\fR\fB\fIfile_name\fR\fR
.sp
Read this option file after the global option file but (on Unix) before the user option file\&. If the file does not exist or is otherwise inaccessible, an error occurs\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql_upgrade: defaults-file option
-.\" defaults-file option: mysql_upgrade
\fB\-\-defaults\-file=\fR\fB\fIfile_name\fR\fR
.sp
Use only the given option file\&. If the file does not exist or is otherwise inaccessible, an error occurs\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql_upgrade: defaults-group-suffix option
-.\" defaults-group-suffix option: mysql_upgrade
\fB\-\-defaults\-group\-suffix=\fR\fB\fIstr\fR\fR
.sp
Read not only the usual option groups, but also groups with the usual names and a suffix of
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql_upgrade: force option
-.\" force option: mysql_upgrade
\fB\-\-force\fR
.sp
Ignore the
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql_upgrade: host option
-.\" host option: mysql_upgrade
\fB\-\-host=\fR\fB\fIhost_name\fR\fR,
\fB\-h \fR\fB\fIhost_name\fR\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql_upgrade: login-path option
-.\" login-path option: mysql_upgrade
\fB\-\-login\-path=\fR\fB\fIname\fR\fR
.sp
Read options from the named login path in the
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql_upgrade: no-defaults option
-.\" no-defaults option: mysql_upgrade
\fB\-\-no\-defaults\fR
.sp
Do not read any option files\&. If program startup fails due to reading unknown options from an option file,
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql_upgrade: password option
-.\" password option: mysql_upgrade
\fB\-\-password[=\fR\fB\fIpassword\fR\fR\fB]\fR,
\fB\-p[\fR\fB\fIpassword\fR\fR\fB]\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql_upgrade: pipe option
-.\" pipe option: mysql_upgrade
\fB\-\-pipe\fR,
\fB\-W\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql_upgrade: plugin-dir option
-.\" plugin-dir option: mysql_upgrade
\fB\-\-plugin\-dir=\fR\fB\fIdir_name\fR\fR
.sp
The directory in which to look for plugins\&. Specify this option if the
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql_upgrade: port option
-.\" port option: mysql_upgrade
\fB\-\-port=\fR\fB\fIport_num\fR\fR,
\fB\-P \fR\fB\fIport_num\fR\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql_upgrade: print-defaults option
-.\" print-defaults option: mysql_upgrade
\fB\-\-print\-defaults\fR
.sp
Print the program name and all options that it gets from option files\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql_upgrade: protocol option
-.\" protocol option: mysql_upgrade
\fB\-\-protocol={TCP|SOCKET|PIPE|MEMORY}\fR
.sp
The connection protocol to use for connecting to the server\&. It is useful when the other connection parameters normally would cause a protocol to be used other than the one you want\&. For details on the permissible values, see
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql_upgrade: shared-memory-base-name option
-.\" shared-memory-base-name option: mysql_upgrade
\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
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql_upgrade: socket option
-.\" socket option: mysql_upgrade
\fB\-\-socket=\fR\fB\fIpath\fR\fR,
\fB\-S \fR\fB\fIpath\fR\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql_upgrade: SSL options
-.\" SSL options: mysql_upgrade
\fB\-\-ssl*\fR
.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.3.9.5, \(lqCommand Options for Secure Connections\(rq\&.
+Section\ \&6.4.5, \(lqCommand Options for Secure Connections\(rq\&.
.RE
.sp
.RS 4
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql_upgrade: tmpdir option
-.\" tmpdir option: mysql_upgrade
\fB\-\-tmpdir=\fR\fB\fIdir_name\fR\fR,
\fB\-t \fR\fB\fIdir_name\fR\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql_upgrade: upgrade-system-tables option
-.\" upgrade-system-tables option: mysql_upgrade
\fB\-\-upgrade\-system\-tables\fR,
\fB\-s\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql_upgrade: user option
-.\" user option: mysql_upgrade
\fB\-\-user=\fR\fB\fIuser_name\fR\fR,
\fB\-u \fR\fB\fIuser_name\fR\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql_upgrade: verbose option
-.\" verbose option: mysql_upgrade
\fB\-\-verbose\fR
.sp
Verbose mode\&. Print more information about what the program does\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql_upgrade: version-check option
-.\" version-check option: mysql_upgrade
\fB\-\-version\-check\fR,
\fB\-k\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql_upgrade: write-binlog option
-.\" write-binlog option: mysql_upgrade
\fB\-\-write\-binlog\fR
.sp
Cause binary logging to be enabled while
'\" t
.\" Title: \fBmysql_waitpid\fR
.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author]
-.\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\" Date: 03/02/2016
+.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
+.\" Date: 08/25/2016
.\" Manual: MySQL Database System
.\" Source: MySQL 5.6
.\" Language: English
.\"
-.TH "\FBMYSQL_WAITPID\FR" "1" "03/02/2016" "MySQL 5\&.6" "MySQL Database System"
+.TH "\FBMYSQL_WAITPID\FR" "1" "08/25/2016" "MySQL 5\&.6" "MySQL Database System"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
-.\" mysql_waitpid
.SH "NAME"
mysql_waitpid \- kill process and wait for its termination
.SH "SYNOPSIS"
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql_waitpid: help option
-.\" help option: mysql_waitpid
\fB\-\-help\fR,
\fB\-?\fR,
\fB\-I\fR
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql_waitpid: verbose option
-.\" verbose option: mysql_waitpid
\fB\-\-verbose\fR,
\fB\-v\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql_waitpid: version option
-.\" version option: mysql_waitpid
\fB\-\-version\fR,
\fB\-V\fR
.sp
'\" t
.\" Title: \fBmysql_zap\fR
.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author]
-.\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\" Date: 03/02/2016
+.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
+.\" Date: 08/25/2016
.\" Manual: MySQL Database System
.\" Source: MySQL 5.6
.\" Language: English
.\"
-.TH "\FBMYSQL_ZAP\FR" "1" "03/02/2016" "MySQL 5\&.6" "MySQL Database System"
+.TH "\FBMYSQL_ZAP\FR" "1" "08/25/2016" "MySQL 5\&.6" "MySQL Database System"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
-.\" mysql_zap
.SH "NAME"
mysql_zap \- kill processes that match a pattern
.SH "SYNOPSIS"
'\" t
.\" Title: \fBmysqlaccess\fR
.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author]
-.\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\" Date: 03/02/2016
+.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
+.\" Date: 08/25/2016
.\" Manual: MySQL Database System
.\" Source: MySQL 5.6
.\" Language: English
.\"
-.TH "\FBMYSQLACCESS\FR" "1" "03/02/2016" "MySQL 5\&.6" "MySQL Database System"
+.TH "\FBMYSQLACCESS\FR" "1" "08/25/2016" "MySQL 5\&.6" "MySQL Database System"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
-.\" mysqlaccess
.SH "NAME"
mysqlaccess \- client for checking access privileges
.SH "SYNOPSIS"
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlaccess: help option
-.\" help option: mysqlaccess
\fB\-\-help\fR,
\fB\-?\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlaccess: brief option
-.\" brief option: mysqlaccess
\fB\-\-brief\fR,
\fB\-b\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlaccess: commit option
-.\" commit option: mysqlaccess
\fB\-\-commit\fR
.sp
Copy the new access privileges from the temporary tables to the original grant tables\&. The grant tables must be flushed for the new privileges to take effect\&. (For example, execute a
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlaccess: copy option
-.\" copy option: mysqlaccess
\fB\-\-copy\fR
.sp
Reload the temporary grant tables from original ones\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlaccess: db option
-.\" db option: mysqlaccess
\fB\-\-db=\fR\fB\fIdb_name\fR\fR,
\fB\-d \fR\fB\fIdb_name\fR\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlaccess: debug option
-.\" debug option: mysqlaccess
\fB\-\-debug=\fR\fB\fIN\fR\fR
.sp
Specify the debug level\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlaccess: host option
-.\" host option: mysqlaccess
\fB\-\-host=\fR\fB\fIhost_name\fR\fR,
\fB\-h \fR\fB\fIhost_name\fR\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlaccess: howto option
-.\" howto option: mysqlaccess
\fB\-\-howto\fR
.sp
Display some examples that show how to use
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlaccess: old_server option
-.\" old_server option: mysqlaccess
\fB\-\-old_server\fR
.sp
Assume that the server is an old MySQL server (before MySQL 3\&.21) that does not yet know how to handle full
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlaccess: password option
-.\" password option: mysqlaccess
\fB\-\-password[=\fR\fB\fIpassword\fR\fR\fB]\fR,
\fB\-p[\fR\fB\fIpassword\fR\fR\fB]\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlaccess: plan option
-.\" plan option: mysqlaccess
\fB\-\-plan\fR
.sp
Display suggestions and ideas for future releases\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlaccess: preview option
-.\" preview option: mysqlaccess
\fB\-\-preview\fR
.sp
Show the privilege differences after making changes to the temporary grant tables\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlaccess: relnotes option
-.\" relnotes option: mysqlaccess
\fB\-\-relnotes\fR
.sp
Display the release notes\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlaccess: rhost option
-.\" rhost option: mysqlaccess
\fB\-\-rhost=\fR\fB\fIhost_name\fR\fR,
\fB\-H \fR\fB\fIhost_name\fR\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlaccess: rollback option
-.\" rollback option: mysqlaccess
\fB\-\-rollback\fR
.sp
Undo the most recent changes to the temporary grant tables\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlaccess: spassword option
-.\" spassword option: mysqlaccess
\fB\-\-spassword[=\fR\fB\fIpassword\fR\fR\fB]\fR,
\fB\-P[\fR\fB\fIpassword\fR\fR\fB]\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlaccess: superuser option
-.\" superuser option: mysqlaccess
\fB\-\-superuser=\fR\fB\fIuser_name\fR\fR,
\fB\-U \fR\fB\fIuser_name\fR\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlaccess: table option
-.\" table option: mysqlaccess
\fB\-\-table\fR,
\fB\-t\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlaccess: user option
-.\" user option: mysqlaccess
\fB\-\-user=\fR\fB\fIuser_name\fR\fR,
\fB\-u \fR\fB\fIuser_name\fR\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlaccess: version option
-.\" version option: mysqlaccess
\fB\-\-version\fR,
\fB\-v\fR
.sp
'\" t
.\" Title: \fBmysqladmin\fR
.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author]
-.\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\" Date: 03/02/2016
+.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
+.\" Date: 08/25/2016
.\" Manual: MySQL Database System
.\" Source: MySQL 5.6
.\" Language: English
.\"
-.TH "\FBMYSQLADMIN\FR" "1" "03/02/2016" "MySQL 5\&.6" "MySQL Database System"
+.TH "\FBMYSQLADMIN\FR" "1" "08/25/2016" "MySQL 5\&.6" "MySQL Database System"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
-.\" mysqladmin
-.\" administration: server
-.\" server administration
.SH "NAME"
mysqladmin \- client for administering a MySQL server
.SH "SYNOPSIS"
.if n \{\
.RE
.\}
-.sp
-.\" status command: results
.PP
The
\fBmysqladmin status\fR
.sp -1
.IP \(bu 2.3
.\}
-.\" uptime
Uptime
.sp
The number of seconds the MySQL server has been running\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" threads
Threads
.sp
The number of active threads (clients)\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" questions
Questions
.sp
The number of questions (queries) from clients since the server was started\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" slow queries
Slow queries
.sp
The number of queries that have taken more than
long_query_time
seconds\&. See
-Section\ \&5.2.5, \(lqThe Slow Query Log\(rq\&.
+Section\ \&5.4.5, \(lqThe Slow Query Log\(rq\&.
.RE
.sp
.RS 4
.sp -1
.IP \(bu 2.3
.\}
-.\" opens
Opens
.sp
The number of tables the server has opened\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" flush tables
-.\" tables: flush
Flush tables
.sp
The number of
.sp -1
.IP \(bu 2.3
.\}
-.\" open tables
Open tables
.sp
The number of tables that currently are open\&.
when connecting to a local server using a Unix socket file,
\fBmysqladmin\fR
waits until the server\*(Aqs process ID file has been removed, to ensure that the server has stopped properly\&.
-.\" mysqladmin command options
-.\" command options: mysqladmin
-.\" options: command-line: mysqladmin
-.\" startup parameters: mysqladmin
.PP
\fBmysqladmin\fR
supports the following options, which can be specified on the command line or in the
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqladmin: help option
-.\" help option: mysqladmin
\fB\-\-help\fR,
\fB\-?\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqladmin: bind-address option
-.\" bind-address option: mysqladmin
\fB\-\-bind\-address=\fR\fB\fIip_address\fR\fR
.sp
On a computer having multiple network interfaces, use this option to select which interface to use for connecting to the MySQL server\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqladmin: character-sets-dir option
-.\" character-sets-dir option: mysqladmin
\fB\-\-character\-sets\-dir=\fR\fB\fIdir_name\fR\fR
.sp
The directory where character sets are installed\&. See
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqladmin: compress option
-.\" compress option: mysqladmin
\fB\-\-compress\fR,
\fB\-C\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqladmin: count option
-.\" count option: mysqladmin
\fB\-\-count=\fR\fB\fIN\fR\fR,
\fB\-c \fR\fB\fIN\fR\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqladmin: debug option
-.\" debug option: mysqladmin
\fB\-\-debug[=\fR\fB\fIdebug_options\fR\fR\fB]\fR,
\fB\-# [\fR\fB\fIdebug_options\fR\fR\fB]\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqladmin: debug-check option
-.\" debug-check option: mysqladmin
\fB\-\-debug\-check\fR
.sp
Print some debugging information when the program exits\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqladmin: debug-info option
-.\" debug-info option: mysqladmin
\fB\-\-debug\-info\fR
.sp
Print debugging information and memory and CPU usage statistics when the program exits\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqladmin: default-auth option
-.\" default-auth option: mysqladmin
\fB\-\-default\-auth=\fR\fB\fIplugin\fR\fR
.sp
A hint about the client\-side authentication plugin to use\&. See
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqladmin: default-character-set option
-.\" default-character-set option: mysqladmin
\fB\-\-default\-character\-set=\fR\fB\fIcharset_name\fR\fR
.sp
Use
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqladmin: defaults-extra-file option
-.\" defaults-extra-file option: mysqladmin
\fB\-\-defaults\-extra\-file=\fR\fB\fIfile_name\fR\fR
.sp
Read this option file after the global option file but (on Unix) before the user option file\&. If the file does not exist or is otherwise inaccessible, an error occurs\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqladmin: defaults-file option
-.\" defaults-file option: mysqladmin
\fB\-\-defaults\-file=\fR\fB\fIfile_name\fR\fR
.sp
Use only the given option file\&. If the file does not exist or is otherwise inaccessible, an error occurs\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqladmin: defaults-group-suffix option
-.\" defaults-group-suffix option: mysqladmin
\fB\-\-defaults\-group\-suffix=\fR\fB\fIstr\fR\fR
.sp
Read not only the usual option groups, but also groups with the usual names and a suffix of
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqladmin: enable-cleartext-plugin option
-.\" enable-cleartext-plugin option: mysqladmin
\fB\-\-enable\-cleartext\-plugin\fR
.sp
Enable the
mysql_clear_password
cleartext authentication plugin\&. (See
-Section\ \&6.4.1.7, \(lqThe Cleartext Client-Side Authentication Plugin\(rq\&.) This option was added in MySQL 5\&.6\&.7\&.
+Section\ \&6.5.1.7, \(lqThe Cleartext Client-Side Authentication Plugin\(rq\&.) This option was added in MySQL 5\&.6\&.7\&.
.RE
.sp
.RS 4
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqladmin: force option
-.\" force option: mysqladmin
\fB\-\-force\fR,
\fB\-f\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqladmin: host option
-.\" host option: mysqladmin
\fB\-\-host=\fR\fB\fIhost_name\fR\fR,
\fB\-h \fR\fB\fIhost_name\fR\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqladmin: login-path option
-.\" login-path option: mysqladmin
\fB\-\-login\-path=\fR\fB\fIname\fR\fR
.sp
Read options from the named login path in the
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqladmin: no-beep option
-.\" no-beep option: mysqladmin
\fB\-\-no\-beep\fR,
\fB\-b\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqladmin: no-defaults option
-.\" no-defaults option: mysqladmin
\fB\-\-no\-defaults\fR
.sp
Do not read any option files\&. If program startup fails due to reading unknown options from an option file,
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqladmin: password option
-.\" password option: mysqladmin
\fB\-\-password[=\fR\fB\fIpassword\fR\fR\fB]\fR,
\fB\-p[\fR\fB\fIpassword\fR\fR\fB]\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqladmin: pipe option
-.\" pipe option: mysqladmin
\fB\-\-pipe\fR,
\fB\-W\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqladmin: plugin-dir option
-.\" plugin-dir option: mysqladmin
\fB\-\-plugin\-dir=\fR\fB\fIdir_name\fR\fR
.sp
The directory in which to look for plugins\&. Specify this option if the
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqladmin: port option
-.\" port option: mysqladmin
\fB\-\-port=\fR\fB\fIport_num\fR\fR,
\fB\-P \fR\fB\fIport_num\fR\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqladmin: print-defaults option
-.\" print-defaults option: mysqladmin
\fB\-\-print\-defaults\fR
.sp
Print the program name and all options that it gets from option files\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqladmin: protocol option
-.\" protocol option: mysqladmin
\fB\-\-protocol={TCP|SOCKET|PIPE|MEMORY}\fR
.sp
The connection protocol to use for connecting to the server\&. It is useful when the other connection parameters normally would cause a protocol to be used other than the one you want\&. For details on the permissible values, see
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqladmin: relative option
-.\" relative option: mysqladmin
\fB\-\-relative\fR,
\fB\-r\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqladmin: secure-auth option
-.\" secure-auth option: mysqladmin
\fB\-\-secure\-auth\fR
.sp
Do not send passwords to the server in old (pre\-4\&.1) format\&. This prevents connections except for servers that use the newer password format\&. This option is enabled by default; use
.ps -1
.br
Passwords that use the pre\-4\&.1 hashing method are less secure than passwords that use the native password hashing method and should be avoided\&. Pre\-4\&.1 passwords are deprecated and support for them will be removed in a future MySQL release\&. For account upgrade instructions, see
-Section\ \&6.4.1.3, \(lqMigrating Away from Pre-4.1 Password Hashing and the mysql_old_password Plugin\(rq\&.
+Section\ \&6.5.1.3, \(lqMigrating Away from Pre-4.1 Password Hashing and the mysql_old_password Plugin\(rq\&.
+.sp .5v
+.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
+This option is deprecated and will be removed in a future release\&. As of MySQL 5\&.7\&.5, it is always enabled and attempting to disable it produces an error\&.
.sp .5v
.RE
.RE
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqladmin: shared-memory-base-name option
-.\" shared-memory-base-name option: mysqladmin
\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
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqladmin: silent option
-.\" silent option: mysqladmin
\fB\-\-silent\fR,
\fB\-s\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqladmin: sleep option
-.\" sleep option: mysqladmin
\fB\-\-sleep=\fR\fB\fIdelay\fR\fR,
\fB\-i \fR\fB\fIdelay\fR\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqladmin: socket option
-.\" socket option: mysqladmin
\fB\-\-socket=\fR\fB\fIpath\fR\fR,
\fB\-S \fR\fB\fIpath\fR\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqladmin: SSL options
-.\" SSL options: mysqladmin
\fB\-\-ssl*\fR
.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.3.9.5, \(lqCommand Options for Secure Connections\(rq\&.
+Section\ \&6.4.5, \(lqCommand Options for Secure Connections\(rq\&.
.RE
.sp
.RS 4
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqladmin: user option
-.\" user option: mysqladmin
\fB\-\-user=\fR\fB\fIuser_name\fR\fR,
\fB\-u \fR\fB\fIuser_name\fR\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqladmin: verbose option
-.\" verbose option: mysqladmin
\fB\-\-verbose\fR,
\fB\-v\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqladmin: version option
-.\" version option: mysqladmin
\fB\-\-version\fR,
\fB\-V\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqladmin: vertical option
-.\" vertical option: mysqladmin
\fB\-\-vertical\fR,
\fB\-E\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqladmin: wait option
-.\" wait option: mysqladmin
\fB\-\-wait[=\fR\fB\fIcount\fR\fR\fB]\fR,
\fB\-w[\fR\fB\fIcount\fR\fR\fB]\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" connect_timeout variable
-.\" timeout: connect_timeout variable
connect_timeout
.sp
The maximum number of seconds before connection timeout\&. The default value is 43200 (12 hours)\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" shutdown_timeout variable
-.\" timeout: shutdown_timeout variable
shutdown_timeout
.sp
The maximum number of seconds to wait for server shutdown\&. The default value is 3600 (1 hour)\&.
'\" t
.\" Title: \fBmysqlbinlog\fR
.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author]
-.\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\" Date: 03/02/2016
+.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
+.\" Date: 08/25/2016
.\" Manual: MySQL Database System
.\" Source: MySQL 5.6
.\" Language: English
.\"
-.TH "\FBMYSQLBINLOG\FR" "1" "03/02/2016" "MySQL 5\&.6" "MySQL Database System"
+.TH "\FBMYSQLBINLOG\FR" "1" "08/25/2016" "MySQL 5\&.6" "MySQL Database System"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
-.\" mysqlbinlog
.SH "NAME"
mysqlbinlog \- utility for processing binary log files
.SH "SYNOPSIS"
utility\&. You can also use
\fBmysqlbinlog\fR
to display the contents of relay log files written by a slave server in a replication setup because relay logs have the same format as binary logs\&. The binary log and relay log are discussed further in
-Section\ \&5.2.4, \(lqThe Binary Log\(rq, and
+Section\ \&5.4.4, \(lqThe Binary Log\(rq, and
Section\ \&17.2.2, \(lqReplication Relay and Status Logs\(rq\&.
.PP
Invoke
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlbinlog: help option
-.\" help option: mysqlbinlog
\fB\-\-help\fR,
\fB\-?\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlbinlog: base64-output option
-.\" base64-output option: mysqlbinlog
\fB\-\-base64\-output=\fR\fB\fIvalue\fR\fR
.sp
This option determines when events should be displayed encoded as base\-64 strings using
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlbinlog: bind-address option
-.\" bind-address option: mysqlbinlog
\fB\-\-bind\-address=\fR\fB\fIip_address\fR\fR
.sp
On a computer having multiple network interfaces, use this option to select which interface to use for connecting to the MySQL server\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlbinlog: binlog-row-event-max-size option
-.\" binlog-row-event-max-size option: mysqlbinlog
\fB\-\-binlog\-row\-event\-max\-size=\fR\fB\fIN\fR\fR
.TS
allbox tab(:);
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlbinlog: character-sets-dir option
-.\" character-sets-dir option: mysqlbinlog
\fB\-\-character\-sets\-dir=\fR\fB\fIdir_name\fR\fR
.sp
The directory where character sets are installed\&. See
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlbinlog: connection-server-id option
-.\" connection-server-id option: mysqlbinlog
\fB\-\-connection\-server\-id=\fR\fB\fIserver_id\fR\fR
.sp
This option is used to test a MySQL server for support of the
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlbinlog: database option
-.\" database option: mysqlbinlog
\fB\-\-database=\fR\fB\fIdb_name\fR\fR,
\fB\-d \fR\fB\fIdb_name\fR\fR
.sp
statements following
USE db2\&.
.PP
-\fBRow-based logging\fR.
-\fBmysqlbinlog\fR
+\fBRow-based logging\fR. \fBmysqlbinlog\fR
outputs only entries that change tables belonging to
\fIdb_name\fR\&. The default database has no effect on this\&. Suppose that the binary log just described was created using row\-based logging rather than statement\-based logging\&.
\fBmysqlbinlog \-\-database=test\fR
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlbinlog: debug option
-.\" debug option: mysqlbinlog
\fB\-\-debug[=\fR\fB\fIdebug_options\fR\fR\fB]\fR,
\fB\-# [\fR\fB\fIdebug_options\fR\fR\fB]\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlbinlog: debug-check option
-.\" debug-check option: mysqlbinlog
\fB\-\-debug\-check\fR
.sp
Print some debugging information when the program exits\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlbinlog: debug-info option
-.\" debug-info option: mysqlbinlog
\fB\-\-debug\-info\fR
.sp
Print debugging information and memory and CPU usage statistics when the program exits\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlbinlog: default-auth option
-.\" default-auth option: mysqlbinlog
\fB\-\-default\-auth=\fR\fB\fIplugin\fR\fR
.sp
A hint about the client\-side authentication plugin to use\&. See
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlbinlog: defaults-extra-file option
-.\" defaults-extra-file option: mysqlbinlog
\fB\-\-defaults\-extra\-file=\fR\fB\fIfile_name\fR\fR
.sp
Read this option file after the global option file but (on Unix) before the user option file\&. If the file does not exist or is otherwise inaccessible, an error occurs\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlbinlog: defaults-file option
-.\" defaults-file option: mysqlbinlog
\fB\-\-defaults\-file=\fR\fB\fIfile_name\fR\fR
.sp
Use only the given option file\&. If the file does not exist or is otherwise inaccessible, an error occurs\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlbinlog: defaults-group-suffix option
-.\" defaults-group-suffix option: mysqlbinlog
\fB\-\-defaults\-group\-suffix=\fR\fB\fIstr\fR\fR
.sp
Read not only the usual option groups, but also groups with the usual names and a suffix of
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlbinlog: disable-log-bin option
-.\" disable-log-bin option: mysqlbinlog
\fB\-\-disable\-log\-bin\fR,
\fB\-D\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlbinlog: exclude-gtids option
-.\" exclude-gtids option: mysqlbinlog
\fB\-\-exclude\-gtids=\fR\fB\fIgtid_set\fR\fR
.sp
Do not display any of the groups listed in the
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlbinlog: force-if-open option
-.\" force-if-open option: mysqlbinlog
\fB\-\-force\-if\-open\fR,
\fB\-F\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlbinlog: force-read option
-.\" force-read option: mysqlbinlog
\fB\-\-force\-read\fR,
\fB\-f\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlbinlog: hexdump option
-.\" hexdump option: mysqlbinlog
\fB\-\-hexdump\fR,
\fB\-H\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlbinlog: host option
-.\" host option: mysqlbinlog
\fB\-\-host=\fR\fB\fIhost_name\fR\fR,
\fB\-h \fR\fB\fIhost_name\fR\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlbinlog: include-gtids option
-.\" include-gtids option: mysqlbinlog
\fB\-\-include\-gtids=\fR\fB\fIgtid_set\fR\fR
.sp
Display only the groups listed in the
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlbinlog: local-load option
-.\" local-load option: mysqlbinlog
\fB\-\-local\-load=\fR\fB\fIdir_name\fR\fR,
\fB\-l \fR\fB\fIdir_name\fR\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlbinlog: login-path option
-.\" login-path option: mysqlbinlog
\fB\-\-login\-path=\fR\fB\fIname\fR\fR
.sp
Read options from the named login path in the
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlbinlog: no-defaults option
-.\" no-defaults option: mysqlbinlog
\fB\-\-no\-defaults\fR
.sp
Do not read any option files\&. If program startup fails due to reading unknown options from an option file,
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlbinlog: offset option
-.\" offset option: mysqlbinlog
\fB\-\-offset=\fR\fB\fIN\fR\fR,
\fB\-o \fR\fB\fIN\fR\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlbinlog: password option
-.\" password option: mysqlbinlog
\fB\-\-password[=\fR\fB\fIpassword\fR\fR\fB]\fR,
\fB\-p[\fR\fB\fIpassword\fR\fR\fB]\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlbinlog: plugin-dir option
-.\" plugin-dir option: mysqlbinlog
\fB\-\-plugin\-dir=\fR\fB\fIdir_name\fR\fR
.sp
The directory in which to look for plugins\&. Specify this option if the
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlbinlog: port option
-.\" port option: mysqlbinlog
-.\" TCP/IP
-.\" ports
\fB\-\-port=\fR\fB\fIport_num\fR\fR,
\fB\-P \fR\fB\fIport_num\fR\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlbinlog: print-defaults option
-.\" print-defaults option: mysqlbinlog
\fB\-\-print\-defaults\fR
.sp
Print the program name and all options that it gets from option files\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlbinlog: protocol option
-.\" protocol option: mysqlbinlog
\fB\-\-protocol={TCP|SOCKET|PIPE|MEMORY}\fR
.sp
The connection protocol to use for connecting to the server\&. It is useful when the other connection parameters normally would cause a protocol to be used other than the one you want\&. For details on the permissible values, see
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlbinlog: raw option
-.\" raw option: mysqlbinlog
\fB\-\-raw\fR
.sp
By default,
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlbinlog: read-from-remote-master option
-.\" read-from-remote-master option: mysqlbinlog
\fB\-\-read\-from\-remote\-master=\fR\fB\fItype\fR\fR
.sp
Read binary logs from a MySQL server with the
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlbinlog: read-from-remote-server option
-.\" read-from-remote-server option: mysqlbinlog
\fB\-\-read\-from\-remote\-server\fR,
\fB\-R\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlbinlog: result-file option
-.\" result-file option: mysqlbinlog
\fB\-\-result\-file=\fR\fB\fIname\fR\fR,
\fB\-r \fR\fB\fIname\fR\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlbinlog: secure-auth option
-.\" secure-auth option: mysqlbinlog
\fB\-\-secure\-auth\fR
.sp
Do not send passwords to the server in old (pre\-4\&.1) format\&. This prevents connections except for servers that use the newer password format\&. This option is enabled by default; use
.ps -1
.br
Passwords that use the pre\-4\&.1 hashing method are less secure than passwords that use the native password hashing method and should be avoided\&. Pre\-4\&.1 passwords are deprecated and support for them will be removed in a future MySQL release\&. For account upgrade instructions, see
-Section\ \&6.4.1.3, \(lqMigrating Away from Pre-4.1 Password Hashing and the mysql_old_password Plugin\(rq\&.
+Section\ \&6.5.1.3, \(lqMigrating Away from Pre-4.1 Password Hashing and the mysql_old_password Plugin\(rq\&.
+.sp .5v
+.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
+This option is deprecated and will be removed in a future release\&. As of MySQL 5\&.7\&.5, it is always enabled and attempting to disable it produces an error\&.
.sp .5v
.RE
.RE
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlbinlog: server-id option
-.\" server-id option: mysqlbinlog
\fB\-\-server\-id=\fR\fB\fIid\fR\fR
.sp
Display only those events created by the server having the given server ID\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlbinlog: server-id-bits option
-.\" server-id-bits option: mysqlbinlog
\fB\-\-server\-id\-bits=\fR\fB\fIN\fR\fR
.sp
Use only the first
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlbinlog: set-charset option
-.\" set-charset option: mysqlbinlog
\fB\-\-set\-charset=\fR\fB\fIcharset_name\fR\fR
.sp
Add a
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlbinlog: shared-memory-base-name option
-.\" shared-memory-base-name option: mysqlbinlog
\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
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlbinlog: short-form option
-.\" short-form option: mysqlbinlog
\fB\-\-short\-form\fR,
\fB\-s\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlbinlog: skip-gtids option
-.\" skip-gtids option: mysqlbinlog
\fB\-\-skip\-gtids[=(true|false)]\fR
.sp
Do not display any GTIDs in the output\&. This is needed when writing to a dump file from one or more binary logs containing GTIDs, as shown in this example:
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlbinlog: socket option
-.\" socket option: mysqlbinlog
\fB\-\-socket=\fR\fB\fIpath\fR\fR,
\fB\-S \fR\fB\fIpath\fR\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlbinlog: start-datetime option
-.\" start-datetime option: mysqlbinlog
\fB\-\-start\-datetime=\fR\fB\fIdatetime\fR\fR
.sp
Start reading the binary log at the first event having a timestamp equal to or later than the
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlbinlog: start-position option
-.\" start-position option: mysqlbinlog
\fB\-\-start\-position=\fR\fB\fIN\fR\fR,
\fB\-j \fR\fB\fIN\fR\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlbinlog: stop-datetime option
-.\" stop-datetime option: mysqlbinlog
\fB\-\-stop\-datetime=\fR\fB\fIdatetime\fR\fR
.sp
Stop reading the binary log at the first event having a timestamp equal to or later than the
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlbinlog: stop-never option
-.\" stop-never option: mysqlbinlog
\fB\-\-stop\-never\fR
.sp
This option is used with
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlbinlog: stop-never-slave-server-id option
-.\" stop-never-slave-server-id option: mysqlbinlog
\fB\-\-stop\-never\-slave\-server\-id=\fR\fB\fIid\fR\fR
.sp
With
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlbinlog: stop-position option
-.\" stop-position option: mysqlbinlog
\fB\-\-stop\-position=\fR\fB\fIN\fR\fR
.sp
Stop reading the binary log at the first event having a position equal to or greater than
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlbinlog: to-last-log option
-.\" to-last-log option: mysqlbinlog
\fB\-\-to\-last\-log\fR,
\fB\-t\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlbinlog: user option
-.\" user option: mysqlbinlog
\fB\-\-user=\fR\fB\fIuser_name\fR\fR,
\fB\-u \fR\fB\fIuser_name\fR\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlbinlog: verbose option
-.\" verbose option: mysqlbinlog
\fB\-\-verbose\fR,
\fB\-v\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlbinlog: verify-binlog-checksum option
-.\" verify-binlog-checksum option: mysqlbinlog
\fB\-\-verify\-binlog\-checksum\fR,
\fB\-c\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlbinlog: version option
-.\" version option: mysqlbinlog
\fB\-\-version\fR,
\fB\-V\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" open_files_limit variable
open_files_limit
.sp
Specify the number of open file descriptors to reserve\&.
.sp 1
.RE
.SH "MYSQLBINLOG ROW EVENT DISPLAY"
-.\" BINLOG statement: mysqlbinlog output
.PP
The following examples illustrate how
\fBmysqlbinlog\fR
'\" t
.\" Title: \fBmysqlbug\fR
.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author]
-.\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\" Date: 03/02/2016
+.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
+.\" Date: 08/25/2016
.\" Manual: MySQL Database System
.\" Source: MySQL 5.6
.\" Language: English
.\"
-.TH "\FBMYSQLBUG\FR" "1" "03/02/2016" "MySQL 5\&.6" "MySQL Database System"
+.TH "\FBMYSQLBUG\FR" "1" "08/25/2016" "MySQL 5\&.6" "MySQL Database System"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
-.\" mysqlbug
.SH "NAME"
mysqlbug \- generate bug report
.SH "SYNOPSIS"
'\" t
.\" Title: \fBmysqlcheck\fR
.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author]
-.\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\" Date: 03/02/2016
+.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
+.\" Date: 08/25/2016
.\" Manual: MySQL Database System
.\" Source: MySQL 5.6
.\" Language: English
.\"
-.TH "\FBMYSQLCHECK\FR" "1" "03/02/2016" "MySQL 5\&.6" "MySQL Database System"
+.TH "\FBMYSQLCHECK\FR" "1" "08/25/2016" "MySQL 5\&.6" "MySQL Database System"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
-.\" mysqlcheck
-.\" maintenance: tables
-.\" repair: tables
-.\" tables: maintenance
-.\" tables: repair
.SH "NAME"
mysqlcheck \- a table maintenance program
.SH "SYNOPSIS"
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlcheck: help option
-.\" help option: mysqlcheck
\fB\-\-help\fR,
\fB\-?\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlcheck: all-databases option
-.\" all-databases option: mysqlcheck
\fB\-\-all\-databases\fR,
\fB\-A\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlcheck: all-in-1 option
-.\" all-in-1 option: mysqlcheck
\fB\-\-all\-in\-1\fR,
\fB\-1\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlcheck: analyze option
-.\" analyze option: mysqlcheck
\fB\-\-analyze\fR,
\fB\-a\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlcheck: auto-repair option
-.\" auto-repair option: mysqlcheck
\fB\-\-auto\-repair\fR
.sp
If a checked table is corrupted, automatically fix it\&. Any necessary repairs are done after all tables have been checked\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlcheck: bind-address option
-.\" bind-address option: mysqlcheck
\fB\-\-bind\-address=\fR\fB\fIip_address\fR\fR
.sp
On a computer having multiple network interfaces, use this option to select which interface to use for connecting to the MySQL server\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlcheck: character-sets-dir option
-.\" character-sets-dir option: mysqlcheck
\fB\-\-character\-sets\-dir=\fR\fB\fIdir_name\fR\fR
.sp
The directory where character sets are installed\&. See
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlcheck: check option
-.\" check option: mysqlcheck
\fB\-\-check\fR,
\fB\-c\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlcheck: check-only-changed option
-.\" check-only-changed option: mysqlcheck
\fB\-\-check\-only\-changed\fR,
\fB\-C\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlcheck: check-upgrade option
-.\" check-upgrade option: mysqlcheck
\fB\-\-check\-upgrade\fR,
\fB\-g\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlcheck: compress option
-.\" compress option: mysqlcheck
\fB\-\-compress\fR
.sp
Compress all information sent between the client and the server if both support compression\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlcheck: databases option
-.\" databases option: mysqlcheck
\fB\-\-databases\fR,
\fB\-B\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlcheck: debug option
-.\" debug option: mysqlcheck
\fB\-\-debug[=\fR\fB\fIdebug_options\fR\fR\fB]\fR,
\fB\-# [\fR\fB\fIdebug_options\fR\fR\fB]\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlcheck: debug-check option
-.\" debug-check option: mysqlcheck
\fB\-\-debug\-check\fR
.sp
Print some debugging information when the program exits\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlcheck: debug-info option
-.\" debug-info option: mysqlcheck
\fB\-\-debug\-info\fR
.sp
Print debugging information and memory and CPU usage statistics when the program exits\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlcheck: default-character-set option
-.\" default-character-set option: mysqlcheck
\fB\-\-default\-character\-set=\fR\fB\fIcharset_name\fR\fR
.sp
Use
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlcheck: defaults-extra-file option
-.\" defaults-extra-file option: mysqlcheck
\fB\-\-defaults\-extra\-file=\fR\fB\fIfile_name\fR\fR
.sp
Read this option file after the global option file but (on Unix) before the user option file\&. If the file does not exist or is otherwise inaccessible, an error occurs\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlcheck: defaults-file option
-.\" defaults-file option: mysqlcheck
\fB\-\-defaults\-file=\fR\fB\fIfile_name\fR\fR
.sp
Use only the given option file\&. If the file does not exist or is otherwise inaccessible, an error occurs\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlcheck: defaults-group-suffix option
-.\" defaults-group-suffix option: mysqlcheck
\fB\-\-defaults\-group\-suffix=\fR\fB\fIstr\fR\fR
.sp
Read not only the usual option groups, but also groups with the usual names and a suffix of
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlcheck: extended option
-.\" extended option: mysqlcheck
\fB\-\-extended\fR,
\fB\-e\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlcheck: default-auth option
-.\" default-auth option: mysqlcheck
\fB\-\-default\-auth=\fR\fB\fIplugin\fR\fR
.sp
A hint about the client\-side authentication plugin to use\&. See
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlcheck: enable-cleartext-plugin option
-.\" enable-cleartext-plugin option: mysqlcheck
\fB\-\-enable\-cleartext\-plugin\fR
.sp
Enable the
mysql_clear_password
cleartext authentication plugin\&. (See
-Section\ \&6.4.1.7, \(lqThe Cleartext Client-Side Authentication Plugin\(rq\&.)
+Section\ \&6.5.1.7, \(lqThe Cleartext Client-Side Authentication Plugin\(rq\&.)
.sp
This option was added in MySQL 5\&.6\&.28\&.
.RE
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlcheck: fast option
-.\" fast option: mysqlcheck
\fB\-\-fast\fR,
\fB\-F\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlcheck: fix-db-names option
-.\" fix-db-names option: mysqlcheck
\fB\-\-fix\-db\-names\fR
.sp
Convert database names to 5\&.1 format\&. Only database names that contain special characters are affected\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlcheck: fix-table-names option
-.\" fix-table-names option: mysqlcheck
\fB\-\-fix\-table\-names\fR
.sp
Convert table names to 5\&.1 format\&. Only table names that contain special characters are affected\&. This option also applies to views\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlcheck: force option
-.\" force option: mysqlcheck
\fB\-\-force\fR,
\fB\-f\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlcheck: host option
-.\" host option: mysqlcheck
\fB\-\-host=\fR\fB\fIhost_name\fR\fR,
\fB\-h \fR\fB\fIhost_name\fR\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlcheck: login-path option
-.\" login-path option: mysqlcheck
\fB\-\-login\-path=\fR\fB\fIname\fR\fR
.sp
Read options from the named login path in the
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlcheck: medium-check option
-.\" medium-check option: mysqlcheck
\fB\-\-medium\-check\fR,
\fB\-m\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlcheck: no-defaults option
-.\" no-defaults option: mysqlcheck
\fB\-\-no\-defaults\fR
.sp
Do not read any option files\&. If program startup fails due to reading unknown options from an option file,
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlcheck: optimize option
-.\" optimize option: mysqlcheck
\fB\-\-optimize\fR,
\fB\-o\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlcheck: password option
-.\" password option: mysqlcheck
\fB\-\-password[=\fR\fB\fIpassword\fR\fR\fB]\fR,
\fB\-p[\fR\fB\fIpassword\fR\fR\fB]\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlcheck: pipe option
-.\" pipe option: mysql
\fB\-\-pipe\fR,
\fB\-W\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlcheck: plugin-dir option
-.\" plugin-dir option: mysqlcheck
\fB\-\-plugin\-dir=\fR\fB\fIdir_name\fR\fR
.sp
The directory in which to look for plugins\&. Specify this option if the
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlcheck: port option
-.\" port option: mysqlcheck
\fB\-\-port=\fR\fB\fIport_num\fR\fR,
\fB\-P \fR\fB\fIport_num\fR\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlcheck: print-defaults option
-.\" print-defaults option: mysqlcheck
\fB\-\-print\-defaults\fR
.sp
Print the program name and all options that it gets from option files\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlcheck: protocol option
-.\" protocol option: mysqlcheck
\fB\-\-protocol={TCP|SOCKET|PIPE|MEMORY}\fR
.sp
The connection protocol to use for connecting to the server\&. It is useful when the other connection parameters normally would cause a protocol to be used other than the one you want\&. For details on the permissible values, see
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlcheck: quick option
-.\" quick option: mysqlcheck
\fB\-\-quick\fR,
\fB\-q\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlcheck: repair option
-.\" repair option: mysqlcheck
\fB\-\-repair\fR,
\fB\-r\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlcheck: secure-auth option
-.\" secure-auth option: mysqlcheck
\fB\-\-secure\-auth\fR
.sp
Do not send passwords to the server in old (pre\-4\&.1) format\&. This prevents connections except for servers that use the newer password format\&. This option is enabled by default; use
.ps -1
.br
Passwords that use the pre\-4\&.1 hashing method are less secure than passwords that use the native password hashing method and should be avoided\&. Pre\-4\&.1 passwords are deprecated and support for them will be removed in a future MySQL release\&. For account upgrade instructions, see
-Section\ \&6.4.1.3, \(lqMigrating Away from Pre-4.1 Password Hashing and the mysql_old_password Plugin\(rq\&.
+Section\ \&6.5.1.3, \(lqMigrating Away from Pre-4.1 Password Hashing and the mysql_old_password Plugin\(rq\&.
+.sp .5v
+.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
+This option is deprecated and will be removed in a future release\&. As of MySQL 5\&.7\&.5, it is always enabled and attempting to disable it produces an error\&.
.sp .5v
.RE
.RE
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlcheck: shared-memory-base-name option
-.\" shared-memory-base-name option: mysqlcheck
\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
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlcheck: silent option
-.\" silent option: mysqlcheck
\fB\-\-silent\fR,
\fB\-s\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlcheck: skip-database option
-.\" skip-database option: mysqlcheck
\fB\-\-skip\-database=\fR\fB\fIdb_name\fR\fR
.sp
Do not include the named database (case sensitive) in the operations performed by
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlcheck: socket option
-.\" socket option: mysqlcheck
\fB\-\-socket=\fR\fB\fIpath\fR\fR,
\fB\-S \fR\fB\fIpath\fR\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlcheck: SSL options
-.\" SSL options: mysqlcheck
\fB\-\-ssl*\fR
.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.3.9.5, \(lqCommand Options for Secure Connections\(rq\&.
+Section\ \&6.4.5, \(lqCommand Options for Secure Connections\(rq\&.
.RE
.sp
.RS 4
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlcheck: tables option
-.\" tables option: mysqlcheck
\fB\-\-tables\fR
.sp
Override the
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlcheck: use-frm option
-.\" use-frm option: mysqlcheck
\fB\-\-use\-frm\fR
.sp
For repair operations on
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlcheck: user option
-.\" user option: mysqlcheck
\fB\-\-user=\fR\fB\fIuser_name\fR\fR,
\fB\-u \fR\fB\fIuser_name\fR\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlcheck: verbose option
-.\" verbose option: mysqlcheck
\fB\-\-verbose\fR,
\fB\-v\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlcheck: version option
-.\" version option: mysqlcheck
\fB\-\-version\fR,
\fB\-V\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlcheck: write-binlog option
-.\" write-binlog option: mysqlcheck
\fB\-\-write\-binlog\fR
.sp
This option is enabled by default, so that
'\" t
.\" Title: \fBmysqld\fR
.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author]
-.\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\" Date: 03/02/2016
+.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
+.\" Date: 08/25/2016
.\" Manual: MySQL Database System
.\" Source: MySQL 5.6
.\" Language: English
.\"
-.TH "\FBMYSQLD\FR" "8" "03/02/2016" "MySQL 5\&.6" "MySQL Database System"
+.TH "\FBMYSQLD\FR" "8" "08/25/2016" "MySQL 5\&.6" "MySQL Database System"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
-.\" mysqld: MySQL server
-.\" MySQL server: mysqld
.SH "NAME"
mysqld \- the MySQL server
.SH "SYNOPSIS"
'\" t
.\" Title: \fBmysqld_multi\fR
.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author]
-.\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\" Date: 03/02/2016
+.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
+.\" Date: 08/25/2016
.\" Manual: MySQL Database System
.\" Source: MySQL 5.6
.\" Language: English
.\"
-.TH "\FBMYSQLD_MULTI\FR" "1" "03/02/2016" "MySQL 5\&.6" "MySQL Database System"
+.TH "\FBMYSQLD_MULTI\FR" "1" "08/25/2016" "MySQL 5\&.6" "MySQL Database System"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
-.\" mysqld_multi
-.\" tools: mysqld_multi
-.\" scripts
-.\" multi mysqld
.SH "NAME"
mysqld_multi \- manage multiple MySQL servers
.SH "SYNOPSIS"
group used for starting
\fBmysqld\fR\&. (See, for example,
Section\ \&2.10.5, \(lqStarting and Stopping MySQL Automatically\(rq\&.) However, when using multiple servers, it is necessary that each one use its own value for options such as the Unix socket file and TCP/IP port number\&. For more information on which options must be unique per server in a multiple\-server environment, see
-Section\ \&5.3, \(lqRunning Multiple MySQL Instances on One Machine\(rq\&.
+Section\ \&5.6, \(lqRunning Multiple MySQL Instances on One Machine\(rq\&.
.PP
To invoke
\fBmysqld_multi\fR, use the following syntax:
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqld_multi: no-defaults option
-.\" no-defaults option: mysqld_multi
With
\fB\-\-no\-defaults\fR, no option files are read\&.
.RE
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqld_multi: defaults-file option
-.\" defaults-file option: mysqld_multi
With
\fB\-\-defaults\-file=\fR\fB\fIfile_name\fR\fR, only the named file is read\&.
.RE
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqld_multi: defaults-extra-file option
-.\" defaults-extra-file option: mysqld_multi
Otherwise, option files in the standard list of locations are read, including any file named by the
\fB\-\-defaults\-extra\-file=\fR\fB\fIfile_name\fR\fR
option, if one is given\&. (If the option is given multiple times, the last value is used\&.)
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqld_multi: help option
-.\" help option: mysqld_multi
\fB\-\-help\fR
.sp
Display a help message and exit\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqld_multi: example option
-.\" example option: mysqld_multi
\fB\-\-example\fR
.sp
Display a sample option file\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqld_multi: log option
-.\" log option: mysqld_multi
\fB\-\-log=\fR\fB\fIfile_name\fR\fR
.sp
Specify the name of the log file\&. If the file exists, log output is appended to it\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqld_multi: mysqladmin option
-.\" mysqladmin option: mysqld_multi
\fB\-\-mysqladmin=\fR\fB\fIprog_name\fR\fR
.sp
The
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqld_multi: mysqld option
-.\" mysqld option: mysqld_multi
\fB\-\-mysqld=\fR\fB\fIprog_name\fR\fR
.sp
The
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqld_multi: no-log option
-.\" no-log option: mysqld_multi
\fB\-\-no\-log\fR
.sp
Print log information to
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqld_multi: password option
-.\" password option: mysqld_multi
\fB\-\-password=\fR\fB\fIpassword\fR\fR
.sp
The password of the MySQL account to use when invoking
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqld_multi: silent option
-.\" silent option: mysqld_multi
\fB\-\-silent\fR
.sp
Silent mode; disable warnings\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqld_multi: tcp-ip option
-.\" tcp-ip option: mysqld_multi
\fB\-\-tcp\-ip\fR
.sp
Connect to each MySQL server through the TCP/IP port instead of the Unix socket file\&. (If a socket file is missing, the server might still be running, but accessible only through the TCP/IP port\&.) By default, connections are made using the Unix socket file\&. This option affects
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqld_multi: user option
-.\" user option: mysqld_multi
\fB\-\-user=\fR\fB\fIuser_name\fR\fR
.sp
The user name of the MySQL account to use when invoking
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqld_multi: verbose option
-.\" verbose option: mysqld_multi
\fB\-\-verbose\fR
.sp
Be more verbose\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqld_multi: version option
-.\" version option: mysqld_multi
\fB\-\-version\fR
.sp
Display version information and exit\&.
what you are doing\&. Starting multiple servers with the same data directory does
\fInot\fR
give you extra performance in a threaded system\&. See
-Section\ \&5.3, \(lqRunning Multiple MySQL Instances on One Machine\(rq\&.
+Section\ \&5.6, \(lqRunning Multiple MySQL Instances on One Machine\(rq\&.
.RE
.sp
.RS 4
'\" t
.\" Title: \fBmysqld_safe\fR
.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author]
-.\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\" Date: 03/02/2016
+.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
+.\" Date: 08/25/2016
.\" Manual: MySQL Database System
.\" Source: MySQL 5.6
.\" Language: English
.\"
-.TH "\FBMYSQLD_SAFE\FR" "1" "03/02/2016" "MySQL 5\&.6" "MySQL Database System"
+.TH "\FBMYSQLD_SAFE\FR" "1" "08/25/2016" "MySQL 5\&.6" "MySQL Database System"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
-.\" mysqld_safe
-.\" tools: mysqld_safe
-.\" scripts
.SH "NAME"
mysqld_safe \- MySQL server startup script
.SH "SYNOPSIS"
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqld_safe: help option
-.\" help option: mysqld_safe
\fB\-\-help\fR
.sp
Display a help message and exit\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqld_safe: basedir option
-.\" basedir option: mysqld_safe
\fB\-\-basedir=\fR\fB\fIdir_name\fR\fR
.sp
The path to the MySQL installation directory\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqld_safe: core-file-size option
-.\" core-file-size option: mysqld_safe
\fB\-\-core\-file\-size=\fR\fB\fIsize\fR\fR
.sp
The size of the core file that
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqld_safe: datadir option
-.\" datadir option: mysqld_safe
\fB\-\-datadir=\fR\fB\fIdir_name\fR\fR
.sp
The path to the data directory\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqld_safe: defaults-extra-file option
-.\" defaults-extra-file option: mysqld_safe
\fB\-\-defaults\-extra\-file=\fR\fB\fIfile_name\fR\fR
.sp
The name of an option file to be read in addition to the usual option files\&. This must be the first option on the command line if it is used\&. If the file does not exist or is otherwise inaccessible, the server will exit with an error\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqld_safe: defaults-file option
-.\" defaults-file option: mysqld_safe
\fB\-\-defaults\-file=\fR\fB\fIfile_name\fR\fR
.sp
The name of an option file to be read instead of the usual option files\&. This must be the first option on the command line if it is used\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqld_safe: ledir option
-.\" ledir option: mysqld_safe
\fB\-\-ledir=\fR\fB\fIdir_name\fR\fR
.sp
If
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqld_safe: log-error option
-.\" log-error option: mysqld_safe
\fB\-\-log\-error=\fR\fB\fIfile_name\fR\fR
.sp
Write the error log to the given file\&. See
-Section\ \&5.2.2, \(lqThe Error Log\(rq\&.
+Section\ \&5.4.2, \(lqThe Error Log\(rq\&.
.RE
.sp
.RS 4
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqld_safe: malloc-lib option
-.\" mysqld option: malloc-lib
\fB\-\-malloc\-lib=[\fR\fB\fIlib_name\fR\fR\fB]\fR
-.\" memory allocation library
-.\" tcmalloc: memory allocation library
The name of the library to use for memory allocation instead of the system
malloc()
-library\&. Any library can be used by specifying its path name, but there is a shortcut form to enable use of the
+library\&. As of MySQL 5\&.6\&.33, the option value must be one of the directories
+/usr/lib,
+/usr/lib64,
+/usr/lib/i386\-linux\-gnu, or
+/usr/lib/x86_64\-linux\-gnu\&. Prior to MySQL 5\&.6\&.33, any library can be used by specifying its path name, but there is a shortcut form to enable use of the
tcmalloc
library that is shipped with binary MySQL distributions for Linux in MySQL 5\&.6\&. It is possible that the shortcut form will not work under certain configurations, in which case you should specify a path name instead\&.
+.if n \{\
.sp
+.\}
+.RS 4
+.it 1 an-trap
+.nr an-no-space-flag 1
+.nr an-break-flag 1
+.br
+.ps +1
+\fBNote\fR
+.ps -1
+.br
+As of MySQL 5\&.6\&.31, MySQL distributions no longer include a
+tcmalloc
+library\&.
+.sp .5v
+.RE
The
\fB\-\-malloc\-lib\fR
option works by modifying the
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqld_safe: mysqld option
-.\" mysqld option: mysqld_safe
\fB\-\-mysqld=\fR\fB\fIprog_name\fR\fR
.sp
The name of the server program (in the
cannot find the server, use the
\fB\-\-ledir\fR
option to indicate the path name to the directory where the server is located\&.
+.sp
+As of MySQL 5\&.6\&.33, this option can be given only on the command line and not in an option file\&.
.RE
.sp
.RS 4
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqld_safe: mysqld-version option
-.\" mysqld-version option: mysqld_safe
\fB\-\-mysqld\-version=\fR\fB\fIsuffix\fR\fR
.sp
This option is similar to the
in the
ledir
directory\&.
+.sp
+As of MySQL 5\&.6\&.33, this option can be given only on the command line and not in an option file\&.
.RE
.sp
.RS 4
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqld_safe: nice option
-.\" nice option: mysqld_safe
\fB\-\-nice=\fR\fB\fIpriority\fR\fR
.sp
Use the
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqld_safe: no-defaults option
-.\" no-defaults option: mysqld_safe
\fB\-\-no\-defaults\fR
.sp
Do not read any option files\&. This must be the first option on the command line if it is used\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqld_safe: open-files-limit option
-.\" open-files-limit option: mysqld_safe
\fB\-\-open\-files\-limit=\fR\fB\fIcount\fR\fR
.sp
The number of files that
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqld_safe: pid-file option
-.\" pid-file option: mysqld_safe
\fB\-\-pid\-file=\fR\fB\fIfile_name\fR\fR
.sp
The path name of the process ID file\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqld_safe: plugin-dir option
-.\" plugin-dir option: mysqld_safe
\fB\-\-plugin\-dir=\fR\fB\fIdir_name\fR\fR
.sp
The path name of the plugin directory\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqld_safe: port option
-.\" port option: mysqld_safe
-.\" TCP/IP
\fB\-\-port=\fR\fB\fIport_num\fR\fR
.sp
The port number that the server should use when listening for TCP/IP connections\&. The port number must be 1024 or higher unless the server is started by the
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqld_safe: skip-kill-mysqld option
-.\" skip-kill-mysqld option: mysqld_safe
\fB\-\-skip\-kill\-mysqld\fR
.sp
Do not try to kill stray
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqld_safe: socket option
-.\" socket option: mysqld_safe
\fB\-\-socket=\fR\fB\fIpath\fR\fR
.sp
The Unix socket file that the server should use when listening for local connections\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqld_safe: syslog option
-.\" syslog option: mysqld_safe
-.\" mysqld_safe: skip-syslog option
-.\" skip-syslog option: mysqld_safe
\fB\-\-syslog\fR,
\fB\-\-skip\-syslog\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqld_safe: syslog-tag option
-.\" syslog-tag option: mysqld_safe
\fB\-\-syslog\-tag=\fR\fB\fItag\fR\fR
.sp
For logging to
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqld_safe: timezone option
-.\" timezone option: mysqld_safe
\fB\-\-timezone=\fR\fB\fItimezone\fR\fR
.sp
Set the
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqld_safe: user option
-.\" user option: mysqld_safe
\fB\-\-user={\fR\fB\fIuser_name\fR\fR\fB|\fR\fB\fIuser_id\fR\fR\fB}\fR
.sp
Run the
'\" t
.\" Title: \fBmysqldump\fR
.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author]
-.\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\" Date: 03/02/2016
+.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
+.\" Date: 08/25/2016
.\" Manual: MySQL Database System
.\" Source: MySQL 5.6
.\" Language: English
.\"
-.TH "\FBMYSQLDUMP\FR" "1" "03/02/2016" "MySQL 5\&.6" "MySQL Database System"
+.TH "\FBMYSQLDUMP\FR" "1" "08/25/2016" "MySQL 5\&.6" "MySQL Database System"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
-.\" mysqldump
-.\" dumping: databases and tables
-.\" backups: databases and tables
-.\" databases: dumping
-.\" tables: dumping
.SH "NAME"
mysqldump \- a database backup program
.SH "SYNOPSIS"
.\}
.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.1.5, \(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
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqldump: bind-address option
-.\" bind-address option: mysqldump
\fB\-\-bind\-address=\fR\fB\fIip_address\fR\fR
.sp
On a computer having multiple network interfaces, use this option to select which interface to use for connecting to the MySQL server\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqldump: compress option
-.\" compress option: mysqldump
\fB\-\-compress\fR,
\fB\-C\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqldump: default-auth option
-.\" default-auth option: mysqldump
\fB\-\-default\-auth=\fR\fB\fIplugin\fR\fR
.sp
A hint about the client\-side authentication plugin to use\&. See
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqldump: enable-cleartext-plugin option
-.\" enable-cleartext-plugin option: mysqldump
\fB\-\-enable\-cleartext\-plugin\fR
.sp
Enable the
mysql_clear_password
cleartext authentication plugin\&. (See
-Section\ \&6.4.1.7, \(lqThe Cleartext Client-Side Authentication Plugin\(rq\&.)
+Section\ \&6.5.1.7, \(lqThe Cleartext Client-Side Authentication Plugin\(rq\&.)
.sp
This option was added in MySQL 5\&.6\&.28\&.
.RE
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqldump: host option
-.\" host option: mysqldump
\fB\-\-host=\fR\fB\fIhost_name\fR\fR,
\fB\-h \fR\fB\fIhost_name\fR\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqldump: login-path option
-.\" login-path option: mysqldump
\fB\-\-login\-path=\fR\fB\fIname\fR\fR
.sp
Read options from the named login path in the
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqldump: password option
-.\" password option: mysqldump
\fB\-\-password[=\fR\fB\fIpassword\fR\fR\fB]\fR,
\fB\-p[\fR\fB\fIpassword\fR\fR\fB]\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqldump: pipe option
-.\" pipe option: mysqldump
\fB\-\-pipe\fR,
\fB\-W\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqldump: plugin-dir option
-.\" plugin-dir option: mysqldump
\fB\-\-plugin\-dir=\fR\fB\fIdir_name\fR\fR
.sp
The directory in which to look for plugins\&. Specify this option if the
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqldump: port option
-.\" port option: mysqldump
\fB\-\-port=\fR\fB\fIport_num\fR\fR,
\fB\-P \fR\fB\fIport_num\fR\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqldump: protocol option
-.\" protocol option: mysqldump
\fB\-\-protocol={TCP|SOCKET|PIPE|MEMORY}\fR
.sp
The connection protocol to use for connecting to the server\&. It is useful when the other connection parameters normally would cause a protocol to be used other than the one you want\&. For details on the permissible values, see
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqldump: secure-auth option
-.\" secure-auth option: mysqldump
\fB\-\-secure\-auth\fR
.sp
Do not send passwords to the server in old (pre\-4\&.1) format\&. This prevents connections except for servers that use the newer password format\&. This option is enabled by default; use
.ps -1
.br
Passwords that use the pre\-4\&.1 hashing method are less secure than passwords that use the native password hashing method and should be avoided\&. Pre\-4\&.1 passwords are deprecated and support for them will be removed in a future MySQL release\&. For account upgrade instructions, see
-Section\ \&6.4.1.3, \(lqMigrating Away from Pre-4.1 Password Hashing and the mysql_old_password Plugin\(rq\&.
+Section\ \&6.5.1.3, \(lqMigrating Away from Pre-4.1 Password Hashing and the mysql_old_password Plugin\(rq\&.
+.sp .5v
+.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
+This option is deprecated and will be removed in a future release\&. As of MySQL 5\&.7\&.5, it is always enabled and attempting to disable it produces an error\&.
.sp .5v
.RE
.RE
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqldump: socket option
-.\" socket option: mysqldump
\fB\-\-socket=\fR\fB\fIpath\fR\fR,
\fB\-S \fR\fB\fIpath\fR\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqldump: SSL options
-.\" SSL options: mysqldump
\fB\-\-ssl*\fR
.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.3.9.5, \(lqCommand Options for Secure Connections\(rq\&.
+Section\ \&6.4.5, \(lqCommand Options for Secure Connections\(rq\&.
.RE
.sp
.RS 4
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqldump: user option
-.\" user option: mysqldump
\fB\-\-user=\fR\fB\fIuser_name\fR\fR,
\fB\-u \fR\fB\fIuser_name\fR\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqldump: defaults-extra-file option
-.\" defaults-extra-file option: mysqldump
\fB\-\-defaults\-extra\-file=\fR\fB\fIfile_name\fR\fR
.sp
Read this option file after the global option file but (on Unix) before the user option file\&. If the file does not exist or is otherwise inaccessible, an error occurs\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqldump: defaults-file option
-.\" defaults-file option: mysqldump
\fB\-\-defaults\-file=\fR\fB\fIfile_name\fR\fR
.sp
Use only the given option file\&. If the file does not exist or is otherwise inaccessible, an error occurs\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqldump: defaults-group-suffix option
-.\" defaults-group-suffix option: mysqldump
\fB\-\-defaults\-group\-suffix=\fR\fB\fIstr\fR\fR
.sp
Read not only the usual option groups, but also groups with the usual names and a suffix of
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqldump: no-defaults option
-.\" no-defaults option: mysqldump
\fB\-\-no\-defaults\fR
.sp
Do not read any option files\&. If program startup fails due to reading unknown options from an option file,
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqldump: print-defaults option
-.\" print-defaults option: mysqldump
\fB\-\-print\-defaults\fR
.sp
Print the program name and all options that it gets from option files\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqldump: add-drop-database option
-.\" add-drop-database option: mysqldump
\fB\-\-add\-drop\-database\fR
.sp
Write a
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqldump: add-drop-table option
-.\" add-drop-table option: mysqldump
\fB\-\-add\-drop\-table\fR
.sp
Write a
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqldump: add-drop-trigger option
-.\" add-drop-trigger option: mysqldump
\fB\-\-add\-drop\-trigger\fR
.sp
Write a
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqldump: all-tablespaces option
-.\" all-tablespaces option: mysqldump
\fB\-\-all\-tablespaces\fR,
\fB\-Y\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqldump: no-create-db option
-.\" no-create-db option: mysqldump
\fB\-\-no\-create\-db\fR,
\fB\-n\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqldump: no-create-info option
-.\" no-create-info option: mysqldump
\fB\-\-no\-create\-info\fR,
\fB\-t\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqldump: no-tablespaces option
-.\" no-tablespaces option: mysqldump
\fB\-\-no\-tablespaces\fR,
\fB\-y\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqldump: replace option
-.\" replace option: mysqldump
\fB\-\-replace\fR
.sp
Write
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqldump: allow-keywords option
-.\" allow-keywords option: mysqldump
\fB\-\-allow\-keywords\fR
.sp
Permit creation of column names that are keywords\&. This works by prefixing each column name with the table name\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqldump: comments option
-.\" comments option: mysqldump
\fB\-\-comments\fR,
\fB\-i\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqldump: debug option
-.\" debug option: mysqldump
\fB\-\-debug[=\fR\fB\fIdebug_options\fR\fR\fB]\fR,
\fB\-# [\fR\fB\fIdebug_options\fR\fR\fB]\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqldump: debug-check option
-.\" debug-check option: mysqldump
\fB\-\-debug\-check\fR
.sp
Print some debugging information when the program exits\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqldump: debug-info option
-.\" debug-info option: mysqldump
\fB\-\-debug\-info\fR
.sp
Print debugging information and memory and CPU usage statistics when the program exits\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqldump: dump-date option
-.\" dump-date option: mysqldump
\fB\-\-dump\-date\fR
.sp
If the
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqldump: force option
-.\" force option: mysqldump
\fB\-\-force\fR,
\fB\-f\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqldump: log-error option
-.\" log-error option: mysqldump
\fB\-\-log\-error=\fR\fB\fIfile_name\fR\fR
.sp
Log warnings and errors by appending them to the named file\&. The default is to do no logging\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqldump: skip-comments option
-.\" skip-comments option: mysqldump
\fB\-\-skip\-comments\fR
.sp
See the description for the
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqldump: verbose option
-.\" verbose option: mysqldump
\fB\-\-verbose\fR,
\fB\-v\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqldump: help option
-.\" help option: mysqldump
\fB\-\-help\fR,
\fB\-?\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqldump: version option
-.\" version option: mysqldump
\fB\-\-version\fR,
\fB\-V\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqldump: character-sets-dir option
-.\" character-sets-dir option: mysqldump
\fB\-\-character\-sets\-dir=\fR\fB\fIdir_name\fR\fR
.sp
The directory where character sets are installed\&. See
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqldump: default-character-set option
-.\" default-character-set option: mysqldump
\fB\-\-default\-character\-set=\fR\fB\fIcharset_name\fR\fR
.sp
Use
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqldump: no-set-names option
-.\" no-set-names option: mysqldump
\fB\-\-no\-set\-names\fR,
\fB\-N\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqldump: set-charset option
-.\" set-charset option: mysqldump
\fB\-\-set\-charset\fR
.sp
Write
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqldump: apply-slave-statements option
-.\" apply-slave-statements option: mysqldump
\fB\-\-apply\-slave\-statements\fR
.sp
For a slave dump produced with the
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqldump: delete-master-logs option
-.\" delete-master-logs option: mysqldump
\fB\-\-delete\-master\-logs\fR
.sp
On a master replication server, delete the binary logs by sending a
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqldump: dump-slave option
-.\" dump-slave option: mysqldump
\fB\-\-dump\-slave[=\fR\fB\fIvalue\fR\fR\fB]\fR
.sp
This option is similar to
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqldump: include-master-host-port option
-.\" include-master-host-port option: mysqldump
\fB\-\-include\-master\-host\-port\fR
.sp
For the
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqldump: master-data option
-.\" master-data option: mysqldump
\fB\-\-master\-data[=\fR\fB\fIvalue\fR\fR\fB]\fR
.sp
Use this option to dump a master replication server to produce a dump file that can be used to set up another server as a slave of the master\&. It causes the dump output to include a
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqldump: set-gtid-purged option
-.\" set-gtid-purged option: mysqldump
\fB\-\-set\-gtid\-purged=\fR\fB\fIvalue\fR\fR
.sp
This option enables control over global transaction ID (GTID) information written to the dump file, by indicating whether to add a
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqldump: compact option
-.\" compact option: mysqldump
\fB\-\-compact\fR
.sp
Produce more compact output\&. This option enables the
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqldump: compatible option
-.\" compatible option: mysqldump
\fB\-\-compatible=\fR\fB\fIname\fR\fR
.sp
Produce output that is more compatible with other database systems or with older MySQL servers\&. The value of
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqldump: complete-insert option
-.\" complete-insert option: mysqldump
\fB\-\-complete\-insert\fR,
\fB\-c\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqldump: create-options option
-.\" create-options option: mysqldump
\fB\-\-create\-options\fR
.sp
Include all MySQL\-specific table options in the
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqldump: fields-terminated-by option
-.\" fields-terminated-by option: mysqldump
\fB\-\-fields\-terminated\-by=\&.\&.\&.\fR,
-.\" mysqldump: fields-enclosed-by option
-.\" fields-enclosed-by option: mysqldump
\fB\-\-fields\-enclosed\-by=\&.\&.\&.\fR,
-.\" mysqldump: fields-optionally-enclosed-by option
-.\" fields-optionally-enclosed-by option: mysqldump
\fB\-\-fields\-optionally\-enclosed\-by=\&.\&.\&.\fR,
-.\" mysqldump: fields-escaped-by option
-.\" fields-escaped-by option: mysqldump
\fB\-\-fields\-escaped\-by=\&.\&.\&.\fR
.sp
These options are used with the
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqldump: hex-blob option
-.\" hex-blob option: mysqldump
\fB\-\-hex\-blob\fR
.sp
Dump binary columns using hexadecimal notation (for example,
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqldump: lines-terminated-by option
-.\" lines-terminated-by option: mysqldump
\fB\-\-lines\-terminated\-by=\&.\&.\&.\fR
.sp
This option is used with the
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqldump: quote-names option
-.\" quote-names option: mysqldump
\fB\-\-quote\-names\fR,
\fB\-Q\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqldump: result-file option
-.\" result-file option: mysqldump
\fB\-\-result\-file=\fR\fB\fIfile_name\fR\fR,
\fB\-r \fR\fB\fIfile_name\fR\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqldump: tab option
-.\" tab option: mysqldump
\fB\-\-tab=\fR\fB\fIdir_name\fR\fR,
\fB\-T \fR\fB\fIdir_name\fR\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqldump: tz-utc option
-.\" tz-utc option: mysqldump
\fB\-\-tz\-utc\fR
.sp
This option enables
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqldump: xml option
-.\" xml option: mysqldump
\fB\-\-xml\fR,
\fB\-X\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqldump: all-databases option
-.\" all-databases option: mysqldump
\fB\-\-all\-databases\fR,
\fB\-A\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqldump: databases option
-.\" databases option: mysqldump
\fB\-\-databases\fR,
\fB\-B\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqldump: events option
-.\" events option: mysqldump
\fB\-\-events\fR,
\fB\-E\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqldump: ignore-table option
-.\" ignore-table option: mysqldump
\fB\-\-ignore\-table=\fR\fB\fIdb_name\&.tbl_name\fR\fR
.sp
Do not dump the given table, which must be specified using both the database and table names\&. To ignore multiple tables, use this option multiple times\&. This option also can be used to ignore views\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqldump: no-data option
-.\" no-data option: mysqldump
\fB\-\-no\-data\fR,
\fB\-d\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqldump: routines option
-.\" routines option: mysqldump
\fB\-\-routines\fR,
\fB\-R\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqldump: tables option
-.\" tables option: mysqldump
\fB\-\-tables\fR
.sp
Override the
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqldump: triggers option
-.\" triggers option: mysqldump
\fB\-\-triggers\fR
.sp
Include triggers for each dumped table in the output\&. This option is enabled by default; disable it with
\fB\-\-skip\-triggers\fR\&.
+.sp
+To be able to dump a table\*(Aqs triggers, you must have the
+TRIGGER
+privilege for the table\&.
.RE
.sp
.RS 4
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqldump: where option
-.\" where option: mysqldump
\fB\-\-where=\*(Aq\fR\fB\fIwhere_condition\fR\fR\fB\*(Aq\fR,
\fB\-w \*(Aq\fR\fB\fIwhere_condition\fR\fR\fB\*(Aq\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqldump: delayed-insert option
-.\" delayed-insert option: mysqldump
\fB\-\-delayed\-insert\fR
.sp
For those nontransactional tables that support the
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqldump: disable-keys option
-.\" disable-keys option: mysqldump
\fB\-\-disable\-keys\fR,
\fB\-K\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqldump: extended-insert option
-.\" extended-insert option: mysqldump
\fB\-\-extended\-insert\fR,
\fB\-e\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqldump: insert-ignore option
-.\" insert-ignore option: mysqldump
\fB\-\-insert\-ignore\fR
.sp
Write
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqldump: opt option
-.\" opt option: mysqldump
\fB\-\-opt\fR
.sp
This option, enabled by default, is shorthand for the combination of
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqldump: quick option
-.\" quick option: mysqldump
\fB\-\-quick\fR,
\fB\-q\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqldump: skip-opt option
-.\" skip-opt option: mysqldump
\fB\-\-skip\-opt\fR
.sp
See the description for the
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqldump: add-locks option
-.\" add-locks option: mysqldump
\fB\-\-add\-locks\fR
.sp
Surround each table dump with
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqldump: flush-logs option
-.\" flush-logs option: mysqldump
\fB\-\-flush\-logs\fR,
\fB\-F\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqldump: flush-privileges option
-.\" flush-privileges option: mysqldump
\fB\-\-flush\-privileges\fR
.sp
Add a
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqldump: lock-all-tables option
-.\" lock-all-tables option: mysqldump
\fB\-\-lock\-all\-tables\fR,
\fB\-x\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqldump: lock-tables option
-.\" lock-tables option: mysqldump
\fB\-\-lock\-tables\fR,
\fB\-l\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqldump: no-autocommit option
-.\" no-autocommit option: mysqldump
\fB\-\-no\-autocommit\fR
.sp
Enclose the
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqldump: order-by-primary option
-.\" order-by-primary option: mysqldump
\fB\-\-order\-by\-primary\fR
.sp
Dump each table\*(Aqs rows sorted by its primary key, or by its first unique index, if such an index exists\&. This is useful when dumping a
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqldump: shared-memory-base-name option
-.\" shared-memory-base-name option: mysqldump
\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
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqldump: single-transaction option
-.\" single-transaction option: mysqldump
\fB\-\-single\-transaction\fR
.sp
This option sets the transaction isolation mode to
For point\-in\-time recovery (also known as
\(lqroll\-forward,\(rq
when you need to restore an old backup and replay the changes that happened since that backup), it is often useful to rotate the binary log (see
-Section\ \&5.2.4, \(lqThe Binary Log\(rq) or at least know the binary log coordinates to which the dump corresponds:
+Section\ \&5.4.4, \(lqThe Binary Log\(rq) or at least know the binary log coordinates to which the dump corresponds:
.sp
.if n \{\
.RS 4
\fB\-\-disable\-keys\fR
\fB\-\-lock\-tables\fR\&.
.RE
-Restrictions.\" mysqldump: views
-.\" mysqldump: problems
-.\" mysqldump: workarounds
-.PP
+Restrictions.PP
\fBmysqldump\fR
does not dump the
INFORMATION_SCHEMA
'\" t
.\" Title: \fBmysqldumpslow\fR
.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author]
-.\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\" Date: 03/02/2016
+.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
+.\" Date: 08/25/2016
.\" Manual: MySQL Database System
.\" Source: MySQL 5.6
.\" Language: English
.\"
-.TH "\FBMYSQLDUMPSLOW\FR" "1" "03/02/2016" "MySQL 5\&.6" "MySQL Database System"
+.TH "\FBMYSQLDUMPSLOW\FR" "1" "08/25/2016" "MySQL 5\&.6" "MySQL Database System"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
-.\" mysqldumpslow
.SH "NAME"
mysqldumpslow \- Summarize slow query log files
.SH "SYNOPSIS"
.SH "DESCRIPTION"
.PP
The MySQL slow query log contains information about queries that take a long time to execute (see
-Section\ \&5.2.5, \(lqThe Slow Query Log\(rq)\&.
+Section\ \&5.4.5, \(lqThe Slow Query Log\(rq)\&.
\fBmysqldumpslow\fR
parses MySQL slow query log files and prints a summary of their contents\&.
.PP
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqldumpslow: help option
-.\" help option: mysqldumpslow
\fB\-\-help\fR
.sp
Display a help message and exit\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqldumpslow: debug option
-.\" debug option: mysqldumpslow
\fB\-\-debug\fR,
\fB\-d\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqldumpslow: verbose option
-.\" verbose option: mysqldumpslow
\fB\-\-verbose\fR,
\fB\-v\fR
.sp
'\" t
.\" Title: \fBmysqlhotcopy\fR
.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author]
-.\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\" Date: 03/02/2016
+.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
+.\" Date: 08/25/2016
.\" Manual: MySQL Database System
.\" Source: MySQL 5.6
.\" Language: English
.\"
-.TH "\FBMYSQLHOTCOPY\FR" "1" "03/02/2016" "MySQL 5\&.6" "MySQL Database System"
+.TH "\FBMYSQLHOTCOPY\FR" "1" "08/25/2016" "MySQL 5\&.6" "MySQL Database System"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
-.\" mysqlhotcopy
-.\" dumping: databases and tables
-.\" backups: databases and tables
-.\" databases: dumping
-.\" tables: dumping
.SH "NAME"
mysqlhotcopy \- a database backup program
.SH "SYNOPSIS"
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlhotcopy: help option
-.\" help option: mysqlhotcopy
\fB\-\-help\fR,
\fB\-?\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlhotcopy: addtodest option
-.\" addtodest option: mysqlhotcopy
\fB\-\-addtodest\fR
.sp
Do not rename target directory (if it exists); merely add files to it\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlhotcopy: allowold option
-.\" allowold option: mysqlhotcopy
\fB\-\-allowold\fR
.sp
Do not abort if a target exists; rename it by adding an
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlhotcopy: checkpoint option
-.\" checkpoint option: mysqlhotcopy
\fB\-\-checkpoint=\fR\fB\fIdb_name\fR\fR\fB\&.\fR\fB\fItbl_name\fR\fR
.sp
Insert checkpoint entries into the specified database
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlhotcopy: chroot option
-.\" chroot option: mysqlhotcopy
\fB\-\-chroot=\fR\fB\fIdir_name\fR\fR
.sp
Base directory of the
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlhotcopy: debug option
-.\" debug option: mysqlhotcopy
\fB\-\-debug\fR
.sp
Enable debug output\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlhotcopy: dryrun option
-.\" dryrun option: mysqlhotcopy
\fB\-\-dryrun\fR,
\fB\-n\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlhotcopy: flushlog option
-.\" flushlog option: mysqlhotcopy
\fB\-\-flushlog\fR
.sp
Flush logs after all tables are locked\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlhotcopy: host option
-.\" host option: mysqlhotcopy
\fB\-\-host=\fR\fB\fIhost_name\fR\fR,
\fB\-h \fR\fB\fIhost_name\fR\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlhotcopy: keepold option
-.\" keepold option: mysqlhotcopy
\fB\-\-keepold\fR
.sp
Do not delete previous (renamed) target when done\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlhotcopy: method option
-.\" method option: mysqlhotcopy
\fB\-\-method=\fR\fB\fIcommand\fR\fR
.sp
The method for copying files (cp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlhotcopy: noindices option
-.\" noindices option: mysqlhotcopy
\fB\-\-noindices\fR
.sp
Do not include full index files for
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlhotcopy: password option
-.\" password option: mysqlhotcopy
\fB\-\-password=\fR\fB\fIpassword\fR\fR,
\fB\-p\fR\fB\fIpassword\fR\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlhotcopy: port option
-.\" port option: mysqlhotcopy
\fB\-\-port=\fR\fB\fIport_num\fR\fR,
\fB\-P \fR\fB\fIport_num\fR\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlhotcopy: old_server option
-.\" old_server option: mysqlhotcopy
\fB\-\-old_server\fR
.sp
In MySQL 5\&.6,
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlhotcopy: quiet option
-.\" quiet option: mysqlhotcopy
\fB\-\-quiet\fR,
\fB\-q\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlhotcopy: record_log_pos option
-.\" record_log_pos option: mysqlhotcopy
\fB\-\-record_log_pos=\fR\fB\fIdb_name\fR\fR\fB\&.\fR\fB\fItbl_name\fR\fR
.sp
Record master and slave status in the specified database
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlhotcopy: regexp option
-.\" regexp option: mysqlhotcopy
\fB\-\-regexp=\fR\fB\fIexpr\fR\fR
.sp
Copy all databases with names that match the given regular expression\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlhotcopy: resetmaster option
-.\" resetmaster option: mysqlhotcopy
\fB\-\-resetmaster\fR
.sp
Reset the binary log after locking all the tables\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlhotcopy: resetslave option
-.\" resetslave option: mysqlhotcopy
\fB\-\-resetslave\fR
.sp
Reset the master info repository file or table after locking all the tables\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlhotcopy: socket option
-.\" socket option: mysqlhotcopy
\fB\-\-socket=\fR\fB\fIpath\fR\fR,
\fB\-S \fR\fB\fIpath\fR\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlhotcopy: suffix option
-.\" suffix option: mysqlhotcopy
\fB\-\-suffix=\fR\fB\fIstr\fR\fR
.sp
The suffix to use for names of copied databases\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlhotcopy: tmpdir option
-.\" tmpdir option: mysqlhotcopy
\fB\-\-tmpdir=\fR\fB\fIdir_name\fR\fR
.sp
The temporary directory\&. The default is
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlhotcopy: user option
-.\" user option: mysqlhotcopy
\fB\-\-user=\fR\fB\fIuser_name\fR\fR,
\fB\-u \fR\fB\fIuser_name\fR\fR
.sp
'\" t
.\" Title: \fBmysqlimport\fR
.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author]
-.\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\" Date: 03/02/2016
+.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
+.\" Date: 08/25/2016
.\" Manual: MySQL Database System
.\" Source: MySQL 5.6
.\" Language: English
.\"
-.TH "\FBMYSQLIMPORT\FR" "1" "03/02/2016" "MySQL 5\&.6" "MySQL Database System"
+.TH "\FBMYSQLIMPORT\FR" "1" "08/25/2016" "MySQL 5\&.6" "MySQL Database System"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
-.\" mysqlimport
-.\" importing: data
-.\" data: importing
-.\" files: text
-.\" text files: importing
.SH "NAME"
mysqlimport \- a data import program
.SH "SYNOPSIS"
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlimport: help option
-.\" help option: mysqlimport
\fB\-\-help\fR,
\fB\-?\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlimport: bind-address option
-.\" bind-address option: mysqlimport
\fB\-\-bind\-address=\fR\fB\fIip_address\fR\fR
.sp
On a computer having multiple network interfaces, use this option to select which interface to use for connecting to the MySQL server\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlimport: character-sets-dir option
-.\" character-sets-dir option: mysqlimport
\fB\-\-character\-sets\-dir=\fR\fB\fIdir_name\fR\fR
.sp
The directory where character sets are installed\&. See
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlimport: columns option
-.\" columns option: mysqlimport
\fB\-\-columns=\fR\fB\fIcolumn_list\fR\fR,
\fB\-c \fR\fB\fIcolumn_list\fR\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlimport: compress option
-.\" compress option: mysqlimport
\fB\-\-compress\fR,
\fB\-C\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlimport: debug option
-.\" debug option: mysqlimport
\fB\-\-debug[=\fR\fB\fIdebug_options\fR\fR\fB]\fR,
\fB\-# [\fR\fB\fIdebug_options\fR\fR\fB]\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlimport: debug-check option
-.\" debug-check option: mysqlimport
\fB\-\-debug\-check\fR
.sp
Print some debugging information when the program exits\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlimport: debug-info option
-.\" debug-info option: mysqlimport
\fB\-\-debug\-info\fR
.sp
Print debugging information and memory and CPU usage statistics when the program exits\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlimport: default-character-set option
-.\" default-character-set option: mysqlimport
\fB\-\-default\-character\-set=\fR\fB\fIcharset_name\fR\fR
.sp
Use
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlimport: default-auth option
-.\" default-auth option: mysqlimport
\fB\-\-default\-auth=\fR\fB\fIplugin\fR\fR
.sp
A hint about the client\-side authentication plugin to use\&. See
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlimport: defaults-extra-file option
-.\" defaults-extra-file option: mysqlimport
\fB\-\-defaults\-extra\-file=\fR\fB\fIfile_name\fR\fR
.sp
Read this option file after the global option file but (on Unix) before the user option file\&. If the file does not exist or is otherwise inaccessible, an error occurs\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlimport: defaults-file option
-.\" defaults-file option: mysqlimport
\fB\-\-defaults\-file=\fR\fB\fIfile_name\fR\fR
.sp
Use only the given option file\&. If the file does not exist or is otherwise inaccessible, an error occurs\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlimport: defaults-group-suffix option
-.\" defaults-group-suffix option: mysqlimport
\fB\-\-defaults\-group\-suffix=\fR\fB\fIstr\fR\fR
.sp
Read not only the usual option groups, but also groups with the usual names and a suffix of
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlimport: delete option
-.\" delete option: mysqlimport
\fB\-\-delete\fR,
\fB\-D\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlimport: enable-cleartext-plugin option
-.\" enable-cleartext-plugin option: mysqlimport
\fB\-\-enable\-cleartext\-plugin\fR
.sp
Enable the
mysql_clear_password
cleartext authentication plugin\&. (See
-Section\ \&6.4.1.7, \(lqThe Cleartext Client-Side Authentication Plugin\(rq\&.)
+Section\ \&6.5.1.7, \(lqThe Cleartext Client-Side Authentication Plugin\(rq\&.)
.sp
This option was added in MySQL 5\&.6\&.28\&.
.RE
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqldump: fields-terminated-by option
-.\" fields-terminated-by option: mysqldump
\fB\-\-fields\-terminated\-by=\&.\&.\&.\fR,
-.\" mysqldump: fields-enclosed-by option
-.\" fields-enclosed-by option: mysqldump
\fB\-\-fields\-enclosed\-by=\&.\&.\&.\fR,
-.\" mysqldump: fields-optionally-enclosed-by option
-.\" fields-optionally-enclosed-by option: mysqldump
\fB\-\-fields\-optionally\-enclosed\-by=\&.\&.\&.\fR,
-.\" mysqldump: fields-escaped-by option
-.\" fields-escaped-by option: mysqldump
\fB\-\-fields\-escaped\-by=\&.\&.\&.\fR
.sp
These options have the same meaning as the corresponding clauses for
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlimport: force option
-.\" force option: mysqlimport
\fB\-\-force\fR,
\fB\-f\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlimport: host option
-.\" host option: mysqlimport
\fB\-\-host=\fR\fB\fIhost_name\fR\fR,
\fB\-h \fR\fB\fIhost_name\fR\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlimport: ignore option
-.\" ignore option: mysqlimport
\fB\-\-ignore\fR,
\fB\-i\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlimport: ignore-lines option
-.\" ignore-lines option: mysqlimport
\fB\-\-ignore\-lines=\fR\fB\fIN\fR\fR
.sp
Ignore the first
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqldump: lines-terminated-by option
-.\" lines-terminated-by option: mysqldump
\fB\-\-lines\-terminated\-by=\&.\&.\&.\fR
.sp
This option has the same meaning as the corresponding clause for
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlimport: local option
-.\" local option: mysqlimport
\fB\-\-local\fR,
\fB\-L\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlimport: lock-tables option
-.\" lock-tables option: mysqlimport
\fB\-\-lock\-tables\fR,
\fB\-l\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlimport: login-path option
-.\" login-path option: mysqlimport
\fB\-\-login\-path=\fR\fB\fIname\fR\fR
.sp
Read options from the named login path in the
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlimport: low-priority option
-.\" low-priority option: mysqlimport
\fB\-\-low\-priority\fR
.sp
Use
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlimport: no-defaults option
-.\" no-defaults option: mysqlimport
\fB\-\-no\-defaults\fR
.sp
Do not read any option files\&. If program startup fails due to reading unknown options from an option file,
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlimport: password option
-.\" password option: mysqlimport
\fB\-\-password[=\fR\fB\fIpassword\fR\fR\fB]\fR,
\fB\-p[\fR\fB\fIpassword\fR\fR\fB]\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlimport: pipe option
-.\" pipe option: mysqlimport
\fB\-\-pipe\fR,
\fB\-W\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlimport: plugin-dir option
-.\" plugin-dir option: mysqlimport
\fB\-\-plugin\-dir=\fR\fB\fIdir_name\fR\fR
.sp
The directory in which to look for plugins\&. Specify this option if the
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlimport: port option
-.\" port option: mysqlimport
\fB\-\-port=\fR\fB\fIport_num\fR\fR,
\fB\-P \fR\fB\fIport_num\fR\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlimport: print-defaults option
-.\" print-defaults option: mysqlimport
\fB\-\-print\-defaults\fR
.sp
Print the program name and all options that it gets from option files\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlimport: protocol option
-.\" protocol option: mysqlimport
\fB\-\-protocol={TCP|SOCKET|PIPE|MEMORY}\fR
.sp
The connection protocol to use for connecting to the server\&. It is useful when the other connection parameters normally would cause a protocol to be used other than the one you want\&. For details on the permissible values, see
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlimport: replace option
-.\" replace option: mysqlimport
\fB\-\-replace\fR,
\fB\-r\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlimport: secure-auth option
-.\" secure-auth option: mysqlimport
\fB\-\-secure\-auth\fR
.sp
Do not send passwords to the server in old (pre\-4\&.1) format\&. This prevents connections except for servers that use the newer password format\&. This option is enabled by default; use
.ps -1
.br
Passwords that use the pre\-4\&.1 hashing method are less secure than passwords that use the native password hashing method and should be avoided\&. Pre\-4\&.1 passwords are deprecated and support for them will be removed in a future MySQL release\&. For account upgrade instructions, see
-Section\ \&6.4.1.3, \(lqMigrating Away from Pre-4.1 Password Hashing and the mysql_old_password Plugin\(rq\&.
+Section\ \&6.5.1.3, \(lqMigrating Away from Pre-4.1 Password Hashing and the mysql_old_password Plugin\(rq\&.
+.sp .5v
+.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
+This option is deprecated and will be removed in a future release\&. As of MySQL 5\&.7\&.5, it is always enabled and attempting to disable it produces an error\&.
.sp .5v
.RE
.RE
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlimport: shared-memory-base-name option
-.\" shared-memory-base-name option: mysqlimport
\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
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlimport: silent option
-.\" silent option: mysqlimport
\fB\-\-silent\fR,
\fB\-s\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlimport: socket option
-.\" socket option: mysqlimport
\fB\-\-socket=\fR\fB\fIpath\fR\fR,
\fB\-S \fR\fB\fIpath\fR\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlimport: SSL options
-.\" SSL options: mysqlimport
\fB\-\-ssl*\fR
.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.3.9.5, \(lqCommand Options for Secure Connections\(rq\&.
+Section\ \&6.4.5, \(lqCommand Options for Secure Connections\(rq\&.
.RE
.sp
.RS 4
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlimport: user option
-.\" user option: mysqlimport
\fB\-\-user=\fR\fB\fIuser_name\fR\fR,
\fB\-u \fR\fB\fIuser_name\fR\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlimport: use-threads option
-.\" use-threads option: mysqlimport
\fB\-\-use\-threads=\fR\fB\fIN\fR\fR
.sp
Load files in parallel using
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlimport: verbose option
-.\" verbose option: mysqlimport
\fB\-\-verbose\fR,
\fB\-v\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlimport: version option
-.\" version option: mysqlimport
\fB\-\-version\fR,
\fB\-V\fR
.sp
'\" t
.\" Title: \fBmysqlshow\fR
.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author]
-.\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\" Date: 03/02/2016
+.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
+.\" Date: 08/25/2016
.\" Manual: MySQL Database System
.\" Source: MySQL 5.6
.\" Language: English
.\"
-.TH "\FBMYSQLSHOW\FR" "1" "03/02/2016" "MySQL 5\&.6" "MySQL Database System"
+.TH "\FBMYSQLSHOW\FR" "1" "08/25/2016" "MySQL 5\&.6" "MySQL Database System"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
-.\" mysqlshow
-.\" databases: displaying
-.\" displaying: database information
-.\" tables: displaying
-.\" columns: displaying
-.\" showing: database information
.SH "NAME"
mysqlshow \- display database, table, and column information
.SH "SYNOPSIS"
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlshow: help option
-.\" help option: mysqlshow
\fB\-\-help\fR,
\fB\-?\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlshow: bind-address option
-.\" bind-address option: mysqlshow
\fB\-\-bind\-address=\fR\fB\fIip_address\fR\fR
.sp
On a computer having multiple network interfaces, use this option to select which interface to use for connecting to the MySQL server\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlshow: character-sets-dir option
-.\" character-sets-dir option: mysqlshow
\fB\-\-character\-sets\-dir=\fR\fB\fIdir_name\fR\fR
.sp
The directory where character sets are installed\&. See
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlshow: compress option
-.\" compress option: mysqlshow
\fB\-\-compress\fR,
\fB\-C\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlshow: count option
-.\" count option: mysqlshow
\fB\-\-count\fR
.sp
Show the number of rows per table\&. This can be slow for non\-MyISAM
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlshow: debug option
-.\" debug option: mysqlshow
\fB\-\-debug[=\fR\fB\fIdebug_options\fR\fR\fB]\fR,
\fB\-# [\fR\fB\fIdebug_options\fR\fR\fB]\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlshow: debug-check option
-.\" debug-check option: mysqlshow
\fB\-\-debug\-check\fR
.sp
Print some debugging information when the program exits\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlshow: debug-info option
-.\" debug-info option: mysqlshow
\fB\-\-debug\-info\fR
.sp
Print debugging information and memory and CPU usage statistics when the program exits\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlshow: default-character-set option
-.\" default-character-set option: mysqlshow
\fB\-\-default\-character\-set=\fR\fB\fIcharset_name\fR\fR
.sp
Use
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlshow: default-auth option
-.\" default-auth option: mysqlshow
\fB\-\-default\-auth=\fR\fB\fIplugin\fR\fR
.sp
A hint about the client\-side authentication plugin to use\&. See
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlshow: defaults-extra-file option
-.\" defaults-extra-file option: mysqlshow
\fB\-\-defaults\-extra\-file=\fR\fB\fIfile_name\fR\fR
.sp
Read this option file after the global option file but (on Unix) before the user option file\&. If the file does not exist or is otherwise inaccessible, an error occurs\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlshow: defaults-file option
-.\" defaults-file option: mysqlshow
\fB\-\-defaults\-file=\fR\fB\fIfile_name\fR\fR
.sp
Use only the given option file\&. If the file does not exist or is otherwise inaccessible, an error occurs\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlshow: defaults-group-suffix option
-.\" defaults-group-suffix option: mysqlshow
\fB\-\-defaults\-group\-suffix=\fR\fB\fIstr\fR\fR
.sp
Read not only the usual option groups, but also groups with the usual names and a suffix of
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlshow: enable-cleartext-plugin option
-.\" enable-cleartext-plugin option: mysqlshow
\fB\-\-enable\-cleartext\-plugin\fR
.sp
Enable the
mysql_clear_password
cleartext authentication plugin\&. (See
-Section\ \&6.4.1.7, \(lqThe Cleartext Client-Side Authentication Plugin\(rq\&.)
+Section\ \&6.5.1.7, \(lqThe Cleartext Client-Side Authentication Plugin\(rq\&.)
.sp
This option was added in MySQL 5\&.6\&.28\&.
.RE
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlshow: host option
-.\" host option: mysqlshow
\fB\-\-host=\fR\fB\fIhost_name\fR\fR,
\fB\-h \fR\fB\fIhost_name\fR\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlshow: keys option
-.\" keys option: mysqlshow
\fB\-\-keys\fR,
\fB\-k\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlshow: login-path option
-.\" login-path option: mysqlshow
\fB\-\-login\-path=\fR\fB\fIname\fR\fR
.sp
Read options from the named login path in the
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlshow: no-defaults option
-.\" no-defaults option: mysqlshow
\fB\-\-no\-defaults\fR
.sp
Do not read any option files\&. If program startup fails due to reading unknown options from an option file,
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlshow: password option
-.\" password option: mysqlshow
\fB\-\-password[=\fR\fB\fIpassword\fR\fR\fB]\fR,
\fB\-p[\fR\fB\fIpassword\fR\fR\fB]\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlshow: pipe option
-.\" pipe option: mysqlshow
\fB\-\-pipe\fR,
\fB\-W\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlshow: plugin-dir option
-.\" plugin-dir option: mysqlshow
\fB\-\-plugin\-dir=\fR\fB\fIdir_name\fR\fR
.sp
The directory in which to look for plugins\&. Specify this option if the
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlshow: port option
-.\" port option: mysqlshow
\fB\-\-port=\fR\fB\fIport_num\fR\fR,
\fB\-P \fR\fB\fIport_num\fR\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlshow: print-defaults option
-.\" print-defaults option: mysqlshow
\fB\-\-print\-defaults\fR
.sp
Print the program name and all options that it gets from option files\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlshow: protocol option
-.\" protocol option: mysqlshow
\fB\-\-protocol={TCP|SOCKET|PIPE|MEMORY}\fR
.sp
The connection protocol to use for connecting to the server\&. It is useful when the other connection parameters normally would cause a protocol to be used other than the one you want\&. For details on the permissible values, see
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlshow: secure-auth option
-.\" secure-auth option: mysqlshow
\fB\-\-secure\-auth\fR
.sp
Do not send passwords to the server in old (pre\-4\&.1) format\&. This prevents connections except for servers that use the newer password format\&. This option is enabled by default; use
.ps -1
.br
Passwords that use the pre\-4\&.1 hashing method are less secure than passwords that use the native password hashing method and should be avoided\&. Pre\-4\&.1 passwords are deprecated and support for them will be removed in a future MySQL release\&. For account upgrade instructions, see
-Section\ \&6.4.1.3, \(lqMigrating Away from Pre-4.1 Password Hashing and the mysql_old_password Plugin\(rq\&.
+Section\ \&6.5.1.3, \(lqMigrating Away from Pre-4.1 Password Hashing and the mysql_old_password Plugin\(rq\&.
+.sp .5v
+.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
+This option is deprecated and will be removed in a future release\&. As of MySQL 5\&.7\&.5, it is always enabled and attempting to disable it produces an error\&.
.sp .5v
.RE
.RE
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlshow: shared-memory-base-name option
-.\" shared-memory-base-name option: mysqlshow
\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
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlshow: show-table-type option
-.\" show-table-type option: mysqlshow
\fB\-\-show\-table\-type\fR,
\fB\-t\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlshow: socket option
-.\" socket option: mysqlshow
\fB\-\-socket=\fR\fB\fIpath\fR\fR,
\fB\-S \fR\fB\fIpath\fR\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlshow: SSL options
-.\" SSL options: mysqlshow
\fB\-\-ssl*\fR
.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.3.9.5, \(lqCommand Options for Secure Connections\(rq\&.
+Section\ \&6.4.5, \(lqCommand Options for Secure Connections\(rq\&.
.RE
.sp
.RS 4
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlshow: status option
-.\" status option: mysqlshow
\fB\-\-status\fR,
\fB\-i\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlshow: user option
-.\" user option: mysqlshow
\fB\-\-user=\fR\fB\fIuser_name\fR\fR,
\fB\-u \fR\fB\fIuser_name\fR\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlshow: verbose option
-.\" verbose option: mysqlshow
\fB\-\-verbose\fR,
\fB\-v\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlshow: version option
-.\" version option: mysqlshow
\fB\-\-version\fR,
\fB\-V\fR
.sp
'\" t
.\" Title: \fBmysqlslap\fR
.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author]
-.\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\" Date: 03/02/2016
+.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
+.\" Date: 08/25/2016
.\" Manual: MySQL Database System
.\" Source: MySQL 5.6
.\" Language: English
.\"
-.TH "\FBMYSQLSLAP\FR" "1" "03/02/2016" "MySQL 5\&.6" "MySQL Database System"
+.TH "\FBMYSQLSLAP\FR" "1" "08/25/2016" "MySQL 5\&.6" "MySQL Database System"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
-.\" mysqlslap
-.\" load emulation
.SH "NAME"
mysqlslap \- load emulation client
.SH "SYNOPSIS"
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlslap: help option
-.\" help option: mysqlslap
\fB\-\-help\fR,
\fB\-?\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlslap: auto-generate-sql option
-.\" auto-generate-sql option: mysqlslap
\fB\-\-auto\-generate\-sql\fR,
\fB\-a\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlslap: auto-generate-sql-add-autoincrement option
-.\" auto-generate-sql-add-autoincrement option: mysqlslap
\fB\-\-auto\-generate\-sql\-add\-autoincrement\fR
.sp
Add an
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlslap: auto-generate-sql-execute-number option
-.\" auto-generate-sql-execute-number option: mysqlslap
\fB\-\-auto\-generate\-sql\-execute\-number=\fR\fB\fIN\fR\fR
.sp
Specify how many queries to generate automatically\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlslap: auto-generate-sql-guid-primary option
-.\" auto-generate-sql-guid-primary option: mysqlslap
\fB\-\-auto\-generate\-sql\-guid\-primary\fR
.sp
Add a GUID\-based primary key to automatically generated tables\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlslap: auto-generate-sql-load-type option
-.\" auto-generate-sql-load-type option: mysqlslap
\fB\-\-auto\-generate\-sql\-load\-type=\fR\fB\fItype\fR\fR
.sp
Specify the test load type\&. The permissible values are
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlslap: auto-generate-sql-secondary-indexes option
-.\" auto-generate-sql-secondary-indexes option: mysqlslap
\fB\-\-auto\-generate\-sql\-secondary\-indexes=\fR\fB\fIN\fR\fR
.sp
Specify how many secondary indexes to add to automatically generated tables\&. By default, none are added\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlslap: auto-generate-sql-unique-query-number option
-.\" auto-generate-sql-unique-query-number option: mysqlslap
\fB\-\-auto\-generate\-sql\-unique\-query\-number=\fR\fB\fIN\fR\fR
.sp
How many different queries to generate for automatic tests\&. For example, if you run a
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlslap: auto-generate-sql-unique-write-number option
-.\" auto-generate-sql-unique-write-number option: mysqlslap
\fB\-\-auto\-generate\-sql\-unique\-write\-number=\fR\fB\fIN\fR\fR
.sp
How many different queries to generate for
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlslap: auto-generate-sql-write-number option
-.\" auto-generate-sql-write-number option: mysqlslap
\fB\-\-auto\-generate\-sql\-write\-number=\fR\fB\fIN\fR\fR
.sp
-How many row inserts to perform on each thread\&. The default is 100\&.
+How many row inserts to perform\&. The default is 100\&.
.RE
.sp
.RS 4
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlslap: commit option
-.\" commit option: mysqlslap
\fB\-\-commit=\fR\fB\fIN\fR\fR
.sp
How many statements to execute before committing\&. The default is 0 (no commits are done)\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlslap: compress option
-.\" compress option: mysqlslap
\fB\-\-compress\fR,
\fB\-C\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlslap: concurrency option
-.\" concurrency option: mysqlslap
\fB\-\-concurrency=\fR\fB\fIN\fR\fR,
\fB\-c \fR\fB\fIN\fR\fR
.sp
-The number of clients to simulate when issuing the
-SELECT
-statement\&.
+The number of parallel clients to simulate\&.
.RE
.sp
.RS 4
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlslap: create option
-.\" create option: mysqlslap
\fB\-\-create=\fR\fB\fIvalue\fR\fR
.sp
The file or string containing the statement to use for creating the table\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlslap: create-schema option
-.\" create-schema option: mysqlslap
\fB\-\-create\-schema=\fR\fB\fIvalue\fR\fR
.sp
The schema in which to run the tests\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlslap: csv option
-.\" csv option: mysqlslap
\fB\-\-csv[=\fR\fB\fIfile_name\fR\fR\fB]\fR
.sp
Generate output in comma\-separated values format\&. The output goes to the named file, or to the standard output if no file is given\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlslap: debug option
-.\" debug option: mysqlslap
\fB\-\-debug[=\fR\fB\fIdebug_options\fR\fR\fB]\fR,
\fB\-# [\fR\fB\fIdebug_options\fR\fR\fB]\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlslap: debug-check option
-.\" debug-check option: mysqlslap
\fB\-\-debug\-check\fR
.sp
Print some debugging information when the program exits\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlslap: debug-info option
-.\" debug-info option: mysqlslap
\fB\-\-debug\-info\fR,
\fB\-T\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlslap: default-auth option
-.\" default-auth option: mysqlslap
\fB\-\-default\-auth=\fR\fB\fIplugin\fR\fR
.sp
A hint about the client\-side authentication plugin to use\&. See
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlslap: defaults-extra-file option
-.\" defaults-extra-file option: mysqlslap
\fB\-\-defaults\-extra\-file=\fR\fB\fIfile_name\fR\fR
.sp
Read this option file after the global option file but (on Unix) before the user option file\&. If the file does not exist or is otherwise inaccessible, an error occurs\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlslap: defaults-file option
-.\" defaults-file option: mysqlslap
\fB\-\-defaults\-file=\fR\fB\fIfile_name\fR\fR
.sp
Use only the given option file\&. If the file does not exist or is otherwise inaccessible, an error occurs\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlslap: defaults-group-suffix option
-.\" defaults-group-suffix option: mysqlslap
\fB\-\-defaults\-group\-suffix=\fR\fB\fIstr\fR\fR
.sp
Read not only the usual option groups, but also groups with the usual names and a suffix of
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlslap: delimiter option
-.\" delimiter option: mysqlslap
\fB\-\-delimiter=\fR\fB\fIstr\fR\fR,
\fB\-F \fR\fB\fIstr\fR\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlslap: detach option
-.\" detach option: mysqlslap
\fB\-\-detach=\fR\fB\fIN\fR\fR
.sp
Detach (close and reopen) each connection after each
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlslap: enable-cleartext-plugin option
-.\" enable-cleartext-plugin option: mysqlslap
\fB\-\-enable\-cleartext\-plugin\fR
.sp
Enable the
mysql_clear_password
cleartext authentication plugin\&. (See
-Section\ \&6.4.1.7, \(lqThe Cleartext Client-Side Authentication Plugin\(rq\&.) This option was added in MySQL 5\&.6\&.7\&.
+Section\ \&6.5.1.7, \(lqThe Cleartext Client-Side Authentication Plugin\(rq\&.) This option was added in MySQL 5\&.6\&.7\&.
.RE
.sp
.RS 4
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlslap: engine option
-.\" engine option: mysqlslap
\fB\-\-engine=\fR\fB\fIengine_name\fR\fR,
\fB\-e \fR\fB\fIengine_name\fR\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlslap: host option
-.\" host option: mysqlslap
\fB\-\-host=\fR\fB\fIhost_name\fR\fR,
\fB\-h \fR\fB\fIhost_name\fR\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlslap: iterations option
-.\" iterations option: mysqlslap
\fB\-\-iterations=\fR\fB\fIN\fR\fR,
\fB\-i \fR\fB\fIN\fR\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlslap: login-path option
-.\" login-path option: mysqlslap
\fB\-\-login\-path=\fR\fB\fIname\fR\fR
.sp
Read options from the named login path in the
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlslap: no-drop option
-.\" no-drop option: mysqlslap
\fB\-\-no\-drop\fR
.sp
Prevent
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlslap: no-defaults option
-.\" no-defaults option: mysqlslap
\fB\-\-no\-defaults\fR
.sp
Do not read any option files\&. If program startup fails due to reading unknown options from an option file,
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlslap: number-char-cols option
-.\" number-char-cols option: mysqlslap
\fB\-\-number\-char\-cols=\fR\fB\fIN\fR\fR,
\fB\-x \fR\fB\fIN\fR\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlslap: number-int-cols option
-.\" number-int-cols option: mysqlslap
\fB\-\-number\-int\-cols=\fR\fB\fIN\fR\fR,
\fB\-y \fR\fB\fIN\fR\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlslap: number-of-queries option
-.\" number-of-queries option: mysqlslap
\fB\-\-number\-of\-queries=\fR\fB\fIN\fR\fR
.sp
Limit each client to approximately this many queries\&. Query counting takes into account the statement delimiter\&. For example, if you invoke
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlslap: only-print option
-.\" only-print option: mysqlslap
\fB\-\-only\-print\fR
.sp
Do not connect to databases\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlslap: password option
-.\" password option: mysqlslap
\fB\-\-password[=\fR\fB\fIpassword\fR\fR\fB]\fR,
\fB\-p[\fR\fB\fIpassword\fR\fR\fB]\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlslap: pipe option
-.\" pipe option: mysqlslap
\fB\-\-pipe\fR,
\fB\-W\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlslap: plugin-dir option
-.\" plugin-dir option: mysqlslap
\fB\-\-plugin\-dir=\fR\fB\fIdir_name\fR\fR
.sp
The directory in which to look for plugins\&. Specify this option if the
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlslap: port option
-.\" port option: mysqlslap
\fB\-\-port=\fR\fB\fIport_num\fR\fR,
\fB\-P \fR\fB\fIport_num\fR\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlslap: post-query option
-.\" post-query option: mysqlslap
\fB\-\-post\-query=\fR\fB\fIvalue\fR\fR
.sp
The file or string containing the statement to execute after the tests have completed\&. This execution is not counted for timing purposes\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlslap: post-system option
-.\" post-system option: mysqlslap
\fB\-\-post\-system=\fR\fB\fIstr\fR\fR
.sp
The string to execute using
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlslap: pre-query option
-.\" pre-query option: mysqlslap
\fB\-\-pre\-query=\fR\fB\fIvalue\fR\fR
.sp
The file or string containing the statement to execute before running the tests\&. This execution is not counted for timing purposes\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlslap: pre-system option
-.\" pre-system option: mysqlslap
\fB\-\-pre\-system=\fR\fB\fIstr\fR\fR
.sp
The string to execute using
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlslap: print-defaults option
-.\" print-defaults option: mysqlslap
\fB\-\-print\-defaults\fR
.sp
Print the program name and all options that it gets from option files\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlslap: protocol option
-.\" protocol option: mysqlslap
\fB\-\-protocol={TCP|SOCKET|PIPE|MEMORY}\fR
.sp
The connection protocol to use for connecting to the server\&. It is useful when the other connection parameters normally would cause a protocol to be used other than the one you want\&. For details on the permissible values, see
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlslap: query option
-.\" query option: mysqlslap
\fB\-\-query=\fR\fB\fIvalue\fR\fR,
\fB\-q \fR\fB\fIvalue\fR\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlslap: secure-auth option
-.\" secure-auth option: mysqlslap
\fB\-\-secure\-auth\fR
.sp
Do not send passwords to the server in old (pre\-4\&.1) format\&. This prevents connections except for servers that use the newer password format\&. This option is enabled by default; use
.ps -1
.br
Passwords that use the pre\-4\&.1 hashing method are less secure than passwords that use the native password hashing method and should be avoided\&. Pre\-4\&.1 passwords are deprecated and support for them will be removed in a future MySQL release\&. For account upgrade instructions, see
-Section\ \&6.4.1.3, \(lqMigrating Away from Pre-4.1 Password Hashing and the mysql_old_password Plugin\(rq\&.
+Section\ \&6.5.1.3, \(lqMigrating Away from Pre-4.1 Password Hashing and the mysql_old_password Plugin\(rq\&.
+.sp .5v
+.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
+This option is deprecated and will be removed in a future release\&. As of MySQL 5\&.7\&.5, it is always enabled and attempting to disable it produces an error\&.
.sp .5v
.RE
.RE
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlslap: shared-memory-base-name option
-.\" shared-memory-base-name option: mysqlslap
\fB\-\-shared\-memory\-base\-name=\fR\fB\fIname\fR\fR
.sp
On Windows, the shared\-memory name to use, for connections made using shared memory to a local server\&. This option applies only if the server supports shared\-memory connections\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlslap: silent option
-.\" silent option: mysqlslap
\fB\-\-silent\fR,
\fB\-s\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlslap: socket option
-.\" socket option: mysqlslap
\fB\-\-socket=\fR\fB\fIpath\fR\fR,
\fB\-S \fR\fB\fIpath\fR\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlslap: SSL options
-.\" SSL options: mysqlslap
\fB\-\-ssl*\fR
.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.3.9.5, \(lqCommand Options for Secure Connections\(rq\&.
+Section\ \&6.4.5, \(lqCommand Options for Secure Connections\(rq\&.
.RE
.sp
.RS 4
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlslap: user option
-.\" user option: mysqlslap
\fB\-\-user=\fR\fB\fIuser_name\fR\fR,
\fB\-u \fR\fB\fIuser_name\fR\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlslap: verbose option
-.\" verbose option: mysqlslap
\fB\-\-verbose\fR,
\fB\-v\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlslap: version option
-.\" version option: mysqlslap
\fB\-\-version\fR,
\fB\-V\fR
.sp
'\" t
.\" Title: \fBmysqltest\fR
.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author]
-.\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\" Date: 03/02/2016
+.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
+.\" Date: 08/25/2016
.\" Manual: MySQL Database System
.\" Source: MySQL
.\" Language: English
.\"
-.TH "\FBMYSQLTEST\FR" "1" "03/02/2016" "MySQL" "MySQL Database System"
+.TH "\FBMYSQLTEST\FR" "1" "08/25/2016" "MySQL" "MySQL Database System"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
-.\" mysqltest
-.\" mysqltest_embedded
.SH "NAME"
mysqltest \- program to run test cases
.br
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqltest: help option
-.\" help option: mysqltest
\fB\-\-help\fR,
\fB\-?\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqltest: basedir option
-.\" basedir option: mysqltest
\fB\-\-basedir=\fR\fB\fIdir_name\fR\fR,
\fB\-b \fR\fB\fIdir_name\fR\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqltest: character-sets-dir option
-.\" character-sets-dir option: mysqltest
\fB\-\-character\-sets\-dir=\fR\fB\fIpath\fR\fR
.sp
The directory where character sets are installed\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqltest: compress option
-.\" compress option: mysqltest
\fB\-\-compress\fR,
\fB\-C\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqltest: currsor-protocol option
-.\" cursor-protocol option: mysqltest
\fB\-\-cursor\-protocol\fR
.sp
Use cursors for prepared statements\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqltest: database option
-.\" database option: mysqltest
\fB\-\-database=\fR\fB\fIdb_name\fR\fR,
\fB\-D \fR\fB\fIdb_name\fR\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqltest: debug option
-.\" debug option: mysqltest
\fB\-\-debug[=\fR\fB\fIdebug_options\fR\fR\fB]\fR,
\fB\-#[\fR\fB\fIdebug_options\fR\fR\fB]\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqltest: debug-check option
-.\" debug-check option: mysqltest
\fB\-\-debug\-check\fR
.sp
Print some debugging information when the program exits\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqltest: debug-info option
-.\" debug-info option: mysqltest
\fB\-\-debug\-info\fR
.sp
Print debugging information and memory and CPU usage statistics when the program exits\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqltest: explain-protocol option
-.\" explain-protocol option: mysqltest
\fB\-\-explain\-protocol\fR,
.sp
Run
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqltest: host option
-.\" host option: mysqltest
\fB\-\-host=\fR\fB\fIhost_name\fR\fR,
\fB\-h \fR\fB\fIhost_name\fR\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqltest: include option
-.\" include option: mysqltest
\fB\-\-include=\fR\fB\fIfile_name\fR\fR,
\fB\-i \fR\fB\fIfile_name\fR\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqltest: json-explain-protocol option
-.\" json-explain-protocol option: mysqltest
\fB\-\-json\-explain\-protocol\fR,
.sp
Run
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqltest: logdir option
-.\" logdir option: mysqltest
\fB\-\-logdir=\fR\fB\fIdir_name\fR\fR
.sp
The directory to use for log files\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqltest: mark-progress option
-.\" mark-progress option: mysqltest
\fB\-\-mark\-progress\fR
.sp
Write the line number and elapsed time to
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqltest: max-connect-retries option
-.\" max-connect-retries option: mysqltest
\fB\-\-max\-connect\-retries=\fR\fB\fInum\fR\fR
.sp
The maximum number of connection attempts when connecting to server\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqltest: max-connections option
-.\" max-connections option: mysqltest
\fB\-\-max\-connections=\fR\fB\fInum\fR\fR
.sp
The maximum number of simultaneous server connections per client (that is, per test)\&. If not set, the maximum is 128\&. Minimum allowed limit is 8, maximum is 5120\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqltest: no-defaults option
-.\" no-defaults option: mysqltest
\fB\-\-no\-defaults\fR
.sp
Do not read default options from any option files\&. If used, this must be the first option\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqltest: plugin-dir option
-.\" plugin-dir option: mysqltest
\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
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqltest: password option
-.\" password option: mysqltest
\fB\-\-password[=\fR\fB\fIpassword\fR\fR\fB]\fR,
\fB\-p[\fR\fB\fIpassword\fR\fR\fB]\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqltest: port option
-.\" port option: mysqltest
\fB\-\-port=\fR\fB\fIport_num\fR\fR,
\fB\-P \fR\fB\fIport_num\fR\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqltest: protocol option
-.\" protocol option: mysqltest
\fB\-\-protocol=\fR\fB{TCP|SOCKET|PIPE|MEMORY}\fR
.sp
Choose the protocol for communication with the server\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqltest: ps-protocol option
-.\" ps-protocol option: mysqltest
\fB\-\-ps\-protocol\fR
.sp
Use the prepared\-statement protocol for communication\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqltest: quiet option
-.\" quiet option: mysqltest
\fB\-\-quiet\fR
.sp
Suppress all normal output\&. This is a synonym for
-.\" mysqltest: silent option
-.\" silent option: mysqltest
\fB\-\-silent\fR\&.
.RE
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqltest: record option
-.\" record option: mysqltest
\fB\-\-record\fR,
\fB\-r\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqltest: result-file option
-.\" result-file option: mysqltest
\fB\-\-result\-file=\fR\fB\fIfile_name\fR\fR,
\fB\-R \fR\fB\fIfile_name\fR\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqltest: server-arg option
-.\" server-arg option: mysqltest
\fB\-\-server\-arg=\fR\fB\fIvalue\fR\fR,
\fB\-A \fR\fB\fIvalue\fR\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqltest: server-file option
-.\" server-file option: mysqltest
\fB\-\-server\-file=\fR\fB\fIfile_name\fR\fR,
\fB\-F \fR\fB\fIfile_name\fR\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqltest: server-public-key-path option
-.\" server-public-key-path option: mysqltest
\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
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqltest: silent option
-.\" silent option: mysqltest
\fB\-\-silent\fR,
\fB\-s\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqltest: skip-safemalloc option
-.\" skip-safemalloc option: mysqltest
\fB\-\-skip\-safemalloc\fR
.sp
Do not use memory allocation checking\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqltest: sleep option
-.\" sleep option: mysqltest
\fB\-\-sleep=\fR\fB\fInum\fR\fR,
\fB\-T \fR\fB\fInum\fR\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqltest: socket option
-.\" socket option: mysqltest
\fB\-\-socket=\fR\fB\fIpath\fR\fR,
\fB\-S \fR\fB\fIpath\fR\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqltest: sp-protocol option
-.\" sp-protocol option: mysqltest
\fB\-\-sp\-protocol\fR
.sp
Execute DML statements within a stored procedure\&. For every DML statement,
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqltest: tail-lines option
-.\" tail-lines option: mysqltest
\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\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqltest: test-file option
-.\" test-file option: mysqltest
\fB\-\-test\-file=\fR\fB\fIfile_name\fR\fR,
\fB\-x \fR\fB\fIfile_name\fR\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqltest: timer-file option
-.\" timer-file option: mysqltest
\fB\-\-timer\-file=\fR\fB\fIfile_name\fR\fR,
\fB\-m \fR\fB\fIfile_name\fR\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqltest: tls-version option
-.\" tls-version option: mysqltest
\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 -1
.IP \(bu 2.3
.\}
-.\" mysqltest: tmpdir option
-.\" tmpdir option: mysqltest
\fB\-\-tmpdir=\fR\fB\fIdir_name\fR\fR,
\fB\-t \fR\fB\fIdir_name\fR\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqltest: trace-exec option
-.\" trace-exec option: mysqltest
\fB\-\-trace\-exec\fR
.sp
If enabled, this option causes
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqltest: user option
-.\" user option: mysqltest
\fB\-\-user=\fR\fB\fIuser_name\fR\fR,
\fB\-u \fR\fB\fIuser_name\fR\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqltest: verbose option
-.\" verbose option: mysqltest
\fB\-\-verbose\fR,
\fB\-v\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqltest: version option
-.\" version option: mysqltest
\fB\-\-version\fR,
\fB\-V\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqltest: view-protocol option
-.\" view-protocol option: mysqltest
\fB\-\-view\-protocol\fR
.sp
Every
-.so man/mysqltest.1
+.so mysqltest.1
'\" t
.\" Title: \fBperror\fR
.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author]
-.\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\" Date: 03/02/2016
+.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
+.\" Date: 08/25/2016
.\" Manual: MySQL Database System
.\" Source: MySQL 5.6
.\" Language: English
.\"
-.TH "\FBPERROR\FR" "1" "03/02/2016" "MySQL 5\&.6" "MySQL Database System"
+.TH "\FBPERROR\FR" "1" "08/25/2016" "MySQL 5\&.6" "MySQL Database System"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
-.\" perror
-.\" error messages: displaying
-.\" errno
-.\" Errcode
.SH "NAME"
perror \- explain error codes
.SH "SYNOPSIS"
.sp -1
.IP \(bu 2.3
.\}
-.\" perror: help option
-.\" help option: perror
\fB\-\-help\fR,
\fB\-\-info\fR,
\fB\-I\fR,
.sp -1
.IP \(bu 2.3
.\}
-.\" perror: ndb option
-.\" ndb option: perror
\fB\-\-ndb\fR
.sp
Print the error message for a MySQL Cluster error code\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" perror: silent option
-.\" silent option: perror
\fB\-\-silent\fR,
\fB\-s\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" perror: verbose option
-.\" verbose option: perror
\fB\-\-verbose\fR,
\fB\-v\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" perror: version option
-.\" version option: perror
\fB\-\-version\fR,
\fB\-V\fR
.sp
'\" t
.\" Title: \fBreplace\fR
.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author]
-.\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\" Date: 03/02/2016
+.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
+.\" Date: 08/25/2016
.\" Manual: MySQL Database System
.\" Source: MySQL 5.6
.\" Language: English
.\"
-.TH "\FBREPLACE\FR" "1" "03/02/2016" "MySQL 5\&.6" "MySQL Database System"
+.TH "\FBREPLACE\FR" "1" "08/25/2016" "MySQL 5\&.6" "MySQL Database System"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
-.\" replace utility
-.\" string replacement: replace utility
.SH "NAME"
replace \- a string\-replacement utility
.SH "SYNOPSIS"
'\" t
.\" Title: \fBresolve_stack_dump\fR
.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author]
-.\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\" Date: 03/02/2016
+.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
+.\" Date: 08/25/2016
.\" Manual: MySQL Database System
.\" Source: MySQL 5.6
.\" Language: English
.\"
-.TH "\FBRESOLVE_STACK_DUM" "1" "03/02/2016" "MySQL 5\&.6" "MySQL Database System"
+.TH "\FBRESOLVE_STACK_DUM" "1" "08/25/2016" "MySQL 5\&.6" "MySQL Database System"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
-.\" resolve_stack_dump
.SH "NAME"
resolve_stack_dump \- resolve numeric stack trace dump to symbols
.SH "SYNOPSIS"
.sp -1
.IP \(bu 2.3
.\}
-.\" resolve_stack_dump: help option
-.\" help option: resolve_stack_dump
\fB\-\-help\fR,
\fB\-h\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" resolve_stack_dump: numeric-dump-file option
-.\" numeric-dump-file option: resolve_stack_dump
\fB\-\-numeric\-dump\-file=\fR\fB\fIfile_name\fR\fR,
\fB\-n \fR\fB\fIfile_name\fR\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" resolve_stack_dump: symbols-file option
-.\" symbols-file option: resolve_stack_dump
\fB\-\-symbols\-file=\fR\fB\fIfile_name\fR\fR,
\fB\-s \fR\fB\fIfile_name\fR\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" resolve_stack_dump: version option
-.\" version option: resolve_stack_dump
\fB\-\-version\fR,
\fB\-V\fR
.sp
'\" t
.\" Title: \fBresolveip\fR
.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author]
-.\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\" Date: 03/02/2016
+.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
+.\" Date: 08/25/2016
.\" Manual: MySQL Database System
.\" Source: MySQL 5.6
.\" Language: English
.\"
-.TH "\FBRESOLVEIP\FR" "1" "03/02/2016" "MySQL 5\&.6" "MySQL Database System"
+.TH "\FBRESOLVEIP\FR" "1" "08/25/2016" "MySQL 5\&.6" "MySQL Database System"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
-.\" resolveip
.SH "NAME"
resolveip \- resolve host name to IP address or vice versa
.SH "SYNOPSIS"
.sp -1
.IP \(bu 2.3
.\}
-.\" resolveip: help option
-.\" help option: resolveip
\fB\-\-help\fR,
\fB\-\-info\fR,
\fB\-?\fR,
.sp -1
.IP \(bu 2.3
.\}
-.\" resolveip: silent option
-.\" silent option: resolveip
\fB\-\-silent\fR,
\fB\-s\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" resolveip: version option
-.\" version option: resolveip
\fB\-\-version\fR,
\fB\-V\fR
.sp
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
eval select
(@a:=load_file("$MYSQLTEST_VARDIR/tmp/mix_innodb_myisam_binlog.output"))
- is not null;
+ is not null AS Loaded;
--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR
eval select
@a like "%#%error_code=0%ROLLBACK\\n/*!*/;%ROLLBACK /* added by mysqlbinlog */;%" OR
--- /dev/null
+# Following test first creates two databases (d1 and d2) and setup slave to use
+# two parallel workers. The test case then insert on the slave a tuple that will
+# block writes on d2 and generate gaps.
+
+--let $slave_stop_wait=5
+
+--echo #### I. Initialize ####
+
+--source include/rpl_connection_slave.inc
+--source include/stop_slave.inc
+SET @save.innodb_lock_wait_timeout= @@global.innodb_lock_wait_timeout;
+--eval set @@global.innodb_lock_wait_timeout=$slave_stop_wait + 1000
+
+--source include/start_slave.inc
+
+--source include/rpl_connection_master.inc
+CREATE DATABASE d1;
+CREATE DATABASE d2;
+CREATE TABLE d1.t (a INT PRIMARY KEY, name text) ENGINE=INNODB;
+CREATE TABLE d2.t (a INT PRIMARY KEY, name text) ENGINE=INNODB;
+
+--echo #### II. Prepare test scenario ####
+
+--source include/sync_slave_sql_with_master.inc
+BEGIN;
+INSERT INTO d2.t VALUES (2, 'Slave local'); # Hold T3
+INSERT INTO d1.t VALUES (3, 'Slave local'); # Hold T6
+
+--source include/rpl_connection_master.inc
+INSERT INTO d1.t VALUES (1, 'T1');
+INSERT INTO d2.t VALUES (1, 'T2');
+INSERT INTO d2.t VALUES (2, 'T3'); # This will be a gap when executed on slave
+INSERT INTO d2.t VALUES (3, 'T4'); # This will be a gap when executed on slave
+INSERT INTO d1.t VALUES (2, 'T5');
+
+--source include/rpl_connection_slave1.inc
+--let $table=d1.t
+--let $count=2
+--source include/wait_until_rows_count.inc
+
+--echo # Now d1.t has two rows and d2.t has one row.
+
+# 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
--- /dev/null
+###############################################################################
+# Bug#21507981: REPLICATION POSITION LOST AFTER CRASH ON MTS CONFIGURED SLAVE
+#
+# Problem:
+# ========
+# Enable MTS along with crash-safe replication tables. Make sure that the server
+# is busily inserting data with multiple threads in parallel. Shutdown mysqld
+# uncleanly (kill -9 or power off server without notice).
+#
+# Now users are restarting the server with --relay-log-recovery=1 to recover the
+# crashed slave.
+#
+# This results in following error:
+# ================================
+# 2015-06-24 13:49:03 3895 [ERROR] --relay-log-recovery cannot
+# be executed when the slave was stopped with an error or
+# killed in MTS mode; consider using RESET SLAVE or restart
+# the server with --relay-log-recovery = 0 followed by
+# START SLAVE UNTIL SQL_AFTER_MTS_GAPS.
+#
+# i.e relay-log-recovery will not work in MTS mode.
+###############################################################################
+# Following test demonstrates that when gaps are generated due to MTS crash
+# but not due to an error then recovery should be successful with
+# --relay-log-recovery=1 option.
+#
+# ==== Usage ====
+# --let $skip_slave_start_var= BOOL [ TRUE / FALSE ]
+# --source extra/rpl_tests/rpl_mts_relay_log_recovery.test
+#
+# Parameters:
+#
+# $skip_slave_start_var
+# Boolean that specifies if 'skip_slave_start' server parameter should be
+# TRUE or FALSE.
+#
+# Testing Method:
+# ===============
+# It first creates two databases (d1 and d2) and setup slave to use two parallel
+# workers. The test case then insert on the slave a tuple that will block
+# writes on d2 and generate gaps. Crash the slave server at this point and
+# bring it back with --relay-log-recovery=1 and crash safe tables. Recovery
+# should be successful.
+
+--source extra/rpl_tests/rpl_generate_mts_gap.test
+
+--source include/rpl_connection_slave.inc
+CALL mtr.add_suppression("Recovery from master pos");
+# Kill the slave server
+--exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.2.expect
+let PID_FILE= `SELECT @@pid_file`;
+perl;
+use strict;
+my $file= $ENV{'PID_FILE'} or die "Pid file not set";
+open(FILE, "$file") or die("Unable to open $file: $!\n");
+my $pid=0;
+while (<FILE>) {
+ $pid = $_;
+}
+close(FILE);
+kill 9, $pid;
+EOF
+
+# Restart the slave server
+--let $rpl_server_number= 2
+--let $rpl_server_parameters= --skip_slave_start=$skip_slave_start_var --relay_log_info_repository=TABLE --master_info_repository=TABLE --sync_master_info=1 --relay-log-recovery=1
+--source include/rpl_start_server.inc
+
+--exec echo "After restart gaps should be filled."
+
+--let $assert_text= Table d1.t should contain 2 rows.
+--let $assert_cond= [select count(*) from d1.t] = 2
+--source include/assert.inc
+
+--let $assert_text= Table d2.t should contain 3 rows.
+--let $assert_cond= [select count(*) from d2.t] = 3
+--source include/assert.inc
+
+--source include/start_slave.inc
+
+# Check consistency
+--source include/rpl_connection_master.inc
+--source include/sync_slave_sql_with_master.inc
+--let $diff_tables= master:d1.t, slave:d1.t
+--source include/diff_tables.inc
+
+--let $diff_tables= master:d2.t, slave:d2.t
+--source include/diff_tables.inc
+
+#
+# Cleanup
+#
+--source include/rpl_connection_master.inc
+DROP DATABASE d1;
+DROP DATABASE d2;
}
}
--eval EXPLAIN FORMAT=JSON $query;
-if ($validation) {
---disable_query_log
---replace_result $MASTER_MYSOCK MASTER_MYSOCK
+--disable_result_log
--exec $MYSQL -S $MASTER_MYSOCK -u root -r test -e "EXPLAIN FORMAT=JSON $query;" > $MYSQLTEST_VARDIR/tmp/explain.json
---replace_regex /[-]*// /FILE.[\/\\:_\.0-9A-Za-z]*/Validation:/
---exec python $MYSQL_TEST_DIR/suite/opt_trace/validate_json.py $MYSQLTEST_VARDIR/tmp/explain.json
+--exec perl $MYSQL_TEST_DIR/suite/opt_trace/validate_json.pl $MYSQLTEST_VARDIR/tmp/explain.json
--remove_file '$MYSQLTEST_VARDIR/tmp/explain.json'
---enable_query_log
-}
+--enable_result_log
}
if ($select) {
}
}
--eval EXPLAIN FORMAT=JSON $select;
-if ($validation) {
---disable_query_log
---replace_result $MASTER_MYSOCK MASTER_MYSOCK
+--disable_result_log
--exec $MYSQL -S $MASTER_MYSOCK -u root -r test -e "EXPLAIN FORMAT=JSON $select;" > $MYSQLTEST_VARDIR/tmp/explain.json
---replace_regex /[-]*// /FILE.[\/\\:_\.0-9A-Za-z]*/Validation:/
---exec python $MYSQL_TEST_DIR/suite/opt_trace/validate_json.py $MYSQLTEST_VARDIR/tmp/explain.json
+--exec perl $MYSQL_TEST_DIR/suite/opt_trace/validate_json.pl $MYSQLTEST_VARDIR/tmp/explain.json
--remove_file '$MYSQLTEST_VARDIR/tmp/explain.json'
---enable_query_log
-}
+--enable_result_log
}
}
-let $wait_timeout = 10;
let $wait_condition = SELECT 1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_ready' AND VARIABLE_VALUE = 'ON';
--source include/wait_condition.inc
("WSREP: Failed to prepare for incremental state transfer: Local state seqno is undefined:"),
("WSREP: gcs_caused\\(\\) returned -107 \\(Transport endpoint is not connected\\)"),
("WSREP: gcs_caused\\(\\) returned -1 \\(Operation not permitted\\)"),
- ("WSREP: Action message in non-primary configuration from member 0"),
+ ("Action message in non-primary configuration from member"),
("InnoDB: Resizing redo log from"),
("InnoDB: Starting to delete and rewrite log files"),
("InnoDB: New log files created, LSN="),
-
+-- WSREP: Send action {0x7f86280147f0, 73, STATE_REQUEST} returned -107 (Transport endpoint is not connected)
+ ("Transport endpoint is not connected"),
+-- "WSREP: Protocol violation. JOIN message sender 1.0 (host-91-221-67-96) is not in state transfer (SYNCED). Message ignored.
+ ("is not in state transfer"),
+ ("JOIN message from member .* in non-primary configuration"),
+ ("install timer expired"),
+ ("Last Applied Action message in non-primary configuration from member"),
("THE_LAST_SUPPRESSION")||
innodb_engine plugin/innodb_memcached/innodb_memcache INNODB_ENGINE
validate_password plugin/password_validation VALIDATE_PASSWORD validate_password
mysql_no_login plugin/mysql_no_login MYSQL_NO_LOGIN mysql_no_login
+test_udf_services plugin/udf_services TESTUDFSERVICES
+++ /dev/null
---disable_result_log
-write_file $MYSQLTEST_VARDIR/tmp/explain.json;
-{
- "table":
- {
- "id": 1,
- "select_type": "SIMPLE",
- "table_name": "t1",
- "join_type": "index",
- "key": "i1",
- "key_length": "5",
- "rows": 3,
- "extra":
- [
- "Using index"
- ]
- }
-}
-EOF
---require r/python_with_json.require
---replace_regex /[-]*// /FILE.[\/\\:_\.0-9A-Za-z]*/Validation:/
---exec python $MYSQL_TEST_DIR/suite/opt_trace/validate_json.py $MYSQLTEST_VARDIR/tmp/explain.json
---remove_file '$MYSQLTEST_VARDIR/tmp/explain.json'
---enable_result_log
-
# New tests go here.
--echo # End of 5.6 tests
+
+--echo # Bug#21139722: Assertion failed: !(used_tables() & ((table_map) 1) ...
+
+CREATE TABLE t1(a INTEGER) engine=innodb;
+CREATE TABLE t2(b INTEGER) engine=innodb;
+
+let $query=
+SELECT 1
+FROM (SELECT 1 IN (SELECT 1
+ FROM t1
+ WHERE (SELECT 1 FROM t2 HAVING b) NOT IN (SELECT 1 FROM t2)
+ )
+ FROM t2
+ ) AS z;
+
+eval explain $query;
+eval $query;
+
+DROP TABLE t1, t2;
+
+# A test case containing two outer references from different query blocks
+# Debugging is needed to inspect correct transformation, unfortunately.
+
+CREATE TABLE t1(a INTEGER) engine=innodb;
+
+let $query=
+SELECT (SELECT a
+ FROM t1 AS t2
+ WHERE a IN (SELECT t1.a+t2.a
+ FROM t1 AS t3))
+FROM t1 AS t1;
+
+eval explain $query;
+eval $query;
+
+DROP TABLE t1;
+
+--echo # End of test for Bug#21139722
+
+--echo #
+--echo # Bug#21139402 ASSERTION FAILED: LENGTH > 0 && KEYPARTS != 0, CRASH IN JOIN::OPTIMIZE_KEYUSE
+--echo #
+
+CREATE TABLE t1 (a INT, b INT, PRIMARY KEY(a));
+CREATE TABLE t2 (c INT PRIMARY KEY);
+let $query=
+SELECT 1
+FROM t1
+WHERE 1 IN (SELECT (c IS NULL) IN (SELECT a
+ FROM t1
+ WHERE b)
+ FROM t2);
+eval EXPLAIN $query;
+eval $query;
+DROP TABLE t1,t2;
+
+--echo #
+--echo # Bug #22305361: QUERY WITH MATERIALIZED TABLE RETURNS INCORRECT
+--echo # RESULTS IN 5.6
+--echo #
+
+CREATE TABLE t(a INT,b INT);
+INSERT INTO t VALUES (1,0),(1,0),(1,0),(1,0),(1,1);
+
+let query=
+SELECT *
+FROM t AS t1
+WHERE t1.a IN (SELECT t2.a
+ FROM t AS t2
+ WHERE CONCAT(t2.a,'') NOT IN (SELECT t3.a
+ FROM t AS t3
+ WHERE t3.b=1));
+
+eval EXPLAIN extended $query;
+eval $query;
+
+DROP TABLE t;
let $wait_condition_reps= 0;
while ($wait_counter)
{
- --error 0,ER_NO_SUCH_TABLE,ER_LOCK_WAIT_TIMEOUT,ER_UNKNOWN_COM_ERROR
+ --error 0,ER_NO_SUCH_TABLE,ER_LOCK_WAIT_TIMEOUT,ER_UNKNOWN_COM_ERROR,ER_LOCK_DEADLOCK
let $success= `$wait_condition`;
inc $wait_condition_reps;
if ($success)
# -*- cperl -*-
-# Copyright (c) 2008, 2013, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2008, 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
return undef;
}
+sub _sysctl {
+ my ($self)= @_;
+ my $ncpu= `sysctl hw.ncpu 2> /dev/null`;
+ if ($ncpu eq '') {
+ return undef;
+ }
+
+ my $cpuinfo= {};
+ $ncpu =~ s/\D//g;
+ my $list = `sysctl machdep.cpu | grep machdep\.cpu\.[^.]*: 2> /dev/null`;
+ my @lines= split('\n', $list);
+
+ foreach my $line (@lines) {
+ # Default value, the actual cpu values can be used to decrease this
+ # on slower cpus
+ $cpuinfo->{bogomips}= DEFAULT_BOGO_MIPS;
+
+ my ($statistic, $value)=
+ $line=~ /machdep\.cpu\.(.*):\s+(.*)/;
+ $cpuinfo->{$statistic}= $value;
+ }
+
+ for (1..$ncpu) {
+ my $temp_cpuinfo = $cpuinfo;
+ $temp_cpuinfo->{processor}= $_;
+ push(@{$self->{cpus}}, $temp_cpuinfo);
+ }
+
+ # At least one cpu should have been found
+ # if this method worked
+ if ( $self->{cpus} ) {
+ return $self;
+ }
+}
sub _unamex {
my ($self)= @_;
(
\&_cpuinfo,
\&_kstat,
+ \&_sysctl,
\&_unamex,
);
# Return the number of cpus found
sub num_cpus {
+ if (IS_WINDOWS) {
+ return $ENV{NUMBER_OF_PROCESSORS} || 1;
+ }
my ($self)= @_;
return int(@{$self->{cpus}}) or
confess "INTERNAL ERROR: No cpus in list";
#!/usr/bin/perl
# -*- cperl -*-
-# Copyright (c) 2004, 2015, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2004, 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
for my $limit (2000, 1500, 1000, 500){
$opt_parallel-- if ($sys_info->min_bogomips() < $limit);
}
- my $max_par= $ENV{MTR_MAX_PARALLEL} || 8;
- $opt_parallel= $max_par if ($opt_parallel > $max_par);
- $opt_parallel= $num_tests if ($opt_parallel > $num_tests);
- $opt_parallel= 1 if (IS_WINDOWS and $sys_info->isvm());
+ if(defined $ENV{MTR_MAX_PARALLEL}) {
+ my $max_par= $ENV{MTR_MAX_PARALLEL};
+ $opt_parallel= $max_par if ($opt_parallel > $max_par);
+ }
$opt_parallel= 1 if ($opt_parallel < 1);
- mtr_report("Using parallel: $opt_parallel");
}
+ # Limit parallel workers to number of tests to avoid idle workers
+ $opt_parallel= $num_tests if ($num_tests > 0 and $opt_parallel > $num_tests);
$ENV{MTR_PARALLEL} = $opt_parallel;
+ mtr_report("Using parallel: $opt_parallel");
if ($opt_parallel > 1 && ($opt_start_exit || $opt_stress)) {
mtr_warning("Parallel cannot be used with --start-and-exit or --stress\n" .
if ( lc($opt_build_thread) eq 'auto' ) {
my $found_free = 0;
$build_thread = 300; # Start attempts from here
+
+ my $build_thread_upper = $build_thread + ($opt_parallel > 39
+ ? $opt_parallel + int($opt_parallel / 4)
+ : 49);
while (! $found_free)
{
- $build_thread= mtr_get_unique_id($build_thread, 349);
+ $build_thread= mtr_get_unique_id($build_thread, $build_thread_upper);
if ( !defined $build_thread ) {
mtr_error("Could not get a unique build thread id");
}
$exe= "strace";
mtr_add_arg($args, "-o");
mtr_add_arg($args, "%s/log/mysqltest.strace", $opt_vardir);
+ mtr_add_arg($args, "-f");
mtr_add_arg($args, "$exe_mysqltest");
}
mtr_add_arg($args, "-o");
mtr_add_arg($args, "%s/log/%s.strace", $opt_vardir, $type);
+ mtr_add_arg($args, "-f");
mtr_add_arg($args, $$exe);
$$exe= "strace";
}
2 public data:
DROP TABLE t1;
#
+# Bug#22888420 CONCAT_WS: ASSERTION FAILED: !S.USES_BUFFER_OWNED_BY(THIS)
+#
+do concat('a',concat_ws('a', 0x2859, 'a' ,
+trim(period_add('a',1) from (1&''))
+)
+);
+Warnings:
+Warning 1292 Truncated incorrect INTEGER value: ''
+Warning 1292 Truncated incorrect INTEGER value: 'a'
+#
# End of 5.6 tests
#
UPDATE t1, t2 SET t1.fld1= t1.fld1 + 3;
ERROR 23000: Cannot delete or update a parent row: a foreign key constraint fails (`test`.`t2`, CONSTRAINT `t2_ibfk_1` FOREIGN KEY (`fld2`) REFERENCES `t1` (`fld1`))
DROP TABLE t2, t1;
+#
+# BUG#22037930: INSERT IGNORE FAILS TO IGNORE FOREIGN
+# KEY CONSTRAINT
+CREATE TABLE t1 (fld1 INT PRIMARY KEY) ENGINE= INNODB;
+CREATE TABLE t2 (fld1 VARCHAR(10), fld2 INT NOT NULL,
+CONSTRAINT fk FOREIGN KEY (fld2) REFERENCES t1(fld1)) ENGINE= INNODB;
+# Without patch, reports incorrect error.
+INSERT INTO t2 VALUES('abc', 2) ON DUPLICATE KEY UPDATE fld1= 'def';
+ERROR 23000: Cannot add or update a child row: a foreign key constraint fails (`test`.`t2`, CONSTRAINT `fk` FOREIGN KEY (`fld2`) REFERENCES `t1` (`fld1`))
+REPLACE INTO t2 VALUES('abc', 2);
+ERROR 23000: Cannot add or update a child row: a foreign key constraint fails (`test`.`t2`, CONSTRAINT `fk` FOREIGN KEY (`fld2`) REFERENCES `t1` (`fld1`))
+INSERT IGNORE INTO t2 VALUES('abc', 2) ON DUPLICATE KEY UPDATE fld1= 'def';
+Warnings:
+Warning 1452 `test`.`t2`, CONSTRAINT `fk` FOREIGN KEY (`fld2`) REFERENCES `t1` (`fld1`)
+DROP TABLE t2, t1;
# Bug#11765139 58069: LOAD DATA INFILE: VALGRIND REPORTS INVALID MEMORY READS AND WRITES WITH U
#
CREATE TABLE t1(f1 INT);
-SELECT 0xE1BB30 INTO OUTFILE 't1.dat';
+SELECT 0xE1C330 INTO OUTFILE 't1.dat';
LOAD DATA INFILE 't1.dat' IGNORE INTO TABLE t1 CHARACTER SET utf8;
DROP TABLE t1;
#
Got one of the listed errors
SET @@sql_mode= @old_mode;
DROP TABLE t1;
+
+#
+# Bug#23080148 - Backport of Bug#20683959.
+# Bug#20683959 LOAD DATA INFILE IGNORES A SPECIFIC ROW SILENTLY
+# UNDER DB CHARSET IS UTF8.
+#
+CREATE DATABASE d1 CHARSET latin1;
+USE d1;
+CREATE TABLE t1 (val TEXT);
+LOAD DATA INFILE '../../std_data/bug20683959loaddata.txt' INTO TABLE t1;
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+1
+SELECT HEX(val) FROM t1;
+HEX(val)
+C38322525420406E696F757A656368756E3A20E98198E2889AF58081AEE7B99DE4B88AE383A3E7B99DE69690F58087B3E7B9A7EFBDA8E7B99DEFBDB3E7B99DE78999E880B3E7B8BAEFBDAAE7B9A7E89699E296A1E7B8BAE4BBA3EFBD8CE7B8BAEFBDA9E7B8B2E2889AE38184E7B99DEFBDB3E7B99DE4B88AE383A3E7B99DE69690F58087B3E7B9A7EFBDA8E7B99DEFBDB3E7B99DE5B3A8EFBD84E8ABA0EFBDA8E89C89F580948EE599AAE7B8BAEFBDAAE7B8BAE9A198EFBDA9EFBDB1E7B9A7E581B5E289A0E7B8BAEFBDBEE7B9A7E9A194EFBDA9E882B4EFBDA5EFBDB5E980A7F5808B96E28693E99EABE38287E58F99E7B8BAE58AB1E28691E7B8BAF5808B9AE7828AE98095EFBDB1E7B8BAEFBDAFE7B8B2E288ABE6A89FE89EB3E6BA98F58081ADE88EA0EFBDBAE98095E6BA98F58081AEE89D93EFBDBAE8AD9BEFBDACE980A7F5808B96E28693E7B8BAF580918EE288AAE7B8BAE4B88AEFBC9EE7B8BAE4B99DE28691E7B8BAF5808B96EFBCA0E88DB3E6A68AEFBDB9EFBDB3E981B2E5B3A8E296A1E7B8BAE7A4BCE7828AE88DB3E6A68AEFBDB0EFBDBDE7B8BAA0E7B8BAE88B93EFBDBEE5B899EFBC9E
+CREATE DATABASE d2 CHARSET utf8;
+USE d2;
+CREATE TABLE t1 (val TEXT);
+LOAD DATA INFILE '../../std_data/bug20683959loaddata.txt' INTO TABLE t1;
+ERROR HY000: Invalid utf8 character string: 'Ã"RT @niouzechun: \9058\221A'
+DROP TABLE d1.t1, d2.t1;
+DROP DATABASE d1;
+DROP DATABASE d2;
--- /dev/null
+# Bug#22559575 "the statement (1) has no open cursor" pops sometimes with
+# prepared+query_cache
+#
+# Create relevent tables and call C API test cases
+# Setup
+select VARIABLE_VALUE into @qcache_hit_val1 from
+information_schema.GLOBAL_STATUS where VARIABLE_NAME = 'Qcache_hits';
+
+#Run C_API test case
+select VARIABLE_VALUE into @qcache_hit_val2 from
+information_schema.GLOBAL_STATUS where VARIABLE_NAME = 'Qcache_hits';
+SELECT @qcache_hit_val2 - @qcache_hit_val1;
+@qcache_hit_val2 - @qcache_hit_val1
+1
# Show the help.
#
mysql_plugin Ver V.V.VV Distrib XX.XX.XX
-Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
+Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
Enable or disable plugins.
FLUSH LOGS;
SELECT
(@a:=LOAD_FILE("MYSQLTEST_VARDIR/tmp/mysqlbinlog_bug37313.binlog"))
-IS NOT NULL;
-(@a:=LOAD_FILE("MYSQLTEST_VARDIR/tmp/mysqlbinlog_bug37313.binlog"))
-IS NOT NULL
+IS NOT NULL AS Loaded;
+Loaded
1
*** Unsigned server_id 4294967295 is found: 1 ***
SET @@global.server_id= 1;
wsrep-forced-binlog-format NONE
wsrep-load-data-splitting TRUE
wsrep-log-conflicts FALSE
-wsrep-max-ws-rows 131072
-wsrep-max-ws-size 1073741824
+wsrep-max-ws-rows 0
+wsrep-max-ws-size 2147483647
wsrep-mysql-replication-bundle 0
wsrep-node-address
wsrep-node-incoming-address AUTO
DROP TRIGGER t1_ai;
DROP TABLE t1, t2;
End of 5.0 tests
+#
+# Bug#21142859: FUNCTION UPDATING A VIEW FAILS TO FIND TABLE THAT ACTUALLY EXISTS
+#
+CREATE TABLE t1 SELECT 1 AS fld1, 'A' AS fld2;
+CREATE TABLE t2 (fld3 INT, fld4 CHAR(1));
+CREATE VIEW v1 AS SELECT * FROM t1;
+CREATE TRIGGER t1_au AFTER UPDATE ON t1
+FOR EACH ROW INSERT INTO t2 VALUES (new.fld1, new.fld2);
+CREATE FUNCTION f1() RETURNS INT
+BEGIN
+UPDATE v1 SET fld2='B' WHERE fld1=1;
+RETURN row_count();
+END !
+# Without the patch, an error was getting reported.
+SELECT f1();
+f1()
+1
+DROP FUNCTION f1;
+DROP VIEW v1;
+DROP TABLE t1,t2;
+#
+# Bug #16672723 "CAN'T FIND TEMPORARY TABLE".
+#
+CREATE FUNCTION f1() RETURNS INT RETURN 1;
+CREATE TEMPORARY TABLE tmp1(a INT);
+PREPARE stmt1 FROM "CREATE TEMPORARY TABLE tmp2 AS SELECT b FROM (SELECT f1() AS b FROM tmp1) AS t";
+# The below statement failed before the fix.
+EXECUTE stmt1;
+DROP TEMPORARY TABLES tmp1, tmp2;
+DEALLOCATE PREPARE stmt1;
+DROP FUNCTION f1;
--- /dev/null
+#
+# Bug#21920657: SSL-CA FAILS SILENTLY IF THE PATH CANNOT BE FOUND
+#
+# try to connect with wrong '--ssl-ca' path : should fail
+ERROR 2026 (HY000): SSL connection error: SSL_CTX_set_default_verify_paths failed
+# try to connect with correct '--ssl-ca' path : should connect
+Variable_name Value
+Ssl_cipher DHE-RSA-AES256-SHA
+#
+# Bug#21920678: SSL-CA DOES NOT ACCEPT ~USER TILDE HOME DIRECTORY
+# PATH SUBSTITUTION
+#
+# try to connect with '--ssl-ca' option using tilde home directoy
+# path substitution : should connect
+Variable_name Value
+Ssl_cipher DHE-RSA-AES256-SHA
+# try to connect with '--ssl-key' option using tilde home directoy
+# path substitution : should connect
+Variable_name Value
+Ssl_cipher DHE-RSA-AES256-SHA
+# try to connect with '--ssl-cert' option using tilde home directoy
+# path substitution : should connect
+Variable_name Value
+Ssl_cipher DHE-RSA-AES256-SHA
ssl_crlpath
ssl_key MYSQL_TEST_DIR/std_data/crl-server-key.pem
# try logging in with a certificate in the server's --ssl-crl : should fail
+#
+# Bug#21920678: SSL-CA DOES NOT ACCEPT ~USER TILDE HOME DIRECTORY
+# PATH SUBSTITUTION
+#
+# try to connect with '--ssl-crl' option using tilde home directoy
+# path substitution : should connect
+Variable_name Value
+Ssl_cipher DHE-RSA-AES256-SHA
+# try to connect with '--ssl-crlpath' option using tilde home directoy
+# path substitution : should connect
+Variable_name Value
+Ssl_cipher DHE-RSA-AES256-SHA
# End of test for Bug#21184091
set @@optimizer_switch=@old_opt_switch;
# End of 5.6 tests
+# Bug#21139722: Assertion failed: !(used_tables() & ((table_map) 1) ...
+CREATE TABLE t1(a INTEGER) engine=innodb;
+CREATE TABLE t2(b INTEGER) engine=innodb;
+explain SELECT 1
+FROM (SELECT 1 IN (SELECT 1
+FROM t1
+WHERE (SELECT 1 FROM t2 HAVING b) NOT IN (SELECT 1 FROM t2)
+)
+FROM t2
+) AS z;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY <derived2> ALL NULL NULL NULL NULL 2 NULL
+2 DERIVED t2 ALL NULL NULL NULL NULL 1 NULL
+3 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL 1 Using where
+5 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 1 Using where
+4 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 1 NULL
+SELECT 1
+FROM (SELECT 1 IN (SELECT 1
+FROM t1
+WHERE (SELECT 1 FROM t2 HAVING b) NOT IN (SELECT 1 FROM t2)
+)
+FROM t2
+) AS z;
+1
+DROP TABLE t1, t2;
+CREATE TABLE t1(a INTEGER) engine=innodb;
+explain SELECT (SELECT a
+FROM t1 AS t2
+WHERE a IN (SELECT t1.a+t2.a
+FROM t1 AS t3))
+FROM t1 AS t1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 1 NULL
+2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 1 Using where
+2 DEPENDENT SUBQUERY t3 ALL NULL NULL NULL NULL 1 FirstMatch(t2); Using join buffer (Block Nested Loop)
+SELECT (SELECT a
+FROM t1 AS t2
+WHERE a IN (SELECT t1.a+t2.a
+FROM t1 AS t3))
+FROM t1 AS t1;
+(SELECT a
+FROM t1 AS t2
+WHERE a IN (SELECT t1.a+t2.a
+FROM t1 AS t3))
+DROP TABLE t1;
+# End of test for Bug#21139722
+#
+# Bug#21139402 ASSERTION FAILED: LENGTH > 0 && KEYPARTS != 0, CRASH IN JOIN::OPTIMIZE_KEYUSE
+#
+CREATE TABLE t1 (a INT, b INT, PRIMARY KEY(a));
+CREATE TABLE t2 (c INT PRIMARY KEY);
+EXPLAIN SELECT 1
+FROM t1
+WHERE 1 IN (SELECT (c IS NULL) IN (SELECT a
+FROM t1
+WHERE b)
+FROM t2);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
+3 DEPENDENT SUBQUERY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
+SELECT 1
+FROM t1
+WHERE 1 IN (SELECT (c IS NULL) IN (SELECT a
+FROM t1
+WHERE b)
+FROM t2);
+1
+DROP TABLE t1,t2;
+#
+# Bug #22305361: QUERY WITH MATERIALIZED TABLE RETURNS INCORRECT
+# RESULTS IN 5.6
+#
+CREATE TABLE t(a INT,b INT);
+INSERT INTO t VALUES (1,0),(1,0),(1,0),(1,0),(1,1);
+EXPLAIN extended SELECT *
+FROM t AS t1
+WHERE t1.a IN (SELECT t2.a
+FROM t AS t2
+WHERE CONCAT(t2.a,'') NOT IN (SELECT t3.a
+FROM t AS t3
+WHERE t3.b=1));
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 5 100.00 Using where
+1 PRIMARY <subquery2> eq_ref <auto_key> <auto_key> 5 test.t1.a 1 100.00 NULL
+2 MATERIALIZED t2 ALL NULL NULL NULL NULL 5 100.00 Using where
+3 DEPENDENT SUBQUERY t3 ALL NULL NULL NULL NULL 5 100.00 Using where
+Warnings:
+Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t` `t1` semi join (`test`.`t` `t2`) where ((`<subquery2>`.`a` = `test`.`t1`.`a`) and (not(<in_optimizer>(concat(`test`.`t2`.`a`,''),<exists>(/* select#3 */ select 1 from `test`.`t` `t3` where ((`test`.`t3`.`b` = 1) and <if>(outer_field_is_not_null, ((<cache>(concat(`test`.`t2`.`a`,'')) = `test`.`t3`.`a`) or isnull(`test`.`t3`.`a`)), true)) having <if>(outer_field_is_not_null, <is_not_null_test>(`test`.`t3`.`a`), true))))))
+SELECT *
+FROM t AS t1
+WHERE t1.a IN (SELECT t2.a
+FROM t AS t2
+WHERE CONCAT(t2.a,'') NOT IN (SELECT t3.a
+FROM t AS t3
+WHERE t3.b=1));
+a b
+DROP TABLE t;
set optimizer_switch=default;
# End of test for Bug#21184091
set @@optimizer_switch=@old_opt_switch;
# End of 5.6 tests
+# Bug#21139722: Assertion failed: !(used_tables() & ((table_map) 1) ...
+CREATE TABLE t1(a INTEGER) engine=innodb;
+CREATE TABLE t2(b INTEGER) engine=innodb;
+explain SELECT 1
+FROM (SELECT 1 IN (SELECT 1
+FROM t1
+WHERE (SELECT 1 FROM t2 HAVING b) NOT IN (SELECT 1 FROM t2)
+)
+FROM t2
+) AS z;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY <derived2> ALL NULL NULL NULL NULL 2 NULL
+2 DERIVED t2 ALL NULL NULL NULL NULL 1 NULL
+3 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL 1 Using where
+5 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 1 Using where
+4 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 1 NULL
+SELECT 1
+FROM (SELECT 1 IN (SELECT 1
+FROM t1
+WHERE (SELECT 1 FROM t2 HAVING b) NOT IN (SELECT 1 FROM t2)
+)
+FROM t2
+) AS z;
+1
+DROP TABLE t1, t2;
+CREATE TABLE t1(a INTEGER) engine=innodb;
+explain SELECT (SELECT a
+FROM t1 AS t2
+WHERE a IN (SELECT t1.a+t2.a
+FROM t1 AS t3))
+FROM t1 AS t1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 1 NULL
+2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 1 Using where
+2 DEPENDENT SUBQUERY t3 ALL NULL NULL NULL NULL 1 FirstMatch(t2); Using join buffer (Block Nested Loop)
+SELECT (SELECT a
+FROM t1 AS t2
+WHERE a IN (SELECT t1.a+t2.a
+FROM t1 AS t3))
+FROM t1 AS t1;
+(SELECT a
+FROM t1 AS t2
+WHERE a IN (SELECT t1.a+t2.a
+FROM t1 AS t3))
+DROP TABLE t1;
+# End of test for Bug#21139722
+#
+# Bug#21139402 ASSERTION FAILED: LENGTH > 0 && KEYPARTS != 0, CRASH IN JOIN::OPTIMIZE_KEYUSE
+#
+CREATE TABLE t1 (a INT, b INT, PRIMARY KEY(a));
+CREATE TABLE t2 (c INT PRIMARY KEY);
+EXPLAIN SELECT 1
+FROM t1
+WHERE 1 IN (SELECT (c IS NULL) IN (SELECT a
+FROM t1
+WHERE b)
+FROM t2);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
+3 DEPENDENT SUBQUERY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
+SELECT 1
+FROM t1
+WHERE 1 IN (SELECT (c IS NULL) IN (SELECT a
+FROM t1
+WHERE b)
+FROM t2);
+1
+DROP TABLE t1,t2;
+#
+# Bug #22305361: QUERY WITH MATERIALIZED TABLE RETURNS INCORRECT
+# RESULTS IN 5.6
+#
+CREATE TABLE t(a INT,b INT);
+INSERT INTO t VALUES (1,0),(1,0),(1,0),(1,0),(1,1);
+EXPLAIN extended SELECT *
+FROM t AS t1
+WHERE t1.a IN (SELECT t2.a
+FROM t AS t2
+WHERE CONCAT(t2.a,'') NOT IN (SELECT t3.a
+FROM t AS t3
+WHERE t3.b=1));
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 5 100.00 Using where
+1 PRIMARY <subquery2> eq_ref <auto_key> <auto_key> 5 test.t1.a 1 100.00 NULL
+2 MATERIALIZED t2 ALL NULL NULL NULL NULL 5 100.00 Using where
+3 DEPENDENT SUBQUERY t3 ALL NULL NULL NULL NULL 5 100.00 Using where
+Warnings:
+Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t` `t1` semi join (`test`.`t` `t2`) where ((`<subquery2>`.`a` = `test`.`t1`.`a`) and (not(<in_optimizer>(concat(`test`.`t2`.`a`,''),<exists>(/* select#3 */ select 1 from `test`.`t` `t3` where ((`test`.`t3`.`b` = 1) and <if>(outer_field_is_not_null, ((<cache>(concat(`test`.`t2`.`a`,'')) = `test`.`t3`.`a`) or isnull(`test`.`t3`.`a`)), true)) having <if>(outer_field_is_not_null, <is_not_null_test>(`test`.`t3`.`a`), true))))))
+SELECT *
+FROM t AS t1
+WHERE t1.a IN (SELECT t2.a
+FROM t AS t2
+WHERE CONCAT(t2.a,'') NOT IN (SELECT t3.a
+FROM t AS t3
+WHERE t3.b=1));
+a b
+DROP TABLE t;
set optimizer_switch=default;
set optimizer_switch=default;
# End of test for Bug#21184091
set @@optimizer_switch=@old_opt_switch;
# End of 5.6 tests
+# Bug#21139722: Assertion failed: !(used_tables() & ((table_map) 1) ...
+CREATE TABLE t1(a INTEGER) engine=innodb;
+CREATE TABLE t2(b INTEGER) engine=innodb;
+explain SELECT 1
+FROM (SELECT 1 IN (SELECT 1
+FROM t1
+WHERE (SELECT 1 FROM t2 HAVING b) NOT IN (SELECT 1 FROM t2)
+)
+FROM t2
+) AS z;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY <derived2> ALL NULL NULL NULL NULL 2 NULL
+2 DERIVED t2 ALL NULL NULL NULL NULL 1 NULL
+3 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL 1 Using where
+5 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 1 Using where
+4 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 1 NULL
+SELECT 1
+FROM (SELECT 1 IN (SELECT 1
+FROM t1
+WHERE (SELECT 1 FROM t2 HAVING b) NOT IN (SELECT 1 FROM t2)
+)
+FROM t2
+) AS z;
+1
+DROP TABLE t1, t2;
+CREATE TABLE t1(a INTEGER) engine=innodb;
+explain SELECT (SELECT a
+FROM t1 AS t2
+WHERE a IN (SELECT t1.a+t2.a
+FROM t1 AS t3))
+FROM t1 AS t1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 1 NULL
+2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 1 Using where
+2 DEPENDENT SUBQUERY t3 ALL NULL NULL NULL NULL 1 FirstMatch(t2)
+SELECT (SELECT a
+FROM t1 AS t2
+WHERE a IN (SELECT t1.a+t2.a
+FROM t1 AS t3))
+FROM t1 AS t1;
+(SELECT a
+FROM t1 AS t2
+WHERE a IN (SELECT t1.a+t2.a
+FROM t1 AS t3))
+DROP TABLE t1;
+# End of test for Bug#21139722
+#
+# Bug#21139402 ASSERTION FAILED: LENGTH > 0 && KEYPARTS != 0, CRASH IN JOIN::OPTIMIZE_KEYUSE
+#
+CREATE TABLE t1 (a INT, b INT, PRIMARY KEY(a));
+CREATE TABLE t2 (c INT PRIMARY KEY);
+EXPLAIN SELECT 1
+FROM t1
+WHERE 1 IN (SELECT (c IS NULL) IN (SELECT a
+FROM t1
+WHERE b)
+FROM t2);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
+3 DEPENDENT SUBQUERY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
+SELECT 1
+FROM t1
+WHERE 1 IN (SELECT (c IS NULL) IN (SELECT a
+FROM t1
+WHERE b)
+FROM t2);
+1
+DROP TABLE t1,t2;
+#
+# Bug #22305361: QUERY WITH MATERIALIZED TABLE RETURNS INCORRECT
+# RESULTS IN 5.6
+#
+CREATE TABLE t(a INT,b INT);
+INSERT INTO t VALUES (1,0),(1,0),(1,0),(1,0),(1,1);
+EXPLAIN extended SELECT *
+FROM t AS t1
+WHERE t1.a IN (SELECT t2.a
+FROM t AS t2
+WHERE CONCAT(t2.a,'') NOT IN (SELECT t3.a
+FROM t AS t3
+WHERE t3.b=1));
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 5 100.00 Using where
+1 PRIMARY <subquery2> eq_ref <auto_key> <auto_key> 5 test.t1.a 1 100.00 NULL
+2 MATERIALIZED t2 ALL NULL NULL NULL NULL 5 100.00 Using where
+3 DEPENDENT SUBQUERY t3 ALL NULL NULL NULL NULL 5 100.00 Using where
+Warnings:
+Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t` `t1` semi join (`test`.`t` `t2`) where ((`<subquery2>`.`a` = `test`.`t1`.`a`) and (not(<in_optimizer>(concat(`test`.`t2`.`a`,''),<exists>(/* select#3 */ select 1 from `test`.`t` `t3` where ((`test`.`t3`.`b` = 1) and <if>(outer_field_is_not_null, ((<cache>(concat(`test`.`t2`.`a`,'')) = `test`.`t3`.`a`) or isnull(`test`.`t3`.`a`)), true)) having <if>(outer_field_is_not_null, <is_not_null_test>(`test`.`t3`.`a`), true))))))
+SELECT *
+FROM t AS t1
+WHERE t1.a IN (SELECT t2.a
+FROM t AS t2
+WHERE CONCAT(t2.a,'') NOT IN (SELECT t3.a
+FROM t AS t3
+WHERE t3.b=1));
+a b
+DROP TABLE t;
set optimizer_switch=default;
set optimizer_switch=default;
# End of test for Bug#21184091
set @@optimizer_switch=@old_opt_switch;
# End of 5.6 tests
+# Bug#21139722: Assertion failed: !(used_tables() & ((table_map) 1) ...
+CREATE TABLE t1(a INTEGER) engine=innodb;
+CREATE TABLE t2(b INTEGER) engine=innodb;
+explain SELECT 1
+FROM (SELECT 1 IN (SELECT 1
+FROM t1
+WHERE (SELECT 1 FROM t2 HAVING b) NOT IN (SELECT 1 FROM t2)
+)
+FROM t2
+) AS z;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY <derived2> ALL NULL NULL NULL NULL 2 NULL
+2 DERIVED t2 ALL NULL NULL NULL NULL 1 NULL
+3 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL 1 Using where
+5 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 1 Using where
+4 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 1 NULL
+SELECT 1
+FROM (SELECT 1 IN (SELECT 1
+FROM t1
+WHERE (SELECT 1 FROM t2 HAVING b) NOT IN (SELECT 1 FROM t2)
+)
+FROM t2
+) AS z;
+1
+DROP TABLE t1, t2;
+CREATE TABLE t1(a INTEGER) engine=innodb;
+explain SELECT (SELECT a
+FROM t1 AS t2
+WHERE a IN (SELECT t1.a+t2.a
+FROM t1 AS t3))
+FROM t1 AS t1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 1 NULL
+2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 1 Using where
+2 DEPENDENT SUBQUERY t3 ALL NULL NULL NULL NULL 1 FirstMatch(t2); Using join buffer (Block Nested Loop)
+SELECT (SELECT a
+FROM t1 AS t2
+WHERE a IN (SELECT t1.a+t2.a
+FROM t1 AS t3))
+FROM t1 AS t1;
+(SELECT a
+FROM t1 AS t2
+WHERE a IN (SELECT t1.a+t2.a
+FROM t1 AS t3))
+DROP TABLE t1;
+# End of test for Bug#21139722
+#
+# Bug#21139402 ASSERTION FAILED: LENGTH > 0 && KEYPARTS != 0, CRASH IN JOIN::OPTIMIZE_KEYUSE
+#
+CREATE TABLE t1 (a INT, b INT, PRIMARY KEY(a));
+CREATE TABLE t2 (c INT PRIMARY KEY);
+EXPLAIN SELECT 1
+FROM t1
+WHERE 1 IN (SELECT (c IS NULL) IN (SELECT a
+FROM t1
+WHERE b)
+FROM t2);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
+3 DEPENDENT SUBQUERY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
+SELECT 1
+FROM t1
+WHERE 1 IN (SELECT (c IS NULL) IN (SELECT a
+FROM t1
+WHERE b)
+FROM t2);
+1
+DROP TABLE t1,t2;
+#
+# Bug #22305361: QUERY WITH MATERIALIZED TABLE RETURNS INCORRECT
+# RESULTS IN 5.6
+#
+CREATE TABLE t(a INT,b INT);
+INSERT INTO t VALUES (1,0),(1,0),(1,0),(1,0),(1,1);
+EXPLAIN extended SELECT *
+FROM t AS t1
+WHERE t1.a IN (SELECT t2.a
+FROM t AS t2
+WHERE CONCAT(t2.a,'') NOT IN (SELECT t3.a
+FROM t AS t3
+WHERE t3.b=1));
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 5 100.00 Using where
+1 PRIMARY <subquery2> eq_ref <auto_key> <auto_key> 5 test.t1.a 1 100.00 NULL
+2 MATERIALIZED t2 ALL NULL NULL NULL NULL 5 100.00 Using where
+3 DEPENDENT SUBQUERY t3 ALL NULL NULL NULL NULL 5 100.00 Using where
+Warnings:
+Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t` `t1` semi join (`test`.`t` `t2`) where ((`<subquery2>`.`a` = `test`.`t1`.`a`) and (not(<in_optimizer>(concat(`test`.`t2`.`a`,''),<exists>(/* select#3 */ select 1 from `test`.`t` `t3` where ((`test`.`t3`.`b` = 1) and <if>(outer_field_is_not_null, ((<cache>(concat(`test`.`t2`.`a`,'')) = `test`.`t3`.`a`) or isnull(`test`.`t3`.`a`)), true)) having <if>(outer_field_is_not_null, <is_not_null_test>(`test`.`t3`.`a`), true))))))
+SELECT *
+FROM t AS t1
+WHERE t1.a IN (SELECT t2.a
+FROM t AS t2
+WHERE CONCAT(t2.a,'') NOT IN (SELECT t3.a
+FROM t AS t3
+WHERE t3.b=1));
+a b
+DROP TABLE t;
set optimizer_switch=default;
set optimizer_switch=default;
# End of test for Bug#21184091
set @@optimizer_switch=@old_opt_switch;
# End of 5.6 tests
+# Bug#21139722: Assertion failed: !(used_tables() & ((table_map) 1) ...
+CREATE TABLE t1(a INTEGER) engine=innodb;
+CREATE TABLE t2(b INTEGER) engine=innodb;
+explain SELECT 1
+FROM (SELECT 1 IN (SELECT 1
+FROM t1
+WHERE (SELECT 1 FROM t2 HAVING b) NOT IN (SELECT 1 FROM t2)
+)
+FROM t2
+) AS z;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY <derived2> ALL NULL NULL NULL NULL 2 NULL
+2 DERIVED t2 ALL NULL NULL NULL NULL 1 NULL
+3 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL 1 Using where
+5 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 1 Using where
+4 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 1 NULL
+SELECT 1
+FROM (SELECT 1 IN (SELECT 1
+FROM t1
+WHERE (SELECT 1 FROM t2 HAVING b) NOT IN (SELECT 1 FROM t2)
+)
+FROM t2
+) AS z;
+1
+DROP TABLE t1, t2;
+CREATE TABLE t1(a INTEGER) engine=innodb;
+explain SELECT (SELECT a
+FROM t1 AS t2
+WHERE a IN (SELECT t1.a+t2.a
+FROM t1 AS t3))
+FROM t1 AS t1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 1 NULL
+2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 1 Using where; Start temporary
+2 DEPENDENT SUBQUERY t3 ALL NULL NULL NULL NULL 1 End temporary; Using join buffer (Block Nested Loop)
+SELECT (SELECT a
+FROM t1 AS t2
+WHERE a IN (SELECT t1.a+t2.a
+FROM t1 AS t3))
+FROM t1 AS t1;
+(SELECT a
+FROM t1 AS t2
+WHERE a IN (SELECT t1.a+t2.a
+FROM t1 AS t3))
+DROP TABLE t1;
+# End of test for Bug#21139722
+#
+# Bug#21139402 ASSERTION FAILED: LENGTH > 0 && KEYPARTS != 0, CRASH IN JOIN::OPTIMIZE_KEYUSE
+#
+CREATE TABLE t1 (a INT, b INT, PRIMARY KEY(a));
+CREATE TABLE t2 (c INT PRIMARY KEY);
+EXPLAIN SELECT 1
+FROM t1
+WHERE 1 IN (SELECT (c IS NULL) IN (SELECT a
+FROM t1
+WHERE b)
+FROM t2);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
+3 DEPENDENT SUBQUERY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
+SELECT 1
+FROM t1
+WHERE 1 IN (SELECT (c IS NULL) IN (SELECT a
+FROM t1
+WHERE b)
+FROM t2);
+1
+DROP TABLE t1,t2;
+#
+# Bug #22305361: QUERY WITH MATERIALIZED TABLE RETURNS INCORRECT
+# RESULTS IN 5.6
+#
+CREATE TABLE t(a INT,b INT);
+INSERT INTO t VALUES (1,0),(1,0),(1,0),(1,0),(1,1);
+EXPLAIN extended SELECT *
+FROM t AS t1
+WHERE t1.a IN (SELECT t2.a
+FROM t AS t2
+WHERE CONCAT(t2.a,'') NOT IN (SELECT t3.a
+FROM t AS t3
+WHERE t3.b=1));
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 5 100.00 Start temporary
+1 PRIMARY t2 ALL NULL NULL NULL NULL 5 100.00 Using where; End temporary; Using join buffer (Block Nested Loop)
+3 DEPENDENT SUBQUERY t3 ALL NULL NULL NULL NULL 5 100.00 Using where
+Warnings:
+Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t` `t1` semi join (`test`.`t` `t2`) where ((`test`.`t2`.`a` = `test`.`t1`.`a`) and (not(<in_optimizer>(concat(`test`.`t1`.`a`,''),<exists>(/* select#3 */ select 1 from `test`.`t` `t3` where ((`test`.`t3`.`b` = 1) and <if>(outer_field_is_not_null, ((<cache>(concat(`test`.`t1`.`a`,'')) = `test`.`t3`.`a`) or isnull(`test`.`t3`.`a`)), true)) having <if>(outer_field_is_not_null, <is_not_null_test>(`test`.`t3`.`a`), true))))))
+SELECT *
+FROM t AS t1
+WHERE t1.a IN (SELECT t2.a
+FROM t AS t2
+WHERE CONCAT(t2.a,'') NOT IN (SELECT t3.a
+FROM t AS t3
+WHERE t3.b=1));
+a b
+DROP TABLE t;
set optimizer_switch=default;
# End of test for Bug#21184091
set @@optimizer_switch=@old_opt_switch;
# End of 5.6 tests
+# Bug#21139722: Assertion failed: !(used_tables() & ((table_map) 1) ...
+CREATE TABLE t1(a INTEGER) engine=innodb;
+CREATE TABLE t2(b INTEGER) engine=innodb;
+explain SELECT 1
+FROM (SELECT 1 IN (SELECT 1
+FROM t1
+WHERE (SELECT 1 FROM t2 HAVING b) NOT IN (SELECT 1 FROM t2)
+)
+FROM t2
+) AS z;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY <derived2> ALL NULL NULL NULL NULL 2 NULL
+2 DERIVED t2 ALL NULL NULL NULL NULL 1 NULL
+3 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL 1 Using where
+5 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 1 Using where
+4 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 1 NULL
+SELECT 1
+FROM (SELECT 1 IN (SELECT 1
+FROM t1
+WHERE (SELECT 1 FROM t2 HAVING b) NOT IN (SELECT 1 FROM t2)
+)
+FROM t2
+) AS z;
+1
+DROP TABLE t1, t2;
+CREATE TABLE t1(a INTEGER) engine=innodb;
+explain SELECT (SELECT a
+FROM t1 AS t2
+WHERE a IN (SELECT t1.a+t2.a
+FROM t1 AS t3))
+FROM t1 AS t1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 1 NULL
+2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 1 Using where; Start temporary
+2 DEPENDENT SUBQUERY t3 ALL NULL NULL NULL NULL 1 End temporary; Using join buffer (Block Nested Loop)
+SELECT (SELECT a
+FROM t1 AS t2
+WHERE a IN (SELECT t1.a+t2.a
+FROM t1 AS t3))
+FROM t1 AS t1;
+(SELECT a
+FROM t1 AS t2
+WHERE a IN (SELECT t1.a+t2.a
+FROM t1 AS t3))
+DROP TABLE t1;
+# End of test for Bug#21139722
+#
+# Bug#21139402 ASSERTION FAILED: LENGTH > 0 && KEYPARTS != 0, CRASH IN JOIN::OPTIMIZE_KEYUSE
+#
+CREATE TABLE t1 (a INT, b INT, PRIMARY KEY(a));
+CREATE TABLE t2 (c INT PRIMARY KEY);
+EXPLAIN SELECT 1
+FROM t1
+WHERE 1 IN (SELECT (c IS NULL) IN (SELECT a
+FROM t1
+WHERE b)
+FROM t2);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
+3 DEPENDENT SUBQUERY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
+SELECT 1
+FROM t1
+WHERE 1 IN (SELECT (c IS NULL) IN (SELECT a
+FROM t1
+WHERE b)
+FROM t2);
+1
+DROP TABLE t1,t2;
+#
+# Bug #22305361: QUERY WITH MATERIALIZED TABLE RETURNS INCORRECT
+# RESULTS IN 5.6
+#
+CREATE TABLE t(a INT,b INT);
+INSERT INTO t VALUES (1,0),(1,0),(1,0),(1,0),(1,1);
+EXPLAIN extended SELECT *
+FROM t AS t1
+WHERE t1.a IN (SELECT t2.a
+FROM t AS t2
+WHERE CONCAT(t2.a,'') NOT IN (SELECT t3.a
+FROM t AS t3
+WHERE t3.b=1));
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 5 100.00 Start temporary
+1 PRIMARY t2 ALL NULL NULL NULL NULL 5 100.00 Using where; End temporary; Using join buffer (Block Nested Loop)
+3 DEPENDENT SUBQUERY t3 ALL NULL NULL NULL NULL 5 100.00 Using where
+Warnings:
+Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t` `t1` semi join (`test`.`t` `t2`) where ((`test`.`t2`.`a` = `test`.`t1`.`a`) and (not(<in_optimizer>(concat(`test`.`t1`.`a`,''),<exists>(/* select#3 */ select 1 from `test`.`t` `t3` where ((`test`.`t3`.`b` = 1) and <if>(outer_field_is_not_null, ((<cache>(concat(`test`.`t1`.`a`,'')) = `test`.`t3`.`a`) or isnull(`test`.`t3`.`a`)), true)) having <if>(outer_field_is_not_null, <is_not_null_test>(`test`.`t3`.`a`), true))))))
+SELECT *
+FROM t AS t1
+WHERE t1.a IN (SELECT t2.a
+FROM t AS t2
+WHERE CONCAT(t2.a,'') NOT IN (SELECT t3.a
+FROM t AS t3
+WHERE t3.b=1));
+a b
+DROP TABLE t;
set optimizer_switch=default;
set optimizer_switch=default;
# End of test for Bug#21184091
set @@optimizer_switch=@old_opt_switch;
# End of 5.6 tests
+# Bug#21139722: Assertion failed: !(used_tables() & ((table_map) 1) ...
+CREATE TABLE t1(a INTEGER) engine=innodb;
+CREATE TABLE t2(b INTEGER) engine=innodb;
+explain SELECT 1
+FROM (SELECT 1 IN (SELECT 1
+FROM t1
+WHERE (SELECT 1 FROM t2 HAVING b) NOT IN (SELECT 1 FROM t2)
+)
+FROM t2
+) AS z;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY <derived2> ALL NULL NULL NULL NULL 2 NULL
+2 DERIVED t2 ALL NULL NULL NULL NULL 1 NULL
+3 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL 1 Using where
+5 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 1 Using where
+4 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 1 NULL
+SELECT 1
+FROM (SELECT 1 IN (SELECT 1
+FROM t1
+WHERE (SELECT 1 FROM t2 HAVING b) NOT IN (SELECT 1 FROM t2)
+)
+FROM t2
+) AS z;
+1
+DROP TABLE t1, t2;
+CREATE TABLE t1(a INTEGER) engine=innodb;
+explain SELECT (SELECT a
+FROM t1 AS t2
+WHERE a IN (SELECT t1.a+t2.a
+FROM t1 AS t3))
+FROM t1 AS t1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 1 NULL
+2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 1 Using where
+2 DEPENDENT SUBQUERY t3 ALL NULL NULL NULL NULL 1 Start temporary; End temporary
+SELECT (SELECT a
+FROM t1 AS t2
+WHERE a IN (SELECT t1.a+t2.a
+FROM t1 AS t3))
+FROM t1 AS t1;
+(SELECT a
+FROM t1 AS t2
+WHERE a IN (SELECT t1.a+t2.a
+FROM t1 AS t3))
+DROP TABLE t1;
+# End of test for Bug#21139722
+#
+# Bug#21139402 ASSERTION FAILED: LENGTH > 0 && KEYPARTS != 0, CRASH IN JOIN::OPTIMIZE_KEYUSE
+#
+CREATE TABLE t1 (a INT, b INT, PRIMARY KEY(a));
+CREATE TABLE t2 (c INT PRIMARY KEY);
+EXPLAIN SELECT 1
+FROM t1
+WHERE 1 IN (SELECT (c IS NULL) IN (SELECT a
+FROM t1
+WHERE b)
+FROM t2);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
+3 DEPENDENT SUBQUERY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
+SELECT 1
+FROM t1
+WHERE 1 IN (SELECT (c IS NULL) IN (SELECT a
+FROM t1
+WHERE b)
+FROM t2);
+1
+DROP TABLE t1,t2;
+#
+# Bug #22305361: QUERY WITH MATERIALIZED TABLE RETURNS INCORRECT
+# RESULTS IN 5.6
+#
+CREATE TABLE t(a INT,b INT);
+INSERT INTO t VALUES (1,0),(1,0),(1,0),(1,0),(1,1);
+EXPLAIN extended SELECT *
+FROM t AS t1
+WHERE t1.a IN (SELECT t2.a
+FROM t AS t2
+WHERE CONCAT(t2.a,'') NOT IN (SELECT t3.a
+FROM t AS t3
+WHERE t3.b=1));
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 5 100.00 NULL
+1 PRIMARY t2 ALL NULL NULL NULL NULL 5 100.00 Using where; Start temporary; End temporary
+3 DEPENDENT SUBQUERY t3 ALL NULL NULL NULL NULL 5 100.00 Using where
+Warnings:
+Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t` `t1` semi join (`test`.`t` `t2`) where ((`test`.`t2`.`a` = `test`.`t1`.`a`) and (not(<in_optimizer>(concat(`test`.`t1`.`a`,''),<exists>(/* select#3 */ select 1 from `test`.`t` `t3` where ((`test`.`t3`.`b` = 1) and <if>(outer_field_is_not_null, ((<cache>(concat(`test`.`t1`.`a`,'')) = `test`.`t3`.`a`) or isnull(`test`.`t3`.`a`)), true)) having <if>(outer_field_is_not_null, <is_not_null_test>(`test`.`t3`.`a`), true))))))
+SELECT *
+FROM t AS t1
+WHERE t1.a IN (SELECT t2.a
+FROM t AS t2
+WHERE CONCAT(t2.a,'') NOT IN (SELECT t3.a
+FROM t AS t3
+WHERE t3.b=1));
+a b
+DROP TABLE t;
set optimizer_switch=default;
set optimizer_switch=default;
# End of test for Bug#21184091
set @@optimizer_switch=@old_opt_switch;
# End of 5.6 tests
+# Bug#21139722: Assertion failed: !(used_tables() & ((table_map) 1) ...
+CREATE TABLE t1(a INTEGER) engine=innodb;
+CREATE TABLE t2(b INTEGER) engine=innodb;
+explain SELECT 1
+FROM (SELECT 1 IN (SELECT 1
+FROM t1
+WHERE (SELECT 1 FROM t2 HAVING b) NOT IN (SELECT 1 FROM t2)
+)
+FROM t2
+) AS z;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY <derived2> ALL NULL NULL NULL NULL 2 NULL
+2 DERIVED t2 ALL NULL NULL NULL NULL 1 NULL
+3 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL 1 Using where
+5 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 1 Using where
+4 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 1 NULL
+SELECT 1
+FROM (SELECT 1 IN (SELECT 1
+FROM t1
+WHERE (SELECT 1 FROM t2 HAVING b) NOT IN (SELECT 1 FROM t2)
+)
+FROM t2
+) AS z;
+1
+DROP TABLE t1, t2;
+CREATE TABLE t1(a INTEGER) engine=innodb;
+explain SELECT (SELECT a
+FROM t1 AS t2
+WHERE a IN (SELECT t1.a+t2.a
+FROM t1 AS t3))
+FROM t1 AS t1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 1 NULL
+2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 1 Using where; Start temporary
+2 DEPENDENT SUBQUERY t3 ALL NULL NULL NULL NULL 1 End temporary; Using join buffer (Block Nested Loop)
+SELECT (SELECT a
+FROM t1 AS t2
+WHERE a IN (SELECT t1.a+t2.a
+FROM t1 AS t3))
+FROM t1 AS t1;
+(SELECT a
+FROM t1 AS t2
+WHERE a IN (SELECT t1.a+t2.a
+FROM t1 AS t3))
+DROP TABLE t1;
+# End of test for Bug#21139722
+#
+# Bug#21139402 ASSERTION FAILED: LENGTH > 0 && KEYPARTS != 0, CRASH IN JOIN::OPTIMIZE_KEYUSE
+#
+CREATE TABLE t1 (a INT, b INT, PRIMARY KEY(a));
+CREATE TABLE t2 (c INT PRIMARY KEY);
+EXPLAIN SELECT 1
+FROM t1
+WHERE 1 IN (SELECT (c IS NULL) IN (SELECT a
+FROM t1
+WHERE b)
+FROM t2);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
+3 DEPENDENT SUBQUERY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
+SELECT 1
+FROM t1
+WHERE 1 IN (SELECT (c IS NULL) IN (SELECT a
+FROM t1
+WHERE b)
+FROM t2);
+1
+DROP TABLE t1,t2;
+#
+# Bug #22305361: QUERY WITH MATERIALIZED TABLE RETURNS INCORRECT
+# RESULTS IN 5.6
+#
+CREATE TABLE t(a INT,b INT);
+INSERT INTO t VALUES (1,0),(1,0),(1,0),(1,0),(1,1);
+EXPLAIN extended SELECT *
+FROM t AS t1
+WHERE t1.a IN (SELECT t2.a
+FROM t AS t2
+WHERE CONCAT(t2.a,'') NOT IN (SELECT t3.a
+FROM t AS t3
+WHERE t3.b=1));
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 5 100.00 Start temporary
+1 PRIMARY t2 ALL NULL NULL NULL NULL 5 100.00 Using where; End temporary; Using join buffer (Block Nested Loop)
+3 DEPENDENT SUBQUERY t3 ALL NULL NULL NULL NULL 5 100.00 Using where
+Warnings:
+Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t` `t1` semi join (`test`.`t` `t2`) where ((`test`.`t2`.`a` = `test`.`t1`.`a`) and (not(<in_optimizer>(concat(`test`.`t1`.`a`,''),<exists>(/* select#3 */ select 1 from `test`.`t` `t3` where ((`test`.`t3`.`b` = 1) and <if>(outer_field_is_not_null, ((<cache>(concat(`test`.`t1`.`a`,'')) = `test`.`t3`.`a`) or isnull(`test`.`t3`.`a`)), true)) having <if>(outer_field_is_not_null, <is_not_null_test>(`test`.`t3`.`a`), true))))))
+SELECT *
+FROM t AS t1
+WHERE t1.a IN (SELECT t2.a
+FROM t AS t2
+WHERE CONCAT(t2.a,'') NOT IN (SELECT t3.a
+FROM t AS t3
+WHERE t3.b=1));
+a b
+DROP TABLE t;
set optimizer_switch=default;
set optimizer_switch=default;
# End of test for Bug#21184091
set @@optimizer_switch=@old_opt_switch;
# End of 5.6 tests
+# Bug#21139722: Assertion failed: !(used_tables() & ((table_map) 1) ...
+CREATE TABLE t1(a INTEGER) engine=innodb;
+CREATE TABLE t2(b INTEGER) engine=innodb;
+explain SELECT 1
+FROM (SELECT 1 IN (SELECT 1
+FROM t1
+WHERE (SELECT 1 FROM t2 HAVING b) NOT IN (SELECT 1 FROM t2)
+)
+FROM t2
+) AS z;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY <derived2> ALL NULL NULL NULL NULL 2 NULL
+2 DERIVED t2 ALL NULL NULL NULL NULL 1 NULL
+3 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL 1 Using where
+5 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 1 Using where
+4 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 1 NULL
+SELECT 1
+FROM (SELECT 1 IN (SELECT 1
+FROM t1
+WHERE (SELECT 1 FROM t2 HAVING b) NOT IN (SELECT 1 FROM t2)
+)
+FROM t2
+) AS z;
+1
+DROP TABLE t1, t2;
+CREATE TABLE t1(a INTEGER) engine=innodb;
+explain SELECT (SELECT a
+FROM t1 AS t2
+WHERE a IN (SELECT t1.a+t2.a
+FROM t1 AS t3))
+FROM t1 AS t1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 1 NULL
+2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 1 Using where
+2 DEPENDENT SUBQUERY t3 ALL NULL NULL NULL NULL 1 FirstMatch(t2); Using join buffer (Block Nested Loop)
+SELECT (SELECT a
+FROM t1 AS t2
+WHERE a IN (SELECT t1.a+t2.a
+FROM t1 AS t3))
+FROM t1 AS t1;
+(SELECT a
+FROM t1 AS t2
+WHERE a IN (SELECT t1.a+t2.a
+FROM t1 AS t3))
+DROP TABLE t1;
+# End of test for Bug#21139722
+#
+# Bug#21139402 ASSERTION FAILED: LENGTH > 0 && KEYPARTS != 0, CRASH IN JOIN::OPTIMIZE_KEYUSE
+#
+CREATE TABLE t1 (a INT, b INT, PRIMARY KEY(a));
+CREATE TABLE t2 (c INT PRIMARY KEY);
+EXPLAIN SELECT 1
+FROM t1
+WHERE 1 IN (SELECT (c IS NULL) IN (SELECT a
+FROM t1
+WHERE b)
+FROM t2);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
+3 DEPENDENT SUBQUERY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
+SELECT 1
+FROM t1
+WHERE 1 IN (SELECT (c IS NULL) IN (SELECT a
+FROM t1
+WHERE b)
+FROM t2);
+1
+DROP TABLE t1,t2;
+#
+# Bug #22305361: QUERY WITH MATERIALIZED TABLE RETURNS INCORRECT
+# RESULTS IN 5.6
+#
+CREATE TABLE t(a INT,b INT);
+INSERT INTO t VALUES (1,0),(1,0),(1,0),(1,0),(1,1);
+EXPLAIN extended SELECT *
+FROM t AS t1
+WHERE t1.a IN (SELECT t2.a
+FROM t AS t2
+WHERE CONCAT(t2.a,'') NOT IN (SELECT t3.a
+FROM t AS t3
+WHERE t3.b=1));
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 5 100.00 NULL
+1 PRIMARY t2 ALL NULL NULL NULL NULL 5 100.00 Using where; FirstMatch(t1); Using join buffer (Block Nested Loop)
+3 DEPENDENT SUBQUERY t3 ALL NULL NULL NULL NULL 5 100.00 Using where
+Warnings:
+Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t` `t1` semi join (`test`.`t` `t2`) where ((`test`.`t2`.`a` = `test`.`t1`.`a`) and (not(<in_optimizer>(concat(`test`.`t1`.`a`,''),<exists>(/* select#3 */ select 1 from `test`.`t` `t3` where ((`test`.`t3`.`b` = 1) and <if>(outer_field_is_not_null, ((<cache>(concat(`test`.`t1`.`a`,'')) = `test`.`t3`.`a`) or isnull(`test`.`t3`.`a`)), true)) having <if>(outer_field_is_not_null, <is_not_null_test>(`test`.`t3`.`a`), true))))))
+SELECT *
+FROM t AS t1
+WHERE t1.a IN (SELECT t2.a
+FROM t AS t2
+WHERE CONCAT(t2.a,'') NOT IN (SELECT t3.a
+FROM t AS t3
+WHERE t3.b=1));
+a b
+DROP TABLE t;
#
# Bug#51457 Firstmatch semijoin strategy gives wrong results for
# certain query plans
# End of test for Bug#21184091
set @@optimizer_switch=@old_opt_switch;
# End of 5.6 tests
+# Bug#21139722: Assertion failed: !(used_tables() & ((table_map) 1) ...
+CREATE TABLE t1(a INTEGER) engine=innodb;
+CREATE TABLE t2(b INTEGER) engine=innodb;
+explain SELECT 1
+FROM (SELECT 1 IN (SELECT 1
+FROM t1
+WHERE (SELECT 1 FROM t2 HAVING b) NOT IN (SELECT 1 FROM t2)
+)
+FROM t2
+) AS z;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY <derived2> ALL NULL NULL NULL NULL 2 NULL
+2 DERIVED t2 ALL NULL NULL NULL NULL 1 NULL
+3 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL 1 Using where
+5 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 1 Using where
+4 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 1 NULL
+SELECT 1
+FROM (SELECT 1 IN (SELECT 1
+FROM t1
+WHERE (SELECT 1 FROM t2 HAVING b) NOT IN (SELECT 1 FROM t2)
+)
+FROM t2
+) AS z;
+1
+DROP TABLE t1, t2;
+CREATE TABLE t1(a INTEGER) engine=innodb;
+explain SELECT (SELECT a
+FROM t1 AS t2
+WHERE a IN (SELECT t1.a+t2.a
+FROM t1 AS t3))
+FROM t1 AS t1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 1 NULL
+2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 1 Using where
+2 DEPENDENT SUBQUERY t3 ALL NULL NULL NULL NULL 1 FirstMatch(t2); Using join buffer (Block Nested Loop)
+SELECT (SELECT a
+FROM t1 AS t2
+WHERE a IN (SELECT t1.a+t2.a
+FROM t1 AS t3))
+FROM t1 AS t1;
+(SELECT a
+FROM t1 AS t2
+WHERE a IN (SELECT t1.a+t2.a
+FROM t1 AS t3))
+DROP TABLE t1;
+# End of test for Bug#21139722
+#
+# Bug#21139402 ASSERTION FAILED: LENGTH > 0 && KEYPARTS != 0, CRASH IN JOIN::OPTIMIZE_KEYUSE
+#
+CREATE TABLE t1 (a INT, b INT, PRIMARY KEY(a));
+CREATE TABLE t2 (c INT PRIMARY KEY);
+EXPLAIN SELECT 1
+FROM t1
+WHERE 1 IN (SELECT (c IS NULL) IN (SELECT a
+FROM t1
+WHERE b)
+FROM t2);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
+3 DEPENDENT SUBQUERY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
+SELECT 1
+FROM t1
+WHERE 1 IN (SELECT (c IS NULL) IN (SELECT a
+FROM t1
+WHERE b)
+FROM t2);
+1
+DROP TABLE t1,t2;
+#
+# Bug #22305361: QUERY WITH MATERIALIZED TABLE RETURNS INCORRECT
+# RESULTS IN 5.6
+#
+CREATE TABLE t(a INT,b INT);
+INSERT INTO t VALUES (1,0),(1,0),(1,0),(1,0),(1,1);
+EXPLAIN extended SELECT *
+FROM t AS t1
+WHERE t1.a IN (SELECT t2.a
+FROM t AS t2
+WHERE CONCAT(t2.a,'') NOT IN (SELECT t3.a
+FROM t AS t3
+WHERE t3.b=1));
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 5 100.00 NULL
+1 PRIMARY t2 ALL NULL NULL NULL NULL 5 100.00 Using where; FirstMatch(t1); Using join buffer (Block Nested Loop)
+3 DEPENDENT SUBQUERY t3 ALL NULL NULL NULL NULL 5 100.00 Using where
+Warnings:
+Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t` `t1` semi join (`test`.`t` `t2`) where ((`test`.`t2`.`a` = `test`.`t1`.`a`) and (not(<in_optimizer>(concat(`test`.`t1`.`a`,''),<exists>(/* select#3 */ select 1 from `test`.`t` `t3` where ((`test`.`t3`.`b` = 1) and <if>(outer_field_is_not_null, ((<cache>(concat(`test`.`t1`.`a`,'')) = `test`.`t3`.`a`) or isnull(`test`.`t3`.`a`)), true)) having <if>(outer_field_is_not_null, <is_not_null_test>(`test`.`t3`.`a`), true))))))
+SELECT *
+FROM t AS t1
+WHERE t1.a IN (SELECT t2.a
+FROM t AS t2
+WHERE CONCAT(t2.a,'') NOT IN (SELECT t3.a
+FROM t AS t3
+WHERE t3.b=1));
+a b
+DROP TABLE t;
#
# Bug#51457 Firstmatch semijoin strategy gives wrong results for
# certain query plans
# End of test for Bug#21184091
set @@optimizer_switch=@old_opt_switch;
# End of 5.6 tests
+# Bug#21139722: Assertion failed: !(used_tables() & ((table_map) 1) ...
+CREATE TABLE t1(a INTEGER) engine=innodb;
+CREATE TABLE t2(b INTEGER) engine=innodb;
+explain SELECT 1
+FROM (SELECT 1 IN (SELECT 1
+FROM t1
+WHERE (SELECT 1 FROM t2 HAVING b) NOT IN (SELECT 1 FROM t2)
+)
+FROM t2
+) AS z;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY <derived2> ALL NULL NULL NULL NULL 2 NULL
+2 DERIVED t2 ALL NULL NULL NULL NULL 1 NULL
+3 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL 1 Using where
+5 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 1 Using where
+4 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 1 NULL
+SELECT 1
+FROM (SELECT 1 IN (SELECT 1
+FROM t1
+WHERE (SELECT 1 FROM t2 HAVING b) NOT IN (SELECT 1 FROM t2)
+)
+FROM t2
+) AS z;
+1
+DROP TABLE t1, t2;
+CREATE TABLE t1(a INTEGER) engine=innodb;
+explain SELECT (SELECT a
+FROM t1 AS t2
+WHERE a IN (SELECT t1.a+t2.a
+FROM t1 AS t3))
+FROM t1 AS t1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 1 NULL
+2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 1 Using where
+2 DEPENDENT SUBQUERY t3 ALL NULL NULL NULL NULL 1 FirstMatch(t2)
+SELECT (SELECT a
+FROM t1 AS t2
+WHERE a IN (SELECT t1.a+t2.a
+FROM t1 AS t3))
+FROM t1 AS t1;
+(SELECT a
+FROM t1 AS t2
+WHERE a IN (SELECT t1.a+t2.a
+FROM t1 AS t3))
+DROP TABLE t1;
+# End of test for Bug#21139722
+#
+# Bug#21139402 ASSERTION FAILED: LENGTH > 0 && KEYPARTS != 0, CRASH IN JOIN::OPTIMIZE_KEYUSE
+#
+CREATE TABLE t1 (a INT, b INT, PRIMARY KEY(a));
+CREATE TABLE t2 (c INT PRIMARY KEY);
+EXPLAIN SELECT 1
+FROM t1
+WHERE 1 IN (SELECT (c IS NULL) IN (SELECT a
+FROM t1
+WHERE b)
+FROM t2);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
+3 DEPENDENT SUBQUERY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
+SELECT 1
+FROM t1
+WHERE 1 IN (SELECT (c IS NULL) IN (SELECT a
+FROM t1
+WHERE b)
+FROM t2);
+1
+DROP TABLE t1,t2;
+#
+# Bug #22305361: QUERY WITH MATERIALIZED TABLE RETURNS INCORRECT
+# RESULTS IN 5.6
+#
+CREATE TABLE t(a INT,b INT);
+INSERT INTO t VALUES (1,0),(1,0),(1,0),(1,0),(1,1);
+EXPLAIN extended SELECT *
+FROM t AS t1
+WHERE t1.a IN (SELECT t2.a
+FROM t AS t2
+WHERE CONCAT(t2.a,'') NOT IN (SELECT t3.a
+FROM t AS t3
+WHERE t3.b=1));
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 5 100.00 NULL
+1 PRIMARY t2 ALL NULL NULL NULL NULL 5 100.00 Using where; FirstMatch(t1)
+3 DEPENDENT SUBQUERY t3 ALL NULL NULL NULL NULL 5 100.00 Using where
+Warnings:
+Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t` `t1` semi join (`test`.`t` `t2`) where ((`test`.`t2`.`a` = `test`.`t1`.`a`) and (not(<in_optimizer>(concat(`test`.`t1`.`a`,''),<exists>(/* select#3 */ select 1 from `test`.`t` `t3` where ((`test`.`t3`.`b` = 1) and <if>(outer_field_is_not_null, ((<cache>(concat(`test`.`t1`.`a`,'')) = `test`.`t3`.`a`) or isnull(`test`.`t3`.`a`)), true)) having <if>(outer_field_is_not_null, <is_not_null_test>(`test`.`t3`.`a`), true))))))
+SELECT *
+FROM t AS t1
+WHERE t1.a IN (SELECT t2.a
+FROM t AS t2
+WHERE CONCAT(t2.a,'') NOT IN (SELECT t3.a
+FROM t AS t3
+WHERE t3.b=1));
+a b
+DROP TABLE t;
#
# Bug#51457 Firstmatch semijoin strategy gives wrong results for
# certain query plans
# End of test for Bug#21184091
set @@optimizer_switch=@old_opt_switch;
# End of 5.6 tests
+# Bug#21139722: Assertion failed: !(used_tables() & ((table_map) 1) ...
+CREATE TABLE t1(a INTEGER) engine=innodb;
+CREATE TABLE t2(b INTEGER) engine=innodb;
+explain SELECT 1
+FROM (SELECT 1 IN (SELECT 1
+FROM t1
+WHERE (SELECT 1 FROM t2 HAVING b) NOT IN (SELECT 1 FROM t2)
+)
+FROM t2
+) AS z;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY <derived2> ALL NULL NULL NULL NULL 2 NULL
+2 DERIVED t2 ALL NULL NULL NULL NULL 1 NULL
+3 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL 1 Using where
+5 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 1 Using where
+4 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 1 NULL
+SELECT 1
+FROM (SELECT 1 IN (SELECT 1
+FROM t1
+WHERE (SELECT 1 FROM t2 HAVING b) NOT IN (SELECT 1 FROM t2)
+)
+FROM t2
+) AS z;
+1
+DROP TABLE t1, t2;
+CREATE TABLE t1(a INTEGER) engine=innodb;
+explain SELECT (SELECT a
+FROM t1 AS t2
+WHERE a IN (SELECT t1.a+t2.a
+FROM t1 AS t3))
+FROM t1 AS t1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 1 NULL
+2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 1 Using where
+2 DEPENDENT SUBQUERY t3 ALL NULL NULL NULL NULL 1 FirstMatch(t2); Using join buffer (Block Nested Loop)
+SELECT (SELECT a
+FROM t1 AS t2
+WHERE a IN (SELECT t1.a+t2.a
+FROM t1 AS t3))
+FROM t1 AS t1;
+(SELECT a
+FROM t1 AS t2
+WHERE a IN (SELECT t1.a+t2.a
+FROM t1 AS t3))
+DROP TABLE t1;
+# End of test for Bug#21139722
+#
+# Bug#21139402 ASSERTION FAILED: LENGTH > 0 && KEYPARTS != 0, CRASH IN JOIN::OPTIMIZE_KEYUSE
+#
+CREATE TABLE t1 (a INT, b INT, PRIMARY KEY(a));
+CREATE TABLE t2 (c INT PRIMARY KEY);
+EXPLAIN SELECT 1
+FROM t1
+WHERE 1 IN (SELECT (c IS NULL) IN (SELECT a
+FROM t1
+WHERE b)
+FROM t2);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
+3 DEPENDENT SUBQUERY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
+SELECT 1
+FROM t1
+WHERE 1 IN (SELECT (c IS NULL) IN (SELECT a
+FROM t1
+WHERE b)
+FROM t2);
+1
+DROP TABLE t1,t2;
+#
+# Bug #22305361: QUERY WITH MATERIALIZED TABLE RETURNS INCORRECT
+# RESULTS IN 5.6
+#
+CREATE TABLE t(a INT,b INT);
+INSERT INTO t VALUES (1,0),(1,0),(1,0),(1,0),(1,1);
+EXPLAIN extended SELECT *
+FROM t AS t1
+WHERE t1.a IN (SELECT t2.a
+FROM t AS t2
+WHERE CONCAT(t2.a,'') NOT IN (SELECT t3.a
+FROM t AS t3
+WHERE t3.b=1));
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 5 100.00 NULL
+1 PRIMARY t2 ALL NULL NULL NULL NULL 5 100.00 Using where; FirstMatch(t1); Using join buffer (Block Nested Loop)
+3 DEPENDENT SUBQUERY t3 ALL NULL NULL NULL NULL 5 100.00 Using where
+Warnings:
+Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t` `t1` semi join (`test`.`t` `t2`) where ((`test`.`t2`.`a` = `test`.`t1`.`a`) and (not(<in_optimizer>(concat(`test`.`t1`.`a`,''),<exists>(/* select#3 */ select 1 from `test`.`t` `t3` where ((`test`.`t3`.`b` = 1) and <if>(outer_field_is_not_null, ((<cache>(concat(`test`.`t1`.`a`,'')) = `test`.`t3`.`a`) or isnull(`test`.`t3`.`a`)), true)) having <if>(outer_field_is_not_null, <is_not_null_test>(`test`.`t3`.`a`), true))))))
+SELECT *
+FROM t AS t1
+WHERE t1.a IN (SELECT t2.a
+FROM t AS t2
+WHERE CONCAT(t2.a,'') NOT IN (SELECT t3.a
+FROM t AS t3
+WHERE t3.b=1));
+a b
+DROP TABLE t;
#
# Bug#51457 Firstmatch semijoin strategy gives wrong results for
# certain query plans
# End of test for Bug#21184091
set @@optimizer_switch=@old_opt_switch;
# End of 5.6 tests
+# Bug#21139722: Assertion failed: !(used_tables() & ((table_map) 1) ...
+CREATE TABLE t1(a INTEGER) engine=innodb;
+CREATE TABLE t2(b INTEGER) engine=innodb;
+explain SELECT 1
+FROM (SELECT 1 IN (SELECT 1
+FROM t1
+WHERE (SELECT 1 FROM t2 HAVING b) NOT IN (SELECT 1 FROM t2)
+)
+FROM t2
+) AS z;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY <derived2> ALL NULL NULL NULL NULL 2 NULL
+2 DERIVED t2 ALL NULL NULL NULL NULL 1 NULL
+3 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL 1 Using where
+5 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 1 Using where
+4 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 1 NULL
+SELECT 1
+FROM (SELECT 1 IN (SELECT 1
+FROM t1
+WHERE (SELECT 1 FROM t2 HAVING b) NOT IN (SELECT 1 FROM t2)
+)
+FROM t2
+) AS z;
+1
+DROP TABLE t1, t2;
+CREATE TABLE t1(a INTEGER) engine=innodb;
+explain SELECT (SELECT a
+FROM t1 AS t2
+WHERE a IN (SELECT t1.a+t2.a
+FROM t1 AS t3))
+FROM t1 AS t1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 1 NULL
+2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 1 Using where; Start temporary
+2 DEPENDENT SUBQUERY t3 ALL NULL NULL NULL NULL 1 End temporary; Using join buffer (Block Nested Loop)
+SELECT (SELECT a
+FROM t1 AS t2
+WHERE a IN (SELECT t1.a+t2.a
+FROM t1 AS t3))
+FROM t1 AS t1;
+(SELECT a
+FROM t1 AS t2
+WHERE a IN (SELECT t1.a+t2.a
+FROM t1 AS t3))
+DROP TABLE t1;
+# End of test for Bug#21139722
+#
+# Bug#21139402 ASSERTION FAILED: LENGTH > 0 && KEYPARTS != 0, CRASH IN JOIN::OPTIMIZE_KEYUSE
+#
+CREATE TABLE t1 (a INT, b INT, PRIMARY KEY(a));
+CREATE TABLE t2 (c INT PRIMARY KEY);
+EXPLAIN SELECT 1
+FROM t1
+WHERE 1 IN (SELECT (c IS NULL) IN (SELECT a
+FROM t1
+WHERE b)
+FROM t2);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
+3 DEPENDENT SUBQUERY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
+SELECT 1
+FROM t1
+WHERE 1 IN (SELECT (c IS NULL) IN (SELECT a
+FROM t1
+WHERE b)
+FROM t2);
+1
+DROP TABLE t1,t2;
+#
+# Bug #22305361: QUERY WITH MATERIALIZED TABLE RETURNS INCORRECT
+# RESULTS IN 5.6
+#
+CREATE TABLE t(a INT,b INT);
+INSERT INTO t VALUES (1,0),(1,0),(1,0),(1,0),(1,1);
+EXPLAIN extended SELECT *
+FROM t AS t1
+WHERE t1.a IN (SELECT t2.a
+FROM t AS t2
+WHERE CONCAT(t2.a,'') NOT IN (SELECT t3.a
+FROM t AS t3
+WHERE t3.b=1));
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 5 100.00 Start temporary
+1 PRIMARY t2 ALL NULL NULL NULL NULL 5 100.00 Using where; End temporary; Using join buffer (Block Nested Loop)
+3 DEPENDENT SUBQUERY t3 ALL NULL NULL NULL NULL 5 100.00 Using where
+Warnings:
+Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t` `t1` semi join (`test`.`t` `t2`) where ((`test`.`t2`.`a` = `test`.`t1`.`a`) and (not(<in_optimizer>(concat(`test`.`t1`.`a`,''),<exists>(/* select#3 */ select 1 from `test`.`t` `t3` where ((`test`.`t3`.`b` = 1) and <if>(outer_field_is_not_null, ((<cache>(concat(`test`.`t1`.`a`,'')) = `test`.`t3`.`a`) or isnull(`test`.`t3`.`a`)), true)) having <if>(outer_field_is_not_null, <is_not_null_test>(`test`.`t3`.`a`), true))))))
+SELECT *
+FROM t AS t1
+WHERE t1.a IN (SELECT t2.a
+FROM t AS t2
+WHERE CONCAT(t2.a,'') NOT IN (SELECT t3.a
+FROM t AS t3
+WHERE t3.b=1));
+a b
+DROP TABLE t;
set optimizer_switch=default;
# End of test for Bug#21184091
set @@optimizer_switch=@old_opt_switch;
# End of 5.6 tests
+# Bug#21139722: Assertion failed: !(used_tables() & ((table_map) 1) ...
+CREATE TABLE t1(a INTEGER) engine=innodb;
+CREATE TABLE t2(b INTEGER) engine=innodb;
+explain SELECT 1
+FROM (SELECT 1 IN (SELECT 1
+FROM t1
+WHERE (SELECT 1 FROM t2 HAVING b) NOT IN (SELECT 1 FROM t2)
+)
+FROM t2
+) AS z;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY <derived2> ALL NULL NULL NULL NULL 2 NULL
+2 DERIVED t2 ALL NULL NULL NULL NULL 1 NULL
+3 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL 1 Using where
+5 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 1 Using where
+4 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 1 NULL
+SELECT 1
+FROM (SELECT 1 IN (SELECT 1
+FROM t1
+WHERE (SELECT 1 FROM t2 HAVING b) NOT IN (SELECT 1 FROM t2)
+)
+FROM t2
+) AS z;
+1
+DROP TABLE t1, t2;
+CREATE TABLE t1(a INTEGER) engine=innodb;
+explain SELECT (SELECT a
+FROM t1 AS t2
+WHERE a IN (SELECT t1.a+t2.a
+FROM t1 AS t3))
+FROM t1 AS t1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 1 NULL
+2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 1 Using where; Start temporary
+2 DEPENDENT SUBQUERY t3 ALL NULL NULL NULL NULL 1 End temporary; Using join buffer (Block Nested Loop)
+SELECT (SELECT a
+FROM t1 AS t2
+WHERE a IN (SELECT t1.a+t2.a
+FROM t1 AS t3))
+FROM t1 AS t1;
+(SELECT a
+FROM t1 AS t2
+WHERE a IN (SELECT t1.a+t2.a
+FROM t1 AS t3))
+DROP TABLE t1;
+# End of test for Bug#21139722
+#
+# Bug#21139402 ASSERTION FAILED: LENGTH > 0 && KEYPARTS != 0, CRASH IN JOIN::OPTIMIZE_KEYUSE
+#
+CREATE TABLE t1 (a INT, b INT, PRIMARY KEY(a));
+CREATE TABLE t2 (c INT PRIMARY KEY);
+EXPLAIN SELECT 1
+FROM t1
+WHERE 1 IN (SELECT (c IS NULL) IN (SELECT a
+FROM t1
+WHERE b)
+FROM t2);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
+3 DEPENDENT SUBQUERY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
+SELECT 1
+FROM t1
+WHERE 1 IN (SELECT (c IS NULL) IN (SELECT a
+FROM t1
+WHERE b)
+FROM t2);
+1
+DROP TABLE t1,t2;
+#
+# Bug #22305361: QUERY WITH MATERIALIZED TABLE RETURNS INCORRECT
+# RESULTS IN 5.6
+#
+CREATE TABLE t(a INT,b INT);
+INSERT INTO t VALUES (1,0),(1,0),(1,0),(1,0),(1,1);
+EXPLAIN extended SELECT *
+FROM t AS t1
+WHERE t1.a IN (SELECT t2.a
+FROM t AS t2
+WHERE CONCAT(t2.a,'') NOT IN (SELECT t3.a
+FROM t AS t3
+WHERE t3.b=1));
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 5 100.00 Start temporary
+1 PRIMARY t2 ALL NULL NULL NULL NULL 5 100.00 Using where; End temporary; Using join buffer (Block Nested Loop)
+3 DEPENDENT SUBQUERY t3 ALL NULL NULL NULL NULL 5 100.00 Using where
+Warnings:
+Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t` `t1` semi join (`test`.`t` `t2`) where ((`test`.`t2`.`a` = `test`.`t1`.`a`) and (not(<in_optimizer>(concat(`test`.`t1`.`a`,''),<exists>(/* select#3 */ select 1 from `test`.`t` `t3` where ((`test`.`t3`.`b` = 1) and <if>(outer_field_is_not_null, ((<cache>(concat(`test`.`t1`.`a`,'')) = `test`.`t3`.`a`) or isnull(`test`.`t3`.`a`)), true)) having <if>(outer_field_is_not_null, <is_not_null_test>(`test`.`t3`.`a`), true))))))
+SELECT *
+FROM t AS t1
+WHERE t1.a IN (SELECT t2.a
+FROM t AS t2
+WHERE CONCAT(t2.a,'') NOT IN (SELECT t3.a
+FROM t AS t3
+WHERE t3.b=1));
+a b
+DROP TABLE t;
set optimizer_switch=default;
set optimizer_switch=default;
# End of test for Bug#21184091
set @@optimizer_switch=@old_opt_switch;
# End of 5.6 tests
+# Bug#21139722: Assertion failed: !(used_tables() & ((table_map) 1) ...
+CREATE TABLE t1(a INTEGER) engine=innodb;
+CREATE TABLE t2(b INTEGER) engine=innodb;
+explain SELECT 1
+FROM (SELECT 1 IN (SELECT 1
+FROM t1
+WHERE (SELECT 1 FROM t2 HAVING b) NOT IN (SELECT 1 FROM t2)
+)
+FROM t2
+) AS z;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY <derived2> ALL NULL NULL NULL NULL 2 NULL
+2 DERIVED t2 ALL NULL NULL NULL NULL 1 NULL
+3 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL 1 Using where
+5 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 1 Using where
+4 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 1 NULL
+SELECT 1
+FROM (SELECT 1 IN (SELECT 1
+FROM t1
+WHERE (SELECT 1 FROM t2 HAVING b) NOT IN (SELECT 1 FROM t2)
+)
+FROM t2
+) AS z;
+1
+DROP TABLE t1, t2;
+CREATE TABLE t1(a INTEGER) engine=innodb;
+explain SELECT (SELECT a
+FROM t1 AS t2
+WHERE a IN (SELECT t1.a+t2.a
+FROM t1 AS t3))
+FROM t1 AS t1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 1 NULL
+2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 1 Using where
+2 DEPENDENT SUBQUERY t3 ALL NULL NULL NULL NULL 1 Start temporary; End temporary
+SELECT (SELECT a
+FROM t1 AS t2
+WHERE a IN (SELECT t1.a+t2.a
+FROM t1 AS t3))
+FROM t1 AS t1;
+(SELECT a
+FROM t1 AS t2
+WHERE a IN (SELECT t1.a+t2.a
+FROM t1 AS t3))
+DROP TABLE t1;
+# End of test for Bug#21139722
+#
+# Bug#21139402 ASSERTION FAILED: LENGTH > 0 && KEYPARTS != 0, CRASH IN JOIN::OPTIMIZE_KEYUSE
+#
+CREATE TABLE t1 (a INT, b INT, PRIMARY KEY(a));
+CREATE TABLE t2 (c INT PRIMARY KEY);
+EXPLAIN SELECT 1
+FROM t1
+WHERE 1 IN (SELECT (c IS NULL) IN (SELECT a
+FROM t1
+WHERE b)
+FROM t2);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
+3 DEPENDENT SUBQUERY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
+SELECT 1
+FROM t1
+WHERE 1 IN (SELECT (c IS NULL) IN (SELECT a
+FROM t1
+WHERE b)
+FROM t2);
+1
+DROP TABLE t1,t2;
+#
+# Bug #22305361: QUERY WITH MATERIALIZED TABLE RETURNS INCORRECT
+# RESULTS IN 5.6
+#
+CREATE TABLE t(a INT,b INT);
+INSERT INTO t VALUES (1,0),(1,0),(1,0),(1,0),(1,1);
+EXPLAIN extended SELECT *
+FROM t AS t1
+WHERE t1.a IN (SELECT t2.a
+FROM t AS t2
+WHERE CONCAT(t2.a,'') NOT IN (SELECT t3.a
+FROM t AS t3
+WHERE t3.b=1));
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 5 100.00 NULL
+1 PRIMARY t2 ALL NULL NULL NULL NULL 5 100.00 Using where; Start temporary; End temporary
+3 DEPENDENT SUBQUERY t3 ALL NULL NULL NULL NULL 5 100.00 Using where
+Warnings:
+Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t` `t1` semi join (`test`.`t` `t2`) where ((`test`.`t2`.`a` = `test`.`t1`.`a`) and (not(<in_optimizer>(concat(`test`.`t1`.`a`,''),<exists>(/* select#3 */ select 1 from `test`.`t` `t3` where ((`test`.`t3`.`b` = 1) and <if>(outer_field_is_not_null, ((<cache>(concat(`test`.`t1`.`a`,'')) = `test`.`t3`.`a`) or isnull(`test`.`t3`.`a`)), true)) having <if>(outer_field_is_not_null, <is_not_null_test>(`test`.`t3`.`a`), true))))))
+SELECT *
+FROM t AS t1
+WHERE t1.a IN (SELECT t2.a
+FROM t AS t2
+WHERE CONCAT(t2.a,'') NOT IN (SELECT t3.a
+FROM t AS t3
+WHERE t3.b=1));
+a b
+DROP TABLE t;
set optimizer_switch=default;
set optimizer_switch=default;
# End of test for Bug#21184091
set @@optimizer_switch=@old_opt_switch;
# End of 5.6 tests
+# Bug#21139722: Assertion failed: !(used_tables() & ((table_map) 1) ...
+CREATE TABLE t1(a INTEGER) engine=innodb;
+CREATE TABLE t2(b INTEGER) engine=innodb;
+explain SELECT 1
+FROM (SELECT 1 IN (SELECT 1
+FROM t1
+WHERE (SELECT 1 FROM t2 HAVING b) NOT IN (SELECT 1 FROM t2)
+)
+FROM t2
+) AS z;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY <derived2> ALL NULL NULL NULL NULL 2 NULL
+2 DERIVED t2 ALL NULL NULL NULL NULL 1 NULL
+3 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL 1 Using where
+5 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 1 Using where
+4 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 1 NULL
+SELECT 1
+FROM (SELECT 1 IN (SELECT 1
+FROM t1
+WHERE (SELECT 1 FROM t2 HAVING b) NOT IN (SELECT 1 FROM t2)
+)
+FROM t2
+) AS z;
+1
+DROP TABLE t1, t2;
+CREATE TABLE t1(a INTEGER) engine=innodb;
+explain SELECT (SELECT a
+FROM t1 AS t2
+WHERE a IN (SELECT t1.a+t2.a
+FROM t1 AS t3))
+FROM t1 AS t1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 1 NULL
+2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 1 Using where; Start temporary
+2 DEPENDENT SUBQUERY t3 ALL NULL NULL NULL NULL 1 End temporary; Using join buffer (Block Nested Loop)
+SELECT (SELECT a
+FROM t1 AS t2
+WHERE a IN (SELECT t1.a+t2.a
+FROM t1 AS t3))
+FROM t1 AS t1;
+(SELECT a
+FROM t1 AS t2
+WHERE a IN (SELECT t1.a+t2.a
+FROM t1 AS t3))
+DROP TABLE t1;
+# End of test for Bug#21139722
+#
+# Bug#21139402 ASSERTION FAILED: LENGTH > 0 && KEYPARTS != 0, CRASH IN JOIN::OPTIMIZE_KEYUSE
+#
+CREATE TABLE t1 (a INT, b INT, PRIMARY KEY(a));
+CREATE TABLE t2 (c INT PRIMARY KEY);
+EXPLAIN SELECT 1
+FROM t1
+WHERE 1 IN (SELECT (c IS NULL) IN (SELECT a
+FROM t1
+WHERE b)
+FROM t2);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
+3 DEPENDENT SUBQUERY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
+SELECT 1
+FROM t1
+WHERE 1 IN (SELECT (c IS NULL) IN (SELECT a
+FROM t1
+WHERE b)
+FROM t2);
+1
+DROP TABLE t1,t2;
+#
+# Bug #22305361: QUERY WITH MATERIALIZED TABLE RETURNS INCORRECT
+# RESULTS IN 5.6
+#
+CREATE TABLE t(a INT,b INT);
+INSERT INTO t VALUES (1,0),(1,0),(1,0),(1,0),(1,1);
+EXPLAIN extended SELECT *
+FROM t AS t1
+WHERE t1.a IN (SELECT t2.a
+FROM t AS t2
+WHERE CONCAT(t2.a,'') NOT IN (SELECT t3.a
+FROM t AS t3
+WHERE t3.b=1));
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 5 100.00 Start temporary
+1 PRIMARY t2 ALL NULL NULL NULL NULL 5 100.00 Using where; End temporary; Using join buffer (Block Nested Loop)
+3 DEPENDENT SUBQUERY t3 ALL NULL NULL NULL NULL 5 100.00 Using where
+Warnings:
+Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t` `t1` semi join (`test`.`t` `t2`) where ((`test`.`t2`.`a` = `test`.`t1`.`a`) and (not(<in_optimizer>(concat(`test`.`t1`.`a`,''),<exists>(/* select#3 */ select 1 from `test`.`t` `t3` where ((`test`.`t3`.`b` = 1) and <if>(outer_field_is_not_null, ((<cache>(concat(`test`.`t1`.`a`,'')) = `test`.`t3`.`a`) or isnull(`test`.`t3`.`a`)), true)) having <if>(outer_field_is_not_null, <is_not_null_test>(`test`.`t3`.`a`), true))))))
+SELECT *
+FROM t AS t1
+WHERE t1.a IN (SELECT t2.a
+FROM t AS t2
+WHERE CONCAT(t2.a,'') NOT IN (SELECT t3.a
+FROM t AS t3
+WHERE t3.b=1));
+a b
+DROP TABLE t;
set optimizer_switch=default;
set optimizer_switch=default;
# End of test for Bug#21184091
set @@optimizer_switch=@old_opt_switch;
# End of 5.6 tests
+# Bug#21139722: Assertion failed: !(used_tables() & ((table_map) 1) ...
+CREATE TABLE t1(a INTEGER) engine=innodb;
+CREATE TABLE t2(b INTEGER) engine=innodb;
+explain SELECT 1
+FROM (SELECT 1 IN (SELECT 1
+FROM t1
+WHERE (SELECT 1 FROM t2 HAVING b) NOT IN (SELECT 1 FROM t2)
+)
+FROM t2
+) AS z;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY <derived2> ALL NULL NULL NULL NULL 2 NULL
+2 DERIVED t2 ALL NULL NULL NULL NULL 1 NULL
+3 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL 1 Using where
+5 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 1 Using where
+4 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 1 NULL
+SELECT 1
+FROM (SELECT 1 IN (SELECT 1
+FROM t1
+WHERE (SELECT 1 FROM t2 HAVING b) NOT IN (SELECT 1 FROM t2)
+)
+FROM t2
+) AS z;
+1
+DROP TABLE t1, t2;
+CREATE TABLE t1(a INTEGER) engine=innodb;
+explain SELECT (SELECT a
+FROM t1 AS t2
+WHERE a IN (SELECT t1.a+t2.a
+FROM t1 AS t3))
+FROM t1 AS t1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 1 NULL
+2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 1 Using where; Start temporary
+2 DEPENDENT SUBQUERY t3 ALL NULL NULL NULL NULL 1 End temporary; Using join buffer (Block Nested Loop)
+SELECT (SELECT a
+FROM t1 AS t2
+WHERE a IN (SELECT t1.a+t2.a
+FROM t1 AS t3))
+FROM t1 AS t1;
+(SELECT a
+FROM t1 AS t2
+WHERE a IN (SELECT t1.a+t2.a
+FROM t1 AS t3))
+DROP TABLE t1;
+# End of test for Bug#21139722
+#
+# Bug#21139402 ASSERTION FAILED: LENGTH > 0 && KEYPARTS != 0, CRASH IN JOIN::OPTIMIZE_KEYUSE
+#
+CREATE TABLE t1 (a INT, b INT, PRIMARY KEY(a));
+CREATE TABLE t2 (c INT PRIMARY KEY);
+EXPLAIN SELECT 1
+FROM t1
+WHERE 1 IN (SELECT (c IS NULL) IN (SELECT a
+FROM t1
+WHERE b)
+FROM t2);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
+3 DEPENDENT SUBQUERY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
+SELECT 1
+FROM t1
+WHERE 1 IN (SELECT (c IS NULL) IN (SELECT a
+FROM t1
+WHERE b)
+FROM t2);
+1
+DROP TABLE t1,t2;
+#
+# Bug #22305361: QUERY WITH MATERIALIZED TABLE RETURNS INCORRECT
+# RESULTS IN 5.6
+#
+CREATE TABLE t(a INT,b INT);
+INSERT INTO t VALUES (1,0),(1,0),(1,0),(1,0),(1,1);
+EXPLAIN extended SELECT *
+FROM t AS t1
+WHERE t1.a IN (SELECT t2.a
+FROM t AS t2
+WHERE CONCAT(t2.a,'') NOT IN (SELECT t3.a
+FROM t AS t3
+WHERE t3.b=1));
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 5 100.00 Using where
+1 PRIMARY <subquery2> eq_ref <auto_key> <auto_key> 5 test.t1.a 1 100.00 NULL
+2 MATERIALIZED t2 ALL NULL NULL NULL NULL 5 100.00 Using where
+3 DEPENDENT SUBQUERY t3 ALL NULL NULL NULL NULL 5 100.00 Using where
+Warnings:
+Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t` `t1` semi join (`test`.`t` `t2`) where ((`<subquery2>`.`a` = `test`.`t1`.`a`) and (not(<in_optimizer>(concat(`test`.`t2`.`a`,''),<exists>(/* select#3 */ select 1 from `test`.`t` `t3` where ((`test`.`t3`.`b` = 1) and <if>(outer_field_is_not_null, ((<cache>(concat(`test`.`t2`.`a`,'')) = `test`.`t3`.`a`) or isnull(`test`.`t3`.`a`)), true)) having <if>(outer_field_is_not_null, <is_not_null_test>(`test`.`t3`.`a`), true))))))
+SELECT *
+FROM t AS t1
+WHERE t1.a IN (SELECT t2.a
+FROM t AS t2
+WHERE CONCAT(t2.a,'') NOT IN (SELECT t3.a
+FROM t AS t3
+WHERE t3.b=1));
+a b
+DROP TABLE t;
set optimizer_switch=default;
# End of test for Bug#21184091
set @@optimizer_switch=@old_opt_switch;
# End of 5.6 tests
+# Bug#21139722: Assertion failed: !(used_tables() & ((table_map) 1) ...
+CREATE TABLE t1(a INTEGER) engine=innodb;
+CREATE TABLE t2(b INTEGER) engine=innodb;
+explain SELECT 1
+FROM (SELECT 1 IN (SELECT 1
+FROM t1
+WHERE (SELECT 1 FROM t2 HAVING b) NOT IN (SELECT 1 FROM t2)
+)
+FROM t2
+) AS z;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY <derived2> ALL NULL NULL NULL NULL 2 NULL
+2 DERIVED t2 ALL NULL NULL NULL NULL 1 NULL
+3 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL 1 Using where
+5 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 1 Using where
+4 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 1 NULL
+SELECT 1
+FROM (SELECT 1 IN (SELECT 1
+FROM t1
+WHERE (SELECT 1 FROM t2 HAVING b) NOT IN (SELECT 1 FROM t2)
+)
+FROM t2
+) AS z;
+1
+DROP TABLE t1, t2;
+CREATE TABLE t1(a INTEGER) engine=innodb;
+explain SELECT (SELECT a
+FROM t1 AS t2
+WHERE a IN (SELECT t1.a+t2.a
+FROM t1 AS t3))
+FROM t1 AS t1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 1 NULL
+2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 1 Using where; Start temporary
+2 DEPENDENT SUBQUERY t3 ALL NULL NULL NULL NULL 1 End temporary; Using join buffer (Block Nested Loop)
+SELECT (SELECT a
+FROM t1 AS t2
+WHERE a IN (SELECT t1.a+t2.a
+FROM t1 AS t3))
+FROM t1 AS t1;
+(SELECT a
+FROM t1 AS t2
+WHERE a IN (SELECT t1.a+t2.a
+FROM t1 AS t3))
+DROP TABLE t1;
+# End of test for Bug#21139722
+#
+# Bug#21139402 ASSERTION FAILED: LENGTH > 0 && KEYPARTS != 0, CRASH IN JOIN::OPTIMIZE_KEYUSE
+#
+CREATE TABLE t1 (a INT, b INT, PRIMARY KEY(a));
+CREATE TABLE t2 (c INT PRIMARY KEY);
+EXPLAIN SELECT 1
+FROM t1
+WHERE 1 IN (SELECT (c IS NULL) IN (SELECT a
+FROM t1
+WHERE b)
+FROM t2);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
+3 DEPENDENT SUBQUERY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
+SELECT 1
+FROM t1
+WHERE 1 IN (SELECT (c IS NULL) IN (SELECT a
+FROM t1
+WHERE b)
+FROM t2);
+1
+DROP TABLE t1,t2;
+#
+# Bug #22305361: QUERY WITH MATERIALIZED TABLE RETURNS INCORRECT
+# RESULTS IN 5.6
+#
+CREATE TABLE t(a INT,b INT);
+INSERT INTO t VALUES (1,0),(1,0),(1,0),(1,0),(1,1);
+EXPLAIN extended SELECT *
+FROM t AS t1
+WHERE t1.a IN (SELECT t2.a
+FROM t AS t2
+WHERE CONCAT(t2.a,'') NOT IN (SELECT t3.a
+FROM t AS t3
+WHERE t3.b=1));
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 5 100.00 Using where
+1 PRIMARY <subquery2> eq_ref <auto_key> <auto_key> 5 test.t1.a 1 100.00 NULL
+2 MATERIALIZED t2 ALL NULL NULL NULL NULL 5 100.00 Using where
+3 DEPENDENT SUBQUERY t3 ALL NULL NULL NULL NULL 5 100.00 Using where
+Warnings:
+Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t` `t1` semi join (`test`.`t` `t2`) where ((`<subquery2>`.`a` = `test`.`t1`.`a`) and (not(<in_optimizer>(concat(`test`.`t2`.`a`,''),<exists>(/* select#3 */ select 1 from `test`.`t` `t3` where ((`test`.`t3`.`b` = 1) and <if>(outer_field_is_not_null, ((<cache>(concat(`test`.`t2`.`a`,'')) = `test`.`t3`.`a`) or isnull(`test`.`t3`.`a`)), true)) having <if>(outer_field_is_not_null, <is_not_null_test>(`test`.`t3`.`a`), true))))))
+SELECT *
+FROM t AS t1
+WHERE t1.a IN (SELECT t2.a
+FROM t AS t2
+WHERE CONCAT(t2.a,'') NOT IN (SELECT t3.a
+FROM t AS t3
+WHERE t3.b=1));
+a b
+DROP TABLE t;
set optimizer_switch=default;
set optimizer_switch=default;
# End of test for Bug#21184091
set @@optimizer_switch=@old_opt_switch;
# End of 5.6 tests
+# Bug#21139722: Assertion failed: !(used_tables() & ((table_map) 1) ...
+CREATE TABLE t1(a INTEGER) engine=innodb;
+CREATE TABLE t2(b INTEGER) engine=innodb;
+explain SELECT 1
+FROM (SELECT 1 IN (SELECT 1
+FROM t1
+WHERE (SELECT 1 FROM t2 HAVING b) NOT IN (SELECT 1 FROM t2)
+)
+FROM t2
+) AS z;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY <derived2> ALL NULL NULL NULL NULL 2 NULL
+2 DERIVED t2 ALL NULL NULL NULL NULL 1 NULL
+3 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL 1 Using where
+5 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 1 Using where
+4 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 1 NULL
+SELECT 1
+FROM (SELECT 1 IN (SELECT 1
+FROM t1
+WHERE (SELECT 1 FROM t2 HAVING b) NOT IN (SELECT 1 FROM t2)
+)
+FROM t2
+) AS z;
+1
+DROP TABLE t1, t2;
+CREATE TABLE t1(a INTEGER) engine=innodb;
+explain SELECT (SELECT a
+FROM t1 AS t2
+WHERE a IN (SELECT t1.a+t2.a
+FROM t1 AS t3))
+FROM t1 AS t1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 1 NULL
+2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 1 Using where
+2 DEPENDENT SUBQUERY t3 ALL NULL NULL NULL NULL 1 Start temporary; End temporary
+SELECT (SELECT a
+FROM t1 AS t2
+WHERE a IN (SELECT t1.a+t2.a
+FROM t1 AS t3))
+FROM t1 AS t1;
+(SELECT a
+FROM t1 AS t2
+WHERE a IN (SELECT t1.a+t2.a
+FROM t1 AS t3))
+DROP TABLE t1;
+# End of test for Bug#21139722
+#
+# Bug#21139402 ASSERTION FAILED: LENGTH > 0 && KEYPARTS != 0, CRASH IN JOIN::OPTIMIZE_KEYUSE
+#
+CREATE TABLE t1 (a INT, b INT, PRIMARY KEY(a));
+CREATE TABLE t2 (c INT PRIMARY KEY);
+EXPLAIN SELECT 1
+FROM t1
+WHERE 1 IN (SELECT (c IS NULL) IN (SELECT a
+FROM t1
+WHERE b)
+FROM t2);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
+3 DEPENDENT SUBQUERY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
+SELECT 1
+FROM t1
+WHERE 1 IN (SELECT (c IS NULL) IN (SELECT a
+FROM t1
+WHERE b)
+FROM t2);
+1
+DROP TABLE t1,t2;
+#
+# Bug #22305361: QUERY WITH MATERIALIZED TABLE RETURNS INCORRECT
+# RESULTS IN 5.6
+#
+CREATE TABLE t(a INT,b INT);
+INSERT INTO t VALUES (1,0),(1,0),(1,0),(1,0),(1,1);
+EXPLAIN extended SELECT *
+FROM t AS t1
+WHERE t1.a IN (SELECT t2.a
+FROM t AS t2
+WHERE CONCAT(t2.a,'') NOT IN (SELECT t3.a
+FROM t AS t3
+WHERE t3.b=1));
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 5 100.00 Using where
+1 PRIMARY <subquery2> eq_ref <auto_key> <auto_key> 5 test.t1.a 1 100.00 NULL
+2 MATERIALIZED t2 ALL NULL NULL NULL NULL 5 100.00 Using where
+3 DEPENDENT SUBQUERY t3 ALL NULL NULL NULL NULL 5 100.00 Using where
+Warnings:
+Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t` `t1` semi join (`test`.`t` `t2`) where ((`<subquery2>`.`a` = `test`.`t1`.`a`) and (not(<in_optimizer>(concat(`test`.`t2`.`a`,''),<exists>(/* select#3 */ select 1 from `test`.`t` `t3` where ((`test`.`t3`.`b` = 1) and <if>(outer_field_is_not_null, ((<cache>(concat(`test`.`t2`.`a`,'')) = `test`.`t3`.`a`) or isnull(`test`.`t3`.`a`)), true)) having <if>(outer_field_is_not_null, <is_not_null_test>(`test`.`t3`.`a`), true))))))
+SELECT *
+FROM t AS t1
+WHERE t1.a IN (SELECT t2.a
+FROM t AS t2
+WHERE CONCAT(t2.a,'') NOT IN (SELECT t3.a
+FROM t AS t3
+WHERE t3.b=1));
+a b
+DROP TABLE t;
set optimizer_switch=default;
set optimizer_switch=default;
# End of test for Bug#21184091
set @@optimizer_switch=@old_opt_switch;
# End of 5.6 tests
+# Bug#21139722: Assertion failed: !(used_tables() & ((table_map) 1) ...
+CREATE TABLE t1(a INTEGER) engine=innodb;
+CREATE TABLE t2(b INTEGER) engine=innodb;
+explain SELECT 1
+FROM (SELECT 1 IN (SELECT 1
+FROM t1
+WHERE (SELECT 1 FROM t2 HAVING b) NOT IN (SELECT 1 FROM t2)
+)
+FROM t2
+) AS z;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY <derived2> ALL NULL NULL NULL NULL 2 NULL
+2 DERIVED t2 ALL NULL NULL NULL NULL 1 NULL
+3 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL 1 Using where
+5 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 1 Using where
+4 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 1 NULL
+SELECT 1
+FROM (SELECT 1 IN (SELECT 1
+FROM t1
+WHERE (SELECT 1 FROM t2 HAVING b) NOT IN (SELECT 1 FROM t2)
+)
+FROM t2
+) AS z;
+1
+DROP TABLE t1, t2;
+CREATE TABLE t1(a INTEGER) engine=innodb;
+explain SELECT (SELECT a
+FROM t1 AS t2
+WHERE a IN (SELECT t1.a+t2.a
+FROM t1 AS t3))
+FROM t1 AS t1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 1 NULL
+2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 1 Using where; Start temporary
+2 DEPENDENT SUBQUERY t3 ALL NULL NULL NULL NULL 1 End temporary; Using join buffer (Block Nested Loop)
+SELECT (SELECT a
+FROM t1 AS t2
+WHERE a IN (SELECT t1.a+t2.a
+FROM t1 AS t3))
+FROM t1 AS t1;
+(SELECT a
+FROM t1 AS t2
+WHERE a IN (SELECT t1.a+t2.a
+FROM t1 AS t3))
+DROP TABLE t1;
+# End of test for Bug#21139722
+#
+# Bug#21139402 ASSERTION FAILED: LENGTH > 0 && KEYPARTS != 0, CRASH IN JOIN::OPTIMIZE_KEYUSE
+#
+CREATE TABLE t1 (a INT, b INT, PRIMARY KEY(a));
+CREATE TABLE t2 (c INT PRIMARY KEY);
+EXPLAIN SELECT 1
+FROM t1
+WHERE 1 IN (SELECT (c IS NULL) IN (SELECT a
+FROM t1
+WHERE b)
+FROM t2);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
+3 DEPENDENT SUBQUERY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
+SELECT 1
+FROM t1
+WHERE 1 IN (SELECT (c IS NULL) IN (SELECT a
+FROM t1
+WHERE b)
+FROM t2);
+1
+DROP TABLE t1,t2;
+#
+# Bug #22305361: QUERY WITH MATERIALIZED TABLE RETURNS INCORRECT
+# RESULTS IN 5.6
+#
+CREATE TABLE t(a INT,b INT);
+INSERT INTO t VALUES (1,0),(1,0),(1,0),(1,0),(1,1);
+EXPLAIN extended SELECT *
+FROM t AS t1
+WHERE t1.a IN (SELECT t2.a
+FROM t AS t2
+WHERE CONCAT(t2.a,'') NOT IN (SELECT t3.a
+FROM t AS t3
+WHERE t3.b=1));
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 5 100.00 Using where
+1 PRIMARY <subquery2> eq_ref <auto_key> <auto_key> 5 test.t1.a 1 100.00 NULL
+2 MATERIALIZED t2 ALL NULL NULL NULL NULL 5 100.00 Using where
+3 DEPENDENT SUBQUERY t3 ALL NULL NULL NULL NULL 5 100.00 Using where
+Warnings:
+Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t` `t1` semi join (`test`.`t` `t2`) where ((`<subquery2>`.`a` = `test`.`t1`.`a`) and (not(<in_optimizer>(concat(`test`.`t2`.`a`,''),<exists>(/* select#3 */ select 1 from `test`.`t` `t3` where ((`test`.`t3`.`b` = 1) and <if>(outer_field_is_not_null, ((<cache>(concat(`test`.`t2`.`a`,'')) = `test`.`t3`.`a`) or isnull(`test`.`t3`.`a`)), true)) having <if>(outer_field_is_not_null, <is_not_null_test>(`test`.`t3`.`a`), true))))))
+SELECT *
+FROM t AS t1
+WHERE t1.a IN (SELECT t2.a
+FROM t AS t2
+WHERE CONCAT(t2.a,'') NOT IN (SELECT t3.a
+FROM t AS t3
+WHERE t3.b=1));
+a b
+DROP TABLE t;
set optimizer_switch=default;
set optimizer_switch=default;
# End of test for Bug#21184091
set @@optimizer_switch=@old_opt_switch;
# End of 5.6 tests
+# Bug#21139722: Assertion failed: !(used_tables() & ((table_map) 1) ...
+CREATE TABLE t1(a INTEGER) engine=innodb;
+CREATE TABLE t2(b INTEGER) engine=innodb;
+explain SELECT 1
+FROM (SELECT 1 IN (SELECT 1
+FROM t1
+WHERE (SELECT 1 FROM t2 HAVING b) NOT IN (SELECT 1 FROM t2)
+)
+FROM t2
+) AS z;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY <derived2> ALL NULL NULL NULL NULL 2 NULL
+2 DERIVED t2 ALL NULL NULL NULL NULL 1 NULL
+3 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL 1 Using where
+5 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 1 Using where
+4 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 1 NULL
+SELECT 1
+FROM (SELECT 1 IN (SELECT 1
+FROM t1
+WHERE (SELECT 1 FROM t2 HAVING b) NOT IN (SELECT 1 FROM t2)
+)
+FROM t2
+) AS z;
+1
+DROP TABLE t1, t2;
+CREATE TABLE t1(a INTEGER) engine=innodb;
+explain SELECT (SELECT a
+FROM t1 AS t2
+WHERE a IN (SELECT t1.a+t2.a
+FROM t1 AS t3))
+FROM t1 AS t1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 1 NULL
+2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 1 Using where
+3 DEPENDENT SUBQUERY t3 ALL NULL NULL NULL NULL 1 Using where
+SELECT (SELECT a
+FROM t1 AS t2
+WHERE a IN (SELECT t1.a+t2.a
+FROM t1 AS t3))
+FROM t1 AS t1;
+(SELECT a
+FROM t1 AS t2
+WHERE a IN (SELECT t1.a+t2.a
+FROM t1 AS t3))
+DROP TABLE t1;
+# End of test for Bug#21139722
+#
+# Bug#21139402 ASSERTION FAILED: LENGTH > 0 && KEYPARTS != 0, CRASH IN JOIN::OPTIMIZE_KEYUSE
+#
+CREATE TABLE t1 (a INT, b INT, PRIMARY KEY(a));
+CREATE TABLE t2 (c INT PRIMARY KEY);
+EXPLAIN SELECT 1
+FROM t1
+WHERE 1 IN (SELECT (c IS NULL) IN (SELECT a
+FROM t1
+WHERE b)
+FROM t2);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
+2 DEPENDENT SUBQUERY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
+3 DEPENDENT SUBQUERY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
+SELECT 1
+FROM t1
+WHERE 1 IN (SELECT (c IS NULL) IN (SELECT a
+FROM t1
+WHERE b)
+FROM t2);
+1
+DROP TABLE t1,t2;
+#
+# Bug #22305361: QUERY WITH MATERIALIZED TABLE RETURNS INCORRECT
+# RESULTS IN 5.6
+#
+CREATE TABLE t(a INT,b INT);
+INSERT INTO t VALUES (1,0),(1,0),(1,0),(1,0),(1,1);
+EXPLAIN extended SELECT *
+FROM t AS t1
+WHERE t1.a IN (SELECT t2.a
+FROM t AS t2
+WHERE CONCAT(t2.a,'') NOT IN (SELECT t3.a
+FROM t AS t3
+WHERE t3.b=1));
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 5 100.00 Using where
+2 SUBQUERY t2 ALL NULL NULL NULL NULL 5 100.00 Using where
+3 DEPENDENT SUBQUERY t3 ALL NULL NULL NULL NULL 5 100.00 Using where
+Warnings:
+Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t` `t1` where <in_optimizer>(`test`.`t1`.`a`,`test`.`t1`.`a` in ( <materialize> (/* select#2 */ select `test`.`t2`.`a` from `test`.`t` `t2` where (not(<in_optimizer>(concat(`test`.`t2`.`a`,''),<exists>(/* select#3 */ select 1 from `test`.`t` `t3` where ((`test`.`t3`.`b` = 1) and <if>(outer_field_is_not_null, ((<cache>(concat(`test`.`t2`.`a`,'')) = `test`.`t3`.`a`) or isnull(`test`.`t3`.`a`)), true)) having <if>(outer_field_is_not_null, <is_not_null_test>(`test`.`t3`.`a`), true))))) ), <primary_index_lookup>(`test`.`t1`.`a` in <temporary table> on <auto_key> where ((`test`.`t1`.`a` = `materialized-subquery`.`a`)))))
+SELECT *
+FROM t AS t1
+WHERE t1.a IN (SELECT t2.a
+FROM t AS t2
+WHERE CONCAT(t2.a,'') NOT IN (SELECT t3.a
+FROM t AS t3
+WHERE t3.b=1));
+a b
+DROP TABLE t;
set optimizer_switch=default;
# End of test for Bug#21184091
set @@optimizer_switch=@old_opt_switch;
# End of 5.6 tests
+# Bug#21139722: Assertion failed: !(used_tables() & ((table_map) 1) ...
+CREATE TABLE t1(a INTEGER) engine=innodb;
+CREATE TABLE t2(b INTEGER) engine=innodb;
+explain SELECT 1
+FROM (SELECT 1 IN (SELECT 1
+FROM t1
+WHERE (SELECT 1 FROM t2 HAVING b) NOT IN (SELECT 1 FROM t2)
+)
+FROM t2
+) AS z;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY <derived2> ALL NULL NULL NULL NULL 2 NULL
+2 DERIVED t2 ALL NULL NULL NULL NULL 1 NULL
+3 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL 1 Using where
+5 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 1 Using where
+4 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 1 NULL
+SELECT 1
+FROM (SELECT 1 IN (SELECT 1
+FROM t1
+WHERE (SELECT 1 FROM t2 HAVING b) NOT IN (SELECT 1 FROM t2)
+)
+FROM t2
+) AS z;
+1
+DROP TABLE t1, t2;
+CREATE TABLE t1(a INTEGER) engine=innodb;
+explain SELECT (SELECT a
+FROM t1 AS t2
+WHERE a IN (SELECT t1.a+t2.a
+FROM t1 AS t3))
+FROM t1 AS t1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 1 NULL
+2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 1 Using where
+3 DEPENDENT SUBQUERY t3 ALL NULL NULL NULL NULL 1 Using where
+SELECT (SELECT a
+FROM t1 AS t2
+WHERE a IN (SELECT t1.a+t2.a
+FROM t1 AS t3))
+FROM t1 AS t1;
+(SELECT a
+FROM t1 AS t2
+WHERE a IN (SELECT t1.a+t2.a
+FROM t1 AS t3))
+DROP TABLE t1;
+# End of test for Bug#21139722
+#
+# Bug#21139402 ASSERTION FAILED: LENGTH > 0 && KEYPARTS != 0, CRASH IN JOIN::OPTIMIZE_KEYUSE
+#
+CREATE TABLE t1 (a INT, b INT, PRIMARY KEY(a));
+CREATE TABLE t2 (c INT PRIMARY KEY);
+EXPLAIN SELECT 1
+FROM t1
+WHERE 1 IN (SELECT (c IS NULL) IN (SELECT a
+FROM t1
+WHERE b)
+FROM t2);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
+2 DEPENDENT SUBQUERY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
+3 DEPENDENT SUBQUERY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
+SELECT 1
+FROM t1
+WHERE 1 IN (SELECT (c IS NULL) IN (SELECT a
+FROM t1
+WHERE b)
+FROM t2);
+1
+DROP TABLE t1,t2;
+#
+# Bug #22305361: QUERY WITH MATERIALIZED TABLE RETURNS INCORRECT
+# RESULTS IN 5.6
+#
+CREATE TABLE t(a INT,b INT);
+INSERT INTO t VALUES (1,0),(1,0),(1,0),(1,0),(1,1);
+EXPLAIN extended SELECT *
+FROM t AS t1
+WHERE t1.a IN (SELECT t2.a
+FROM t AS t2
+WHERE CONCAT(t2.a,'') NOT IN (SELECT t3.a
+FROM t AS t3
+WHERE t3.b=1));
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 5 100.00 Using where
+2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 5 100.00 Using where
+3 DEPENDENT SUBQUERY t3 ALL NULL NULL NULL NULL 5 100.00 Using where
+Warnings:
+Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t` `t1` where <in_optimizer>(`test`.`t1`.`a`,<exists>(/* select#2 */ select 1 from `test`.`t` `t2` where ((not(<in_optimizer>(concat(`test`.`t2`.`a`,''),<exists>(/* select#3 */ select 1 from `test`.`t` `t3` where ((`test`.`t3`.`b` = 1) and <if>(outer_field_is_not_null, ((<cache>(concat(`test`.`t2`.`a`,'')) = `test`.`t3`.`a`) or isnull(`test`.`t3`.`a`)), true)) having <if>(outer_field_is_not_null, <is_not_null_test>(`test`.`t3`.`a`), true))))) and (<cache>(`test`.`t1`.`a`) = `test`.`t2`.`a`))))
+SELECT *
+FROM t AS t1
+WHERE t1.a IN (SELECT t2.a
+FROM t AS t2
+WHERE CONCAT(t2.a,'') NOT IN (SELECT t3.a
+FROM t AS t3
+WHERE t3.b=1));
+a b
+DROP TABLE t;
set optimizer_switch=default;
# End of test for Bug#21184091
set @@optimizer_switch=@old_opt_switch;
# End of 5.6 tests
+# Bug#21139722: Assertion failed: !(used_tables() & ((table_map) 1) ...
+CREATE TABLE t1(a INTEGER) engine=innodb;
+CREATE TABLE t2(b INTEGER) engine=innodb;
+explain SELECT 1
+FROM (SELECT 1 IN (SELECT 1
+FROM t1
+WHERE (SELECT 1 FROM t2 HAVING b) NOT IN (SELECT 1 FROM t2)
+)
+FROM t2
+) AS z;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY <derived2> ALL NULL NULL NULL NULL 2 NULL
+2 DERIVED t2 ALL NULL NULL NULL NULL 1 NULL
+3 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL 1 Using where
+5 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 1 Using where
+4 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 1 NULL
+SELECT 1
+FROM (SELECT 1 IN (SELECT 1
+FROM t1
+WHERE (SELECT 1 FROM t2 HAVING b) NOT IN (SELECT 1 FROM t2)
+)
+FROM t2
+) AS z;
+1
+DROP TABLE t1, t2;
+CREATE TABLE t1(a INTEGER) engine=innodb;
+explain SELECT (SELECT a
+FROM t1 AS t2
+WHERE a IN (SELECT t1.a+t2.a
+FROM t1 AS t3))
+FROM t1 AS t1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 1 NULL
+2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 1 Using where
+3 DEPENDENT SUBQUERY t3 ALL NULL NULL NULL NULL 1 Using where
+SELECT (SELECT a
+FROM t1 AS t2
+WHERE a IN (SELECT t1.a+t2.a
+FROM t1 AS t3))
+FROM t1 AS t1;
+(SELECT a
+FROM t1 AS t2
+WHERE a IN (SELECT t1.a+t2.a
+FROM t1 AS t3))
+DROP TABLE t1;
+# End of test for Bug#21139722
+#
+# Bug#21139402 ASSERTION FAILED: LENGTH > 0 && KEYPARTS != 0, CRASH IN JOIN::OPTIMIZE_KEYUSE
+#
+CREATE TABLE t1 (a INT, b INT, PRIMARY KEY(a));
+CREATE TABLE t2 (c INT PRIMARY KEY);
+EXPLAIN SELECT 1
+FROM t1
+WHERE 1 IN (SELECT (c IS NULL) IN (SELECT a
+FROM t1
+WHERE b)
+FROM t2);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
+2 DEPENDENT SUBQUERY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
+3 DEPENDENT SUBQUERY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
+SELECT 1
+FROM t1
+WHERE 1 IN (SELECT (c IS NULL) IN (SELECT a
+FROM t1
+WHERE b)
+FROM t2);
+1
+DROP TABLE t1,t2;
+#
+# Bug #22305361: QUERY WITH MATERIALIZED TABLE RETURNS INCORRECT
+# RESULTS IN 5.6
+#
+CREATE TABLE t(a INT,b INT);
+INSERT INTO t VALUES (1,0),(1,0),(1,0),(1,0),(1,1);
+EXPLAIN extended SELECT *
+FROM t AS t1
+WHERE t1.a IN (SELECT t2.a
+FROM t AS t2
+WHERE CONCAT(t2.a,'') NOT IN (SELECT t3.a
+FROM t AS t3
+WHERE t3.b=1));
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 5 100.00 Using where
+2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 5 100.00 Using where
+3 DEPENDENT SUBQUERY t3 ALL NULL NULL NULL NULL 5 100.00 Using where
+Warnings:
+Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t` `t1` where <in_optimizer>(`test`.`t1`.`a`,<exists>(/* select#2 */ select 1 from `test`.`t` `t2` where ((not(<in_optimizer>(concat(`test`.`t2`.`a`,''),<exists>(/* select#3 */ select 1 from `test`.`t` `t3` where ((`test`.`t3`.`b` = 1) and <if>(outer_field_is_not_null, ((<cache>(concat(`test`.`t2`.`a`,'')) = `test`.`t3`.`a`) or isnull(`test`.`t3`.`a`)), true)) having <if>(outer_field_is_not_null, <is_not_null_test>(`test`.`t3`.`a`), true))))) and (<cache>(`test`.`t1`.`a`) = `test`.`t2`.`a`))))
+SELECT *
+FROM t AS t1
+WHERE t1.a IN (SELECT t2.a
+FROM t AS t2
+WHERE CONCAT(t2.a,'') NOT IN (SELECT t3.a
+FROM t AS t3
+WHERE t3.b=1));
+a b
+DROP TABLE t;
set optimizer_switch=default;
set optimizer_switch=default;
# End of test for Bug#21184091
set @@optimizer_switch=@old_opt_switch;
# End of 5.6 tests
+# Bug#21139722: Assertion failed: !(used_tables() & ((table_map) 1) ...
+CREATE TABLE t1(a INTEGER) engine=innodb;
+CREATE TABLE t2(b INTEGER) engine=innodb;
+explain SELECT 1
+FROM (SELECT 1 IN (SELECT 1
+FROM t1
+WHERE (SELECT 1 FROM t2 HAVING b) NOT IN (SELECT 1 FROM t2)
+)
+FROM t2
+) AS z;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY <derived2> ALL NULL NULL NULL NULL 2 NULL
+2 DERIVED t2 ALL NULL NULL NULL NULL 1 NULL
+3 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL 1 Using where
+5 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 1 Using where
+4 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 1 NULL
+SELECT 1
+FROM (SELECT 1 IN (SELECT 1
+FROM t1
+WHERE (SELECT 1 FROM t2 HAVING b) NOT IN (SELECT 1 FROM t2)
+)
+FROM t2
+) AS z;
+1
+DROP TABLE t1, t2;
+CREATE TABLE t1(a INTEGER) engine=innodb;
+explain SELECT (SELECT a
+FROM t1 AS t2
+WHERE a IN (SELECT t1.a+t2.a
+FROM t1 AS t3))
+FROM t1 AS t1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 1 NULL
+2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 1 Using where
+3 DEPENDENT SUBQUERY t3 ALL NULL NULL NULL NULL 1 Using where
+SELECT (SELECT a
+FROM t1 AS t2
+WHERE a IN (SELECT t1.a+t2.a
+FROM t1 AS t3))
+FROM t1 AS t1;
+(SELECT a
+FROM t1 AS t2
+WHERE a IN (SELECT t1.a+t2.a
+FROM t1 AS t3))
+DROP TABLE t1;
+# End of test for Bug#21139722
+#
+# Bug#21139402 ASSERTION FAILED: LENGTH > 0 && KEYPARTS != 0, CRASH IN JOIN::OPTIMIZE_KEYUSE
+#
+CREATE TABLE t1 (a INT, b INT, PRIMARY KEY(a));
+CREATE TABLE t2 (c INT PRIMARY KEY);
+EXPLAIN SELECT 1
+FROM t1
+WHERE 1 IN (SELECT (c IS NULL) IN (SELECT a
+FROM t1
+WHERE b)
+FROM t2);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
+2 DEPENDENT SUBQUERY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
+3 DEPENDENT SUBQUERY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
+SELECT 1
+FROM t1
+WHERE 1 IN (SELECT (c IS NULL) IN (SELECT a
+FROM t1
+WHERE b)
+FROM t2);
+1
+DROP TABLE t1,t2;
+#
+# Bug #22305361: QUERY WITH MATERIALIZED TABLE RETURNS INCORRECT
+# RESULTS IN 5.6
+#
+CREATE TABLE t(a INT,b INT);
+INSERT INTO t VALUES (1,0),(1,0),(1,0),(1,0),(1,1);
+EXPLAIN extended SELECT *
+FROM t AS t1
+WHERE t1.a IN (SELECT t2.a
+FROM t AS t2
+WHERE CONCAT(t2.a,'') NOT IN (SELECT t3.a
+FROM t AS t3
+WHERE t3.b=1));
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 5 100.00 Using where
+2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 5 100.00 Using where
+3 DEPENDENT SUBQUERY t3 ALL NULL NULL NULL NULL 5 100.00 Using where
+Warnings:
+Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t` `t1` where <in_optimizer>(`test`.`t1`.`a`,<exists>(/* select#2 */ select 1 from `test`.`t` `t2` where ((not(<in_optimizer>(concat(`test`.`t2`.`a`,''),<exists>(/* select#3 */ select 1 from `test`.`t` `t3` where ((`test`.`t3`.`b` = 1) and <if>(outer_field_is_not_null, ((<cache>(concat(`test`.`t2`.`a`,'')) = `test`.`t3`.`a`) or isnull(`test`.`t3`.`a`)), true)) having <if>(outer_field_is_not_null, <is_not_null_test>(`test`.`t3`.`a`), true))))) and (<cache>(`test`.`t1`.`a`) = `test`.`t2`.`a`))))
+SELECT *
+FROM t AS t1
+WHERE t1.a IN (SELECT t2.a
+FROM t AS t2
+WHERE CONCAT(t2.a,'') NOT IN (SELECT t3.a
+FROM t AS t3
+WHERE t3.b=1));
+a b
+DROP TABLE t;
set optimizer_switch=default;
set optimizer_switch=default;
# End of test for Bug#21184091
set @@optimizer_switch=@old_opt_switch;
# End of 5.6 tests
+# Bug#21139722: Assertion failed: !(used_tables() & ((table_map) 1) ...
+CREATE TABLE t1(a INTEGER) engine=innodb;
+CREATE TABLE t2(b INTEGER) engine=innodb;
+explain SELECT 1
+FROM (SELECT 1 IN (SELECT 1
+FROM t1
+WHERE (SELECT 1 FROM t2 HAVING b) NOT IN (SELECT 1 FROM t2)
+)
+FROM t2
+) AS z;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY <derived2> ALL NULL NULL NULL NULL 2 NULL
+2 DERIVED t2 ALL NULL NULL NULL NULL 1 NULL
+3 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL 1 Using where
+5 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 1 Using where
+4 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 1 NULL
+SELECT 1
+FROM (SELECT 1 IN (SELECT 1
+FROM t1
+WHERE (SELECT 1 FROM t2 HAVING b) NOT IN (SELECT 1 FROM t2)
+)
+FROM t2
+) AS z;
+1
+DROP TABLE t1, t2;
+CREATE TABLE t1(a INTEGER) engine=innodb;
+explain SELECT (SELECT a
+FROM t1 AS t2
+WHERE a IN (SELECT t1.a+t2.a
+FROM t1 AS t3))
+FROM t1 AS t1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 1 NULL
+2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 1 Using where
+3 DEPENDENT SUBQUERY t3 ALL NULL NULL NULL NULL 1 Using where
+SELECT (SELECT a
+FROM t1 AS t2
+WHERE a IN (SELECT t1.a+t2.a
+FROM t1 AS t3))
+FROM t1 AS t1;
+(SELECT a
+FROM t1 AS t2
+WHERE a IN (SELECT t1.a+t2.a
+FROM t1 AS t3))
+DROP TABLE t1;
+# End of test for Bug#21139722
+#
+# Bug#21139402 ASSERTION FAILED: LENGTH > 0 && KEYPARTS != 0, CRASH IN JOIN::OPTIMIZE_KEYUSE
+#
+CREATE TABLE t1 (a INT, b INT, PRIMARY KEY(a));
+CREATE TABLE t2 (c INT PRIMARY KEY);
+EXPLAIN SELECT 1
+FROM t1
+WHERE 1 IN (SELECT (c IS NULL) IN (SELECT a
+FROM t1
+WHERE b)
+FROM t2);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
+2 DEPENDENT SUBQUERY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
+3 DEPENDENT SUBQUERY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
+SELECT 1
+FROM t1
+WHERE 1 IN (SELECT (c IS NULL) IN (SELECT a
+FROM t1
+WHERE b)
+FROM t2);
+1
+DROP TABLE t1,t2;
+#
+# Bug #22305361: QUERY WITH MATERIALIZED TABLE RETURNS INCORRECT
+# RESULTS IN 5.6
+#
+CREATE TABLE t(a INT,b INT);
+INSERT INTO t VALUES (1,0),(1,0),(1,0),(1,0),(1,1);
+EXPLAIN extended SELECT *
+FROM t AS t1
+WHERE t1.a IN (SELECT t2.a
+FROM t AS t2
+WHERE CONCAT(t2.a,'') NOT IN (SELECT t3.a
+FROM t AS t3
+WHERE t3.b=1));
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 5 100.00 Using where
+2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 5 100.00 Using where
+3 DEPENDENT SUBQUERY t3 ALL NULL NULL NULL NULL 5 100.00 Using where
+Warnings:
+Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t` `t1` where <in_optimizer>(`test`.`t1`.`a`,<exists>(/* select#2 */ select 1 from `test`.`t` `t2` where ((not(<in_optimizer>(concat(`test`.`t2`.`a`,''),<exists>(/* select#3 */ select 1 from `test`.`t` `t3` where ((`test`.`t3`.`b` = 1) and <if>(outer_field_is_not_null, ((<cache>(concat(`test`.`t2`.`a`,'')) = `test`.`t3`.`a`) or isnull(`test`.`t3`.`a`)), true)) having <if>(outer_field_is_not_null, <is_not_null_test>(`test`.`t3`.`a`), true))))) and (<cache>(`test`.`t1`.`a`) = `test`.`t2`.`a`))))
+SELECT *
+FROM t AS t1
+WHERE t1.a IN (SELECT t2.a
+FROM t AS t2
+WHERE CONCAT(t2.a,'') NOT IN (SELECT t3.a
+FROM t AS t3
+WHERE t3.b=1));
+a b
+DROP TABLE t;
set optimizer_switch=default;
set optimizer_switch=default;
--- /dev/null
+#
+# Bug #20085672: CRYPTIC ERROR WHEN FAILING TO UNLOAD A DYNAMIC LIBRARY
+#
+# Install the plugin
+INSTALL PLUGIN test_udf_services SONAME 'TESTUDFSERVICES';
+# Define the function
+CREATE FUNCTION test_udf_services_udf RETURNS INT
+SONAME "TESTUDFSERVICES";
+# Uninstall the plugin
+UNINSTALL PLUGIN test_udf_services;
+# Install the plugin again. Should not fail
+INSTALL PLUGIN test_udf_services SONAME 'TESTUDFSERVICES';
+# Cleanup
+DROP FUNCTION test_udf_services_udf;
+UNINSTALL PLUGIN test_udf_services;
# cleanup
DROP USER 'user1'@'localhost', 'user2'@'localhost';
SET @@global.validate_password_policy=DEFAULT;
+#
+# Bug#21616496: CREATE USER ACCEPTS PLUGIN AND PASSWORD HASH,
+# BUT IGNORES THE PASSWORD HASH
+#
+CREATE USER 'user1'@'localhost' IDENTIFIED WITH 'mysql_native_password';
+ERROR HY000: Your password does not satisfy the current policy requirements
+CREATE USER 'user1'@'localhost' IDENTIFIED WITH 'mysql_old_password';
+ERROR HY000: Your password does not satisfy the current policy requirements
+CREATE USER 'user1'@'localhost' IDENTIFIED WITH 'mysql_native_password' AS '*0D3CED9BEC10A777AEC23CCC353A8C08A633045E';
+ERROR HY000: Your password does not satisfy the current policy requirements
+CREATE USER 'user1'@'localhost' IDENTIFIED WITH 'mysql_old_password' AS '*0D3CED9BEC10A777AEC23CCC353A8C08A633045E';
+ERROR HY000: Your password does not satisfy the current policy requirements
# clean up after the test
UNINSTALL PLUGIN validate_password;
End of tests
--- /dev/null
+#
+# Bug #23747899: @@basedir sysvar value not normalized if set through
+# the command line/ini file
+# There should be no slashes in @@basedir and just backslashes
+# since it's normalized
+SELECT
+LOCATE('/', @@basedir) <> 0 AS have_slashes,
+LOCATE('\\', @@basedir) <> 0 AS have_backslashes;
+have_slashes have_backslashes
+0 1
+End of the 5.6 tests
--- /dev/null
+Ã\83"RT @niouzechun: é\81\98â\88\9aõ\80\81®ç¹\9dä¸\8aã\83£ç¹\9dæ\96\90õ\80\87³ç¹§ï½¨ç¹\9dï½³ç¹\9dç\89\99è\80³ç¸ºï½ªç¹§è\96\99â\96¡ç¸ºä»£ï½\8c縺ゥ縲â\88\9aã\81\84ç¹\9dï½³ç¹\9dä¸\8aã\83£ç¹\9dæ\96\90õ\80\87³ç¹§ï½¨ç¹\9dï½³ç¹\9d峨ï½\84è« ï½¨è\9c\89õ\80\94\8eå\99ªç¸ºï½ªç¸ºé¡\98ゥア繧å\81µâ\89 縺セ繧é¡\94ゥè\82´ï½¥ï½µé\80§õ\80\8b\96â\86\93é\9e«ã\82\87å\8f\99縺å\8a±â\86\91縺õ\80\8b\9aç\82\8aé\80\95ア縺ッ縲â\88«æ¨\9fè\9e³æº\98õ\80\81è\8e コé\80\95æº\98õ\80\81®è\9d\93コè\9bャé\80§õ\80\8b\96â\86\93縺õ\80\91\8eâ\88ªç¸ºä¸\8aï¼\9e縺ä¹\9dâ\86\91縺õ\80\8b\96ï¼ è\8d³æ¦\8aケウé\81²å³¨â\96¡ç¸ºç¤¼ç\82\8aè\8d³æ¦\8aース縺 縺è\8b\93ï½¾å¸\99ï¼\9e
--- /dev/null
+DROP TABLE IF EXISTS t1 ;
+# READ_ONLY does nothing to SUPER users
+# so we use a non-SUPER one:
+GRANT CREATE, SELECT, DROP ON *.* TO test@localhost;
+connect con1,localhost,test,,test;
+connection default;
+SET GLOBAL READ_ONLY=1;
+connection con1;
+CREATE TEMPORARY TABLE t1 (a INT) ENGINE=INNODB;
+# Test INSERTS with autocommit being off and on.
+BEGIN;
+INSERT INTO t1 VALUES (10);
+COMMIT;
+INSERT INTO t1 VALUES (20);
+# Test UPDATES with autocommit being off and on.
+BEGIN;
+UPDATE t1 SET a=30 WHERE a=10;
+COMMIT;
+UPDATE t1 SET a=40 WHERE a=20;
+connection default;
+SET GLOBAL READ_ONLY=0;
+# Test scenario where global read_only is enabled in the middle of transaction.
+# Test INSERT operations on temporary tables, INSERTs should be successful even
+# when global read_only is enabled.
+connection con1;
+BEGIN;
+INSERT INTO t1 VALUES(50);
+connection default;
+SET GLOBAL READ_ONLY=1;
+connection con1;
+SELECT @@GLOBAL.READ_ONLY;
+@@GLOBAL.READ_ONLY
+1
+COMMIT;
+connection default;
+SET GLOBAL READ_ONLY=0;
+# Test UPDATE operations on temporary tables, UPDATEs should be successful even
+# when global read_only is enabled.
+connection con1;
+BEGIN;
+UPDATE t1 SET a=60 WHERE a=50;
+connection default;
+SET GLOBAL READ_ONLY=1;
+connection con1;
+SELECT @@GLOBAL.READ_ONLY;
+@@GLOBAL.READ_ONLY
+1
+COMMIT;
+SELECT * FROM t1;
+a
+30
+40
+60
+# Clean up
+connection default;
+SET GLOBAL READ_ONLY=0;
+disconnect con1;
+DROP USER test@localhost;
master-bin.000018 #
master-bin.000019 #
master-bin.000020 #
+# Test case11: Bug #20381055SERVER CRASHES IF INDEX FILE IS OPENED BY
+SET SESSION debug="d,force_index_file_delete_failure";
+call mtr.add_suppression("Failed to delete the existing index file");
+call mtr.add_suppression("failed to move crash safe index file to index file");
+call mtr.add_suppression("failed to update the index file");
+PURGE BINARY LOGS TO 'master-bin.000014';;
+ERROR HY000: I/O error reading log index file
+# Test the index file is complete, although is not purged successfully.
+# Also this will indicate that binary logging is not disabled.
+show binary logs;
+Log_name File_size
+master-bin.000012 #
+master-bin.000013 #
+master-bin.000014 #
+master-bin.000015 #
+master-bin.000016 #
+master-bin.000017 #
+master-bin.000018 #
+master-bin.000019 #
+master-bin.000020 #
+SET GLOBAL binlog_error_action='IGNORE_ERROR';
+FLUSH LOGS;
+ERROR HY000: Can't open file: 'master-bin.000021' (errno: 1 - Operation not permitted)
+SHOW BINARY LOGS;
+ERROR HY000: You are not using binary logging
+show binary logs;
+Log_name File_size
+master-bin.000012 #
+master-bin.000013 #
+master-bin.000014 #
+master-bin.000015 #
+master-bin.000016 #
+master-bin.000017 #
+master-bin.000018 #
+master-bin.000019 #
+master-bin.000020 #
+master-bin.000021 #
+CREATE TABLE t1(i INT);
+SET GLOBAL binlog_error_action='IGNORE_ERROR';
+SET SESSION debug="+d,force_index_file_delete_failure";
+SET SESSION debug="+d,force_rotate";
+INSERT INTO t1 VALUES (12);
+ERROR HY000: Can't open file: 'master-bin.000022' (errno: 1 - Operation not permitted)
+SHOW BINARY LOGS;
+ERROR HY000: You are not using binary logging
+show binary logs;
+Log_name File_size
+master-bin.000012 #
+master-bin.000013 #
+master-bin.000014 #
+master-bin.000015 #
+master-bin.000016 #
+master-bin.000017 #
+master-bin.000018 #
+master-bin.000019 #
+master-bin.000020 #
+master-bin.000021 #
+master-bin.000022 #
+DROP TABLE t1;
+# Test case11: Ends
SET SESSION debug="";
End of tests
*** a proof the query is binlogged with an error ***
select
(@a:=load_file("MYSQLTEST_VARDIR/tmp/binlog_killed_bug27571.binlog"))
-is not null;
-(@a:=load_file("MYSQLTEST_VARDIR/tmp/binlog_killed_bug27571.binlog"))
-is not null
+is not null AS Loaded;
+Loaded
1
select 0 /* must return 0 to mean the killed update is in */;
0
master-bin.000001 # Query # # COMMIT
select
(@a:=load_file("MYSQLTEST_VARDIR/tmp/binlog_killed_bug27571.binlog"))
-is not null;
-(@a:=load_file("MYSQLTEST_VARDIR/tmp/binlog_killed_bug27571.binlog"))
-is not null
+is not null AS Loaded;
+Loaded
1
select 0 /* must return 0 to mean the killed delete is in */;
0
update t1 set a=2 /* will be "killed" after work has been done */;
select
(@a:=load_file("MYSQLTEST_VARDIR/tmp/binlog_killed_bug27571.binlog"))
-is not null;
-(@a:=load_file("MYSQLTEST_VARDIR/tmp/binlog_killed_bug27571.binlog"))
-is not null
+is not null AS Loaded;
+Loaded
1
select 1 /* must return 1 as query completed before got killed*/;
1
master-bin.000001 # Query # # COMMIT
select
(@a:=load_file("MYSQLTEST_VARDIR/tmp/binlog_killed_bug27571.binlog"))
-is not null;
-(@a:=load_file("MYSQLTEST_VARDIR/tmp/binlog_killed_bug27571.binlog"))
-is not null
+is not null AS Loaded;
+Loaded
1
select 0 /* must return 0 to mean the killed query is in */;
0
Check Result
select
(@a:=load_file("MYSQLTEST_VARDIR/tmp/mysqlbinlog_bug39526.binlog"))
-is not null;
-(@a:=load_file("MYSQLTEST_VARDIR/tmp/mysqlbinlog_bug39526.binlog"))
-is not null
+is not null AS Loaded;
+Loaded
1
*** String sql_mode=0 is found: 0 ***
Clean Up
flush logs;
select
(@a:=load_file("MYSQLTEST_VARDIR/tmp/mix_innodb_myisam_binlog.output"))
-is not null;
-(@a:=load_file("MYSQLTEST_VARDIR/tmp/mix_innodb_myisam_binlog.output"))
-is not null
+is not null AS Loaded;
+Loaded
1
select
@a like "%#%error_code=0%ROLLBACK\n/*!*/;%ROLLBACK /* added by mysqlbinlog */;%" OR
--- /dev/null
+# ==== Purpose ====
+#
+# Check that DMLs are allowed on temporary tables, when server is in read only
+# mode and binary log is enabled with binlog-format being stmt/mixed mode.
+#
+# ==== Implementation ====
+#
+# Start the server with binary log being enabled. Mark the server as read only.
+# Create a non-SUPER user and let the user to create a temporary table and
+# perform DML operations on that temporary table. DMLs should not be blocked
+# with a 'server read-only mode' error.
+#
+# ==== References ====
+#
+# Bug#12818255: READ-ONLY OPTION DOES NOT ALLOW INSERTS/UPDATES ON TEMPORARY
+# TABLES
+# Bug#14294223: CHANGES NOT ALLOWED TO TEMPORARY TABLES ON READ-ONLY SERVERS
+###############################################################################
+--source include/have_log_bin.inc
+--disable_warnings
+DROP TABLE IF EXISTS t1 ;
+--enable_warnings
+
+--enable_connect_log
+--echo # READ_ONLY does nothing to SUPER users
+--echo # so we use a non-SUPER one:
+GRANT CREATE, SELECT, DROP ON *.* TO test@localhost;
+
+connect (con1,localhost,test,,test);
+
+connection default;
+SET GLOBAL READ_ONLY=1;
+
+connection con1;
+CREATE TEMPORARY TABLE t1 (a INT) ENGINE=INNODB;
+
+--echo # Test INSERTS with autocommit being off and on.
+BEGIN;
+INSERT INTO t1 VALUES (10);
+COMMIT;
+INSERT INTO t1 VALUES (20);
+
+--echo # Test UPDATES with autocommit being off and on.
+BEGIN;
+UPDATE t1 SET a=30 WHERE a=10;
+COMMIT;
+UPDATE t1 SET a=40 WHERE a=20;
+
+connection default;
+SET GLOBAL READ_ONLY=0;
+
+--echo # Test scenario where global read_only is enabled in the middle of transaction.
+--echo # Test INSERT operations on temporary tables, INSERTs should be successful even
+--echo # when global read_only is enabled.
+connection con1;
+BEGIN;
+INSERT INTO t1 VALUES(50);
+
+connection default;
+SET GLOBAL READ_ONLY=1;
+
+connection con1;
+SELECT @@GLOBAL.READ_ONLY;
+COMMIT;
+
+connection default;
+SET GLOBAL READ_ONLY=0;
+
+--echo # Test UPDATE operations on temporary tables, UPDATEs should be successful even
+--echo # when global read_only is enabled.
+connection con1;
+BEGIN;
+UPDATE t1 SET a=60 WHERE a=50;
+
+connection default;
+SET GLOBAL READ_ONLY=1;
+
+connection con1;
+SELECT @@GLOBAL.READ_ONLY;
+COMMIT;
+
+SELECT * FROM t1;
+
+--echo # Clean up
+connection default;
+SET GLOBAL READ_ONLY=0;
+
+disconnect con1;
+DROP USER test@localhost;
+--disable_connect_log
file_exists $MYSQLD_DATADIR/master-bin.000013;
file_exists $MYSQLD_DATADIR/master-bin.000014;
-eval SET SESSION debug="$old";
+-- echo # Test case11: Bug #20381055SERVER CRASHES IF INDEX FILE IS OPENED BY
+ # OTHER APPLICATION AND PURGE IS ISSUED.
+ # This test case test the server behaviour if index file cannot be
+ # deleted.
+SET SESSION debug="d,force_index_file_delete_failure";
+
+# Add supressions
+call mtr.add_suppression("Failed to delete the existing index file");
+call mtr.add_suppression("failed to move crash safe index file to index file");
+call mtr.add_suppression("failed to update the index file");
+
+# When index file cannot be recreated during purge binary logs command,
+# it should throw error but it should not disable binary logging.
+-- error ER_IO_ERR_LOG_INDEX_READ
+-- eval PURGE BINARY LOGS TO 'master-bin.000014';
+
+-- echo # Test the index file is complete, although is not purged successfully.
+-- echo # Also this will indicate that binary logging is not disabled.
+-- source include/show_binary_logs.inc
+file_exists $MYSQLD_DATADIR/master-bin.000012;
+file_exists $MYSQLD_DATADIR/master-bin.000013;
+file_exists $MYSQLD_DATADIR/master-bin.000014;
+
+# When index file cannot be recreated during FLUSH LOGS command,
+# it should throw error and binary logging should be disabled.
+SET GLOBAL binlog_error_action='IGNORE_ERROR';
+# normalize strerror message for solaris10-sparc-64bit as long as errno is OK
+--replace_regex /\.[\\\/]master/master/ /errno: 1 - .*\)/errno: 1 - Operation not permitted)/
+--error ER_CANT_OPEN_FILE
+FLUSH LOGS;
+--error ER_NO_BINARY_LOGGING
+SHOW BINARY LOGS;
+--source include/restart_mysqld.inc
+-- source include/show_binary_logs.inc
+CREATE TABLE t1(i INT);
+SET GLOBAL binlog_error_action='IGNORE_ERROR';
+SET SESSION debug="+d,force_index_file_delete_failure";
+SET SESSION debug="+d,force_rotate";
+
+# When index file cannot be recreated during DML command which
+# is trying to rotate the binary log, it should throw error and
+# binary logging should be disabled.
+# normalize strerror message for solaris10-sparc-64bit as long as errno is OK
+--replace_regex /\.[\\\/]master/master/ /errno: 1 - .*\)/errno: 1 - Operation not permitted)/
+--error ER_CANT_OPEN_FILE
+INSERT INTO t1 VALUES (12);
+
+--error ER_NO_BINARY_LOGGING
+SHOW BINARY LOGS;
+
+--source include/restart_mysqld.inc
+-- source include/show_binary_logs.inc
+DROP TABLE t1;
+-- echo # Test case11: Ends
+
+eval SET SESSION debug="$old";
--echo End of tests
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
eval select
(@a:=load_file("$MYSQLTEST_VARDIR/tmp/binlog_killed_bug27571.binlog"))
-is not null;
+is not null AS Loaded;
--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR
let $error_code= `select @a like "%#%error_code=0%" /* must return 0*/`;
eval select $error_code /* must return 0 to mean the killed update is in */;
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
eval select
(@a:=load_file("$MYSQLTEST_VARDIR/tmp/binlog_killed_bug27571.binlog"))
-is not null;
+is not null AS Loaded;
--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR
let $error_code= `select @a like "%#%error_code=0%" /* must return 0*/`;
eval select $error_code /* must return 0 to mean the killed delete is in */;
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
eval select
(@a:=load_file("$MYSQLTEST_VARDIR/tmp/binlog_killed_bug27571.binlog"))
-is not null;
+is not null AS Loaded;
--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR
let $error_code= `select @a like "%#%error_code=0%" /* must return 1 */`;
eval select $error_code /* must return 1 as query completed before got killed*/;
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
eval select
(@a:=load_file("$MYSQLTEST_VARDIR/tmp/binlog_killed_bug27571.binlog"))
-is not null;
+is not null AS Loaded;
--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR
let $error_code= `select @a like "%#%error_code=0%" /* must return 0*/`;
eval select $error_code /* must return 0 to mean the killed query is in */;
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
eval select
(@a:=load_file("$MYSQLTEST_VARDIR/tmp/mysqlbinlog_bug39526.binlog"))
-is not null;
+is not null AS Loaded;
let $s_mode_unsigned= `select @a like "%@@session.sql_mode=0%" /* must return 0 */`;
echo *** String sql_mode=0 is found: $s_mode_unsigned ***;
wsrep_provider=@ENV.WSREP_PROVIDER
wsrep_cluster_address='gcomm://'
-wsrep_provider_options='repl.causal_read_timeout=PT90S;base_port=@mysqld.1.#galera_port'
+wsrep_provider_options='repl.causal_read_timeout=PT90S;base_port=@mysqld.1.#galera_port;evs.suspect_timeout=PT10S'
# enforce read-committed characteristics across the cluster
wsrep_causal_reads=ON
wsrep_provider=@ENV.WSREP_PROVIDER
wsrep_cluster_address='gcomm://127.0.0.1:@mysqld.1.#galera_port'
-wsrep_provider_options='repl.causal_read_timeout=PT90S;base_port=@mysqld.2.#galera_port'
+wsrep_provider_options='repl.causal_read_timeout=PT90S;base_port=@mysqld.2.#galera_port;evs.suspect_timeout=PT10S'
# enforce read-committed characteristics across the cluster
wsrep_causal_reads=ON
--- /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 = 7
+
+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 = 7
+
+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 = 7
+
+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 = 7
+
+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
--- /dev/null
+SET GLOBAL wsrep_provider_options = 'pc.ignore_sb=true';
+SET @@global.wsrep_desync = 1;
+SET SESSION wsrep_sync_wait=0;
+SET GLOBAL wsrep_provider_options = 'gmcast.isolate=1';
+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY, f2 CHAR(1));
+SET GLOBAL wsrep_provider_options = 'gmcast.isolate=0';
+SHOW STATUS LIKE 'wsrep_desync_count';
+Variable_name Value
+wsrep_desync_count 0
+SET @@global.wsrep_desync = 0;
+SET SESSION wsrep_sync_wait=7;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `f1` int(11) NOT NULL,
+ `f2` char(1) DEFAULT NULL,
+ PRIMARY KEY (`f1`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+DROP TABLE t1;
+CALL mtr.add_suppression("WSREP: Protocol violation. JOIN message sender (.*) is not in state transfer \\(SYNCED\\). Message ignored.");
+SET GLOBAL wsrep_provider_options = 'pc.ignore_sb=false';
--- /dev/null
+CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB;
+SET GLOBAL wsrep_provider_options='gmcast.isolate=1';
+SET SESSION wsrep_on = OFF;
+SET SESSION wsrep_on = ON;
+START SLAVE USER='root';
+Warnings:
+Note 1759 Sending passwords in plain text without SSL/TLS is extremely insecure.
+include/wait_for_slave_param.inc [Slave_IO_Running]
+SET GLOBAL wsrep_provider_options='gmcast.isolate=0';
+include/wait_for_slave_to_start.inc
+INSERT INTO t1 VALUES (1);
+DROP TABLE t1;
+STOP SLAVE;
+RESET SLAVE ALL;
+CALL mtr.add_suppression('failed registering on master');
--- /dev/null
+CREATE TABLE parent1 ( id INT PRIMARY KEY, KEY (id) ) ENGINE=InnoDB;
+CREATE TABLE parent2 ( id INT PRIMARY KEY, KEY (id) ) ENGINE=InnoDB;
+CREATE TABLE child (
+id INT PRIMARY KEY,
+parent1_id INT,
+parent2_id INT,
+FOREIGN KEY (parent1_id) REFERENCES parent1(id),
+FOREIGN KEY (parent1_id) REFERENCES parent2(id)
+) ENGINE=InnoDB;
+INSERT INTO parent1 VALUES (1);
+INSERT INTO parent2 VALUES (1);
+INSERT INTO child VALUES (1,1,1);
+INSERT INTO child VALUES (2,1,1);
+SET foreign_key_checks=OFF;
+DROP TABLE parent1;
+UPDATE child SET parent1_id=2 WHERE id=1;
+DROP TABLE child;
+DROP TABLE parent2;
+SET foreign_key_checks=ON;
--- /dev/null
+CREATE TABLE ten (f1 INTEGER);
+INSERT INTO ten VALUES (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
+CREATE TABLE t1 (f1 INTEGER) Engine=InnoDB;
+INSERT INTO t1 (f1) SELECT 000000 + (10000 * a1.f1) + (1000 * a2.f1) + (100 * a3.f1) + (10 * a4.f1) + a5.f1 FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4, ten AS a5;
+INSERT INTO t1 (f1) SELECT 100000 + (10000 * a1.f1) + (1000 * a2.f1) + (100 * a3.f1) + (10 * a4.f1) + a5.f1 FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4, ten AS a5;;
+SET GLOBAL wsrep_desync = TRUE;
+SET wsrep_on = FALSE;
+ALTER TABLE t1 ADD PRIMARY KEY (f1);
+ERROR 70100: Query execution was interrupted
+SET wsrep_on = TRUE;
+SET GLOBAL wsrep_desync = FALSE;
+DROP TABLE t1;
+DROP TABLE ten;
--- /dev/null
+CREATE TABLE rand_table (f1 FLOAT);
+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY, f2 CHAR(1));
+INSERT INTO t1 VALUES (1, 'a');
+INSERT INTO t1 VALUES (2, 'a');
+SET AUTOCOMMIT=ON;
+START TRANSACTION;
+UPDATE t1 SET f2 = 'b' WHERE f1 = 1;
+SELECT * FROM t1 WHERE f1 = 2 FOR UPDATE;
+f1 f2
+2 a
+SET GLOBAL wsrep_provider_options = 'dbug=d,commit_monitor_enter_sync';
+COMMIT;;
+SET SESSION wsrep_sync_wait = 0;
+SET SESSION wsrep_on = 0;
+SET SESSION wsrep_on = 1;
+UPDATE t1 SET f2 = 'c' WHERE f1 = 2;
+SET GLOBAL wsrep_provider_options = 'dbug=';
+SET GLOBAL wsrep_provider_options = 'signal=commit_monitor_enter_sync';
+SELECT TIMEDIFF(SYSDATE(), NOW()) < 2;
+TIMEDIFF(SYSDATE(), NOW()) < 2
+1
+INSERT INTO rand_table VALUES (RAND()),(RAND()),(RAND()),(RAND()),(RAND());
+INSERT INTO rand_table VALUES (RAND()),(RAND()),(RAND()),(RAND()),(RAND());
+SELECT COUNT(DISTINCT f1) = 10 FROM rand_table;
+COUNT(DISTINCT f1) = 10
+1
+wsrep_local_replays
+1
+DROP TABLE t1;
+DROP TABLE rand_table;
--- /dev/null
+SAVEPOINT in a stored function should be forbidden
+CREATE FUNCTION f1 () RETURNS INT BEGIN
+SAVEPOINT s;
+RETURN 1;
+END|
+SELECT f1();
+f1()
+1
+DROP FUNCTION f1;
+ROLLBACK TO SAVEPOINT in a stored function should be forbidden
+CREATE FUNCTION f2 () RETURNS INT BEGIN
+ROLLBACK TO SAVEPOINT s;
+RETURN 1;
+END|
+BEGIN;
+SAVEPOINT s;
+SELECT f2();
+ERROR 42000: SAVEPOINT s does not exist
+COMMIT;
+DROP FUNCTION f2;
+BEGIN;
+SAVEPOINT S;
+ROLLBACK TO SAVEPOINT S;
+COMMIT;
+CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE=InnoDB;
+CREATE TABLE t2 (a INT PRIMARY KEY AUTO_INCREMENT) ENGINE=InnoDB;
+INSERT INTO t1 values (110), (111), (112), (113), (114);
+Direct SAVEPOINT in a trigger should be forbidden
+CREATE TRIGGER i1_t1 BEFORE INSERT ON t1 FOR EACH ROW SAVEPOINT s;
+INSERT INTO t1 VALUES (1);
+DROP TRIGGER i1_t1;
+CREATE TRIGGER i2_t1 AFTER INSERT ON t1 FOR EACH ROW SAVEPOINT s;
+INSERT INTO t1 VALUES (2);
+DROP TRIGGER i2_t1;
+INSERT INTO t1 VALUES (3);
+CREATE TRIGGER u1_t1 BEFORE UPDATE ON t1 FOR EACH ROW SAVEPOINT s;
+UPDATE t1 SET a=4 WHERE a=3;
+DROP TRIGGER u1_t1;
+CREATE TRIGGER u2_t1 AFTER UPDATE ON t1 FOR EACH ROW SAVEPOINT s;
+UPDATE t1 SET a=4 WHERE a=3;
+DROP TRIGGER u2_t1;
+CREATE TRIGGER d1_t1 BEFORE DELETE ON t1 FOR EACH ROW SAVEPOINT s;
+DELETE FROM t1;
+DROP TRIGGER d1_t1;
+CREATE TRIGGER d1_t1 AFTER DELETE ON t1 FOR EACH ROW SAVEPOINT s;
+DELETE FROM t1;
+DROP TRIGGER d1_t1;
+SAVEPOINT in a compound statement in a trigger should be forbidden
+CREATE TRIGGER i3_t1 BEFORE INSERT ON t1 FOR EACH ROW BEGIN
+SAVEPOINT s;
+END|
+INSERT INTO t1 VALUES (5);
+DROP TRIGGER i3_t1;
+SAVEPOINT in a PS call in a trigger should be forbidden
+CREATE TRIGGER i4_t1 BEFORE INSERT ON t1 FOR EACH ROW BEGIN
+PREPARE set_savepoint FROM "SAVEPOINT s";
+EXECUTE set_savepoint;
+DEALLOCATE PREPARE set_savepoint;
+END|
+ERROR 0A000: Dynamic SQL is not allowed in stored function or trigger
+SAVEPOINT in SP called from a trigger should be forbidden
+CREATE PROCEDURE p1() BEGIN
+SAVEPOINT s;
+END|
+CREATE TRIGGER i5_t1 BEFORE INSERT ON t1 FOR EACH ROW CALL p1;
+INSERT INTO t1 VALUES (6);
+DROP TRIGGER i5_t1;
+SAVEPOINT in a SP called from a PS called from a trigger be forbidden
+PREPARE call_p1 FROM "CALL p1";
+CREATE TRIGGER i6_t1 BEFORE INSERT ON t1 FOR EACH ROW EXECUTE call_p1;
+ERROR 0A000: Dynamic SQL is not allowed in stored function or trigger
+SAVEPOINT in a function called from a trigger should be forbidden
+CREATE FUNCTION f1 () RETURNS INT BEGIN
+SAVEPOINT s;
+RETURN 1;
+END|
+CREATE TRIGGER i7_t1 BEFORE INSERT ON t1 FOR EACH ROW SET @foo = f1();
+INSERT INTO t1 VALUES (7);
+DROP TRIGGER i7_t1;
+SAVEPOINT in a SP called from a SP called from a trigger should be forbidden
+CREATE PROCEDURE p2() BEGIN
+CALL p1();
+END|
+CREATE TRIGGER i8_t1 BEFORE INSERT ON t1 FOR EACH ROW CALL p2;
+INSERT INTO t1 VALUES (8);
+DROP TRIGGER i8_t1;
+SAVEPOINT in a SP called from a trigger called from a SP should be forbidden
+CREATE TRIGGER i9_t1 BEFORE INSERT ON t1 FOR EACH ROW CALL p1;
+CREATE PROCEDURE p3() BEGIN
+INSERT INTO t1 VALUES (9);
+END|
+CALL p3();
+DROP TRIGGER i9_t1;
+ROLLBACK TO SAVEPOINT in trigger as a trivial statement should be forbidden
+CREATE TRIGGER i4_t1 BEFORE INSERT ON t1 FOR EACH ROW ROLLBACK TO SAVEPOINT s;
+BEGIN;
+SAVEPOINT s;
+INSERT INTO t1 VALUES (5);
+ERROR 42000: SAVEPOINT s does not exist
+COMMIT;
+DROP TRIGGER i4_t1;
+ROLLBACK TO SAVEPOINT in a trigger in a SP call should be forbidden
+CREATE PROCEDURE p4() BEGIN
+ROLLBACK TO SAVEPOINT s;
+END|
+CREATE TRIGGER i5_t1 BEFORE INSERT ON t1 FOR EACH ROW CALL p4;
+BEGIN;
+SAVEPOINT s;
+INSERT INTO t1 VALUES (6);
+ERROR 42000: SAVEPOINT s does not exist
+COMMIT;
+DROP TRIGGER i5_t1;
+SAVEPOINT in a SP next to a trigger should work
+CREATE TRIGGER i6_t1 BEFORE INSERT ON t1 FOR EACH ROW SET NEW.a = NEW.a + 1;
+CREATE PROCEDURE p5() BEGIN
+SAVEPOINT s;
+INSERT INTO t1 VALUES (10);
+ROLLBACK TO SAVEPOINT s;
+END|
+BEGIN;
+CALL p5();
+COMMIT;
+DROP TRIGGER i6_t1;
+create trigger t1 before insert on t1 for each row
+begin
+insert into t2 values (NULL);
+end|
+INSERT INTO t1 VALUES (201), (202), (203);
+SELECT * FROM t1;
+a
+5
+6
+7
+8
+9
+201
+202
+203
+SELECT COUNT(*) FROM t2;
+COUNT(*)
+3
+SELECT * FROM t1;
+a
+5
+6
+7
+8
+9
+201
+202
+203
+SELECT COUNT(*) FROM t2;
+COUNT(*)
+3
+DEALLOCATE PREPARE call_p1;
+DROP TABLE t1, t2;
+DROP PROCEDURE p1;
+DROP PROCEDURE p2;
+DROP PROCEDURE p3;
+DROP PROCEDURE p4;
+DROP PROCEDURE p5;
+DROP FUNCTION f1;
--- /dev/null
+SET SESSION wsrep_sync_wait = 0;
+SET SESSION wsrep_on = OFF;
+SET SESSION wsrep_on = ON;
+CALL mtr.add_suppression("Failed to set packet size");
+CALL mtr.add_suppression("Failed to set packet size");
--- /dev/null
+DROP TABLE IF EXISTS t1, t2;
+DROP TABLE IF EXISTS x1, x2;
+CREATE TABLE t1 (f1 INTEGER);
+CREATE TABLE t2 (f1 INT PRIMARY KEY AUTO_INCREMENT, f2 INTEGER);
+SET GLOBAL wsrep_replicate_myisam = TRUE;
+CREATE TABLE x1 (f1 INTEGER) ENGINE=MyISAM;
+CREATE TABLE x2 (f1 INT PRIMARY KEY AUTO_INCREMENT, f2 INTEGER) ENGINE=MyISAM;
+INSERT INTO t1 VALUES (1), (2), (3), (4), (5), (6), (7), (8), (9), (10);
+INSERT INTO x1 VALUES (1), (2), (3), (4), (5), (6), (7), (8), (9), (10);
+INSERT INTO t2 (f2) SELECT 1 FROM t1 AS a1, t1 AS a2, t1 AS a3, t1 AS a4;
+INSERT INTO x2 (f2) VALUES (1), (2), (3), (4), (5), (6), (7), (8), (9), (10);
+# ANALYZE test
+ANALYZE TABLE t1, t2;
+Table Op Msg_type Msg_text
+test.t1 analyze status OK
+test.t2 analyze status OK
+# OPTIMIZE test
+OPTIMIZE TABLE t1, t2;
+Table Op Msg_type Msg_text
+test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
+test.t1 optimize status OK
+test.t2 optimize note Table does not support optimize, doing recreate + analyze instead
+test.t2 optimize status OK
+# REPAIR test
+REPAIR TABLE x1, x2;
+Table Op Msg_type Msg_text
+test.x1 repair status OK
+test.x2 repair status OK
+SELECT COUNT(*) = 10 FROM t1;
+COUNT(*) = 10
+1
+SELECT COUNT(*) = 10 FROM x1;
+COUNT(*) = 10
+1
+SELECT COUNT(*) = 10000 FROM t2;
+COUNT(*) = 10000
+1
+SELECT COUNT(*) = 10 FROM x2;
+COUNT(*) = 10
+1
+DROP TABLE t1, t2;
+DROP TABLE x1, x2;
+SET GLOBAL wsrep_replicate_myisam = FALSE;
UNLOCK TABLES;
COMMIT;
SET AUTOCOMMIT=ON;
+SET SESSION wsrep_sync_wait = 7;
SELECT COUNT(*) = 1 FROM t1;
COUNT(*) = 1
1
WSREP_FORCED_BINLOG_FORMAT NONE
WSREP_LOAD_DATA_SPLITTING ON
WSREP_LOG_CONFLICTS OFF
-WSREP_MAX_WS_ROWS 131072
-WSREP_MAX_WS_SIZE 1073741824
+WSREP_MAX_WS_ROWS 0
+WSREP_MAX_WS_SIZE 2147483647
WSREP_MYSQL_REPLICATION_BUNDLE 0
WSREP_NOTIFY_CMD
WSREP_ON ON
WSREP_SST_DONOR_REJECTS_QUERIES OFF
WSREP_SST_METHOD rsync
WSREP_SYNC_WAIT 7
-<BASE_DIR>; <BASE_HOST>; <BASE_PORT>; cert.log_conflicts = no; debug = no; evs.auto_evict = 0; evs.causal_keepalive_period = PT1S; evs.debug_log_mask = 0x1; evs.delay_margin = PT1S; evs.delayed_keep_period = PT30S; evs.inactive_check_period = PT0.5S; evs.inactive_timeout = PT15S; evs.info_log_mask = 0; evs.install_timeout = PT7.5S; evs.join_retrans_period = PT1S; evs.keepalive_period = PT1S; evs.max_install_timeouts = 3; evs.send_window = 4; evs.stats_report_period = PT1M; evs.suspect_timeout = PT5S; evs.use_aggregate = true; evs.user_send_window = 2; evs.version = 0; evs.view_forget_timeout = P1D; <GCACHE_DIR>; gcache.keep_pages_size = 0; gcache.mem_size = 0; <GCACHE_NAME>; gcache.page_size = 128M; gcache.size = 128M; gcomm.thread_prio = ; gcs.fc_debug = 0; gcs.fc_factor = 1.0; gcs.fc_limit = 16; gcs.fc_master_slave = no; gcs.max_packet_size = 64500; gcs.max_throttle = 0.25; <RECV_Q_HARD_LIMIT>;gcs.recv_q_soft_limit = 0.25; gcs.sync_donor = no; <GMCAST_LISTEN_ADDR>; gmcast.mcast_addr = ; gmcast.mcast_ttl = 1; gmcast.peer_timeout = PT3S; gmcast.segment = 0; gmcast.time_wait = PT5S; gmcast.version = 0; <IST_RECV_ADDR>; pc.announce_timeout = PT3S; pc.checksum = false; pc.ignore_quorum = false; pc.ignore_sb = false; pc.linger = PT20S; pc.npvo = false; pc.recovery = true; pc.version = 0; pc.wait_prim = true; pc.wait_prim_timeout = P30S; pc.weight = 1; protonet.backend = asio; protonet.version = 0; repl.causal_read_timeout = PT90S; repl.commit_order = 3; repl.key_format = FLAT8; repl.max_ws_size = 2147483647; repl.proto_max = 7; socket.checksum = 2;
+<BASE_DIR>; <BASE_HOST>; <BASE_PORT>; cert.log_conflicts = no; debug = no; evs.auto_evict = 0; evs.causal_keepalive_period = PT1S; evs.debug_log_mask = 0x1; evs.delay_margin = PT1S; evs.delayed_keep_period = PT30S; evs.inactive_check_period = PT0.5S; evs.inactive_timeout = PT15S; evs.info_log_mask = 0; evs.install_timeout = PT7.5S; evs.join_retrans_period = PT1S; evs.keepalive_period = PT1S; evs.max_install_timeouts = 3; evs.send_window = 4; evs.stats_report_period = PT1M; evs.suspect_timeout = PT10S; evs.use_aggregate = true; evs.user_send_window = 2; evs.version = 0; evs.view_forget_timeout = P1D; <GCACHE_DIR>; gcache.keep_pages_size = 0; gcache.mem_size = 0; <GCACHE_NAME>; gcache.page_size = 128M; gcache.size = 128M; gcomm.thread_prio = ; gcs.fc_debug = 0; gcs.fc_factor = 1.0; gcs.fc_limit = 16; gcs.fc_master_slave = no; gcs.max_packet_size = 64500; gcs.max_throttle = 0.25; <RECV_Q_HARD_LIMIT>;gcs.recv_q_soft_limit = 0.25; gcs.sync_donor = no; <GMCAST_LISTEN_ADDR>; gmcast.mcast_addr = ; gmcast.mcast_ttl = 1; gmcast.peer_timeout = PT3S; gmcast.segment = 0; gmcast.time_wait = PT5S; gmcast.version = 0; <IST_RECV_ADDR>; pc.announce_timeout = PT3S; pc.checksum = false; pc.ignore_quorum = false; pc.ignore_sb = false; pc.linger = PT20S; pc.npvo = false; pc.recovery = true; pc.version = 0; pc.wait_prim = true; pc.wait_prim_timeout = P30S; pc.weight = 1; protonet.backend = asio; protonet.version = 0; repl.causal_read_timeout = PT90S; repl.commit_order = 3; repl.key_format = FLAT8; repl.max_ws_size = 2147483647; repl.proto_max = 7; socket.checksum = 2; socket.recv_buf_size = 212992;
SELECT COUNT(*) FROM INFORMATION_SCHEMA.GLOBAL_STATUS
WHERE VARIABLE_NAME LIKE 'wsrep_%'
AND VARIABLE_NAME != 'wsrep_debug_sync_waiters';
--- /dev/null
+CREATE TABLE ten (f1 INTEGER);
+INSERT INTO ten VALUES (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
+CREATE TABLE t1 (f1 INTEGER, PRIMARY KEY (f1)) Engine=InnoDB;
+CREATE TABLE t2 (f1 INTEGER, PRIMARY KEY (f1)) Engine=InnoDB;
+SET GLOBAL wsrep_desync = 1;
+show status like 'wsrep_desync_count';
+Variable_name Value
+wsrep_desync_count 1
+SET DEBUG_SYNC='before_execute_sql_command SIGNAL alter1 WAIT_FOR alter2';
+INSERT INTO t1 (f1) SELECT 0000 + (100 * a1.f1) + (10 * a2.f1) + a3.f1 FROM ten AS a1, ten AS a2, ten AS a3;
+SET GLOBAL wsrep_desync = 1;
+Warnings:
+Warning 1231 'wsrep_desync' is already ON.
+show status like 'wsrep_desync_count';
+Variable_name Value
+wsrep_desync_count 1
+SET DEBUG_SYNC='now WAIT_FOR alter1';
+SET DEBUG_SYNC='before_execute_sql_command SIGNAL alter2';
+INSERT INTO t2 (f1) SELECT 0000 + (100 * a1.f1) + (10 * a2.f1) + a3.f1 FROM ten AS a1, ten AS a2, ten AS a3;
+SET DEBUG_SYNC='RESET';
+SET GLOBAL wsrep_desync = 0;
+show status like 'wsrep_desync_count';
+Variable_name Value
+wsrep_desync_count 0
+SET GLOBAL wsrep_desync = 0;
+Warnings:
+Warning 1231 'wsrep_desync' is already OFF.
+show status like 'wsrep_desync_count';
+Variable_name Value
+wsrep_desync_count 0
+show status like 'wsrep_desync_count';
+Variable_name Value
+wsrep_desync_count 0
+SET GLOBAL wsrep_desync = 0;
+Warnings:
+Warning 1231 'wsrep_desync' is already OFF.
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+1000
+SELECT COUNT(*) FROM t2;
+COUNT(*)
+1000
+DROP TABLE t1;
+DROP TABLE t2;
+DROP TABLE ten;
SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME='t1';
COUNT(*) = 2
1
-SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
-VARIABLE_VALUE = 2
-1
DROP TABLE t1;
CREATE TABLE t1 (id INT) ENGINE=InnoDB;
CREATE TABLE t2 (id INT) ENGINE=InnoDB;
SET GLOBAL wsrep_slave_threads = 2;
+LOCK TABLE t1 WRITE;
INSERT INTO t1 VALUES (1);
INSERT INTO t2 VALUES (1);
INSERT INTO t1 VALUES (1);
INSERT INTO t2 VALUES (1);
INSERT INTO t1 VALUES (1);
INSERT INTO t2 VALUES (1);
+SET SESSION wsrep_sync_wait = 0;
+UNLOCK TABLES;
+SET SESSION wsrep_sync_wait = 7;
SELECT COUNT(*) = 10 FROM t1;
COUNT(*) = 10
0
SELECT COUNT(*) = 10 FROM t2;
COUNT(*) = 10
0
-SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE STATE LIKE 'committed%';
-COUNT(*) = 2
-1
SET GLOBAL wsrep_slave_threads = 1;;
DROP TABLE t1;
DROP TABLE t2;
COUNT(*) = 0
1
DROP TABLE t1;
-CALL mtr.add_suppression("WSREP: Maximum writeset size exceeded by");
-CALL mtr.add_suppression("WSREP: transaction size exceeded");
+CALL mtr.add_suppression("Maximum writeset size exceeded by");
+CALL mtr.add_suppression("transaction size limit");
+CALL mtr.add_suppression("transaction size exceeded");
+CALL mtr.add_suppression("rbr write fail");
--- /dev/null
+CALL mtr.add_suppression("Aborting");
+CALL mtr.add_suppression("unknown option '--galera-unknown-option'");
+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY, f2 CHAR(1));
+INSERT INTO t1 VALUES (1, 'a'), (2, 'a'), (3, 'a');
+SELECT * FROM t1;
+f1 f2
+1 a
+2 a
+3 a
+Shutting down server ...
+UPDATE t1 SET f2 = 'b' WHERE f1 > 1;
+UPDATE t1 SET f2 = 'c' WHERE f1 > 2;
+SELECT * FROM t1;
+f1 f2
+1 a
+2 b
+3 c
+Starting server ...
+Starting server ...
+SELECT * FROM t1;
+f1 f2
+1 a
+2 b
+3 c
+Shutting down server ...
+UPDATE t1 SET f2 = 'd' WHERE f1 > 1;
+UPDATE t1 SET f2 = 'd' WHERE f1 > 2;
+SELECT * FROM t1;
+f1 f2
+1 a
+2 d
+3 d
+Starting server ...
+Starting server ...
+SELECT * FROM t1;
+f1 f2
+1 a
+2 d
+3 d
+DROP TABLE t1;
SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
VARIABLE_VALUE = 2
1
-SELECT VARIABLE_VALUE = 'Synced' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_state_comment';
-VARIABLE_VALUE = 'Synced'
-1
SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
VARIABLE_VALUE = 2
1
-SELECT VARIABLE_VALUE = 'Synced' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_state_comment';
-VARIABLE_VALUE = 'Synced'
-1
SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
VARIABLE_VALUE = 2
1
-SELECT VARIABLE_VALUE = 'Synced' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_state_comment';
-VARIABLE_VALUE = 'Synced'
-1
SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
VARIABLE_VALUE = 2
1
--- /dev/null
+CREATE TABLE ten (f1 INTEGER) ENGINE=InnoDB;
+INSERT INTO ten VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9),(10);
+CREATE TABLE parent (
+id INT PRIMARY KEY,
+KEY (id)
+) ENGINE=InnoDB;
+CREATE TABLE child (
+id INT PRIMARY KEY AUTO_INCREMENT,
+parent_id INT
+) ENGINE=InnoDB;
+INSERT INTO parent VALUES (1);
+INSERT INTO child (parent_id) SELECT 1 FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4;
+ALTER TABLE child ADD FOREIGN KEY (parent_id) REFERENCES parent(id) ON UPDATE CASCADE;;
+UPDATE parent SET id = 2 WHERE id = 1;;
+SELECT COUNT(*) = 10000 FROM child WHERE parent_id = 2;
+COUNT(*) = 10000
+1
+SELECT COUNT(*) = 10000 FROM child WHERE parent_id = 2;
+COUNT(*) = 10000
+1
+DROP TABLE child;
+DROP TABLE parent;
+DROP TABLE ten;
--- /dev/null
+CREATE TABLE ten (f1 INTEGER);
+INSERT INTO ten VALUES (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY AUTO_INCREMENT, f2 INTEGER) ENGINE=InnoDB;
+INSERT INTO t1 (f2) SELECT 1 FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4, ten AS a5;
+INSERT INTO t1 (f2) SELECT 1 FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4, ten AS a5;;
+CREATE INDEX i1 ON t1 (f2);;
+ALTER TABLE t1 ADD COLUMN f3 INTEGER;;
+SELECT COUNT(*) = 200000 FROM t1;
+COUNT(*) = 200000
+1
+SELECT COUNT(*) = 3 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1';
+COUNT(*) = 3
+1
+SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.STATISTICS WHERE TABLE_NAME = 't1';
+COUNT(*) = 2
+1
+SELECT COUNT(*) = 200000 FROM t1;
+COUNT(*) = 200000
+1
+SELECT COUNT(*) = 3 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1';
+COUNT(*) = 3
+1
+SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.STATISTICS WHERE TABLE_NAME = 't1';
+COUNT(*) = 2
+1
+DROP TABLE t1;
+DROP TABLE ten;
--- /dev/null
+CREATE DATABASE database1;
+USE database1;
+CREATE TABLE ten (f1 INTEGER) ENGINE=InnoDB;
+INSERT INTO ten VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9),(10);
+CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB;
+CREATE TABLE t2 (f1 INTEGER) ENGINE=InnoDB;
+INSERT INTO t1 (f1) SELECT 1 FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4, ten AS a5;;
+USE database1;
+INSERT INTO t2 (f1) SELECT 1 FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4, ten AS a5;;
+DROP DATABASE database1;;
+ERROR 42S02: Table 'database1.t1' doesn't exist
+ERROR 42S02: Table 'database1.t2' doesn't exist
+SELECT COUNT(*) = 0 FROM INFORMATION_SCHEMA.SCHEMATA WHERE SCHEMA_NAME = 'database1';
+COUNT(*) = 0
+1
+USE database1;
+ERROR 42000: Unknown database 'database1'
+SELECT COUNT(*) = 0 FROM INFORMATION_SCHEMA.SCHEMATA WHERE SCHEMA_NAME = 'database1';
+COUNT(*) = 0
+1
+USE database1;
+ERROR 42000: Unknown database 'database1'
--- /dev/null
+CREATE TABLE ten (f1 INTEGER) ENGINE=InnoDB;
+INSERT INTO ten VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9),(10);
+CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB;
+INSERT INTO t1 (f1) SELECT 1 FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4, ten AS a5, ten AS a6;;
+TRUNCATE TABLE t1;;
+SELECT COUNT(*) = 1000000 FROM t1;
+COUNT(*) = 1000000
+1
+DROP TABLE t1;
+CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB;
+INSERT INTO t1 (f1) SELECT 1 FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4, ten AS a5, ten AS a6;;
+TRUNCATE TABLE t1;;
+SELECT COUNT(*) = 1000000 FROM t1;
+COUNT(*) = 1000000
+1
+DROP TABLE t1;
+DROP TABLE ten;
--- /dev/null
+CREATE TABLE ten (f1 INTEGER) ENGINE=InnoDB;
+INSERT INTO ten VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9),(10);
+CREATE TABLE t1 (f1 INTEGER AUTO_INCREMENT PRIMARY KEY, f2 INTEGER) ENGINE=InnoDB;
+SET GLOBAL wsrep_max_ws_rows = 4;
+START TRANSACTION;
+INSERT INTO t1 (f2) VALUES (1);
+INSERT INTO t1 (f2) VALUES (2);
+INSERT INTO t1 (f2) VALUES (3);
+INSERT INTO t1 (f2) VALUES (4);
+INSERT INTO t1 (f2) VALUES (5);
+ERROR HY000: wsrep_max_ws_rows exceeded
+COMMIT;
+SELECT COUNT(*) = 0 FROM t1;
+COUNT(*) = 0
+1
+START TRANSACTION;
+INSERT INTO t1 (f2) VALUES (1);
+INSERT INTO t1 (f2) VALUES (2);
+INSERT INTO t1 (f2) VALUES (3);
+INSERT INTO t1 (f2) VALUES (4);
+UPDATE t1 SET f2 = 10 WHERE f2 = 4;
+ERROR HY000: wsrep_max_ws_rows exceeded
+COMMIT;
+SELECT COUNT(*) = 0 FROM t1;
+COUNT(*) = 0
+1
+START TRANSACTION;
+INSERT INTO t1 (f2) VALUES (1);
+INSERT INTO t1 (f2) VALUES (2);
+INSERT INTO t1 (f2) VALUES (3);
+INSERT INTO t1 (f2) VALUES (4);
+DELETE FROM t1 WHERE f2 = 1;
+ERROR HY000: wsrep_max_ws_rows exceeded
+COMMIT;
+SELECT COUNT(*) = 0 FROM t1;
+COUNT(*) = 0
+1
+SET GLOBAL wsrep_max_ws_rows = 5;
+INSERT INTO t1 (f2) VALUES (1),(2),(3),(4),(5);
+SET GLOBAL wsrep_max_ws_rows = 4;
+UPDATE t1 SET f2 = f2 + 10;
+ERROR HY000: wsrep_max_ws_rows exceeded
+SELECT COUNT(*) = 5 FROM t1;
+COUNT(*) = 5
+1
+DELETE FROM t1 WHERE f2 < 10;
+ERROR HY000: wsrep_max_ws_rows exceeded
+SELECT COUNT(*) = 5 FROM t1;
+COUNT(*) = 5
+1
+INSERT INTO t1 (f2) SELECT * FROM ten;
+ERROR HY000: wsrep_max_ws_rows exceeded
+SELECT COUNT(*) = 5 FROM t1;
+COUNT(*) = 5
+1
+INSERT INTO t1 (f2) VALUES (10),(20),(30),(40),(50);
+ERROR HY000: wsrep_max_ws_rows exceeded
+SELECT COUNT(*) = 5 FROM t1;
+COUNT(*) = 5
+1
+SET GLOBAL wsrep_max_ws_rows = 10;
+DELETE FROM t1 WHERE f2 < 10;
+SELECT COUNT(*) = 0 FROM t1;
+COUNT(*) = 0
+1
+SET GLOBAL wsrep_max_ws_rows = 100;
+SELECT COUNT(*) = 100 FROM t1;
+COUNT(*) = 100
+1
+DELETE FROM t1 WHERE f2 < 101;
+SELECT COUNT(*) = 0 FROM t1;
+COUNT(*) = 0
+1
+SET GLOBAL wsrep_max_ws_rows = 9999;
+INSERT INTO t1 (f2) SELECT 1 FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4;
+ERROR HY000: wsrep_max_ws_rows exceeded
+SET GLOBAL wsrep_max_ws_rows = 10000;
+INSERT INTO t1 (f2) SELECT 1 FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4;
+SET GLOBAL wsrep_max_ws_rows = 9999;
+UPDATE t1 SET f2 = 2 WHERE f2 = 1;
+ERROR HY000: wsrep_max_ws_rows exceeded
+SET GLOBAL wsrep_max_ws_rows = 10000;
+UPDATE t1 SET f2 = 2 WHERE f2 = 1;
+SET GLOBAL wsrep_max_ws_rows = 9999;
+DELETE FROM t1 WHERE f2 = 2;
+ERROR HY000: wsrep_max_ws_rows exceeded
+SET GLOBAL wsrep_max_ws_rows = 10000;
+DELETE FROM t1 WHERE f2 = 2;
+SELECT COUNT(*) = 0 FROM t1;
+COUNT(*) = 0
+1
+SET AUTOCOMMIT = ON;
+SET GLOBAL wsrep_max_ws_rows = 1;
+START TRANSACTION;
+INSERT INTO t1 (f2) VALUES (1);
+INSERT INTO t1 (f2) VALUES (2);
+ERROR HY000: wsrep_max_ws_rows exceeded
+INSERT INTO t1 (f2) VALUES (1);
+INSERT INTO t1 (f2) VALUES (2);
+SET AUTOCOMMIT = OFF;
+START TRANSACTION;
+INSERT INTO t1 (f2) VALUES (1);
+INSERT INTO t1 (f2) VALUES (2);
+ERROR HY000: wsrep_max_ws_rows exceeded
+INSERT INTO t1 (f2) VALUES (1);
+INSERT INTO t1 (f2) VALUES (2);
+ERROR HY000: wsrep_max_ws_rows exceeded
+START TRANSACTION;
+INSERT INTO t1 (f2) VALUES (1);
+START TRANSACTION;
+INSERT INTO t1 (f2) VALUES (1);
+INSERT INTO t1 (f2) VALUES (2);
+ERROR HY000: wsrep_max_ws_rows exceeded
+DROP TABLE t1;
+DROP TABLE ten;
SELECT COUNT(*) = 0 FROM t1;
COUNT(*) = 0
1
+SET GLOBAL wsrep_provider_options = 'repl.max_ws_size=10000';
+SELECT @@wsrep_max_ws_size = 10000;
+@@wsrep_max_ws_size = 10000
+1
+SET GLOBAL wsrep_provider_options = 'repl.max_ws_size=20000';
+SET GLOBAL wsrep_provider_options = 'repl.max_ws_size=10000';
+SET GLOBAL wsrep_max_ws_size = 20000;
+provider_options_match
+1
DROP TABLE t1;
--- /dev/null
+call mtr.add_suppression("WSREP\: Unknown parameter 'gmcasts\.segment'");
+call mtr.add_suppression("WSREP\: Set options returned 7");
+SET GLOBAL wsrep_provider_options="gmcasts.segment=1";
+ERROR HY000: Incorrect arguments to SET
+Unhandled exceptions: 0
--- /dev/null
+CREATE TABLE t1 (id INT PRIMARY KEY) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1);
+FLUSH TABLES t1 FOR EXPORT;
+ALTER TABLE t1 ADD COLUMN f2 INTEGER;
+INSERT INTO t1 VALUES (2,3);
+UNLOCK TABLES;
+### t1 should have column f2
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `id` int(11) NOT NULL,
+ `f2` int(11) DEFAULT NULL,
+ PRIMARY KEY (`id`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+SELECT * from t1;
+id f2
+1 NULL
+2 3
+DROP TABLE t1;
--- /dev/null
+CREATE TABLE t1 (id INT PRIMARY KEY) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1);
+FLUSH TABLE WITH READ LOCK;
+### This shouldn't block.
+FLUSH TABLES t1 FOR EXPORT;
+ALTER TABLE t1 ADD COLUMN f2 INTEGER;
+UNLOCK TABLES;
+### t1 should have column f2
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `id` int(11) NOT NULL,
+ `f2` int(11) DEFAULT NULL,
+ PRIMARY KEY (`id`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+INSERT INTO t1 VALUES (2,3);
+SELECT * from t1;
+id f2
+1 NULL
+2 3
+DROP TABLE t1;
--- /dev/null
+CREATE TABLE t1 (id INT PRIMARY KEY) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1);
+SET session wsrep_sync_wait=0;
+SET session wsrep_causal_reads=OFF;
+FLUSH TABLE WITH READ LOCK;
+ALTER TABLE t1 ADD COLUMN f2 INTEGER;
+INSERT INTO t1 VALUES (2,3);
+SET session wsrep_sync_wait=0;
+SET session wsrep_causal_reads=OFF;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `id` int(11) NOT NULL,
+ PRIMARY KEY (`id`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+FLUSH TABLES t1 WITH READ LOCK;;
+UNLOCK TABLES;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `id` int(11) NOT NULL,
+ PRIMARY KEY (`id`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+UNLOCK TABLES;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `id` int(11) NOT NULL,
+ `f2` int(11) DEFAULT NULL,
+ PRIMARY KEY (`id`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+SELECT * from t1;
+id f2
+1 NULL
+2 3
+DROP TABLE t1;
--- /dev/null
+CREATE TABLE t1 (id INT PRIMARY KEY) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1);
+FLUSH TABLES t1 WITH READ LOCK;
+ALTER TABLE t1 ADD COLUMN f2 INTEGER;
+INSERT INTO t1 VALUES (2,3);
+UNLOCK TABLES;
+### t1 should have column f2
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `id` int(11) NOT NULL,
+ `f2` int(11) DEFAULT NULL,
+ PRIMARY KEY (`id`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+SELECT * from t1;
+id f2
+1 NULL
+2 3
+DROP TABLE t1;
--- /dev/null
+set GLOBAL wsrep_slave_threads=26;
+CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1);
+INSERT INTO t1 (f1) SELECT * from t1 as x1;
+set GLOBAL wsrep_slave_threads=16;
+SET GLOBAL wsrep_provider='none';
+INSERT INTO t1 VALUES (2);
+INSERT INTO t1 VALUES (3);
+INSERT INTO t1 VALUES (4);
+set GLOBAL wsrep_slave_threads=5;
+SELECT COUNT(*) = 5 FROM t1;
+COUNT(*) = 5
+1
+set GLOBAL wsrep_slave_threads=12;
+SELECT COUNT(*) = 4 FROM t1;
+COUNT(*) = 4
+1
+INSERT INTO t1 VALUES (100), (101), (102);
+set GLOBAL wsrep_slave_threads=5;
+INSERT INTO t1 (f1) SELECT * from t1 as x1;
+show global variables like 'wsrep_slave_threads';
+Variable_name Value
+wsrep_slave_threads 5
+SET GLOBAL wsrep_slave_threads = 1;
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+16
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+15
+show global variables like 'wsrep_slave_threads';
+Variable_name Value
+wsrep_slave_threads 12
+SET GLOBAL wsrep_slave_threads = 1;
+DROP TABLE t1;
--- /dev/null
+# This tests proper desync counter cleanup when DONOR/DESYNC state is cleared.
+
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+
+# Make node 1 tolerate split-brain
+SET GLOBAL wsrep_provider_options = 'pc.ignore_sb=true';
+
+# Desync and disconnect node 2 from the PC:
+--connection node_2
+SET @@global.wsrep_desync = 1;
+SET SESSION wsrep_sync_wait=0;
+SET GLOBAL wsrep_provider_options = 'gmcast.isolate=1';
+--let $wait_condition = SELECT VARIABLE_VALUE = 'non-Primary' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status';
+--source include/wait_condition.inc
+
+# Wait until node 2 disappears from the PC:
+--connection node_1
+--let $wait_condition = SELECT VARIABLE_VALUE = 1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
+--source include/wait_condition.inc
+--let $wait_condition = SELECT VARIABLE_VALUE = 'Primary' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status';
+--source include/wait_condition.inc
+
+# Modify app state to force node 2 into PRIMARY upon reconnection.
+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY, f2 CHAR(1));
+
+# Reconnect node 2 to the PC:
+--connection node_2
+SET GLOBAL wsrep_provider_options = 'gmcast.isolate=0';
+--let $wait_condition = SELECT VARIABLE_VALUE = 'Primary' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status';
+--source include/wait_condition.inc
+--let $wait_condition = SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
+--source include/wait_condition.inc
+
+# Must return 0:
+SHOW STATUS LIKE 'wsrep_desync_count';
+
+# Resync node_2, should pass:
+SET @@global.wsrep_desync = 0;
+
+SET SESSION wsrep_sync_wait=7;
+SHOW CREATE TABLE t1;
+DROP TABLE t1;
+CALL mtr.add_suppression("WSREP: Protocol violation. JOIN message sender (.*) is not in state transfer \\(SYNCED\\). Message ignored.");
+
+--connection node_1
+--let $wait_condition = SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
+--source include/wait_condition.inc
+SET GLOBAL wsrep_provider_options = 'pc.ignore_sb=false';
--- /dev/null
+!include ../galera_2nodes_as_master.cnf
--- /dev/null
+#
+# MW-284 Slave I/O retry on ER_COM_UNKNOWN_ERROR
+#
+
+--source include/have_log_bin.inc
+--source include/galera_cluster.inc
+
+--connect node_3, 127.0.0.1, root, , test, $NODE_MYPORT_3
+--disable_query_log
+--eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=$NODE_MYPORT_1, MASTER_CONNECT_RETRY=1;
+--enable_query_log
+
+--connection node_1
+CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB;
+SET GLOBAL wsrep_provider_options='gmcast.isolate=1';
+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;
+
+--connection node_3
+START SLAVE USER='root';
+--sleep 1
+--let $slave_param= Slave_IO_Running
+--let $slave_param_value= Connecting
+--source include/wait_for_slave_param.inc
+
+--connection node_1
+SET GLOBAL wsrep_provider_options='gmcast.isolate=0';
+
+# We expect the slave to reconnect and resume replication
+
+--connection node_3
+--source include/wait_for_slave_to_start.inc
+
+--connection node_1
+INSERT INTO t1 VALUES (1);
+
+--connection node_3
+--let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 't1'
+--source include/wait_condition.inc
+--let $wait_condition = SELECT COUNT(*) > 0 FROM t1
+--source include/wait_condition.inc
+
+# Cleanup
+
+--connection node_1
+DROP TABLE t1;
+
+--connection node_3
+--let $wait_condition = SELECT COUNT(*) = 0 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 't1'
+--source include/wait_condition.inc
+
+STOP SLAVE;
+RESET SLAVE ALL;
+
+CALL mtr.add_suppression('failed registering on master');
--- /dev/null
+#
+# Broken FK constraints cause assertions
+#
+
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+
+CREATE TABLE parent1 ( id INT PRIMARY KEY, KEY (id) ) ENGINE=InnoDB;
+CREATE TABLE parent2 ( id INT PRIMARY KEY, KEY (id) ) ENGINE=InnoDB;
+
+CREATE TABLE child (
+ id INT PRIMARY KEY,
+ parent1_id INT,
+ parent2_id INT,
+ FOREIGN KEY (parent1_id) REFERENCES parent1(id),
+ FOREIGN KEY (parent1_id) REFERENCES parent2(id)
+) ENGINE=InnoDB;
+
+INSERT INTO parent1 VALUES (1);
+INSERT INTO parent2 VALUES (1);
+INSERT INTO child VALUES (1,1,1);
+INSERT INTO child VALUES (2,1,1);
+
+SET foreign_key_checks=OFF;
+DROP TABLE parent1;
+
+UPDATE child SET parent1_id=2 WHERE id=1;
+
+DROP TABLE child;
+DROP TABLE parent2;
+SET foreign_key_checks=ON;
--- /dev/null
+#
+# MW-286 Spurious deadlock error after error with wsrep_desync and wsrep_on
+#
+
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+--source include/big_test.inc
+
+--connection node_1
+CREATE TABLE ten (f1 INTEGER);
+INSERT INTO ten VALUES (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
+
+CREATE TABLE t1 (f1 INTEGER) Engine=InnoDB;
+
+# Insert some values before the ALTER
+INSERT INTO t1 (f1) SELECT 000000 + (10000 * a1.f1) + (1000 * a2.f1) + (100 * a3.f1) + (10 * a4.f1) + a5.f1 FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4, ten AS a5;
+
+# Insert more values while the ALTER is running
+--send INSERT INTO t1 (f1) SELECT 100000 + (10000 * a1.f1) + (1000 * a2.f1) + (100 * a3.f1) + (10 * a4.f1) + a5.f1 FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4, ten AS a5;
+
+--connection node_2
+SET GLOBAL wsrep_desync = TRUE;
+SET wsrep_on = FALSE;
+
+--error ER_QUERY_INTERRUPTED
+ALTER TABLE t1 ADD PRIMARY KEY (f1);
+
+SET wsrep_on = TRUE;
+SET GLOBAL wsrep_desync = FALSE;
+
+DROP TABLE t1;
+DROP TABLE ten;
--- /dev/null
+#
+# MW-292 Reset timestamp after transaction replay
+#
+# We force transaction replay to happen and then we check that NOW() is not stuck in time.
+# As a bonus we also check that RAND() continues to return random values after replay
+#
+#
+
+--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
+
+--let $wsrep_local_replays_old = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_replays'`
+
+CREATE TABLE rand_table (f1 FLOAT);
+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY, f2 CHAR(1));
+INSERT INTO t1 VALUES (1, 'a');
+INSERT INTO t1 VALUES (2, 'a');
+
+--connection node_1
+SET AUTOCOMMIT=ON;
+START TRANSACTION;
+
+UPDATE t1 SET f2 = 'b' WHERE f1 = 1;
+SELECT * FROM t1 WHERE f1 = 2 FOR UPDATE;
+
+# Block the commit
+--connect node_1a, 127.0.0.1, root, , test, $NODE_MYPORT_1
+--let $galera_sync_point = commit_monitor_enter_sync
+--source include/galera_set_sync_point.inc
+
+--connection node_1
+--send COMMIT;
+
+# Wait until commit is blocked
+--connection node_1a
+SET SESSION wsrep_sync_wait = 0;
+--source include/galera_wait_sync_point.inc
+
+# Issue a conflicting update on node #2
+--connection node_2
+UPDATE t1 SET f2 = 'c' WHERE f1 = 2;
+
+# Wait for both transactions to be blocked
+--connection node_1a
+--let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE STATE = 'System lock';
+--source include/wait_condition.inc
+
+--let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE STATE = 'init' AND INFO = 'COMMIT';
+--source include/wait_condition.inc
+
+# Unblock the commit
+--connection node_1a
+--source include/galera_clear_sync_point.inc
+--source include/galera_signal_sync_point.inc
+
+# Commit succeeds via replay
+--connection node_1
+--reap
+
+# Confirm that NOW() is not stuck in time relative to SYSDATE();
+--sleep 3
+SELECT TIMEDIFF(SYSDATE(), NOW()) < 2;
+
+INSERT INTO rand_table VALUES (RAND()),(RAND()),(RAND()),(RAND()),(RAND());
+INSERT INTO rand_table VALUES (RAND()),(RAND()),(RAND()),(RAND()),(RAND());
+
+SELECT COUNT(DISTINCT f1) = 10 FROM rand_table;
+
+# wsrep_local_replays has increased by 1
+--let $wsrep_local_replays_new = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_replays'`
+--disable_query_log
+--eval SELECT $wsrep_local_replays_new - $wsrep_local_replays_old = 1 AS wsrep_local_replays;
+--enable_query_log
+
+--connection node_2
+DROP TABLE t1;
+DROP TABLE rand_table;
--- /dev/null
+# Disable SAVEPOINT and ROLLBACK TO SAVEPOINT in SP, SF, TR.
+
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+
+
+--connection node_1
+--echo SAVEPOINT in a stored function should be forbidden
+--delimiter |
+CREATE FUNCTION f1 () RETURNS INT BEGIN
+ SAVEPOINT s;
+ RETURN 1;
+END|
+--delimiter ;
+
+SELECT f1();
+
+DROP FUNCTION f1;
+
+--echo ROLLBACK TO SAVEPOINT in a stored function should be forbidden
+--delimiter |
+CREATE FUNCTION f2 () RETURNS INT BEGIN
+ ROLLBACK TO SAVEPOINT s;
+ RETURN 1;
+END|
+--delimiter ;
+
+BEGIN;
+SAVEPOINT s;
+--error ER_SP_DOES_NOT_EXIST
+SELECT f2();
+COMMIT;
+
+DROP FUNCTION f2;
+
+BEGIN;
+SAVEPOINT S;
+ROLLBACK TO SAVEPOINT S;
+COMMIT;
+
+
+CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE=InnoDB;
+CREATE TABLE t2 (a INT PRIMARY KEY AUTO_INCREMENT) ENGINE=InnoDB;
+INSERT INTO t1 values (110), (111), (112), (113), (114);
+
+--echo Direct SAVEPOINT in a trigger should be forbidden
+--connection node_2
+CREATE TRIGGER i1_t1 BEFORE INSERT ON t1 FOR EACH ROW SAVEPOINT s;
+
+--connection node_1
+INSERT INTO t1 VALUES (1);
+DROP TRIGGER i1_t1;
+
+CREATE TRIGGER i2_t1 AFTER INSERT ON t1 FOR EACH ROW SAVEPOINT s;
+INSERT INTO t1 VALUES (2);
+DROP TRIGGER i2_t1;
+
+INSERT INTO t1 VALUES (3);
+CREATE TRIGGER u1_t1 BEFORE UPDATE ON t1 FOR EACH ROW SAVEPOINT s;
+UPDATE t1 SET a=4 WHERE a=3;
+DROP TRIGGER u1_t1;
+
+CREATE TRIGGER u2_t1 AFTER UPDATE ON t1 FOR EACH ROW SAVEPOINT s;
+UPDATE t1 SET a=4 WHERE a=3;
+DROP TRIGGER u2_t1;
+
+CREATE TRIGGER d1_t1 BEFORE DELETE ON t1 FOR EACH ROW SAVEPOINT s;
+DELETE FROM t1;
+DROP TRIGGER d1_t1;
+
+CREATE TRIGGER d1_t1 AFTER DELETE ON t1 FOR EACH ROW SAVEPOINT s;
+DELETE FROM t1;
+DROP TRIGGER d1_t1;
+
+--echo SAVEPOINT in a compound statement in a trigger should be forbidden
+--delimiter |
+CREATE TRIGGER i3_t1 BEFORE INSERT ON t1 FOR EACH ROW BEGIN
+ SAVEPOINT s;
+END|
+--delimiter ;
+INSERT INTO t1 VALUES (5);
+DROP TRIGGER i3_t1;
+
+--echo SAVEPOINT in a PS call in a trigger should be forbidden
+# echo handled by SAVEPOINT forbidden in PS
+--delimiter |
+--error ER_STMT_NOT_ALLOWED_IN_SF_OR_TRG
+CREATE TRIGGER i4_t1 BEFORE INSERT ON t1 FOR EACH ROW BEGIN
+ PREPARE set_savepoint FROM "SAVEPOINT s";
+ EXECUTE set_savepoint;
+ DEALLOCATE PREPARE set_savepoint;
+END|
+--delimiter ;
+
+--connection node_2
+--echo SAVEPOINT in SP called from a trigger should be forbidden
+--delimiter |
+CREATE PROCEDURE p1() BEGIN
+ SAVEPOINT s;
+END|
+--delimiter ;
+--connection node_1
+CREATE TRIGGER i5_t1 BEFORE INSERT ON t1 FOR EACH ROW CALL p1;
+INSERT INTO t1 VALUES (6);
+DROP TRIGGER i5_t1;
+
+--echo SAVEPOINT in a SP called from a PS called from a trigger be forbidden
+# echo handled by SAVEPOINT forbidden in PS
+PREPARE call_p1 FROM "CALL p1";
+--error ER_STMT_NOT_ALLOWED_IN_SF_OR_TRG
+CREATE TRIGGER i6_t1 BEFORE INSERT ON t1 FOR EACH ROW EXECUTE call_p1;
+
+--echo SAVEPOINT in a function called from a trigger should be forbidden
+--delimiter |
+CREATE FUNCTION f1 () RETURNS INT BEGIN
+ SAVEPOINT s;
+ RETURN 1;
+END|
+--delimiter ;
+CREATE TRIGGER i7_t1 BEFORE INSERT ON t1 FOR EACH ROW SET @foo = f1();
+INSERT INTO t1 VALUES (7);
+DROP TRIGGER i7_t1;
+
+--echo SAVEPOINT in a SP called from a SP called from a trigger should be forbidden
+--delimiter |
+CREATE PROCEDURE p2() BEGIN
+ CALL p1();
+END|
+--delimiter ;
+CREATE TRIGGER i8_t1 BEFORE INSERT ON t1 FOR EACH ROW CALL p2;
+INSERT INTO t1 VALUES (8);
+DROP TRIGGER i8_t1;
+
+--echo SAVEPOINT in a SP called from a trigger called from a SP should be forbidden
+CREATE TRIGGER i9_t1 BEFORE INSERT ON t1 FOR EACH ROW CALL p1;
+--delimiter |
+CREATE PROCEDURE p3() BEGIN
+ INSERT INTO t1 VALUES (9);
+END|
+--delimiter ;
+CALL p3();
+DROP TRIGGER i9_t1;
+
+--echo ROLLBACK TO SAVEPOINT in trigger as a trivial statement should be forbidden
+# Trigger activation creates a new savepoint level, making the earlier levels
+# inaccessible. Thus forbidding SAVEPOINT should be enough as then there is
+# no valid savepoint to pass to ROLLBACK TO SAVEPOINT, but we forbid it once
+# more just in case.
+CREATE TRIGGER i4_t1 BEFORE INSERT ON t1 FOR EACH ROW ROLLBACK TO SAVEPOINT s;
+BEGIN;
+SAVEPOINT s;
+--error ER_SP_DOES_NOT_EXIST
+INSERT INTO t1 VALUES (5);
+COMMIT;
+DROP TRIGGER i4_t1;
+
+--echo ROLLBACK TO SAVEPOINT in a trigger in a SP call should be forbidden
+--delimiter |
+CREATE PROCEDURE p4() BEGIN
+ ROLLBACK TO SAVEPOINT s;
+END|
+--delimiter ;
+CREATE TRIGGER i5_t1 BEFORE INSERT ON t1 FOR EACH ROW CALL p4;
+BEGIN;
+SAVEPOINT s;
+--error ER_SP_DOES_NOT_EXIST
+INSERT INTO t1 VALUES (6);
+COMMIT;
+DROP TRIGGER i5_t1;
+
+--echo SAVEPOINT in a SP next to a trigger should work
+CREATE TRIGGER i6_t1 BEFORE INSERT ON t1 FOR EACH ROW SET NEW.a = NEW.a + 1;
+--delimiter |
+CREATE PROCEDURE p5() BEGIN
+ SAVEPOINT s;
+ INSERT INTO t1 VALUES (10);
+ ROLLBACK TO SAVEPOINT s;
+END|
+--delimiter ;
+BEGIN;
+CALL p5();
+COMMIT;
+DROP TRIGGER i6_t1;
+
+--connection node_2
+delimiter |;
+create trigger t1 before insert on t1 for each row
+begin
+ insert into t2 values (NULL);
+end|
+delimiter ;|
+
+--connection node_1
+INSERT INTO t1 VALUES (201), (202), (203);
+
+--connection node_1
+SELECT * FROM t1;
+SELECT COUNT(*) FROM t2;
+
+--connection node_2
+SELECT * FROM t1;
+SELECT COUNT(*) FROM t2;
+
+--connection node_1
+DEALLOCATE PREPARE call_p1;
+
+--connection node_2
+DROP TABLE t1, t2;
+DROP PROCEDURE p1;
+DROP PROCEDURE p2;
+DROP PROCEDURE p3;
+DROP PROCEDURE p4;
+DROP PROCEDURE p5;
+DROP FUNCTION f1;
--- /dev/null
+!include ../galera_2nodes.cnf
+
+[mysqld.1]
+wsrep_provider_options='base_port=@mysqld.1.#galera_port;gcs.max_packet_size=2'
+
+[mysqld.2]
+wsrep_provider_options='base_port=@mysqld.2.#galera_port;gcs.max_packet_size=2'
+
--- /dev/null
+#
+# codership/galera#414 Shutdown crashes node if the node started with `gcs.max_packet_size=2`
+#
+
+--source include/big_test.inc
+--source include/galera_cluster.inc
+
+# We perform the shutdown/restart sequence in here. If there was a crash during shutdown, MTR will detect it
+
+--connection node_2
+--source include/shutdown_mysqld.inc
+
+--connection node_1
+SET SESSION wsrep_sync_wait = 0;
+SET SESSION wsrep_on = OFF;
+--let $wait_condition = SELECT VARIABLE_VALUE = 1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
+--source include/wait_condition.inc
+
+--connection node_2
+--source include/start_mysqld.inc
+
+--connection node_1
+SET SESSION wsrep_on = ON;
+--let $wait_condition = SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
+--source include/wait_condition.inc
+
+--connection node_1
+CALL mtr.add_suppression("Failed to set packet size");
+
+--connection node_2
+CALL mtr.add_suppression("Failed to set packet size");
+
--- /dev/null
+#
+# Test that various admin commands from sql_admin.cc
+# Currently, REPAIR, OPTIMIZE and ANALYZE are tested.
+# Jira: PXC-390
+#
+
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+
+--disable_warnings
+DROP TABLE IF EXISTS t1, t2;
+DROP TABLE IF EXISTS x1, x2;
+--enable_warnings
+
+--connection node_1
+CREATE TABLE t1 (f1 INTEGER);
+CREATE TABLE t2 (f1 INT PRIMARY KEY AUTO_INCREMENT, f2 INTEGER);
+SET GLOBAL wsrep_replicate_myisam = TRUE;
+CREATE TABLE x1 (f1 INTEGER) ENGINE=MyISAM;
+CREATE TABLE x2 (f1 INT PRIMARY KEY AUTO_INCREMENT, f2 INTEGER) ENGINE=MyISAM;
+INSERT INTO t1 VALUES (1), (2), (3), (4), (5), (6), (7), (8), (9), (10);
+INSERT INTO x1 VALUES (1), (2), (3), (4), (5), (6), (7), (8), (9), (10);
+INSERT INTO t2 (f2) SELECT 1 FROM t1 AS a1, t1 AS a2, t1 AS a3, t1 AS a4;
+INSERT INTO x2 (f2) VALUES (1), (2), (3), (4), (5), (6), (7), (8), (9), (10);
+
+# Wait until all the data from t2 has been replicated
+--connection node_2
+--let $wait_condition = SELECT COUNT(*) = 10 FROM x1;
+--source include/wait_condition.inc
+--let $wait_condition = SELECT COUNT(*) = 10 FROM x2;
+--source include/wait_condition.inc
+--let $wait_condition = SELECT COUNT(*) = 10 FROM t1;
+--source include/wait_condition.inc
+--let $wait_condition = SELECT COUNT(*) = 10000 FROM t2;
+--source include/wait_condition.inc
+
+
+--echo # ANALYZE test
+--connection node_2
+--let $wsrep_last_committed_before = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'wsrep_last_committed'`
+
+--connection node_1
+ANALYZE TABLE t1, t2;
+
+--connection node_2
+--let $wait_condition = SELECT VARIABLE_VALUE = $wsrep_last_committed_before + 1 FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'wsrep_last_committed'
+--source include/wait_condition.inc
+
+
+
+--echo # OPTIMIZE test
+--connection node_2
+--let $wsrep_last_committed_before = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'wsrep_last_committed'`
+
+--connection node_1
+OPTIMIZE TABLE t1, t2;
+
+--connection node_2
+--let $wait_condition = SELECT VARIABLE_VALUE = $wsrep_last_committed_before + 1 FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'wsrep_last_committed'
+--source include/wait_condition.inc
+
+
+
+--echo # REPAIR test
+--connection node_2
+--let $wsrep_last_committed_before = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'wsrep_last_committed'`
+
+--connection node_1
+REPAIR TABLE x1, x2;
+
+--connection node_2
+--let $wait_condition = SELECT VARIABLE_VALUE = $wsrep_last_committed_before + 1 FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'wsrep_last_committed'
+--source include/wait_condition.inc
+
+
+
+--connection node_2
+SELECT COUNT(*) = 10 FROM t1;
+SELECT COUNT(*) = 10 FROM x1;
+SELECT COUNT(*) = 10000 FROM t2;
+SELECT COUNT(*) = 10 FROM x2;
+
+--connection node_1
+DROP TABLE t1, t2;
+DROP TABLE x1, x2;
+SET GLOBAL wsrep_replicate_myisam = FALSE;
COMMIT;
SET AUTOCOMMIT=ON;
+SET SESSION wsrep_sync_wait = 7;
SELECT COUNT(*) = 1 FROM t1;
--let $wsrep_local_bf_aborts_after = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_bf_aborts'`
--- /dev/null
+#
+# Test for overlapped transactions under manual desync.
+#
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+--source include/have_debug_sync.inc
+
+--let $galera_connection_name = node_1a
+--let $galera_server_number = 1
+--source include/galera_connect.inc
+
+--connection node_1
+
+CREATE TABLE ten (f1 INTEGER);
+INSERT INTO ten VALUES (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
+
+CREATE TABLE t1 (f1 INTEGER, PRIMARY KEY (f1)) Engine=InnoDB;
+CREATE TABLE t2 (f1 INTEGER, PRIMARY KEY (f1)) Engine=InnoDB;
+
+SET GLOBAL wsrep_desync = 1;
+show status like 'wsrep_desync_count';
+SET DEBUG_SYNC='before_execute_sql_command SIGNAL alter1 WAIT_FOR alter2';
+send INSERT INTO t1 (f1) SELECT 0000 + (100 * a1.f1) + (10 * a2.f1) + a3.f1 FROM ten AS a1, ten AS a2, ten AS a3;
+
+--connection node_1a
+
+SET GLOBAL wsrep_desync = 1;
+show status like 'wsrep_desync_count';
+SET DEBUG_SYNC='now WAIT_FOR alter1';
+SET DEBUG_SYNC='before_execute_sql_command SIGNAL alter2';
+send INSERT INTO t2 (f1) SELECT 0000 + (100 * a1.f1) + (10 * a2.f1) + a3.f1 FROM ten AS a1, ten AS a2, ten AS a3;
+
+--connection node_1
+reap;
+
+--connection node_1a
+reap;
+
+--connection node_1
+
+SET DEBUG_SYNC='RESET';
+
+SET GLOBAL wsrep_desync = 0;
+show status like 'wsrep_desync_count';
+SET GLOBAL wsrep_desync = 0;
+show status like 'wsrep_desync_count';
+
+--disable_query_log
+call mtr.add_suppression("Trying to make wsrep_desync = OFF on the node that is already synchronized.");
+--enable_query_log
+show status like 'wsrep_desync_count';
+SET GLOBAL wsrep_desync = 0;
+
+SELECT COUNT(*) FROM t1;
+SELECT COUNT(*) FROM t2;
+
+DROP TABLE t1;
+DROP TABLE t2;
+DROP TABLE ten;
---query_cache_type=1 --query_cache_size=1000000 --innodb_track_changed_pages=1 --userstat=1 --thread_statistics=1
+--query_cache_type=1 --query_cache_size=1000000
--source include/galera_connect.inc
--connection node_2a
+--let $wait_condition = SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
+--source include/wait_condition.inc
+
+--let $wait_condition = SELECT VARIABLE_VALUE = 'Primary' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status';
+--source include/wait_condition.inc
+
SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME='t1';
-SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
--connection node_1
--disable_query_log
--connection node_2
SET GLOBAL wsrep_slave_threads = 2;
+LOCK TABLE t1 WRITE;
--connection node_1
INSERT INTO t1 VALUES (1);
INSERT INTO t2 VALUES (1);
--connection node_2
+SET SESSION wsrep_sync_wait = 0;
+
+--let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE STATE LIKE 'Waiting for table metadata lock%';
+--source include/wait_condition.inc
+
+--let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE STATE LIKE 'applied write set%';
+--source include/wait_condition.inc
+
+UNLOCK TABLES;
+
+SET SESSION wsrep_sync_wait = 7;
SELECT COUNT(*) = 10 FROM t1;
SELECT COUNT(*) = 10 FROM t2;
-SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE STATE LIKE 'committed%';
--eval SET GLOBAL wsrep_slave_threads = $wsrep_slave_threads_orig;
DROP TABLE t1;
-CALL mtr.add_suppression("WSREP: Maximum writeset size exceeded by");
-CALL mtr.add_suppression("WSREP: transaction size exceeded");
+CALL mtr.add_suppression("Maximum writeset size exceeded by");
+CALL mtr.add_suppression("transaction size limit");
+CALL mtr.add_suppression("transaction size exceeded");
+CALL mtr.add_suppression("rbr write fail");
--connection node_2
--source include/restart_mysqld.inc
+--connection node_1
+--let $wait_condition = SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
+--source include/wait_condition.inc
+
--let $galera_connection_name = node_2a
--let $galera_server_number = 2
--source include/galera_connect.inc
--- /dev/null
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+
+# Suppress expected warnings:
+
+CALL mtr.add_suppression("Aborting");
+CALL mtr.add_suppression("unknown option '--galera-unknown-option'");
+
+#
+# We should count the number of "Assertion failed" warnings
+# in the log file before and after testing. To do this we need
+# to save original log file before testing:
+#
+--let TEST_LOG=$MYSQLTEST_VARDIR/log/mysqld.2.err
+--perl
+ use strict;
+ my $test_log=$ENV{'TEST_LOG'} or die "TEST_LOG not set";
+ my $test_log_copy=$test_log . '.copy';
+ if (-e $test_log_copy) {
+ unlink $test_log_copy;
+ }
+EOF
+--copy_file $TEST_LOG $TEST_LOG.copy
+
+--connection node_2
+
+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY, f2 CHAR(1));
+INSERT INTO t1 VALUES (1, 'a'), (2, 'a'), (3, 'a');
+
+SELECT * FROM t1;
+
+# Initiate normal shutdown on the node 2 and
+# waiting until shutdown has been completed:
+
+--echo Shutting down server ...
+--source include/shutdown_mysqld.inc
+
+--connection node_1
+
+--let $wait_condition = SELECT VARIABLE_VALUE = 1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'
+--source include/wait_condition.inc
+
+# Some updates on node 1:
+
+UPDATE t1 SET f2 = 'b' WHERE f1 > 1;
+UPDATE t1 SET f2 = 'c' WHERE f1 > 2;
+
+SELECT * FROM t1;
+
+# Remove the "grastate.dat" file (to initiate new SST)
+# and restart node 2 with unknown option:
+
+--connection node_2
+
+--remove_file $MYSQLTEST_VARDIR/mysqld.2/data/grastate.dat
+
+--let $start_mysqld_params=--galera-unknown-option
+
+--echo Starting server ...
+--exec echo "try:$start_mysqld_params" > $_expect_file_name
+
+# Sleep to ensure that server exited...
+
+--sleep 30
+
+# Restart node 2 without unknown option:
+
+--let $start_mysqld_params=
+
+--echo Starting server ...
+--source include/start_mysqld.inc
+
+--let $wait_condition = SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'
+--source include/wait_condition.inc
+
+# Sanity check (node 2 is running now and can perform SQL operators):
+
+SELECT * FROM t1;
+
+# Initiate normal shutdown on the node 2 and
+# waiting until shutdown has been completed:
+
+--echo Shutting down server ...
+--source include/shutdown_mysqld.inc
+
+--connection node_1
+
+--let $wait_condition = SELECT VARIABLE_VALUE = 1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'
+--source include/wait_condition.inc
+
+# Some updates on node 1 - to initiate IST next time:
+
+UPDATE t1 SET f2 = 'd' WHERE f1 > 1;
+UPDATE t1 SET f2 = 'd' WHERE f1 > 2;
+
+SELECT * FROM t1;
+
+# Restart node 2 with unknown option:
+
+--connection node_2
+
+--let $start_mysqld_params=--galera-unknown-option
+
+--echo Starting server ...
+--exec echo "try:$start_mysqld_params" > $_expect_file_name
+
+# Sleep to ensure that server exited...
+
+--sleep 30
+
+# Restart node 2 without unknown option:
+
+--let $start_mysqld_params=
+
+--echo Starting server ...
+--source include/start_mysqld.inc
+
+--let $wait_condition = SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'
+--source include/wait_condition.inc
+
+# Sanity check (node 2 is running now and can perform SQL operators):
+
+SELECT * FROM t1;
+
+--connection node_1
+
+DROP TABLE t1;
+
+#
+# We should count the number of "Assertion failed" warnings
+# in the log file during test phase - to print the error message
+# if quantity of such warnings in log file increased at the end
+# of the test:
+#
+--perl
+ use strict;
+ my $test_log=$ENV{'TEST_LOG'} or die "TEST_LOG not set";
+ my $test_log_copy=$test_log . '.copy';
+ open(FILE, $test_log_copy) or die("Unable to open $test_log_copy: $!\n");
+ my $initial=grep(/Assertion * failed/gi,<FILE>);
+ close(FILE);
+ open(FILE, $test_log) or die("Unable to open $test_log: $!\n");
+ my $count_warnings=grep(/Assertion * failed/gi,<FILE>);
+ close(FILE);
+ if ($count_warnings != $initial) {
+ my $diff=$count_warnings-$initial;
+ print "Assertion failed $diff times.\n";
+ }
+EOF
+--remove_file $TEST_LOG.copy
--source include/start_mysqld.inc
--source include/wait_until_connected_again.inc
-SELECT VARIABLE_VALUE = 'Synced' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_state_comment';
+--let $wait_condition = SELECT VARIABLE_VALUE = 'Synced' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_state_comment';
+--source include/wait_condition.inc
SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
# 3. Restart node #2 with the new socket.ssl_ca , socket.ssl_cert and socket.ssl_key
--source include/start_mysqld.inc
--source include/wait_until_connected_again.inc
-SELECT VARIABLE_VALUE = 'Synced' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_state_comment';
+--let $wait_condition = SELECT VARIABLE_VALUE = 'Synced' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_state_comment';
+--source include/wait_condition.inc
SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
# 4. Restart node #1 with the new socket.ssl_ca , socket.ssl_cert and socket.ssl_key
--source include/start_mysqld.inc
--source include/wait_until_connected_again.inc
-SELECT VARIABLE_VALUE = 'Synced' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_state_comment';
+--let $wait_condition = SELECT VARIABLE_VALUE = 'Synced' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_state_comment';
+--source include/wait_condition.inc
SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
# Upgrade complete. Both nodes now use the new key and certificate
--- /dev/null
+--source include/big_test.inc
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+
+#
+# This test creates a new FK constraint while an UPDATE is running
+#
+
+CREATE TABLE ten (f1 INTEGER) ENGINE=InnoDB;
+INSERT INTO ten VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9),(10);
+
+CREATE TABLE parent (
+ id INT PRIMARY KEY,
+ KEY (id)
+) ENGINE=InnoDB;
+
+CREATE TABLE child (
+ id INT PRIMARY KEY AUTO_INCREMENT,
+ parent_id INT
+) ENGINE=InnoDB;
+
+INSERT INTO parent VALUES (1);
+
+INSERT INTO child (parent_id) SELECT 1 FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4;
+
+--connection node_1
+--sleep 1
+--send ALTER TABLE child ADD FOREIGN KEY (parent_id) REFERENCES parent(id) ON UPDATE CASCADE;
+
+--connection node_2
+--sleep 1
+--send UPDATE parent SET id = 2 WHERE id = 1;
+
+--connection node_1
+--reap
+
+--connection node_2
+--reap
+
+--connection node_2
+SELECT COUNT(*) = 10000 FROM child WHERE parent_id = 2;
+
+--connection node_1
+SELECT COUNT(*) = 10000 FROM child WHERE parent_id = 2;
+
+DROP TABLE child;
+DROP TABLE parent;
+
+DROP TABLE ten;
--- /dev/null
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+
+#
+# In this test, we run concurrent INSERT against a table against which we have issued concurrent DDL statements that are fully online,
+# that is, DDL statements that allow for the DML to proceed non-blocking while the DDL is in progress
+#
+
+CREATE TABLE ten (f1 INTEGER);
+INSERT INTO ten VALUES (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
+
+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY AUTO_INCREMENT, f2 INTEGER) ENGINE=InnoDB;
+INSERT INTO t1 (f2) SELECT 1 FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4, ten AS a5;
+
+--connection node_1
+--send INSERT INTO t1 (f2) SELECT 1 FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4, ten AS a5;
+
+--let $galera_connection_name = node_1a
+--let $galera_server_number = 1
+--source include/galera_connect.inc
+
+--connection node_1a
+--send CREATE INDEX i1 ON t1 (f2);
+
+
+--let $galera_connection_name = node_1b
+--let $galera_server_number = 1
+--source include/galera_connect.inc
+
+--connection node_1b
+--send ALTER TABLE t1 ADD COLUMN f3 INTEGER;
+
+--connection node_1
+--reap
+
+--connection node_1a
+--reap
+
+--connection node_1b
+--reap
+
+--connection node_2
+SELECT COUNT(*) = 200000 FROM t1;
+SELECT COUNT(*) = 3 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1';
+SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.STATISTICS WHERE TABLE_NAME = 't1';
+
+--connection node_1
+SELECT COUNT(*) = 200000 FROM t1;
+SELECT COUNT(*) = 3 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1';
+SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.STATISTICS WHERE TABLE_NAME = 't1';
+
+DROP TABLE t1;
+DROP TABLE ten;
--- /dev/null
+#
+# Test the operation of DDLs that affect multiple database objects
+#
+
+--source include/big_test.inc
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+
+--let $galera_connection_name = node_1a
+--let $galera_server_number = 1
+--source include/galera_connect.inc
+
+--connection node_1
+CREATE DATABASE database1;
+USE database1;
+
+CREATE TABLE ten (f1 INTEGER) ENGINE=InnoDB;
+INSERT INTO ten VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9),(10);
+
+CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB;
+CREATE TABLE t2 (f1 INTEGER) ENGINE=InnoDB;
+
+# Insert 1M rows
+--send INSERT INTO t1 (f1) SELECT 1 FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4, ten AS a5;
+
+--connection node_1a
+USE database1;
+--send INSERT INTO t2 (f1) SELECT 1 FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4, ten AS a5;
+
+--connection node_2
+--sleep 1
+--send DROP DATABASE database1;
+
+--connection node_1
+--sleep 30
+--error ER_NO_SUCH_TABLE
+--reap
+
+--connection node_1a
+--error ER_NO_SUCH_TABLE
+--reap
+
+--connection node_2
+--reap
+
+--connection node_1
+SELECT COUNT(*) = 0 FROM INFORMATION_SCHEMA.SCHEMATA WHERE SCHEMA_NAME = 'database1';
+--error ER_BAD_DB_ERROR
+USE database1;
+
+--connection node_2
+SELECT COUNT(*) = 0 FROM INFORMATION_SCHEMA.SCHEMATA WHERE SCHEMA_NAME = 'database1';
+--error ER_BAD_DB_ERROR
+USE database1;
--- /dev/null
+#
+# Test the operation of TRUNCATE with concurrent DML. Even in the face of a concurrent INSERT,
+# the TRUNCATE will complete first and be recorded in the history before the INSERT.
+#
+
+--source include/big_test.inc
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+
+#
+# INSERT and TRUNCATE on different nodes
+#
+
+--connection node_1
+CREATE TABLE ten (f1 INTEGER) ENGINE=InnoDB;
+INSERT INTO ten VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9),(10);
+
+CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB;
+
+# Insert 100K rows
+--connection node_2
+--send INSERT INTO t1 (f1) SELECT 1 FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4, ten AS a5, ten AS a6;
+
+--connection node_1
+--sleep 1
+--send TRUNCATE TABLE t1;
+
+--connection node_1
+--reap
+
+--connection node_2
+--reap
+
+--connection node_2
+SELECT COUNT(*) = 1000000 FROM t1;
+
+--connection node_1
+--let $wait_condition = SELECT COUNT(*) = 1000000 FROM t1;
+--source include/wait_condition.inc
+
+DROP TABLE t1;
+
+#
+# INSERT AND TRUNCATE on same node
+#
+
+--let $galera_connection_name = node_1a
+--let $galera_server_number = 1
+--source include/galera_connect.inc
+
+--connection node_1
+
+CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB;
+
+# Insert 100K rows
+--connection node_1
+--send INSERT INTO t1 (f1) SELECT 1 FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4, ten AS a5, ten AS a6;
+
+--connection node_1a
+--sleep 1
+--send TRUNCATE TABLE t1;
+
+--connection node_1
+--reap
+
+--connection node_1a
+--reap
+
+--connection node_1
+SELECT COUNT(*) = 1000000 FROM t1;
+
+--connection node_2
+--let $wait_condition = SELECT COUNT(*) = 1000000 FROM t1;
+--source include/wait_condition.inc
+
+DROP TABLE t1;
+DROP TABLE ten;
--- /dev/null
+--source include/galera_cluster.inc
+
+CREATE TABLE ten (f1 INTEGER) ENGINE=InnoDB;
+INSERT INTO ten VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9),(10);
+
+CREATE TABLE t1 (f1 INTEGER AUTO_INCREMENT PRIMARY KEY, f2 INTEGER) ENGINE=InnoDB;
+
+--let $wsrep_max_ws_rows_orig = `SELECT @@wsrep_max_ws_rows`
+SET GLOBAL wsrep_max_ws_rows = 4;
+
+# Test that wsrep_max_ws_rows is enforced with multi statement transactions
+
+START TRANSACTION;
+INSERT INTO t1 (f2) VALUES (1);
+INSERT INTO t1 (f2) VALUES (2);
+INSERT INTO t1 (f2) VALUES (3);
+INSERT INTO t1 (f2) VALUES (4);
+--error ER_ERROR_DURING_COMMIT
+INSERT INTO t1 (f2) VALUES (5);
+COMMIT;
+SELECT COUNT(*) = 0 FROM t1;
+
+START TRANSACTION;
+INSERT INTO t1 (f2) VALUES (1);
+INSERT INTO t1 (f2) VALUES (2);
+INSERT INTO t1 (f2) VALUES (3);
+INSERT INTO t1 (f2) VALUES (4);
+--error ER_ERROR_DURING_COMMIT
+UPDATE t1 SET f2 = 10 WHERE f2 = 4;
+COMMIT;
+SELECT COUNT(*) = 0 FROM t1;
+
+START TRANSACTION;
+INSERT INTO t1 (f2) VALUES (1);
+INSERT INTO t1 (f2) VALUES (2);
+INSERT INTO t1 (f2) VALUES (3);
+INSERT INTO t1 (f2) VALUES (4);
+--error ER_ERROR_DURING_COMMIT
+DELETE FROM t1 WHERE f2 = 1;
+COMMIT;
+SELECT COUNT(*) = 0 FROM t1;
+
+
+# Test that wsrep_max_ws_rows is enforced on sigle statements
+
+SET GLOBAL wsrep_max_ws_rows = 5;
+INSERT INTO t1 (f2) VALUES (1),(2),(3),(4),(5);
+SET GLOBAL wsrep_max_ws_rows = 4;
+
+--error ER_ERROR_DURING_COMMIT
+UPDATE t1 SET f2 = f2 + 10;
+SELECT COUNT(*) = 5 FROM t1;
+
+--error ER_ERROR_DURING_COMMIT
+DELETE FROM t1 WHERE f2 < 10;
+SELECT COUNT(*) = 5 FROM t1;
+
+--error ER_ERROR_DURING_COMMIT
+INSERT INTO t1 (f2) SELECT * FROM ten;
+SELECT COUNT(*) = 5 FROM t1;
+
+--error ER_ERROR_DURING_COMMIT
+INSERT INTO t1 (f2) VALUES (10),(20),(30),(40),(50);
+SELECT COUNT(*) = 5 FROM t1;
+
+# Fewer than wsrep_max_ws_rows is OK
+
+SET GLOBAL wsrep_max_ws_rows = 10;
+DELETE FROM t1 WHERE f2 < 10;
+SELECT COUNT(*) = 0 FROM t1;
+
+# Test a series of transactions
+
+--disable_query_log
+SET GLOBAL wsrep_max_ws_rows = 5;
+let $i= 100;
+while ($i)
+{
+ START TRANSACTION;
+ --eval INSERT INTO t1 (f2) VALUES ($i);
+ COMMIT;
+ dec $i;
+}
+--enable_query_log
+SET GLOBAL wsrep_max_ws_rows = 100;
+SELECT COUNT(*) = 100 FROM t1;
+DELETE FROM t1 WHERE f2 < 101;
+SELECT COUNT(*) = 0 FROM t1;
+
+# Test large statements
+
+SET GLOBAL wsrep_max_ws_rows = 9999;
+--error ER_ERROR_DURING_COMMIT
+INSERT INTO t1 (f2) SELECT 1 FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4;
+SET GLOBAL wsrep_max_ws_rows = 10000;
+INSERT INTO t1 (f2) SELECT 1 FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4;
+
+SET GLOBAL wsrep_max_ws_rows = 9999;
+--error ER_ERROR_DURING_COMMIT
+UPDATE t1 SET f2 = 2 WHERE f2 = 1;
+SET GLOBAL wsrep_max_ws_rows = 10000;
+UPDATE t1 SET f2 = 2 WHERE f2 = 1;
+
+SET GLOBAL wsrep_max_ws_rows = 9999;
+--error ER_ERROR_DURING_COMMIT
+DELETE FROM t1 WHERE f2 = 2;
+SET GLOBAL wsrep_max_ws_rows = 10000;
+DELETE FROM t1 WHERE f2 = 2;
+
+SELECT COUNT(*) = 0 FROM t1;
+
+
+# Test that wsrep_max_ws_rows is reset when switching autocommit mode
+
+SET AUTOCOMMIT = ON;
+SET GLOBAL wsrep_max_ws_rows = 1;
+
+START TRANSACTION;
+INSERT INTO t1 (f2) VALUES (1);
+--error ER_ERROR_DURING_COMMIT
+INSERT INTO t1 (f2) VALUES (2);
+
+INSERT INTO t1 (f2) VALUES (1);
+INSERT INTO t1 (f2) VALUES (2);
+
+
+SET AUTOCOMMIT = OFF;
+START TRANSACTION;
+INSERT INTO t1 (f2) VALUES (1);
+--error ER_ERROR_DURING_COMMIT
+INSERT INTO t1 (f2) VALUES (2);
+
+INSERT INTO t1 (f2) VALUES (1);
+--error ER_ERROR_DURING_COMMIT
+INSERT INTO t1 (f2) VALUES (2);
+
+
+# Test that wsrep_max_ws_rows is reset on implicit commits
+
+START TRANSACTION;
+INSERT INTO t1 (f2) VALUES (1);
+
+START TRANSACTION;
+INSERT INTO t1 (f2) VALUES (1);
+--error ER_ERROR_DURING_COMMIT
+INSERT INTO t1 (f2) VALUES (2);
+
+
+--disable_query_log
+--eval SET GLOBAL wsrep_max_ws_rows = $wsrep_max_ws_rows_orig
+--enable_query_log
+
+DROP TABLE t1;
+DROP TABLE ten;
INSERT INTO t1 VALUES (DEFAULT, REPEAT('X', 1024));
SELECT COUNT(*) = 0 FROM t1;
+#
+# Changing repl.max_ws_size also changes wsrep_max_ws_size
+#
+
+SET GLOBAL wsrep_provider_options = 'repl.max_ws_size=10000';
+SELECT @@wsrep_max_ws_size = 10000;
+
+
+#
+# Changing wsrep_max_ws_size is equivalent to changing repl.max_ws_size
+#
+
+SET GLOBAL wsrep_provider_options = 'repl.max_ws_size=20000';
+--let $provider_options = `SELECT @@wsrep_provider_options`
+SET GLOBAL wsrep_provider_options = 'repl.max_ws_size=10000';
+
+SET GLOBAL wsrep_max_ws_size = 20000;
+--let $provider_options_updated = `SELECT @@wsrep_provider_options`
+
+--disable_query_log
+--eval SELECT STRCMP('$provider_options', '$provider_options_updated') = 0 AS provider_options_match
+--enable_query_log
+
--disable_query_log
--eval SET GLOBAL wsrep_max_ws_size = $wsrep_max_ws_size_orig
--enable_query_log
--- /dev/null
+#
+# PXC-318: Typo in wsrep_provider_options causes an unhandled exception
+#
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+--let LOGF=$MYSQLTEST_VARDIR/log/mysqld.1.err
+--disable_info
+call mtr.add_suppression("WSREP\: Unknown parameter 'gmcasts\.segment'");
+call mtr.add_suppression("WSREP\: Set options returned 7");
+--error ER_WRONG_ARGUMENTS
+SET GLOBAL wsrep_provider_options="gmcasts.segment=1";
+# Search for unhandled exception message.
+perl;
+ use strict;
+ my $logf= $ENV{'LOGF'} or die "LOGF not set";
+ open(FILE, "$logf") or die("Unable to open $logf: $!\n");
+ my $count_warnings=grep(/terminate called after throwing an instance of /gi,<FILE>);
+ print "Unhandled exceptions: $count_warnings\n";
+ close(FILE);
+EOF
--- /dev/null
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+
+CREATE TABLE t1 (id INT PRIMARY KEY) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1);
+
+--connection node_2
+FLUSH TABLES t1 FOR EXPORT;
+
+--connection node_1
+ALTER TABLE t1 ADD COLUMN f2 INTEGER;
+INSERT INTO t1 VALUES (2,3);
+
+--connection node_2
+UNLOCK TABLES;
+
+--echo ### t1 should have column f2
+SHOW CREATE TABLE t1;
+SELECT * from t1;
+
+--connection node_1
+DROP TABLE t1;
--- /dev/null
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+
+CREATE TABLE t1 (id INT PRIMARY KEY) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1);
+
+--connection node_2
+FLUSH TABLE WITH READ LOCK;
+--echo ### This shouldn't block.
+FLUSH TABLES t1 FOR EXPORT;
+
+--connection node_1
+ALTER TABLE t1 ADD COLUMN f2 INTEGER;
+
+--connection node_2
+UNLOCK TABLES;
+
+--echo ### t1 should have column f2
+SHOW CREATE TABLE t1;
+
+--connection node_1
+INSERT INTO t1 VALUES (2,3);
+
+--connection node_2
+SELECT * from t1;
+
+--connection node_1
+DROP TABLE t1;
--- /dev/null
+#
+# Test Flush tables with read lock along with
+# flush tables <table> with read lock for compatibility.
+# Also, making sure all DDL and DMLs are propagated
+# after provider is unpaused
+#
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+
+--let $galera_connection_name = node_2a
+--let $galera_server_number = 2
+--source include/galera_connect.inc
+
+--connection node_1
+CREATE TABLE t1 (id INT PRIMARY KEY) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1);
+
+--connection node_2
+SET session wsrep_sync_wait=0;
+SET session wsrep_causal_reads=OFF;
+FLUSH TABLE WITH READ LOCK;
+
+--connection node_1
+ALTER TABLE t1 ADD COLUMN f2 INTEGER;
+INSERT INTO t1 VALUES (2,3);
+
+--connection node_2a
+SET session wsrep_sync_wait=0;
+SET session wsrep_causal_reads=OFF;
+SHOW CREATE TABLE t1;
+--sleep 1
+--send FLUSH TABLES t1 WITH READ LOCK;
+
+--connection node_2
+# let the flush table wait in pause state before we unlock
+# table otherwise there is window where-in flush table is
+# yet to wait in pause and unlock allows alter table to proceed.
+# this is because send in asynchronous.
+--sleep 3
+# this will release existing lock but will not resume
+# the cluster as there is new FTRL that is still pausing it.
+UNLOCK TABLES;
+SHOW CREATE TABLE t1;
+
+--connection node_2a
+--reap
+UNLOCK TABLES;
+--sleep 1
+SHOW CREATE TABLE t1;
+SELECT * from t1;
+
+--connection node_1
+DROP TABLE t1;
--- /dev/null
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+
+CREATE TABLE t1 (id INT PRIMARY KEY) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1);
+
+--connection node_2
+FLUSH TABLES t1 WITH READ LOCK;
+
+--connection node_1
+ALTER TABLE t1 ADD COLUMN f2 INTEGER;
+INSERT INTO t1 VALUES (2,3);
+
+--sleep 2
+
+--connection node_2
+UNLOCK TABLES;
+
+--echo ### t1 should have column f2
+SHOW CREATE TABLE t1;
+SELECT * from t1;
+
+--connection node_1
+DROP TABLE t1;
--- /dev/null
+#
+# PXC-421: Test deadlock involving updates of
+# wsrep_provider, wsrep_cluster_address and wsrep_slave_threads.
+#
+
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+
+--connection node_1
+--let $wsrep_slave_1 = `SELECT @@wsrep_slave_threads`
+set GLOBAL wsrep_slave_threads=26;
+CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1);
+INSERT INTO t1 (f1) SELECT * from t1 as x1;
+
+--connection node_2
+--let $wsrep_slave_2 = `SELECT @@wsrep_slave_threads`
+set GLOBAL wsrep_slave_threads=16;
+--let $wsrep_provider_orig = `SELECT @@wsrep_provider`
+--let $wsrep_cluster_address_orig = `SELECT @@wsrep_cluster_address`
+
+SET GLOBAL wsrep_provider='none';
+INSERT INTO t1 VALUES (2);
+
+--connection node_1
+INSERT INTO t1 VALUES (3);
+
+--connection node_2
+--disable_query_log
+--eval SET GLOBAL wsrep_provider = '$wsrep_provider_orig';
+--eval SET GLOBAL wsrep_cluster_address = '$wsrep_cluster_address_orig';
+--enable_query_log
+
+--source include/wait_until_connected_again.inc
+--source include/galera_wait_ready.inc
+
+INSERT INTO t1 VALUES (4);
+set GLOBAL wsrep_slave_threads=5;
+
+# Node #2 has all the inserts
+SELECT COUNT(*) = 5 FROM t1;
+
+--connection node_1
+set GLOBAL wsrep_slave_threads=12;
+# Node #1 is missing the insert made while Node #2 was not replicated
+SELECT COUNT(*) = 4 FROM t1;
+INSERT INTO t1 VALUES (100), (101), (102);
+
+--connection node_2
+set GLOBAL wsrep_slave_threads=5;
+INSERT INTO t1 (f1) SELECT * from t1 as x1;
+show global variables like 'wsrep_slave_threads';
+--eval SET GLOBAL wsrep_slave_threads = $wsrep_slave_2
+SELECT COUNT(*) FROM t1;
+
+--connection node_1
+SELECT COUNT(*) FROM t1;
+show global variables like 'wsrep_slave_threads';
+--eval SET GLOBAL wsrep_slave_threads = $wsrep_slave_1
+DROP TABLE t1;
[mysqld.1]
wsrep_cluster_address='gcomm://'
-wsrep_provider_options='base_port=@mysqld.1.#galera_port'
+wsrep_provider_options='base_port=@mysqld.1.#galera_port;evs.suspect_timeout=PT10S'
wsrep_sst_receive_address=127.0.0.2:@mysqld.1.#sst_port
wsrep_node_incoming_address=127.0.0.1:@mysqld.1.port
[mysqld.2]
wsrep_cluster_address='gcomm://127.0.0.1:@mysqld.1.#galera_port'
-wsrep_provider_options='base_port=@mysqld.2.#galera_port'
+wsrep_provider_options='base_port=@mysqld.2.#galera_port;evs.suspect_timeout=PT10S'
wsrep_sst_receive_address=127.0.0.2:@mysqld.2.#sst_port
wsrep_node_incoming_address=127.0.0.1:@mysqld.2.port
[mysqld.3]
wsrep_cluster_address='gcomm://127.0.0.1:@mysqld.1.#galera_port'
-wsrep_provider_options='base_port=@mysqld.3.#galera_port'
+wsrep_provider_options='base_port=@mysqld.3.#galera_port;evs.suspect_timeout=PT10S'
wsrep_sst_receive_address=127.0.0.2:@mysqld.3.#sst_port
wsrep_node_incoming_address=127.0.0.1:@mysqld.3.port
SET GLOBAL wsrep_provider_options = 'gmcast.isolate=1';
SET GLOBAL wsrep_provider_options = 'gmcast.isolate=1';
SET SESSION wsrep_sync_wait = 0;
-SHOW STATUS LIKE 'wsrep_cluster_status';
-Variable_name Value
-wsrep_cluster_status non-Primary
SET GLOBAL wsrep_provider_options = 'pc.bootstrap=1';
SHOW STATUS LIKE 'wsrep_cluster_size';
Variable_name Value
SET GLOBAL wsrep_provider_options = 'pc.weight=3';
Suspending node ...
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
--- /dev/null
+# We need a dedicated .cnf file, even if empty, in order to force this test to run
+# alone on a freshly started cluster. Otherwise there are adverse interactions with
+# prior tests such as galera_3nodes.galera_innobackupex_backup
+
+!include ../galera_3nodes.cnf
# Node #2 should be non-primary
SET SESSION wsrep_sync_wait = 0;
-SHOW STATUS LIKE 'wsrep_cluster_status';
+--let $wait_condition = SELECT variable_value = 'non-Primary' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE variable_name = 'wsrep_cluster_status';
+--source include/wait_condition.inc
# Signal node #2 to bootstrap
--connection node_2
--- /dev/null
+# We need a dedicated .cnf file, even if empty, in order to force this test to run
+# alone on a freshly started cluster. Otherwise there are adverse interactions with
+# following tests such as galera_3nodes.galera_var_dirty_reads2
+
+!include ../galera_3nodes.cnf
SET SESSION wsrep_sync_wait=0;
--source include/wait_until_connected_again.inc
+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;
+
# 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
--connection node_1
--source include/galera_resume.inc
---sleep 5
+--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 = 3 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
--source include/wait_condition.inc
+--connection node_2
+--let $wait_condition = SELECT VARIABLE_VALUE = 'Primary' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status';
+--source include/wait_condition.inc
+
DROP TABLE t1;
--- /dev/null
+#
+#Bug #21133329 HANGING "SYSTEM LOCK" WHEN EXECUTING "FLUSH TABLE ... FOR EXPORT"
+#
+CREATE TABLE t1 (
+c1 BIGINT NOT NULL AUTO_INCREMENT PRIMARY KEY,
+c2 BIGINT,
+c3 VARCHAR(2048),
+c4 VARCHAR(2048),
+INDEX idx1(c2),
+INDEX idx2(c3(512)),
+INDEX idx3(c4(512))) Engine=InnoDB;
+CREATE TABLE t2 ( f1 int PRIMARY KEY) engine=innodb;
+SET GLOBAL INNODB_PURGE_STOP_NOW=ON;
+SET GLOBAL innodb_disable_background_merge=ON;
+SET GLOBAL innodb_stats_persistent=OFF;
+show variables like '%innodb_stats_persistent%';
+Variable_name Value
+innodb_stats_persistent OFF
+innodb_stats_persistent_sample_pages 20
+INSERT INTO t1(c2, c3, c4) VALUES
+(1, REPEAT('a', 2048), REPEAT('a', 2048)),
+(2, REPEAT('b', 2048), REPEAT('b', 2048)),
+(3, REPEAT('c', 2048), REPEAT('c', 2048)),
+(4, REPEAT('d', 2048), REPEAT('d', 2048));
+INSERT INTO t1(c2, c3, c4) SELECT c2, c3, c4 FROM t1;
+INSERT INTO t1(c2, c3, c4) SELECT c2, c3, c4 FROM t1;
+INSERT INTO t1(c2, c3, c4) SELECT c2, c3, c4 FROM t1;
+INSERT INTO t1(c2, c3, c4) SELECT c2, c3, c4 FROM t1;
+INSERT INTO t1(c2, c3, c4) SELECT c2, c3, c4 FROM t1;
+INSERT INTO t1(c2, c3, c4) SELECT c2, c3, c4 FROM t1;
+FLUSH TABLES t2 FOR EXPORT;
+UNLOCK TABLES;
+SET GLOBAL innodb_disable_background_merge=OFF;
+SET GLOBAL INNODB_PURGE_RUN_NOW=ON;
+SET GLOBAL innodb_stats_persistent=ON;
+DROP TABLE t1,t2;
--- /dev/null
+SET @old_innodb_file_per_table = @@innodb_file_per_table;
+SET GLOBAL innodb_file_per_table = 1;
+SELECT @@innodb_file_per_table;
+@@innodb_file_per_table
+1
+CREATE TABLE t1 (
+col_1 CHAR (255),
+col_2 VARCHAR (255)
+) ENGINE = InnoDB;
+CREATE INDEX idx1 ON t1(col_1);
+CREATE INDEX idx2 ON t1(col_2);
+SHOW INDEXES FROM t1;
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
+t1 1 idx1 1 col_1 A 0 NULL NULL YES BTREE
+t1 1 idx2 1 col_2 A 0 NULL NULL YES BTREE
+INSERT INTO t1 VALUES ("col1_00001", "col2_00001"), ("col1_00002", "col2_00002");
+SHOW INDEXES FROM t1;
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
+t1 1 idx1 1 col_1 A 2 NULL NULL YES BTREE
+t1 1 idx2 1 col_2 A 2 NULL NULL YES BTREE
+ANALYZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 analyze status OK
+SHOW INDEXES FROM t1;
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
+t1 1 idx1 1 col_1 A 2 NULL NULL YES BTREE
+t1 1 idx2 1 col_2 A 2 NULL NULL YES BTREE
+FLUSH TABLES t1 FOR EXPORT;
+backup: t1
+UNLOCK TABLES;
+DROP TABLE t1;
+CREATE TABLE t1 (
+col_1 CHAR (255),
+col_2 VARCHAR (255)
+) ENGINE = InnoDB;
+CREATE INDEX idx1 ON t1(col_1);
+CREATE INDEX idx2 ON t1(col_2);
+SHOW INDEXES FROM t1;
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
+t1 1 idx1 1 col_1 A 0 NULL NULL YES BTREE
+t1 1 idx2 1 col_2 A 0 NULL NULL YES BTREE
+INSERT INTO t1 VALUES ("col1_00001", "col2_00001");
+SHOW INDEXES FROM t1;
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
+t1 1 idx1 1 col_1 A 1 NULL NULL YES BTREE
+t1 1 idx2 1 col_2 A 1 NULL NULL YES BTREE
+ANALYZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 analyze status OK
+SHOW INDEXES FROM t1;
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
+t1 1 idx1 1 col_1 A 1 NULL NULL YES BTREE
+t1 1 idx2 1 col_2 A 1 NULL NULL YES BTREE
+ALTER TABLE t1 DISCARD TABLESPACE;
+restore: t1 .ibd and .cfg files
+ALTER TABLE t1 IMPORT TABLESPACE;
+SHOW INDEXES FROM t1;
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
+t1 1 idx1 1 col_1 A 2 NULL NULL YES BTREE
+t1 1 idx2 1 col_2 A 2 NULL NULL YES BTREE
+ANALYZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 analyze status OK
+SHOW INDEXES FROM t1;
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
+t1 1 idx1 1 col_1 A 2 NULL NULL YES BTREE
+t1 1 idx2 1 col_2 A 2 NULL NULL YES BTREE
+DROP TABLE t1;
+SET GLOBAL innodb_file_per_table = @old_innodb_file_per_table;
--- /dev/null
+# INPLACE ALTER WITH INPLACE_IGNORE FLAG AND CHANGE CREATE OPTION
+# CHANGE THE COLUMN DEFAULT (INPLACE_IGNORE)
+# AND TABLE CHARSET(CHANGE CREATE)
+CREATE TABLE t1(
+id INT PRIMARY KEY,
+f1 INT NOT NULL DEFAULT 0)ENGINE=INNODB;
+INSERT INTO t1 VALUES(1, 2);
+ALTER TABLE t1 MODIFY COLUMN f1 INT NOT NULL DEFAULT 0,
+DEFAULT CHARSET=latin1, ALGORITHM=INPLACE;
+DROP TABLE t1;
+# CHANGE THE STORAGE TYPE OF COLUMN(INPLACE IGNORE)
+# AND TABLE CHARSET(CHANGE CREATE)
+CREATE TABLE t1(
+id INT STORAGE DISK)ENGINE=INNODB;
+INSERT INTO t1 values(1);
+ALTER TABLE t1 MODIFY COLUMN id INT STORAGE MEMORY,
+DEFAULT CHARSET=latin1, ALGORITHM=INPLACE;
+DROP TABLE t1;
+# RENAME THE TABLE(INPLACE IGNORE)
+# AND CHANGE TABLE CHARSET(CHANGE CREATE)
+CREATE TABLE t1(
+f1 INT NOT NULL,
+f2 INT NOT NULL)ENGINE=INNODB;
+INSERT INTO t1 VALUES(1, 2);
+ALTER TABLE t1 RENAME t2, DEFAULT CHARSET=latin1, ALGORITHM=INPLACE;
+DROP TABLE t2;
`IF(NULL IS NOT NULL, NULL, NULL)` binary(0) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1
DROP TABLE table_54044;
-CREATE TABLE tmp ENGINE = INNODB AS SELECT COALESCE(NULL, NULL, NULL), GREATEST(NULL, NULL), NULL;
+CREATE TABLE tmp ENGINE = INNODB
+AS SELECT COALESCE(NULL, NULL, NULL), GREATEST(NULL, NULL), NULL;
SHOW CREATE TABLE tmp;
Table Create Table
tmp CREATE TABLE `tmp` (
--- /dev/null
+#
+# Bug #21983865 UNEXPECTED DEADLOCK WITH INNODB_AUTOINC_LOCK_MODE=0
+#
+create table t1(f1 int not null auto_increment primary key) engine=innodb;
+# Hold autoinc_lock on table t1 from connection con1
+set debug_sync='ib_after_row_insert SIGNAL others WAIT_FOR continue_others';
+insert into t1 values(NULL);
+# Create 40 connections and make it to wait for autoinc_lock on table t1.
+# Release the auto_inc lock on table t1 for connection con1
+set debug_sync='now SIGNAL continue_others';
+# Now all 40 connections can finish the insert operation on t1.
+drop table t1;
set global innodb_monitor_disable = default;
set global innodb_monitor_reset = default;
set global innodb_monitor_reset_all = default;
+#
+# Bug#22576241 SETTING INNODB_MONITOR_ENABLE TO ALL DOES NOT ENABLE ALL
+# MONITORS
+#
+CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE=InnoDB;
+SELECT NAME, COUNT FROM INFORMATION_SCHEMA.INNODB_METRICS WHERE NAME
+LIKE 'buffer_page_written_index_leaf';
+NAME COUNT
+buffer_page_written_index_leaf 0
+SET GLOBAL innodb_monitor_enable='module_buffer_page';
+INSERT INTO t1 VALUES (1), (2), (3), (4);
+FLUSH TABLES t1 FOR EXPORT;
+UNLOCK TABLES;
+SELECT NAME, COUNT FROM INFORMATION_SCHEMA.INNODB_METRICS WHERE NAME
+LIKE 'buffer_page_written_index_leaf';
+NAME COUNT
+buffer_page_written_index_leaf NNNN
+SET GLOBAL innodb_monitor_disable='module_buffer_page';
+SET GLOBAL innodb_monitor_reset_all='module_buffer_page';
+SELECT NAME, COUNT FROM INFORMATION_SCHEMA.INNODB_METRICS WHERE NAME
+LIKE 'buffer_page_written_index_leaf';
+NAME COUNT
+buffer_page_written_index_leaf 0
+SET GLOBAL innodb_monitor_enable='%';
+INSERT INTO t1 VALUES (5), (6), (7), (8);
+FLUSH TABLES t1 FOR EXPORT;
+UNLOCK TABLES;
+SELECT NAME, COUNT FROM INFORMATION_SCHEMA.INNODB_METRICS WHERE NAME
+LIKE 'buffer_page_written_index_leaf';
+NAME COUNT
+buffer_page_written_index_leaf NNNN
+SET GLOBAL innodb_monitor_disable='%';
+SET GLOBAL innodb_monitor_reset_all='%';
+SELECT NAME, COUNT FROM INFORMATION_SCHEMA.INNODB_METRICS WHERE NAME
+LIKE 'buffer_page_written_index_leaf';
+NAME COUNT
+buffer_page_written_index_leaf 0
+SET GLOBAL innodb_monitor_enable='ALL';
+INSERT INTO t1 VALUES (9), (10), (11), (12);
+FLUSH TABLES t1 FOR EXPORT;
+UNLOCK TABLES;
+SELECT NAME, COUNT FROM INFORMATION_SCHEMA.INNODB_METRICS WHERE NAME
+LIKE 'buffer_page_written_index_leaf';
+NAME COUNT
+buffer_page_written_index_leaf NNNN
+SET GLOBAL innodb_monitor_enable=default;
+SET GLOBAL innodb_monitor_disable=default;
+SET GLOBAL innodb_monitor_reset_all=default;
+DROP TABLE t1;
--- /dev/null
+
+--echo #
+--echo #Bug #21133329 HANGING "SYSTEM LOCK" WHEN EXECUTING "FLUSH TABLE ... FOR EXPORT"
+--echo #
+
+--source include/not_embedded.inc
+--source include/have_debug.inc
+--source include/have_innodb.inc
+
+CREATE TABLE t1 (
+ c1 BIGINT NOT NULL AUTO_INCREMENT PRIMARY KEY,
+ c2 BIGINT,
+ c3 VARCHAR(2048),
+ c4 VARCHAR(2048),
+ INDEX idx1(c2),
+ INDEX idx2(c3(512)),
+ INDEX idx3(c4(512))) Engine=InnoDB;
+
+CREATE TABLE t2 ( f1 int PRIMARY KEY) engine=innodb;
+
+# Stop purge so that it doesn't remove the delete marked entries.
+SET GLOBAL INNODB_PURGE_STOP_NOW=ON;
+
+# Disable change buffer merge from the master thread, additionally
+# enable aggressive flushing so that more changes are buffered.
+SET GLOBAL innodb_disable_background_merge=ON;
+SET GLOBAL innodb_stats_persistent=OFF;
+show variables like '%innodb_stats_persistent%';
+
+INSERT INTO t1(c2, c3, c4) VALUES
+ (1, REPEAT('a', 2048), REPEAT('a', 2048)),
+ (2, REPEAT('b', 2048), REPEAT('b', 2048)),
+ (3, REPEAT('c', 2048), REPEAT('c', 2048)),
+ (4, REPEAT('d', 2048), REPEAT('d', 2048));
+
+INSERT INTO t1(c2, c3, c4) SELECT c2, c3, c4 FROM t1;
+INSERT INTO t1(c2, c3, c4) SELECT c2, c3, c4 FROM t1;
+INSERT INTO t1(c2, c3, c4) SELECT c2, c3, c4 FROM t1;
+INSERT INTO t1(c2, c3, c4) SELECT c2, c3, c4 FROM t1;
+INSERT INTO t1(c2, c3, c4) SELECT c2, c3, c4 FROM t1;
+INSERT INTO t1(c2, c3, c4) SELECT c2, c3, c4 FROM t1;
+
+FLUSH TABLES t2 FOR EXPORT;
+UNLOCK TABLES;
+
+SET GLOBAL innodb_disable_background_merge=OFF;
+SET GLOBAL INNODB_PURGE_RUN_NOW=ON;
+SET GLOBAL innodb_stats_persistent=ON;
+
+DROP TABLE t1,t2;
innodb_stats_table_flag_auto_recalc : Performs multiple restarts in a row which causes '1047: Unknown command' errors
innodb-lock-inherit-read_commited : Cannot execute statement: impossible to write to binary log since BINLOG_FORMAT = STATEMENT
innodb-index-debug : Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT
+flush-hang : Unsafe statement written to the binary log
+innodb_deadlock_with_autoinc : Test uses autoinc_lock_mode = 0
--- /dev/null
+#
+# BUG#20125349 - PERSISTANT STATS IS NOT UPDATED WHEN TTS IS IMPORTED.
+#
+
+--source include/not_embedded.inc
+--source include/have_innodb.inc
+
+let MYSQLD_DATADIR =`SELECT @@datadir`;
+SET @old_innodb_file_per_table = @@innodb_file_per_table;
+
+SET GLOBAL innodb_file_per_table = 1;
+SELECT @@innodb_file_per_table;
+
+CREATE TABLE t1 (
+ col_1 CHAR (255),
+ col_2 VARCHAR (255)
+) ENGINE = InnoDB;
+
+CREATE INDEX idx1 ON t1(col_1);
+CREATE INDEX idx2 ON t1(col_2);
+
+SHOW INDEXES FROM t1;
+
+INSERT INTO t1 VALUES ("col1_00001", "col2_00001"), ("col1_00002", "col2_00002");
+
+SHOW INDEXES FROM t1;
+
+ANALYZE TABLE t1;
+SHOW INDEXES FROM t1;
+
+FLUSH TABLES t1 FOR EXPORT;
+perl;
+do 'include/innodb-util.inc';
+ib_backup_tablespaces("test", "t1");
+EOF
+
+UNLOCK TABLES;
+
+DROP TABLE t1;
+
+CREATE TABLE t1 (
+ col_1 CHAR (255),
+ col_2 VARCHAR (255)
+) ENGINE = InnoDB;
+
+CREATE INDEX idx1 ON t1(col_1);
+CREATE INDEX idx2 ON t1(col_2);
+
+SHOW INDEXES FROM t1;
+
+INSERT INTO t1 VALUES ("col1_00001", "col2_00001");
+
+SHOW INDEXES FROM t1;
+
+ANALYZE TABLE t1;
+SHOW INDEXES FROM t1;
+
+ALTER TABLE t1 DISCARD TABLESPACE;
+
+perl;
+do 'include/innodb-util.inc';
+ib_discard_tablespaces("test", "t1");
+ib_restore_tablespaces("test", "t1");
+EOF
+
+ALTER TABLE t1 IMPORT TABLESPACE;
+
+SHOW INDEXES FROM t1;
+
+ANALYZE TABLE t1;
+SHOW INDEXES FROM t1;
+
+DROP TABLE t1;
+
+SET GLOBAL innodb_file_per_table = @old_innodb_file_per_table;
+
+--remove_files_wildcard $MYSQLTEST_VARDIR/tmp t1*.ibd
+--remove_files_wildcard $MYSQLTEST_VARDIR/tmp t1*.cfg
--- /dev/null
+--echo # INPLACE ALTER WITH INPLACE_IGNORE FLAG AND CHANGE CREATE OPTION
+
+--echo # CHANGE THE COLUMN DEFAULT (INPLACE_IGNORE)
+--echo # AND TABLE CHARSET(CHANGE CREATE)
+
+CREATE TABLE t1(
+ id INT PRIMARY KEY,
+ f1 INT NOT NULL DEFAULT 0)ENGINE=INNODB;
+
+INSERT INTO t1 VALUES(1, 2);
+
+let id_before_alter =`SELECT table_id FROM INFORMATION_SCHEMA.INNODB_SYS_TABLES WHERE name="test/t1"`;
+
+ALTER TABLE t1 MODIFY COLUMN f1 INT NOT NULL DEFAULT 0,
+ DEFAULT CHARSET=latin1, ALGORITHM=INPLACE;
+
+let id_after_alter =`SELECT table_id FROM INFORMATION_SCHEMA.INNODB_SYS_TABLES WHERE name="test/t1"`;
+
+if ($id_before_alter != $id_after_alter)
+{
+ --echo "Table rebuild happened";
+}
+
+DROP TABLE t1;
+
+--echo # CHANGE THE STORAGE TYPE OF COLUMN(INPLACE IGNORE)
+--echo # AND TABLE CHARSET(CHANGE CREATE)
+
+CREATE TABLE t1(
+ id INT STORAGE DISK)ENGINE=INNODB;
+
+INSERT INTO t1 values(1);
+
+let id_before_alter =`SELECT table_id FROM INFORMATION_SCHEMA.INNODB_SYS_TABLES WHERE name="test/t1"`;
+
+ALTER TABLE t1 MODIFY COLUMN id INT STORAGE MEMORY,
+ DEFAULT CHARSET=latin1, ALGORITHM=INPLACE;
+
+let id_after_alter =`SELECT table_id FROM INFORMATION_SCHEMA.INNODB_SYS_TABLES WHERE name="test/t1"`;
+
+if ($id_before_alter != $id_after_alter)
+{
+ --echo "Table rebuild happened";
+}
+
+DROP TABLE t1;
+
+--echo # RENAME THE TABLE(INPLACE IGNORE)
+--echo # AND CHANGE TABLE CHARSET(CHANGE CREATE)
+
+CREATE TABLE t1(
+ f1 INT NOT NULL,
+ f2 INT NOT NULL)ENGINE=INNODB;
+
+INSERT INTO t1 VALUES(1, 2);
+
+let id_before_alter =`SELECT table_id FROM INFORMATION_SCHEMA.INNODB_SYS_TABLES WHERE name="test/t1"`;
+
+ALTER TABLE t1 RENAME t2, DEFAULT CHARSET=latin1, ALGORITHM=INPLACE;
+
+let id_after_alter =`SELECT table_id FROM INFORMATION_SCHEMA.INNODB_SYS_TABLES WHERE name="test/t2"`;
+
+if ($id_before_alter != $id_after_alter)
+{
+ --echo "Table rebuild happened";
+}
+
+DROP TABLE t2;
SHOW CREATE TABLE table_54044;
DROP TABLE table_54044;
-# These 'create table' operations should fail because of
-# using NULL datatype
+# This 'create table' should pass since it uses a Field_string of size 0.
-CREATE TABLE tmp ENGINE = INNODB AS SELECT COALESCE(NULL, NULL, NULL), GREATEST(NULL, NULL), NULL;
+CREATE TABLE tmp ENGINE = INNODB
+ AS SELECT COALESCE(NULL, NULL, NULL), GREATEST(NULL, NULL), NULL;
SHOW CREATE TABLE tmp;
DROP TABLE tmp;
-
--- /dev/null
+--innodb-autoinc-lock-mode=0
--- /dev/null
+--source include/have_debug.inc
+--source include/have_innodb.inc
+--source include/have_debug_sync.inc
+--source include/count_sessions.inc
+
+--echo #
+--echo # Bug #21983865 UNEXPECTED DEADLOCK WITH INNODB_AUTOINC_LOCK_MODE=0
+--echo #
+
+create table t1(f1 int not null auto_increment primary key) engine=innodb;
+
+--echo # Hold autoinc_lock on table t1 from connection con1
+connect (con1, localhost, root);
+set debug_sync='ib_after_row_insert SIGNAL others WAIT_FOR continue_others';
+--send insert into t1 values(NULL)
+
+connection default;
+--echo # Create 40 connections and make it to wait for autoinc_lock on table t1.
+--disable_query_log
+set debug_sync='now WAIT_FOR others';
+let $1=2;
+while ($1 < 40) {
+ connect (con$1,localhost,root);
+ --send insert into t1 values(NULL)
+ inc $1;
+ connection default;
+}
+
+connect (con40,localhost,root);
+--enable_query_log
+--echo # Release the auto_inc lock on table t1 for connection con1
+set debug_sync='now SIGNAL continue_others';
+
+--echo # Now all 40 connections can finish the insert operation on t1.
+let $1=1;
+connection default;
+disconnect con40;
+while ($1 < 40) {
+ connection con$1;
+ --reap
+ connection default;
+ disconnect con$1;
+ inc $1;
+}
+
+drop table t1;
+--source include/wait_until_count_sessions.inc
set global innodb_monitor_reset = default;
set global innodb_monitor_reset_all = default;
-- enable_warnings
+
+--echo #
+--echo # Bug#22576241 SETTING INNODB_MONITOR_ENABLE TO ALL DOES NOT ENABLE ALL
+--echo # MONITORS
+--echo #
+CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE=InnoDB;
+
+let $innodb_monitor_enable = `SELECT @@innodb_monitor_enable`;
+
+--replace_regex /[1-9]/NNNN/
+SELECT NAME, COUNT FROM INFORMATION_SCHEMA.INNODB_METRICS WHERE NAME
+LIKE 'buffer_page_written_index_leaf';
+
+SET GLOBAL innodb_monitor_enable='module_buffer_page';
+INSERT INTO t1 VALUES (1), (2), (3), (4); FLUSH TABLES t1 FOR EXPORT;
+UNLOCK TABLES;
+--replace_regex /[1-9]/NNNN/
+SELECT NAME, COUNT FROM INFORMATION_SCHEMA.INNODB_METRICS WHERE NAME
+LIKE 'buffer_page_written_index_leaf';
+
+SET GLOBAL innodb_monitor_disable='module_buffer_page';
+SET GLOBAL innodb_monitor_reset_all='module_buffer_page';
+--replace_regex /[1-9]/NNNN/
+SELECT NAME, COUNT FROM INFORMATION_SCHEMA.INNODB_METRICS WHERE NAME
+LIKE 'buffer_page_written_index_leaf';
+
+SET GLOBAL innodb_monitor_enable='%';
+INSERT INTO t1 VALUES (5), (6), (7), (8); FLUSH TABLES t1 FOR EXPORT;
+UNLOCK TABLES;
+--replace_regex /[1-9]/NNNN/
+SELECT NAME, COUNT FROM INFORMATION_SCHEMA.INNODB_METRICS WHERE NAME
+LIKE 'buffer_page_written_index_leaf';
+
+SET GLOBAL innodb_monitor_disable='%';
+SET GLOBAL innodb_monitor_reset_all='%';
+--replace_regex /[1-9]/NNNN/
+SELECT NAME, COUNT FROM INFORMATION_SCHEMA.INNODB_METRICS WHERE NAME
+LIKE 'buffer_page_written_index_leaf';
+
+SET GLOBAL innodb_monitor_enable='ALL';
+INSERT INTO t1 VALUES (9), (10), (11), (12); FLUSH TABLES t1 FOR EXPORT;
+UNLOCK TABLES;
+--replace_regex /[1-9]/NNNN/
+SELECT NAME, COUNT FROM INFORMATION_SCHEMA.INNODB_METRICS WHERE NAME
+LIKE 'buffer_page_written_index_leaf';
+
+--disable_warnings
+SET GLOBAL innodb_monitor_enable=default;
+SET GLOBAL innodb_monitor_disable=default;
+SET GLOBAL innodb_monitor_reset_all=default;
+--enable_warnings
+
+DROP TABLE t1;
AGAINST ('"more test proximity"' IN BOOLEAN MODE);
id title body
drop table articles;
+#
+# Bug #22679185 INVALID INNODB FTS DOC ID DURING INSERT
+#
+create table t1 (f1 int not null primary key, f2 varchar(100),
+FTS_DOC_ID bigint(20) unsigned not null,
+unique key `FTS_DOC_ID_INDEX` (`FTS_DOC_ID`),
+fulltext key (f2))engine=innodb;
+insert into t1 values(1, "This is the first record", 20000);
+insert into t1 values(2, "This is the second record", 40000);
+select FTS_DOC_ID from t1;
+FTS_DOC_ID
+20000
+40000
+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;
+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
+131071
+196606
+262141
+drop table t1;
1 database
2 mysql
DROP TABLE t1;
+# Case 4: Test sync commit & rollback in background
+CREATE TABLE t1(
+id INT AUTO_INCREMENT,
+title VARCHAR(100),
+FULLTEXT(title),
+PRIMARY KEY(id)) ENGINE=InnoDB;
+SET SESSION debug="+d,fts_instrument_sync";
+INSERT INTO t1(title) VALUES('mysql');
+SET SESSION debug="-d,fts_instrument_sync";
+SET GLOBAL debug="+d,fts_instrument_sync,fts_instrument_sync_interrupted";
+INSERT INTO t1(title) VALUES('database');
+SET GLOBAL debug="-d,fts_instrument_sync,fts_instrument_sync_interrupted";
+SET SESSION debug="+d,fts_instrument_sync_debug";
+INSERT INTO t1(title) VALUES('good');
+SET SESSION debug="-d,fts_instrument_sync_debug";
+SET GLOBAL innodb_ft_aux_table="test/t1";
+SELECT * FROM INFORMATION_SCHEMA.INNODB_FT_INDEX_TABLE;
+WORD FIRST_DOC_ID LAST_DOC_ID DOC_COUNT DOC_ID POSITION
+database 2 2 1 2 0
+good 3 3 1 3 0
+mysql 1 1 1 1 0
+SELECT * FROM INFORMATION_SCHEMA.INNODB_FT_INDEX_CACHE;
+WORD FIRST_DOC_ID LAST_DOC_ID DOC_COUNT DOC_ID POSITION
+SET GLOBAL innodb_ft_aux_table=default;
+SELECT * FROM t1 WHERE MATCH(title) AGAINST ('mysql database good');
+id title
+1 mysql
+2 database
+3 good
+DROP TABLE t1;
AGAINST ('"more test proximity"' IN BOOLEAN MODE);
drop table articles;
+
+--echo #
+--echo # Bug #22679185 INVALID INNODB FTS DOC ID DURING INSERT
+--echo #
+
+create table t1 (f1 int not null primary key, f2 varchar(100),
+ FTS_DOC_ID bigint(20) unsigned not null,
+ unique key `FTS_DOC_ID_INDEX` (`FTS_DOC_ID`),
+ fulltext key (f2))engine=innodb;
+
+insert into t1 values(1, "This is the first record", 20000);
+insert into t1 values(2, "This is the second record", 40000);
+select FTS_DOC_ID from t1;
+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;
+
+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;
+drop table t1;
--echo # Case 3: Test insert crash recovery
--let $_expect_file_name=$MYSQLTEST_VARDIR/tmp/mysqld.$_server_id.expect
-connect (con1,localhost,root,,);
-
CREATE TABLE t1 (
FTS_DOC_ID BIGINT UNSIGNED AUTO_INCREMENT NOT NULL PRIMARY KEY,
title VARCHAR(200),
DROP TABLE t1;
+--echo # Case 4: Test sync commit & rollback in background
+CREATE TABLE t1(
+ id INT AUTO_INCREMENT,
+ title VARCHAR(100),
+ FULLTEXT(title),
+ PRIMARY KEY(id)) ENGINE=InnoDB;
+
+SET SESSION debug="+d,fts_instrument_sync";
+INSERT INTO t1(title) VALUES('mysql');
+SET SESSION debug="-d,fts_instrument_sync";
+
+--source include/restart_mysqld.inc
+
+SET GLOBAL debug="+d,fts_instrument_sync,fts_instrument_sync_interrupted";
+INSERT INTO t1(title) VALUES('database');
+SET GLOBAL debug="-d,fts_instrument_sync,fts_instrument_sync_interrupted";
+
+SET SESSION debug="+d,fts_instrument_sync_debug";
+INSERT INTO t1(title) VALUES('good');
+SET SESSION debug="-d,fts_instrument_sync_debug";
+
+SET GLOBAL innodb_ft_aux_table="test/t1";
+SELECT * FROM INFORMATION_SCHEMA.INNODB_FT_INDEX_TABLE;
+SELECT * FROM INFORMATION_SCHEMA.INNODB_FT_INDEX_CACHE;
+SET GLOBAL innodb_ft_aux_table=default;
+
+SELECT * FROM t1 WHERE MATCH(title) AGAINST ('mysql database good');
+
+DROP TABLE t1;
+
--source include/wait_until_count_sessions.inc
--- /dev/null
+#!/usr/bin/perl
+use strict;
+use JSON;
+use File::Spec::Functions qw/ canonpath /;
+my $usage = "This is from WL#5257 \"first API for optimizer trace\".
+
+Usage:
+ %s [-q] <a_file> <another_file> <etc>
+
+ -q quiet mode: only display errors and warnings.
+
+It will verify that all optimizer traces of files (usually a_file
+is a .result or .reject file which contains
+SELECT * FROM OPTIMIZER_TRACE; ) are JSON-compliant, and that
+they contain no duplicates keys.
+Exit code is 0 if all ok.";
+my $retcode = 0;
+my @ignored;
+my @input = @ARGV;
+
+# Filter out "-q" options
+@input = grep {!/-q/} @input;
+
+if (!@input)
+{
+ print "$usage\n";
+ exit 1;
+}
+
+# If command line contains at least one "-q" option, it is quiet mode
+my $quiet= scalar(@input) <= scalar(@ARGV) -1;
+# On Windows, command line arguments specified using wildcards need to be evaluated.
+# On Unix too if the arguments are passed with single quotes.
+my $need_parse = grep(/\*/,@input);
+if ($need_parse)
+{
+ my $platform_independent_dir;
+ $platform_independent_dir= canonpath "@input";
+ @input= glob "$platform_independent_dir";
+}
+
+foreach my $input_file (@input)
+{
+ handle_one_file($input_file);
+ print "\n";
+}
+
+if ( @ignored )
+{
+ print STDERR "These files have been ignored:\n";
+ foreach my $ig ( @ignored )
+ {
+ print "$ig\n";
+ }
+ print "\n";
+}
+if ( $retcode )
+{
+ print STDERR "There are errors\n";
+}
+
+else
+{
+ print "\n";
+ print "ALL OK\n";
+}
+
+exit $retcode;
+
+sub handle_one_file {
+
+ my ( $input_file ) = @_;
+ if ( $input_file =~ /^.*(ctype_.*|mysqldump)\.result/ )
+ {
+ push @ignored ,$input_file;
+ return;
+ }
+ print "FILE $input_file\n";
+ print "\n";
+ open(DATA,"<$input_file") or die "Can't open file";
+ my @lines = <DATA>;
+ close(DATA);
+ my $first_trace_line = 0;
+ my $trace_line = 0;
+ my @trace = undef;
+ label_to: foreach my $i ( @lines )
+ {
+ $trace_line = $trace_line + 1;
+ if (( grep(/^.*(\t)?{\n/,$i) ) and ( $first_trace_line == 0 ))
+ {
+ @trace = undef;
+ $first_trace_line = $trace_line;
+ push @trace, "{\n";
+ next label_to;
+ }
+ if (( $i =~ /^}/ ) and ( $first_trace_line != 0))
+ {
+ push @trace, "}";
+ check($first_trace_line,@trace);
+ $first_trace_line = 0;
+ }
+ if ( $first_trace_line != 0 )
+ {
+ # Eliminate /* */ from end_marker=on (not valid JSON)
+ $i =~ s/\/\*.*\*\// /g;
+ push @trace, $i;
+ }
+
+ }
+}
+
+
+sub check {
+
+ my ( $first_trace_line, @trace ) = @_;
+ my $string = join("", @trace);
+ my $parsed;
+ eval { $parsed = decode_json($string); };
+ unless ( $parsed )
+ {
+ print "Parse error at line: $first_trace_line\n";
+ my $error = $@;
+ print "Error: $@\n";
+ # If there is a character position specified, put a mark ('&') in front of this character
+ if ($error =~ /invalid character.*at character offset (\d+)/)
+ {
+ substr($string,$1,0) = "&";
+ print "$string\n";
+ }
+ else
+ {
+ print "$string\n";
+ }
+ $retcode = 1;
+ print "\n";
+ return;
+ }
+ # Detect non-unique keys in one object, by counting
+ # number of quote symbols ("): the json module outputs only
+ # one of the non-unique keys, making the number of "
+ # smaller compared to the input string.
+
+ my $before = $string =~ tr/'"'//;
+ my $re_json;
+ $re_json= to_json($parsed);
+ my $after = $re_json =~ tr/'"'//;
+ if ( $before != $after )
+ {
+ print "Non-unique keys at line $first_trace_line ( $before vs $after )\n";
+ print "$string\n";
+ $retcode = 1;
+ print "\n";
+ return;
+ }
+ if ( !$quiet )
+ {
+ print "OK at line $first_trace_line\n";
+ }
+}
+++ /dev/null
-#! /usr/bin/python
-
-# Copyright (c) 2011, 2012, 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 */
-
-import sys
-
-usage = """
-This is from WL#5257 "first API for optimizer trace".
-
-Usage:
- %s [-q] <a_file> <another_file> <etc>
-
- -q quiet mode: only display errors and warnings.
-
-It will verify that all optimizer traces of files (usually a_file
-is a .result or .reject file which contains
-SELECT * FROM OPTIMIZER_TRACE; ) are JSON-compliant, and that
-they contain no duplicates keys.
-Exit code is 0 if all ok.
-""" % sys.argv[0]
-
-input_files = filter(lambda x: x != '-q', sys.argv[1:]) # filter out "-q" options
-
-if not input_files:
- print usage
- sys.exit(1)
-
-quiet = len(input_files) < len(sys.argv) - 1 # command line contains at least one "-q" option
-
-import json, re
-
-trace_start_re = re.compile(r"^.*(\t)?{\n")
-trace_end_re = re.compile(r"^}")
-ignorable_re = re.compile(r"^.*(ctype_.*|mysqldump)\.result")
-
-def check(trace, first_trace_line):
- global retcode
- s = "".join(trace)
- try:
- parsed = json.loads(s)
- except:
- print "parse error at line", first_trace_line
- error = str(sys.exc_info())
- print error
- # if there is a character position specified, put a mark ('&')
- # in front of this character
- matchobj = re.search(r"ValueError\('Invalid control character at: line \d+ column \d+ \(char (\d+)\)'", error)
- if matchobj:
- first_error_char = int(matchobj.group(1))
- print s[:first_error_char] + "&" + s[first_error_char:]
- else:
- print s
- retcode = 1
- print
- return
- # detect non-unique keys in one object, by counting
- # number of quote symbols ("'): the json module outputs only
- # one of the non-unique keys, making the number of " and '
- # smaller compared to the input string.
- before = s.count('"') + s.count("'")
- str_parsed = str(parsed)
- after = str_parsed.count('"') + str_parsed.count("'")
- if (before != after):
- print "non-unique keys at line %d (%d vs %d)" % (first_trace_line, before, after)
- print s
- retcode = 1
- print
- return
- if not quiet:
- print "ok at line", first_trace_line
-
-def handle_one_file(name):
- if ignorable_re.match(name):
- ignored.append(name)
- return
- print "FILE %s" % name
- print
- all = open(name).readlines()
- first_trace_line = trace_line = 0
- trace = None
- for l in all:
- trace_line += 1
- if trace_start_re.match(l) and first_trace_line == 0:
- trace = []
- first_trace_line = trace_line
- trace.append("{\n")
- continue
- if trace_end_re.match(l):
- assert first_trace_line != 0
- trace.append("}") # eliminate any following columns of table (MISSING_PRIVILEGES etc)
- check(trace, first_trace_line)
- first_trace_line = 0
- if first_trace_line != 0:
- # eliminate /* */ from end_marker=on (not valid JSON)
- no_comment = re.sub("/\*.*\*/", "", l)
- trace.append(no_comment)
-
-retcode=0
-ignored=[]
-for f in input_files:
- handle_one_file(f)
- print
-if ignored:
- print >>sys.stderr, "Those files have been ignored", ignored
-print
-if retcode:
- print >>sys.stderr, "THERE ARE ERRORS"
-else:
- print "ALL OK"
-sys.exit(retcode)
+++ /dev/null
-"General cleanup"
-drop table if exists t1;
-update performance_schema.setup_instruments set enabled = 'NO';
-update performance_schema.setup_consumers set enabled = 'NO';
-truncate table performance_schema.file_summary_by_event_name;
-truncate table performance_schema.file_summary_by_instance;
-truncate table performance_schema.socket_summary_by_event_name;
-truncate table performance_schema.socket_summary_by_instance;
-truncate table performance_schema.events_waits_summary_global_by_event_name;
-truncate table performance_schema.events_waits_summary_by_instance;
-truncate table performance_schema.events_waits_summary_by_thread_by_event_name;
-update performance_schema.setup_consumers set enabled = 'YES';
-update performance_schema.setup_instruments
-set enabled = 'YES', timed = 'YES';
-create table t1 (
-id INT PRIMARY KEY,
-b CHAR(100) DEFAULT 'initial value')
-ENGINE=MyISAM;
-insert into t1 (id) values (1), (2), (3), (4), (5), (6), (7), (8);
-update performance_schema.setup_instruments SET enabled = 'NO';
-update performance_schema.setup_consumers set enabled = 'NO';
-set @dump_all=FALSE;
-"Verifying file aggregate consistency"
-SELECT EVENT_NAME, e.COUNT_READ, SUM(i.COUNT_READ)
-FROM performance_schema.file_summary_by_event_name AS e
-JOIN performance_schema.file_summary_by_instance AS i USING (EVENT_NAME)
-GROUP BY EVENT_NAME
-HAVING (e.COUNT_READ <> SUM(i.COUNT_READ))
-OR @dump_all;
-EVENT_NAME COUNT_READ SUM(i.COUNT_READ)
-SELECT EVENT_NAME, e.COUNT_WRITE, SUM(i.COUNT_WRITE)
-FROM performance_schema.file_summary_by_event_name AS e
-JOIN performance_schema.file_summary_by_instance AS i USING (EVENT_NAME)
-GROUP BY EVENT_NAME
-HAVING (e.COUNT_WRITE <> SUM(i.COUNT_WRITE))
-OR @dump_all;
-EVENT_NAME COUNT_WRITE SUM(i.COUNT_WRITE)
-SELECT EVENT_NAME, e.COUNT_READ, SUM(i.COUNT_READ)
-FROM performance_schema.socket_summary_by_event_name AS e
-JOIN performance_schema.socket_summary_by_instance AS i USING (EVENT_NAME)
-GROUP BY EVENT_NAME
-HAVING (e.COUNT_READ <> SUM(i.COUNT_READ))
-OR @dump_all;
-EVENT_NAME COUNT_READ SUM(i.COUNT_READ)
-SELECT EVENT_NAME, e.COUNT_WRITE, SUM(i.COUNT_WRITE)
-FROM performance_schema.socket_summary_by_event_name AS e
-JOIN performance_schema.socket_summary_by_instance AS i USING (EVENT_NAME)
-GROUP BY EVENT_NAME
-HAVING (e.COUNT_WRITE <> SUM(i.COUNT_WRITE))
-OR @dump_all;
-EVENT_NAME COUNT_WRITE SUM(i.COUNT_WRITE)
-SELECT EVENT_NAME, e.SUM_NUMBER_OF_BYTES_READ, SUM(i.SUM_NUMBER_OF_BYTES_READ)
-FROM performance_schema.file_summary_by_event_name AS e
-JOIN performance_schema.file_summary_by_instance AS i USING (EVENT_NAME)
-GROUP BY EVENT_NAME
-HAVING (e.SUM_NUMBER_OF_BYTES_READ <> SUM(i.SUM_NUMBER_OF_BYTES_READ))
-OR @dump_all;
-EVENT_NAME SUM_NUMBER_OF_BYTES_READ SUM(i.SUM_NUMBER_OF_BYTES_READ)
-SELECT EVENT_NAME, e.SUM_NUMBER_OF_BYTES_WRITE, SUM(i.SUM_NUMBER_OF_BYTES_WRITE)
-FROM performance_schema.file_summary_by_event_name AS e
-JOIN performance_schema.file_summary_by_instance AS i USING (EVENT_NAME)
-GROUP BY EVENT_NAME
-HAVING (e.SUM_NUMBER_OF_BYTES_WRITE <> SUM(i.SUM_NUMBER_OF_BYTES_WRITE))
-OR @dump_all;
-EVENT_NAME SUM_NUMBER_OF_BYTES_WRITE SUM(i.SUM_NUMBER_OF_BYTES_WRITE)
-"Verifying waits aggregate consistency (instance)"
-SELECT EVENT_NAME, e.SUM_TIMER_WAIT, SUM(i.SUM_TIMER_WAIT)
-FROM performance_schema.events_waits_summary_global_by_event_name AS e
-JOIN performance_schema.events_waits_summary_by_instance AS i USING (EVENT_NAME)
-GROUP BY EVENT_NAME
-HAVING (e.SUM_TIMER_WAIT < SUM(i.SUM_TIMER_WAIT))
-OR @dump_all;
-EVENT_NAME SUM_TIMER_WAIT SUM(i.SUM_TIMER_WAIT)
-SELECT EVENT_NAME, e.MIN_TIMER_WAIT, MIN(i.MIN_TIMER_WAIT)
-FROM performance_schema.events_waits_summary_global_by_event_name AS e
-JOIN performance_schema.events_waits_summary_by_instance AS i USING (EVENT_NAME)
-GROUP BY EVENT_NAME
-HAVING (e.MIN_TIMER_WAIT > MIN(i.MIN_TIMER_WAIT))
-AND (MIN(i.MIN_TIMER_WAIT) != 0)
-OR @dump_all;
-EVENT_NAME MIN_TIMER_WAIT MIN(i.MIN_TIMER_WAIT)
-SELECT EVENT_NAME, e.MAX_TIMER_WAIT, MAX(i.MAX_TIMER_WAIT)
-FROM performance_schema.events_waits_summary_global_by_event_name AS e
-JOIN performance_schema.events_waits_summary_by_instance AS i USING (EVENT_NAME)
-GROUP BY EVENT_NAME
-HAVING (e.MAX_TIMER_WAIT < MAX(i.MAX_TIMER_WAIT))
-OR @dump_all;
-EVENT_NAME MAX_TIMER_WAIT MAX(i.MAX_TIMER_WAIT)
-"Verifying waits aggregate consistency (thread)"
-SELECT EVENT_NAME, e.SUM_TIMER_WAIT, SUM(t.SUM_TIMER_WAIT)
-FROM performance_schema.events_waits_summary_global_by_event_name AS e
-JOIN performance_schema.events_waits_summary_by_thread_by_event_name AS t
-USING (EVENT_NAME)
-GROUP BY EVENT_NAME
-HAVING (e.SUM_TIMER_WAIT < SUM(t.SUM_TIMER_WAIT))
-OR @dump_all;
-EVENT_NAME SUM_TIMER_WAIT SUM(t.SUM_TIMER_WAIT)
-SELECT EVENT_NAME, e.MIN_TIMER_WAIT, MIN(t.MIN_TIMER_WAIT)
-FROM performance_schema.events_waits_summary_global_by_event_name AS e
-JOIN performance_schema.events_waits_summary_by_thread_by_event_name AS t
-USING (EVENT_NAME)
-GROUP BY EVENT_NAME
-HAVING (e.MIN_TIMER_WAIT > MIN(t.MIN_TIMER_WAIT))
-AND (MIN(t.MIN_TIMER_WAIT) != 0)
-OR @dump_all;
-EVENT_NAME MIN_TIMER_WAIT MIN(t.MIN_TIMER_WAIT)
-SELECT EVENT_NAME, e.MAX_TIMER_WAIT, MAX(t.MAX_TIMER_WAIT)
-FROM performance_schema.events_waits_summary_global_by_event_name AS e
-JOIN performance_schema.events_waits_summary_by_thread_by_event_name AS t
-USING (EVENT_NAME)
-GROUP BY EVENT_NAME
-HAVING (e.MAX_TIMER_WAIT < MAX(t.MAX_TIMER_WAIT))
-OR @dump_all;
-EVENT_NAME MAX_TIMER_WAIT MAX(t.MAX_TIMER_WAIT)
-update performance_schema.setup_consumers set enabled = 'YES';
-update performance_schema.setup_instruments
-set enabled = 'YES', timed = 'YES';
-drop table test.t1;
+++ /dev/null
-# Tests for PERFORMANCE_SCHEMA
-# Verify that statistics aggregated by different criteria are consistent.
-
---source include/not_embedded.inc
---source include/have_perfschema.inc
---source include/have_QC_Disabled.inc
-
---echo "General cleanup"
-
---disable_warnings
-drop table if exists t1;
---enable_warnings
-
-update performance_schema.setup_instruments set enabled = 'NO';
-update performance_schema.setup_consumers set enabled = 'NO';
-
-# Cleanup statistics
-truncate table performance_schema.file_summary_by_event_name;
-truncate table performance_schema.file_summary_by_instance;
-truncate table performance_schema.socket_summary_by_event_name;
-truncate table performance_schema.socket_summary_by_instance;
-truncate table performance_schema.events_waits_summary_global_by_event_name;
-truncate table performance_schema.events_waits_summary_by_instance;
-truncate table performance_schema.events_waits_summary_by_thread_by_event_name;
-
-# Start recording data
-update performance_schema.setup_consumers set enabled = 'YES';
-update performance_schema.setup_instruments
- set enabled = 'YES', timed = 'YES';
-
-
-create table t1 (
- id INT PRIMARY KEY,
- b CHAR(100) DEFAULT 'initial value')
- ENGINE=MyISAM;
-
-insert into t1 (id) values (1), (2), (3), (4), (5), (6), (7), (8);
-
-# Stop recording data, so the select below don't add noise.
-update performance_schema.setup_instruments SET enabled = 'NO';
-# Disable all consumers, for long standing waits
-update performance_schema.setup_consumers set enabled = 'NO';
-
-# Helper to debug
-set @dump_all=FALSE;
-
-# Note that in general:
-# - COUNT/SUM/MAX(file_summary_by_event_name) >=
-# COUNT/SUM/MAX(file_summary_by_instance).
-# - MIN(file_summary_by_event_name) <=
-# MIN(file_summary_by_instance).
-# There will be equality only when file instances are not removed,
-# aka when a file is not deleted from the file system,
-# because doing so removes a row in file_summary_by_instance.
-
-# Likewise:
-# - COUNT/SUM/MAX(events_waits_summary_global_by_event_name) >=
-# COUNT/SUM/MAX(events_waits_summary_by_instance)
-# - MIN(events_waits_summary_global_by_event_name) <=
-# MIN(events_waits_summary_by_instance)
-# There will be equality only when an instrument instance
-# is not removed, which is next to impossible to predictably guarantee
-# in the server.
-# For example, a MyISAM table removed from the table cache
-# will cause a mysql_mutex_destroy on myisam/MYISAM_SHARE::intern_lock.
-# Another example, a thread terminating will cause a mysql_mutex_destroy
-# on sql/LOCK_delete
-# Both cause a row to be deleted from events_waits_summary_by_instance.
-
-# Likewise:
-# - COUNT/SUM/MAX(events_waits_summary_global_by_event_name) >=
-# COUNT/SUM/MAX(events_waits_summary_by_thread_by_event_name)
-# - MIN(events_waits_summary_global_by_event_name) <=
-# MIN(events_waits_summary_by_thread_by_event_name)
-# There will be equality only when no thread is removed,
-# that is if no thread disconnects, or no sub thread (for example insert
-# delayed) ever completes.
-# A thread completing will cause rows in
-# events_waits_summary_by_thread_by_event_name to be removed.
-
---echo "Verifying file aggregate consistency"
-
-# Since the code generating the load in this test does:
-# - create table
-# - insert
-# - does not cause temporary tables to be used
-# we can test for equality here for file aggregates.
-
-# If any of these queries returns data, the test failed.
-
-SELECT EVENT_NAME, e.COUNT_READ, SUM(i.COUNT_READ)
-FROM performance_schema.file_summary_by_event_name AS e
-JOIN performance_schema.file_summary_by_instance AS i USING (EVENT_NAME)
-GROUP BY EVENT_NAME
-HAVING (e.COUNT_READ <> SUM(i.COUNT_READ))
-OR @dump_all;
-
-SELECT EVENT_NAME, e.COUNT_WRITE, SUM(i.COUNT_WRITE)
-FROM performance_schema.file_summary_by_event_name AS e
-JOIN performance_schema.file_summary_by_instance AS i USING (EVENT_NAME)
-GROUP BY EVENT_NAME
-HAVING (e.COUNT_WRITE <> SUM(i.COUNT_WRITE))
-OR @dump_all;
-
-SELECT EVENT_NAME, e.COUNT_READ, SUM(i.COUNT_READ)
-FROM performance_schema.socket_summary_by_event_name AS e
-JOIN performance_schema.socket_summary_by_instance AS i USING (EVENT_NAME)
-GROUP BY EVENT_NAME
-HAVING (e.COUNT_READ <> SUM(i.COUNT_READ))
-OR @dump_all;
-
-SELECT EVENT_NAME, e.COUNT_WRITE, SUM(i.COUNT_WRITE)
-FROM performance_schema.socket_summary_by_event_name AS e
-JOIN performance_schema.socket_summary_by_instance AS i USING (EVENT_NAME)
-GROUP BY EVENT_NAME
-HAVING (e.COUNT_WRITE <> SUM(i.COUNT_WRITE))
-OR @dump_all;
-
-SELECT EVENT_NAME, e.SUM_NUMBER_OF_BYTES_READ, SUM(i.SUM_NUMBER_OF_BYTES_READ)
-FROM performance_schema.file_summary_by_event_name AS e
-JOIN performance_schema.file_summary_by_instance AS i USING (EVENT_NAME)
-GROUP BY EVENT_NAME
-HAVING (e.SUM_NUMBER_OF_BYTES_READ <> SUM(i.SUM_NUMBER_OF_BYTES_READ))
-OR @dump_all;
-
-SELECT EVENT_NAME, e.SUM_NUMBER_OF_BYTES_WRITE, SUM(i.SUM_NUMBER_OF_BYTES_WRITE)
-FROM performance_schema.file_summary_by_event_name AS e
-JOIN performance_schema.file_summary_by_instance AS i USING (EVENT_NAME)
-GROUP BY EVENT_NAME
-HAVING (e.SUM_NUMBER_OF_BYTES_WRITE <> SUM(i.SUM_NUMBER_OF_BYTES_WRITE))
-OR @dump_all;
-
---echo "Verifying waits aggregate consistency (instance)"
-
-SELECT EVENT_NAME, e.SUM_TIMER_WAIT, SUM(i.SUM_TIMER_WAIT)
-FROM performance_schema.events_waits_summary_global_by_event_name AS e
-JOIN performance_schema.events_waits_summary_by_instance AS i USING (EVENT_NAME)
-GROUP BY EVENT_NAME
-HAVING (e.SUM_TIMER_WAIT < SUM(i.SUM_TIMER_WAIT))
-OR @dump_all;
-
-SELECT EVENT_NAME, e.MIN_TIMER_WAIT, MIN(i.MIN_TIMER_WAIT)
-FROM performance_schema.events_waits_summary_global_by_event_name AS e
-JOIN performance_schema.events_waits_summary_by_instance AS i USING (EVENT_NAME)
-GROUP BY EVENT_NAME
-HAVING (e.MIN_TIMER_WAIT > MIN(i.MIN_TIMER_WAIT))
-AND (MIN(i.MIN_TIMER_WAIT) != 0)
-OR @dump_all;
-
-SELECT EVENT_NAME, e.MAX_TIMER_WAIT, MAX(i.MAX_TIMER_WAIT)
-FROM performance_schema.events_waits_summary_global_by_event_name AS e
-JOIN performance_schema.events_waits_summary_by_instance AS i USING (EVENT_NAME)
-GROUP BY EVENT_NAME
-HAVING (e.MAX_TIMER_WAIT < MAX(i.MAX_TIMER_WAIT))
-OR @dump_all;
-
---echo "Verifying waits aggregate consistency (thread)"
-
-SELECT EVENT_NAME, e.SUM_TIMER_WAIT, SUM(t.SUM_TIMER_WAIT)
-FROM performance_schema.events_waits_summary_global_by_event_name AS e
-JOIN performance_schema.events_waits_summary_by_thread_by_event_name AS t
-USING (EVENT_NAME)
-GROUP BY EVENT_NAME
-HAVING (e.SUM_TIMER_WAIT < SUM(t.SUM_TIMER_WAIT))
-OR @dump_all;
-
-SELECT EVENT_NAME, e.MIN_TIMER_WAIT, MIN(t.MIN_TIMER_WAIT)
-FROM performance_schema.events_waits_summary_global_by_event_name AS e
-JOIN performance_schema.events_waits_summary_by_thread_by_event_name AS t
-USING (EVENT_NAME)
-GROUP BY EVENT_NAME
-HAVING (e.MIN_TIMER_WAIT > MIN(t.MIN_TIMER_WAIT))
-AND (MIN(t.MIN_TIMER_WAIT) != 0)
-OR @dump_all;
-
-SELECT EVENT_NAME, e.MAX_TIMER_WAIT, MAX(t.MAX_TIMER_WAIT)
-FROM performance_schema.events_waits_summary_global_by_event_name AS e
-JOIN performance_schema.events_waits_summary_by_thread_by_event_name AS t
-USING (EVENT_NAME)
-GROUP BY EVENT_NAME
-HAVING (e.MAX_TIMER_WAIT < MAX(t.MAX_TIMER_WAIT))
-OR @dump_all;
-
-
-# Cleanup
-
-update performance_schema.setup_consumers set enabled = 'YES';
-update performance_schema.setup_instruments
- set enabled = 'YES', timed = 'YES';
-
-drop table test.t1;
--- /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 TABLE t (i INT AUTO_INCREMENT PRIMARY KEY) ENGINE=InnoDB;
+include/sync_slave_sql_with_master.inc
+SET @save_debug=@@debug;
+SET GLOBAL DEBUG='+d,die_if_autoinc_old_lock_style_used';
+[connection master]
+INSERT INTO t VALUES (1);
+DROP TABLE t;
+include/sync_slave_sql_with_master.inc
+SET GLOBAL DEBUG=@save_debug;
+include/rpl_end.inc
+++ /dev/null
-==== Configure ====
-==== Initialize ====
-include/rpl_init.inc [topology=1->2->3->4->5->1]
-include/rpl_sync.inc
-include/rpl_reset.inc
-==== Test ====
-==== Sync ====
-Reap all sent queries.
-include/rpl_stop_slaves.inc
-include/rpl_change_topology.inc [new topology=1->2->3->4->5->1]
-include/rpl_start_slaves.inc
-include/rpl_sync.inc
-==== Check result ====
-Check that GTID_EXECUTED is equal on all servers.
-Check that database state is equal on all servers.
-include/diff_servers.inc [servers=1 2 3 4 5 ]
-==== Clean up ====
-include/rpl_sync.inc
-include/rpl_end.inc
--- /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]
+#### I. Initialize ####
+[connection slave]
+include/stop_slave.inc
+SET @save.innodb_lock_wait_timeout= @@global.innodb_lock_wait_timeout;
+set @@global.innodb_lock_wait_timeout=5 + 1000;
+include/start_slave.inc
+[connection master]
+CREATE DATABASE d1;
+CREATE DATABASE d2;
+CREATE TABLE d1.t (a INT PRIMARY KEY, name text) ENGINE=INNODB;
+CREATE TABLE d2.t (a INT PRIMARY KEY, name text) ENGINE=INNODB;
+#### II. Prepare test scenario ####
+include/sync_slave_sql_with_master.inc
+BEGIN;
+INSERT INTO d2.t VALUES (2, 'Slave local');
+INSERT INTO d1.t VALUES (3, 'Slave local');
+[connection master]
+INSERT INTO d1.t VALUES (1, 'T1');
+INSERT INTO d2.t VALUES (1, 'T2');
+INSERT INTO d2.t VALUES (2, 'T3');
+INSERT INTO d2.t VALUES (3, 'T4');
+INSERT INTO d1.t VALUES (2, 'T5');
+[connection slave1]
+# Now d1.t has two rows and d2.t has one row.
+[connection slave]
+CALL mtr.add_suppression("Recovery from master pos");
+include/rpl_start_server.inc [server_number=2 parameters: --skip_slave_start=FALSE --relay_log_info_repository=TABLE --master_info_repository=TABLE --sync_master_info=1 --relay-log-recovery=1]
+After restart gaps should be filled.
+include/assert.inc [Table d1.t should contain 2 rows.]
+include/assert.inc [Table d2.t should contain 3 rows.]
+include/start_slave.inc
+[connection master]
+include/sync_slave_sql_with_master.inc
+include/diff_tables.inc [master:d1.t, slave:d1.t]
+include/diff_tables.inc [master:d2.t, slave:d2.t]
+[connection master]
+DROP DATABASE d1;
+DROP DATABASE d2;
+#### I. Initialize ####
+[connection slave]
+include/stop_slave.inc
+SET @save.innodb_lock_wait_timeout= @@global.innodb_lock_wait_timeout;
+set @@global.innodb_lock_wait_timeout=5 + 1000;
+include/start_slave.inc
+[connection master]
+CREATE DATABASE d1;
+CREATE DATABASE d2;
+CREATE TABLE d1.t (a INT PRIMARY KEY, name text) ENGINE=INNODB;
+CREATE TABLE d2.t (a INT PRIMARY KEY, name text) ENGINE=INNODB;
+#### II. Prepare test scenario ####
+include/sync_slave_sql_with_master.inc
+BEGIN;
+INSERT INTO d2.t VALUES (2, 'Slave local');
+INSERT INTO d1.t VALUES (3, 'Slave local');
+[connection master]
+INSERT INTO d1.t VALUES (1, 'T1');
+INSERT INTO d2.t VALUES (1, 'T2');
+INSERT INTO d2.t VALUES (2, 'T3');
+INSERT INTO d2.t VALUES (3, 'T4');
+INSERT INTO d1.t VALUES (2, 'T5');
+[connection slave1]
+# Now d1.t has two rows and d2.t has one row.
+[connection slave]
+CALL mtr.add_suppression("Recovery from master pos");
+include/rpl_start_server.inc [server_number=2 parameters: --skip_slave_start=TRUE --relay_log_info_repository=TABLE --master_info_repository=TABLE --sync_master_info=1 --relay-log-recovery=1]
+After restart gaps should be filled.
+include/assert.inc [Table d1.t should contain 2 rows.]
+include/assert.inc [Table d2.t should contain 3 rows.]
+include/start_slave.inc
+[connection master]
+include/sync_slave_sql_with_master.inc
+include/diff_tables.inc [master:d1.t, slave:d1.t]
+include/diff_tables.inc [master:d2.t, slave:d2.t]
+[connection master]
+DROP DATABASE d1;
+DROP DATABASE d2;
+include/rpl_end.inc
--- /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]
+[connection slave]
+call mtr.add_suppression("Duplicate entry*");
+call mtr.add_suppression("The slave coordinator and worker threads are stopped, possibly leaving data in inconsistent state");
+call mtr.add_suppression("Failed to initialize the master info structure");
+call mtr.add_suppression("Slave failed to initialize relay log info*");
+call mtr.add_suppression("MTS recovery: automatic recovery failed.*");
+call mtr.add_suppression("Recovery from master pos");
+#### I. Initialize ####
+[connection slave]
+include/stop_slave.inc
+SET @save.innodb_lock_wait_timeout= @@global.innodb_lock_wait_timeout;
+set @@global.innodb_lock_wait_timeout=5 + 1000;
+include/start_slave.inc
+[connection master]
+CREATE DATABASE d1;
+CREATE DATABASE d2;
+CREATE TABLE d1.t (a INT PRIMARY KEY, name text) ENGINE=INNODB;
+CREATE TABLE d2.t (a INT PRIMARY KEY, name text) ENGINE=INNODB;
+#### II. Prepare test scenario ####
+include/sync_slave_sql_with_master.inc
+BEGIN;
+INSERT INTO d2.t VALUES (2, 'Slave local');
+INSERT INTO d1.t VALUES (3, 'Slave local');
+[connection master]
+INSERT INTO d1.t VALUES (1, 'T1');
+INSERT INTO d2.t VALUES (1, 'T2');
+INSERT INTO d2.t VALUES (2, 'T3');
+INSERT INTO d2.t VALUES (3, 'T4');
+INSERT INTO d1.t VALUES (2, 'T5');
+[connection slave1]
+# Now d1.t has two rows and d2.t has one row.
+[connection slave]
+COMMIT;
+include/wait_for_slave_sql_error.inc [errno=1062]
+include/rpl_restart_server.inc [server_number=2 parameters: --skip_slave_start=TRUE --relay_log_info_repository=TABLE --master_info_repository=TABLE --sync_master_info=1 --relay-log-recovery=1]
+[connection slave]
+Relay log recovery should fail as MTS stopped due to an error
+START SLAVE;
+ERROR HY000: Slave failed to initialize relay log info structure from the repository
+Eliminate the cause of MTS error
+DELETE FROM d2.t WHERE a=2;
+DELETE FROM d1.t WHERE a=3;
+include/rpl_restart_server.inc [server_number=2 parameters: --skip_slave_start=TRUE --relay_log_info_repository=TABLE --master_info_repository=TABLE --sync_master_info=1 --relay-log-recovery=1]
+MTS recovery should be successful. Check that gaps are filled.
+include/assert.inc [Table d1.t should contain 2 rows.]
+include/assert.inc [Table d2.t should contain 3 rows.]
+include/start_slave.inc
+[connection master]
+include/sync_slave_sql_with_master.inc
+include/diff_tables.inc [master:d1.t, slave:d1.t]
+include/diff_tables.inc [master:d2.t, slave:d2.t]
+[connection master]
+DROP DATABASE d1;
+DROP DATABASE d2;
+include/rpl_end.inc
SELECT @@global.relay_log_recovery as 'must be ON';
must be ON
1
-call mtr.add_suppression("--relay-log-recovery cannot be executed when the slave was stopped with an error or killed in MTS mode; consider using RESET SLAVE or restart the server with --relay-log-recovery = 0");
+call mtr.add_suppression("MTS recovery: automatic recovery failed.*");
call mtr.add_suppression("Failed to initialize the master info structure");
call mtr.add_suppression("It is not possible to change the type of the relay log repository because there are workers repositories with possible execution gaps. The value of --relay_log_info_repository is altered to one of the found Worker repositories");
include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start]
include/wait_for_slave_sql_error.inc [errno=1032]
DROP TABLE t;
include/rpl_reset.inc
+CON: 'master', IMG: 'FULL', RESTART SLAVE: 'N'
+SET SESSION binlog_row_image= 'FULL';
+SET GLOBAL binlog_row_image= 'FULL';
+FLUSH TABLES;
+SHOW VARIABLES LIKE 'binlog_row_image';
+Variable_name Value
+binlog_row_image FULL
+CON: 'slave', IMG: 'FULL', RESTART SLAVE: 'Y'
+SET SESSION binlog_row_image= 'FULL';
+SET GLOBAL binlog_row_image= 'FULL';
+include/stop_slave.inc
+include/start_slave.inc
+FLUSH TABLES;
+SHOW VARIABLES LIKE 'binlog_row_image';
+Variable_name Value
+binlog_row_image FULL
+CREATE TABLE t1(id INT PRIMARY KEY, a INT) ENGINE = INNODB;
+include/sync_slave_sql_with_master.inc
+INSERT INTO t1 (id, a) VALUES (1, 1);
+"Case: FULL - EXPLAIN output should not display Using temporary"
+EXPLAIN UPDATE t1 SET a=a+1 WHERE id < 2;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 range PRIMARY PRIMARY 4 const 1 Using where
+UPDATE t1 SET a=a+1 WHERE id < 2;
+CON: 'master', IMG: 'NOBLOB', RESTART SLAVE: 'N'
+SET SESSION binlog_row_image= 'NOBLOB';
+SET GLOBAL binlog_row_image= 'NOBLOB';
+FLUSH TABLES;
+SHOW VARIABLES LIKE 'binlog_row_image';
+Variable_name Value
+binlog_row_image NOBLOB
+CON: 'slave', IMG: 'NOBLOB', RESTART SLAVE: 'Y'
+SET SESSION binlog_row_image= 'NOBLOB';
+SET GLOBAL binlog_row_image= 'NOBLOB';
+include/stop_slave.inc
+include/start_slave.inc
+FLUSH TABLES;
+SHOW VARIABLES LIKE 'binlog_row_image';
+Variable_name Value
+binlog_row_image NOBLOB
+"Case: NOBLOB - EXPLAIN output should not display Using temporary"
+EXPLAIN UPDATE t1 SET a=a+1 WHERE id < 2;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 range PRIMARY PRIMARY 4 const 1 Using where
+UPDATE t1 SET a=a+1 WHERE id < 2;
+CON: 'master', IMG: 'MINIMAL', RESTART SLAVE: 'N'
+SET SESSION binlog_row_image= 'MINIMAL';
+SET GLOBAL binlog_row_image= 'MINIMAL';
+FLUSH TABLES;
+SHOW VARIABLES LIKE 'binlog_row_image';
+Variable_name Value
+binlog_row_image MINIMAL
+CON: 'slave', IMG: 'MINIMAL', RESTART SLAVE: 'Y'
+SET SESSION binlog_row_image= 'MINIMAL';
+SET GLOBAL binlog_row_image= 'MINIMAL';
+include/stop_slave.inc
+include/start_slave.inc
+FLUSH TABLES;
+SHOW VARIABLES LIKE 'binlog_row_image';
+Variable_name Value
+binlog_row_image MINIMAL
+EXPLAIN UPDATE t1 SET a=a+1 WHERE id < 2;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 range PRIMARY PRIMARY 4 const 1 Using where
+UPDATE t1 SET a=a+1 WHERE id < 2;
+DROP TABLE t1;
+include/sync_slave_sql_with_master.inc
SET GLOBAL binlog_row_image= @old_binlog_row_image;
SET SESSION binlog_row_image= @old_binlog_row_image;
SET GLOBAL binlog_row_image= @old_binlog_row_image;
--- /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 TABLE t (name VARCHAR(25) DEFAULT NULL) ENGINE=InnoDB;
+include/sync_slave_sql_with_master.inc
+call mtr.add_suppression("Slave SQL.*Error executing row event: .Table .test.t. doesn.t exist., Error_code: 1146");
+call mtr.add_suppression("Slave SQL.*Column 0 of table .test.t. cannot be converted from type.* Error_code: 1677");
+call mtr.add_suppression("The slave coordinator and worker threads are stopped, possibly leaving data in inconsistent state");
+call mtr.add_suppression("Got error 1 during COMMIT");
+ALTER TABLE t CHANGE name name VARCHAR(255);
+[connection master]
+INSERT INTO t VALUE ('Amy');
+# Sync should be successful. Slave should not stop with an error
+# ER_SLAVE_CONVERSION_FAILED. It should be up and running in spite
+# of errors as we have set slave_skip_error=all.
+include/sync_slave_sql_with_master.inc
+DROP TABLE t;
+[connection master]
+UPDATE t SET name='New';
+# Sync should be successful. Slave should not stop with an error
+# ER_NO_SUCH_TABLE. It should be up and running in spite of errors
+# as we have set slave_skip_error=all.
+include/sync_slave_sql_with_master.inc
+# Enable a debug point to simulate failure during rows event cleanup.
+SET @@GLOBAL.DEBUG= 'd,simulate_rows_event_cleanup_failure';
+[connection master]
+UPDATE t SET name='Old';
+[connection slave]
+# Since this is not an ignored error slave should stop. We only ignore the
+# errors that are generated during the execution of an event. The other errors
+# that are generated during commit/rollback failure, which takes place during cleanup
+# cannot be ignored.
+include/wait_for_slave_sql_error.inc [errno=1180]
+==== Clean up ====
+SET @@GLOBAL.DEBUG= '$debug_saved';
+include/stop_slave_io.inc
+RESET MASTER;
+RESET SLAVE;
+include/start_slave.inc
+[connection master]
+include/sync_slave_sql_with_master.inc
+[connection master]
+DROP TABLE t;
+include/rpl_end.inc
CALL mtr.add_suppression("Master's UUID has changed, although this should not happen unless you have changed it manually");
CALL mtr.add_suppression("Slave I/O: SET @master_heartbeat_period to master failed with error: Lost connection to MySQL server during query");
CALL mtr.add_suppression("Notifying master by SET @master_binlog_checksum= @@global.binlog_checksum failed with error");
-CALL mtr.add_suppression("A slave with the same server_uuid as this slave has connected to the master");
+CALL mtr.add_suppression("A slave with the same server_uuid/server_id as this slave has connected to the master");
include/sync_slave_sql_with_master.inc
# Case 1:
--- /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]
+[connection slave]
+CALL mtr.add_suppression("Relay log read failure");
+SET @save_debug=@@GLOBAL.debug;
+SET GLOBAL debug="d,force_sql_thread_error";
+START SLAVE SQL_THREAD;
+include/wait_for_slave_sql_to_stop.inc
+SET GLOBAL debug=@save_debug;
+include/start_slave.inc
+[connection master]
+CREATE TABLE t1(i INT);
+DROP TABLE t1;
+include/rpl_end.inc
--- /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]
+include/stop_dump_threads.inc
+[connection slave]
+SET @save_debug = @@GLOBAL.debug;
+SET GLOBAL debug="d,fake_5_5_version_slave";
+include/start_slave_io.inc
+include/stop_slave_io.inc
+include/start_slave_io.inc
+[connection master]
+[connection slave]
+SET GLOBAL debug=@save_debug;
+include/rpl_end.inc
rpl_row_binlog_max_cache_size : BUG#14126780 May 29 2012 Vasil Dimov timeout if est number of rows is 3 instead of 4
rpl_test_framework : Too many servers started, so fails under Galera-enabled MTR
rpl_rotate_logs : codership/mysql-wsrep##71 Regression: Duplicate "file was not purged because it is the active log file" warning
-rpl.rpl_gtid_stress_failover : BUG#20630589 2015-10-06 parveez Test needs to be stabilized
--- /dev/null
+###############################################################################
+# Bug#22247668 SLAVE IS ~10X SLOWER TO EXECUTE SET OF STATEMENTS COMPARED TO
+# MASTER RBR
+# Problem: A new style of locking is implemented in Innodb. Starting from 5.6,
+# Innodb uses this new style of locking for all the cases except for the case
+# where for a simple (single/multi) row INSERTs, it fall back to old style
+# locking if another transaction has already acquired the AUTOINC lock on behalf of
+# a LOAD FILE or INSERT...SELECT etc. type of statement. But on
+# Slave, in RBR format, it is always using old style auto inc
+# algorithm.
+#
+# Steps to reproduce:
+# 1) Setup DEBUG simulation point on Slave to bring the server down
+# if the INSERT enters old style autoinc locking method.
+#
+# 2) Execute AUTOINC related work on Master.
+#
+# 3) Make sure that sync on slave happens without any issues.
+#
+###############################################################################
+--source include/have_debug.inc
+--source include/have_binlog_format_row.inc
+--source include/master-slave.inc
+
+# Initial setup
+CREATE TABLE t (i INT AUTO_INCREMENT PRIMARY KEY) ENGINE=InnoDB;
+--source include/sync_slave_sql_with_master.inc
+
+# Step-1 : Setup DEBUG simulation point on Slave to bring the server down
+# if the INSERT enters old style autoinc locking method.
+SET @save_debug=@@debug;
+SET GLOBAL DEBUG='+d,die_if_autoinc_old_lock_style_used';
+
+# Step-2 :Execute AUTOINC related work on Master.
+--source include/rpl_connection_master.inc
+INSERT INTO t VALUES (1);
+DROP TABLE t;
+
+# Step-3: Due to above DEBUG simulation point, server will go down if it enters
+# old autoinc lock style. After fix, sync on Slave happens without any issues.
+--source include/sync_slave_sql_with_master.inc
+
+# Cleanup
+# Reset the simulation point on Slave.
+SET GLOBAL DEBUG=@save_debug;
+--source include/rpl_end.inc
+++ /dev/null
-!include ../my.cnf
-[mysqld.1]
-gtid-mode=on
-enforce-gtid-consistency
-log-slave-updates
-
-[mysqld.2]
-gtid-mode=on
-enforce-gtid-consistency
-log-slave-updates
-
-[mysqld.3]
-gtid-mode=on
-enforce-gtid-consistency
-log-slave-updates
-server-id=3
-
-[mysqld.4]
-gtid-mode=on
-enforce-gtid-consistency
-log-slave-updates
-server-id=4
-
-[mysqld.5]
-gtid-mode=on
-enforce-gtid-consistency
-log-slave-updates
-server-id=5
-
-#[mysqld.6]
-#gtid-mode=on
-#enforce-gtid-consistency
-#log-slave-updates
-#server-id=6
-#
-#[mysqld.7]
-#gtid-mode=on
-#enforce-gtid-consistency
-#log-slave-updates
-#server-id=7
-#
-#[mysqld.8]
-#gtid-mode=on
-#enforce-gtid-consistency
-#log-slave-updates
-#server-id=8
-#
-#[mysqld.9]
-#gtid-mode=on
-#enforce-gtid-consistency
-#log-slave-updates
-#server-id=9
-
-[ENV]
-SERVER_MYPORT_3= @mysqld.3.port
-SERVER_MYPORT_4= @mysqld.4.port
-SERVER_MYPORT_5= @mysqld.5.port
-#SERVER_MYPORT_6= @mysqld.6.port
-#SERVER_MYPORT_7= @mysqld.7.port
-#SERVER_MYPORT_8= @mysqld.8.port
-#SERVER_MYPORT_9= @mysqld.9.port
+++ /dev/null
-# ==== Purpose ====
-#
-# Test that it is possible to change the topology completely randomly,
-# and the GTID system takes care of sending the correct transactions,
-# as long as all servers generate non-conflicting transactions.
-#
-# ==== Implementation ====
-#
-# Configure X servers and Y clients on each server. Iterate Z times.
-#
-# In each iteration, select a random server and select a random client
-# on that server. On this connection, perform each of the following
-# with a fixed probability:
-#
-# - A transaction (DML)
-# - A DDL statement
-# - FLUSH LOGS
-# - CHANGE MASTER to a random other server
-#
-# After all iterations are done, change to a circular topology and
-# wait for the servers to synchronize. Then check that all servers
-# have the same data.
-#
-# Details:
-# - We create as many databases as we have servers.
-# - Each server only executes DML / DDL on one database.
-# - Each database has one table per client. Initially, the table
-# names are t_1_0, t_2_0, ..., t_Y_0, where Y is the number of
-# clients per server, and all tables are empty.
-# - The DDL consists in replacing the table by t_y_i, where i is the
-# iteration counter and y is the client used in this iteration.
-# t_y_i is empty. We do this in a funny way (see the code) just to
-# use a couple of different DDL statements.
-# - The DML consists in replacing the contents of t_y_*, by the value
-# i, where i is the iteration counter and y is the client used in
-# this iteration. We do this in a funny way (see the code) just to
-# use a couple of diffrent DML statements.
-#
-# ==== Custom usage ====
-#
-# You can alter the behavior of this test by setting the following
-# variables (as environment variables or mtr variables):
-#
-# $debug
-# If set, print all statements (default off)
-#
-# $max_iterations
-# The maximal number of iterations to run. (default 10000)
-#
-# $max_seconds
-# The maximal time to run iterations. (default 300)
-#
-# $n_servers
-# The number of servers to run on (default 5)
-#
-# $n_clients_per_server
-# The number of clients to use for each server (default 5)
-#
-# $change_master_probability
-# The probability to execute CHANGE MASTER in each iteration (default 0.1)
-#
-# $flush_logs_probability
-# The probability to execute FLUSH LOGS in each iteration (default 0.05)
-#
-# $dml_probability
-# The probability to execute DML in each iteration (default 1)
-#
-# $ddl_probability
-# The probability to execute DDL in each iteration (default 0.1)
-#
-# $deterministic
-# By default, the random seed is taken to be a random number,
-# different for each run, and the test is deliberately executing
-# several tasks concurrently. If $deterministic is set, the random
-# seed is taken to be the value of $deterministic, and the
-# concurrency is reduced (but not entirely eliminated).
-#
-# ==== References ====
-#
-# WL#3584: Global Transaction Identifiers
-# - Created as part of this worklog
-# BUG#18385953: RPL_GTID_STRESS_FAILOVER FAILS WITH "ERROR IN SYNC_WITH_MASTER.INC"
-# - fixed bug in cleanup code
-
-#Want to skip this test from daily Valgrind execution
---source include/no_valgrind_without_big.inc
---source include/big_test.inc
---source include/have_gtid.inc
-
-# This test case has path issues when executing the
-# external command mysqldump.exe on windows. Since
-# what it tests is not platform dependent we disable
-# it on Windows.
---source include/not_windows.inc
-
-# This test case fails in MTS mode due to BUG#12995174
-# once that bug is fixed, the following line should be
-# removed so that the test is enabled in MTS
---source include/not_mts_slave_parallel_workers.inc
-
---echo ==== Configure ====
-
-if ($max_seconds == '')
-{
- --let $max_seconds= 300
-}
-if ($max_iterations == '')
-{
- --let $max_iterations= 10000
-}
-if (!$n_servers)
-{
- --let $n_servers= 5
-}
-if (!$n_clients_per_server)
-{
- --let $n_clients_per_server= 5
-}
-
-if ($change_master_probability == '')
-{
- --let $change_master_probability= 0.1
-}
-if ($flush_logs_probability == '')
-{
- --let $flush_logs_probability= 0.05
-}
-if ($dml_probability == '')
-{
- --let $dml_probability= 1
-}
-if ($ddl_probability == '')
-{
- --let $ddl_probability= 0.1
-}
-
-if ($deterministic != '')
-{
- --let $rand_seed= $deterministic
-}
-
---echo ==== Initialize ====
-
---let $underscore= _
---let $zero= 0
-
-if (!$debug)
-{
- --disable_query_log
- --disable_result_log
-}
-if ($debug)
-{
- --echo debug: n_servers=$n_servers n_clients_per_server=$n_clients_per_server max_iterations=$max_iterations max_seconds=$max_seconds
- --echo debug: change_master_probability=$change_master_probability flush_logs_probability=$flush_logs_probability dml_probability=$dml_probability ddl_probability=$ddl_probability
-}
-
---let $circular_topology= 1
---let $server_list=
---let $server= $n_servers
-while ($server > 0)
-{
- --let $circular_topology= $server->$circular_topology
- --let $server_list= $server $server_list
- --dec $server
-}
-
---let $rpl_extra_connections_per_server= $n_clients_per_server
---let $rpl_topology= $circular_topology
---let $use_gtids= 1
---source include/rpl_init.inc
-
---let $server= 1
-while ($server <= $n_servers)
-{
- --connection server_$server
- eval CREATE DATABASE db_$server;
-
- --let $client= 1
- while ($client <= $n_clients_per_server)
- {
- --let $connection= server_$server$underscore$client
- --connection $connection
-
- eval CREATE TABLE db_$server.t_$client$underscore$zero (a INT) ENGINE = InnoDB;
- eval SET @last_value = -1;
-
- --inc $client
- }
- --inc $server
-}
-
---source include/rpl_sync.inc
---source include/rpl_reset.inc
-
---let $server= 1
-while ($server <= $n_servers)
-{
- --let $client= 1
- while ($client <= $n_clients_per_server)
- {
- --connection server_$server$underscore$client
- send SELECT 1;
- --inc $client
- }
- --inc $server
-}
-
-
---echo ==== Test ====
-
---connection default
---let $iteration= 1
---let $start_time= `SELECT UNIX_TIMESTAMP()`
---let $done= 0
-while (!$done)
-{
- --connection default
-
- --let $rand_type= int
- --let $rand_min= 1
- --let $rand_max= $n_servers + 1
- --source include/rand.inc
- --let $server= $rand
-
- --let $rand_max= $n_clients_per_server + 1
- --source include/rand.inc
- --let $client= $rand
-
- --let $rand_type= decide
- --let $rand_probability= $change_master_probability
- --source include/rand.inc
- --let $do_change_master= $rand
-
- --let $rand_probability= $flush_logs_probability
- --source include/rand.inc
- --let $do_flush_logs= $rand
-
- --let $rand_probability= $dml_probability
- --source include/rand.inc
- --let $do_dml= $rand
-
- --let $rand_probability= $ddl_probability
- --source include/rand.inc
- --let $do_ddl= $rand
-
- if ($debug)
- {
- --echo debug: server=$server client=$client change_master=$do_change_master flush=$do_flush_logs dml=$do_dml ddl=$do_ddl
- }
-
- --let $connection= server_$server$underscore$client
- --connection $connection
-
- if ($do_change_master)
- {
- --reap
-
- # Computes a random number between 1 and $n_servers that is
- # different from $server.
- --let $rand_type= int
- --let $rand_min= 0
- --let $rand_max= $n_servers - 1
- --source include/rand.inc
- --let $new_master= `SELECT 1 + (($server + $rand) % $n_servers)`
- if ($debug)
- {
- --echo change master for $server to $new_master
- }
-
- --let $include_silent= 1
- --source include/stop_slave.inc
-
- --let $port= \$SERVER_MYPORT_$new_master
- --disable_warnings
- eval CHANGE MASTER TO MASTER_HOST = '127.0.0.1',
- MASTER_PORT = $port,
- MASTER_USER = 'root',
- MASTER_CONNECT_RETRY = 1,
- MASTER_AUTO_POSITION = 1;
- --enable_warnings
-
- --source include/start_slave.inc
- --let $include_silent= 0
- # give something for the next reap
- send SELECT 1;
- }
-
- if ($do_flush_logs)
- {
- --reap
- send FLUSH LOGS;
- }
-
- if ($do_dml)
- {
- --reap
- --let $t= `SHOW TABLES IN db_$server LIKE 't_$client$underscore%'`
- --let $t= db_$server.$t
- --let $last_value= `SELECT @last_value`
- --delimiter |
- send|
- eval
- BEGIN;
- INSERT INTO $t VALUES (-1);
- UPDATE $t SET a = $iteration WHERE a = $last_value;
- DELETE FROM $t WHERE a = -1;
- COMMIT;
- SET @last_value= $iteration;
- |
- --delimiter ;
- }
-
- if ($do_ddl)
- {
- --reap
- --let $t= `SHOW TABLES IN db_$server LIKE 't_$client$underscore%'`
- --let $t= db_$server.$t
- --delimiter |
- send|
- eval
- CREATE TABLE db_$server.t_$client (a INT) ENGINE = InnoDB;
- DROP TABLE $t;
- RENAME TABLE db_$server.t_$client TO db_$server.t_$client$underscore$iteration;
- SET @last_value = -1;
- |
- --delimiter ;
- }
-
- if ($deterministic != '')
- {
- --reap
- --sleep 2
- --send SELECT 1
- }
-
- --inc $iteration
-
- if ($iteration > $max_iterations)
- {
- --let $done= 1
- }
- --connection default
- --let $elapsed_time= `SELECT UNIX_TIMESTAMP() - $start_time`
- if ($elapsed_time > $max_seconds)
- {
- --let $done= 1
- }
-}
-if ($debug)
-{
- --echo exited after iteration $iteration, $elapsed_time seconds (max_seconds=$max_seconds, start_time=$start_time)
-}
-# extra debug info for show_rpl_debug_info
---let $extra_debug_info= iterations=$iterations
-
-
---echo ==== Sync ====
-
---echo Reap all sent queries.
---let $server= 1
-while ($server <= $n_servers)
-{
- --let $client= 1
- while ($client <= $n_clients_per_server)
- {
- --connection server_$server$underscore$client
- --reap
- --inc $client
- }
- --inc $server
-}
-
-# Wait for replication to catch up
---connection default
-
---source include/rpl_stop_slaves.inc
-
---let $rpl_topology= $circular_topology
---let $rpl_extra_connections_per_server= 5
---let $rpl_unconditional_change_master= 1
---source include/rpl_change_topology.inc
-
---source include/rpl_start_slaves.inc
-
---source include/rpl_sync.inc
-
-
---echo ==== Check result ====
-
---echo Check that GTID_EXECUTED is equal on all servers.
---let $server= 1
-while ($server <= $n_servers)
-{
- --connection server_$server
- --let $gtid_executed= `SELECT @@GLOBAL.GTID_EXECUTED`
- if ($server > 1)
- {
- if ($last_gtid_executed != $gtid_executed)
- {
- --source include/show_rpl_debug_info.inc
- --echo ERROR: GTID_EXECUTED differs between server 1 and server $server
- --echo ERROR: GTID_EXECUTED on server 1: '$last_gtid_executed'
- --echo ERROR: GTID_EXECUTED on server $server: '$gtid_executed'
- --die GTID_EXECUTED differs between two servers
- }
- }
- --let $last_gtid_executed= $gtid_executed
- --inc $server
-}
-
---echo Check that database state is equal on all servers.
---let $diff_servers= $server_list
---source include/diff_servers.inc
-
-
---echo ==== Clean up ====
-
-# drop database
---connection default
---let $server= 1
-while ($server <= $n_servers)
-{
- eval DROP DATABASE db_$server;
- --inc $server
-}
---source include/rpl_sync.inc
-
-# restore AUTO_POSITION
---let $server= 1
-while ($server <= $n_servers)
-{
- --connection server_$server
-
- --let $include_silent=1
- --source include/stop_slave.inc
- CHANGE MASTER TO MASTER_AUTO_POSITION=0;
- --source include/start_slave.inc
- --let $include_silent=0
-
- --inc $server
-}
-
---source include/rpl_end.inc
--- /dev/null
+--slave-transaction-retries=0 --relay_log_info_repository=TABLE --master_info_repository=TABLE --sync_master_info=1
--- /dev/null
+###############################################################################
+# Bug#21507981: REPLICATION POSITION LOST AFTER CRASH ON MTS CONFIGURED SLAVE
+#
+# Problem:
+# ========
+# Enable MTS along with crash-safe replication tables. Make sure that the
+# server
+# is busily inserting data with multiple threads in parallel. Shutdown mysqld
+# uncleanly (kill -9 or power off server without notice).
+#
+# Now users are restarting the server with --relay-log-recovery=1 to recover
+# the
+# crashed slave.
+#
+# This results in following error:
+# ================================
+# 2015-06-24 13:49:03 3895 [ERROR] --relay-log-recovery cannot
+# be executed when the slave was stopped with an error or
+# killed in MTS mode; consider using RESET SLAVE or restart
+# the server with --relay-log-recovery = 0 followed by
+# START SLAVE UNTIL SQL_AFTER_MTS_GAPS.
+#
+# i.e relay-log-recovery will not work in MTS mode.
+###############################################################################
+# Following test demonstrates that when gaps are generated due to MTS crash
+# but not due to an error then recovery should be successful with
+# --relay-log-recovery=1 option.
+
+--source include/force_restart.inc
+--source include/have_binlog_format_statement.inc
+--source include/only_mts_slave_parallel_workers.inc
+--source include/master-slave.inc
+
+--let $skip_slave_start_var= FALSE
+--source extra/rpl_tests/rpl_mts_relay_log_recovery.test
+
+--let $skip_slave_start_var= TRUE
+--source extra/rpl_tests/rpl_mts_relay_log_recovery.test
+
+--source include/rpl_end.inc
--- /dev/null
+--slave-transaction-retries=0 --relay_log_info_repository=TABLE --master_info_repository=TABLE --sync_master_info=1
--- /dev/null
+###############################################################################
+# Bug#21507981: REPLICATION POSITION LOST AFTER CRASH ON MTS CONFIGURED SLAVE
+#
+# Problem:
+# ========
+# Enable MTS along with crash-safe replication tables. Make sure that the server
+# is busily inserting data with multiple threads in parallel. Shutdown mysqld
+# uncleanly (kill -9 or power off server without notice).
+#
+# Now users are restarting the server with --relay-log-recovery=1 to recover the
+# crashed slave.
+#
+# This results in following error:
+# ================================
+# 2015-06-24 13:49:03 3895 [ERROR] --relay-log-recovery cannot be executed when
+# the slave was stopped with an error or killed in MTS mode; consider using
+# RESET SLAVE or restart the server with --relay-log-recovery = 0 followed by
+# START SLAVE UNTIL SQL_AFTER_MTS_GAPS.
+#
+# i.e relay-log-recovery will not work in MTS mode.
+###############################################################################
+# Following test demonstrates that when a gap is generated because MTS has
+# stopped due to an error then attempting 'relay-log-recovery' will not be
+# successful. Once the route cause of the error is eliminated restarting the
+# recovery with relay-log-recovery=1 should fix the issue.
+#
+# Testing Method:
+# ===============
+# It first creates two databases (d1 and d2) and setup slave to use two parallel
+# workers. The test case then insert on the slave a tuple that will block
+# writes on d2 and generate gaps. Now COMMIT the blocking tuple on slave so
+# that workers will proceed and apply the pending transactions. This will
+# result in duplicate key error and slave will stop. Now crash the slave
+# server and initiate relay-log-recovery. It should fail as slave has stopped
+# due to an error. Eliminate the cause of duplicate key error by removing the
+# local changes on slave. Restart the recovery process it should be
+# successful.
+--source include/force_restart.inc
+--source include/have_binlog_format_statement.inc
+--source include/only_mts_slave_parallel_workers.inc
+--source include/master-slave.inc
+
+--source include/rpl_connection_slave.inc
+call mtr.add_suppression("Duplicate entry*");
+call mtr.add_suppression("The slave coordinator and worker threads are stopped, possibly leaving data in inconsistent state");
+call mtr.add_suppression("Failed to initialize the master info structure");
+call mtr.add_suppression("Slave failed to initialize relay log info*");
+call mtr.add_suppression("MTS recovery: automatic recovery failed.*");
+call mtr.add_suppression("Recovery from master pos");
+
+--source extra/rpl_tests/rpl_generate_mts_gap.test
+
+--source include/rpl_connection_slave.inc
+COMMIT;
+--let $slave_sql_errno= convert_error(ER_DUP_ENTRY)
+source include/wait_for_slave_sql_error.inc;
+
+# Restart the slave server - Recovery will fail as MTS has stopped due to an
+# error.
+--let $rpl_server_number= 2
+--let $rpl_server_parameters= --skip_slave_start=TRUE --relay_log_info_repository=TABLE --master_info_repository=TABLE --sync_master_info=1 --relay-log-recovery=1
+--source include/rpl_restart_server.inc
+
+--source include/rpl_connection_slave.inc
+--exec echo "Relay log recovery should fail as MTS stopped due to an error"
+
+--error ER_SLAVE_RLI_INIT_REPOSITORY
+START SLAVE;
+
+# Remove the affending rows from slave.
+--exec echo "Eliminate the cause of MTS error"
+DELETE FROM d2.t WHERE a=2;
+DELETE FROM d1.t WHERE a=3;
+
+--let $table=d2.t
+--let $count=1
+--source include/wait_until_rows_count.inc
+
+--let $table=d1.t
+--let $count=2
+--source include/wait_until_rows_count.inc
+
+# Restart the slave server this should fix the gaps.
+--let $rpl_server_number= 2
+--let $rpl_server_parameters= --skip_slave_start=TRUE --relay_log_info_repository=TABLE --master_info_repository=TABLE --sync_master_info=1 --relay-log-recovery=1
+--source include/rpl_restart_server.inc
+
+--exec echo "MTS recovery should be successful. Check that gaps are filled."
+
+--let $assert_text= Table d1.t should contain 2 rows.
+--let $assert_cond= [select count(*) from d1.t] = 2
+--source include/assert.inc
+
+--let $assert_text= Table d2.t should contain 3 rows.
+--let $assert_cond= [select count(*) from d2.t] = 3
+--source include/assert.inc
+
+--source include/start_slave.inc
+
+# Check consistency
+--source include/rpl_connection_master.inc
+--source include/sync_slave_sql_with_master.inc
+--let $diff_tables= master:d1.t, slave:d1.t
+--source include/diff_tables.inc
+
+--let $diff_tables= master:d2.t, slave:d2.t
+--source include/diff_tables.inc
+
+#
+# Cleanup
+#
+--source include/rpl_connection_master.inc
+DROP DATABASE d1;
+DROP DATABASE d2;
+--source include/rpl_end.inc
--connection slave
SELECT @@global.relay_log_recovery as 'must be ON';
-call mtr.add_suppression("--relay-log-recovery cannot be executed when the slave was stopped with an error or killed in MTS mode; consider using RESET SLAVE or restart the server with --relay-log-recovery = 0");
+call mtr.add_suppression("MTS recovery: automatic recovery failed.*");
call mtr.add_suppression("Failed to initialize the master info structure");
#
# the following suppression applies to either restart.
source include/wait_for_slave_sql_error.inc;
DROP TABLE t;
--let $rpl_only_running_threads= 1
+
+# ==== Purpose ====
+#
+# Check that when binlog_row_image= FULL 'UPDATE' query should not using
+# temporary if the PRIMARY KEY not being modified as part of the query.
+#
+# ==== Implementation ====
+#
+# Set binlog_row_image= FULL. Create a table which has both a primary key and
+# a regular int field which is not a key. Execute an UPDATE statement in such
+# a way that it doesn't update the primary key field. See the 'EXPLAIN' output
+# it should not use a temporary table. Repeat the same test in case of
+# binlog_row_image= NOBLOB as well. No temporary table should be used in this
+# case as well.
+#
+# ==== References ====
+#
+# Bug#22510353: UNNECESSARY USING TEMPORARY FOR UPDATE
+#
+###############################################################################
-- source include/rpl_reset.inc
+-- connection master
+-- let $row_img_set=master:FULL:N,slave:FULL:Y
+-- source include/rpl_row_img_set.inc
+CREATE TABLE t1(id INT PRIMARY KEY, a INT) ENGINE = INNODB;
-## CLEAN UP
+--source include/sync_slave_sql_with_master.inc
+
+-- connection master
+-- let $row_img_query= INSERT INTO t1 (id, a) VALUES (1, 1)
+-- let $row_img_expected_master= | 1:1 2:1
+-- let $row_img_expected_slave = | 1:1 2:1
+-- source include/rpl_row_img_parts_master_slave.inc
+
+-- echo "Case: FULL - EXPLAIN output should not display Using temporary"
+EXPLAIN UPDATE t1 SET a=a+1 WHERE id < 2;
+
+-- let $row_img_query= UPDATE t1 SET a=a+1 WHERE id < 2
+-- let $row_img_expected_master= 1:1 2:1 | 1:1 2:2
+-- let $row_img_expected_slave = 1:1 2:1 | 1:1 2:2
+-- source include/rpl_row_img_parts_master_slave.inc
+-- let $row_img_set=master:NOBLOB:N,slave:NOBLOB:Y
+-- source include/rpl_row_img_set.inc
+
+-- echo "Case: NOBLOB - EXPLAIN output should not display Using temporary"
+EXPLAIN UPDATE t1 SET a=a+1 WHERE id < 2;
+
+-- let $row_img_query= UPDATE t1 SET a=a+1 WHERE id < 2
+-- let $row_img_expected_master= 1:1 2:2 | 1:1 2:3
+-- let $row_img_expected_slave = 1:1 2:2 | 1:1 2:3
+-- source include/rpl_row_img_parts_master_slave.inc
+
+-- let $row_img_set=master:MINIMAL:N,slave:MINIMAL:Y
+-- source include/rpl_row_img_set.inc
+
+EXPLAIN UPDATE t1 SET a=a+1 WHERE id < 2;
+
+-- let $row_img_query= UPDATE t1 SET a=a+1 WHERE id < 2
+-- let $row_img_expected_master= 1:1 | 2:4
+-- let $row_img_expected_slave = 1:1 | 2:4
+-- source include/rpl_row_img_parts_master_slave.inc
+
+DROP TABLE t1;
+--source include/sync_slave_sql_with_master.inc
+
+## CLEAN UP
-- connection master
SET GLOBAL binlog_row_image= @old_binlog_row_image;
SET SESSION binlog_row_image= @old_binlog_row_image;
--- /dev/null
+--slave-skip-errors=all --log_warnings=2
--- /dev/null
+# ==== Purpose ====
+#
+# Check that slave-skip-errors skips following errors like
+# ER_SLAVE_CONVERSION_FAILED and ER_NO_SUCH_TABLE.
+#
+# ==== Implementation ====
+# On slave, set slave_skip_errors=all, so that slave skips all the errors that
+# are reported during application of row based events.
+#
+# On master, create a table t with a varchar filed of length 25. On slave
+# increase the varchar field width to 255, so that updates that are received
+# from master will fail on slave with error ER_SLAVE_CONVERSION_FAILED.
+#
+# Secondly drop the table t on slave and try to the update the table from
+# master. The updates will fail on slave with an error ER_NO_SUCH_TABLE.
+#
+# Verify that slave doesn't break inspite of these errors.
+# ==== References ====
+#
+# Bug#17653275:--SLAVE-SKIP-ERRORS WON'T SKIP MISSING DATABASE/TABLE
+################################################################################
+--source include/have_debug.inc
+--source include/have_binlog_format_row.inc
+--source include/master-slave.inc
+
+# On master create table t which contains a field named 'name' with length
+# varchar(25).
+CREATE TABLE t (name VARCHAR(25) DEFAULT NULL) ENGINE=InnoDB;
+--source include/sync_slave_sql_with_master.inc
+
+# On slave alter the name field length to varchar(255).
+call mtr.add_suppression("Slave SQL.*Error executing row event: .Table .test.t. doesn.t exist., Error_code: 1146");
+call mtr.add_suppression("Slave SQL.*Column 0 of table .test.t. cannot be converted from type.* Error_code: 1677");
+call mtr.add_suppression("The slave coordinator and worker threads are stopped, possibly leaving data in inconsistent state");
+call mtr.add_suppression("Got error 1 during COMMIT");
+ALTER TABLE t CHANGE name name VARCHAR(255);
+
+--source include/rpl_connection_master.inc
+INSERT INTO t VALUE ('Amy');
+--echo # Sync should be successful. Slave should not stop with an error
+--echo # ER_SLAVE_CONVERSION_FAILED. It should be up and running in spite
+--echo # of errors as we have set slave_skip_error=all.
+--source include/sync_slave_sql_with_master.inc
+
+# Drop the table t on slave.
+DROP TABLE t;
+
+--source include/rpl_connection_master.inc
+UPDATE t SET name='New';
+--echo # Sync should be successful. Slave should not stop with an error
+--echo # ER_NO_SUCH_TABLE. It should be up and running in spite of errors
+--echo # as we have set slave_skip_error=all.
+--source include/sync_slave_sql_with_master.inc
+
+--echo # Enable a debug point to simulate failure during rows event cleanup.
+--let $debug_saved= `SELECT @@GLOBAL.DEBUG`
+SET @@GLOBAL.DEBUG= 'd,simulate_rows_event_cleanup_failure';
+
+--source include/rpl_connection_master.inc
+UPDATE t SET name='Old';
+--source include/rpl_connection_slave.inc
+--echo # Since this is not an ignored error slave should stop. We only ignore the
+--echo # errors that are generated during the execution of an event. The other errors
+--echo # that are generated during commit/rollback failure, which takes place during cleanup
+--echo # cannot be ignored.
+--let $slave_sql_errno= convert_error(ER_ERROR_DURING_COMMIT);
+--source include/wait_for_slave_sql_error.inc
+--echo ==== Clean up ====
+SET @@GLOBAL.DEBUG= '$debug_saved';
+--source include/stop_slave_io.inc
+RESET MASTER;
+RESET SLAVE;
+--source include/start_slave.inc
+
+--source include/rpl_connection_master.inc
+--source include/sync_slave_sql_with_master.inc
+
+--source include/rpl_connection_master.inc
+DROP TABLE t;
+--source include/rpl_end.inc
CALL mtr.add_suppression("Master's UUID has changed, although this should not happen unless you have changed it manually");
CALL mtr.add_suppression("Slave I/O: SET @master_heartbeat_period to master failed with error: Lost connection to MySQL server during query");
CALL mtr.add_suppression("Notifying master by SET @master_binlog_checksum= @@global.binlog_checksum failed with error");
-CALL mtr.add_suppression("A slave with the same server_uuid as this slave has connected to the master");
+CALL mtr.add_suppression("A slave with the same server_uuid/server_id as this slave has connected to the master");
--let $uuid_file= auto.cnf
--let $assert_file=$MYSQLTEST_VARDIR/log/mysqld.2.err
# Assert only the occurrences after the last CHANGE MASTER
--let $assert_only_after=CHANGE MASTER .* executed
---let $assert_select= Slave .* Got fatal error .* from master .* slave with the same server_uuid as this slave
+--let $assert_select= Slave .* Got fatal error .* from master .* slave with the same server_uuid/server_id as this slave
--let $assert_text= Found the expected line in server 2 error log
--source include/assert_grep.inc
--- /dev/null
+###############################################################################
+#
+# Bug#21697821 RELAYLOG.LOG_LOCK IS NOT RELEASED IN
+# AN ERROR CASE (IN NEXT_EVENT())
+#
+# Problem: In an error case, relaylog.log_lock acquired by SQL thread is not
+# released which is causing all threads, which are looking to acquire
+# the lock, to hang forever.
+#
+# Steps to reproduce:
+#
+# 1) Inject sql thread error using a simulation point and start SQL thread.
+#
+# 2) Wait till SQL thread goes down (before fix, it wont release the log_lock).
+#
+# 3) start SQL thread (before fix, it will wait for log_lock)
+#
+# 4) After the fix, make sure the replication is working fine.
+#
+###############################################################################
+
+--source include/have_debug.inc
+--source include/have_binlog_format_statement.inc
+--let rpl_skip_start_slave=1
+--source include/master-slave.inc
+
+# Step 1) Set a simulation on Slave SQL thread so that it enters
+# into faulty code (before fix) path.
+--source include/rpl_connection_slave.inc
+CALL mtr.add_suppression("Relay log read failure");
+SET @save_debug=@@GLOBAL.debug;
+SET GLOBAL debug="d,force_sql_thread_error";
+
+# Start SQL thread
+START SLAVE SQL_THREAD;
+
+# 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.
+--source include/wait_for_slave_sql_to_stop.inc
+
+# Step 3) Before fix, when SQL thread is trying to acquire
+# relay_log.log_lock which was not released will hang
+# forever.
+SET GLOBAL debug=@save_debug;
+--source include/start_slave.inc
+
+# Step 4) Execute dummy statements on master and see that it
+# replication is working fine.
+--source include/rpl_connection_master.inc
+CREATE TABLE t1(i INT);
+DROP TABLE t1;
+--source include/rpl_end.inc
--- /dev/null
+###############################################################################
+# Bug#21179199 ZOMBIE DUMP THREADS ARE NOT DISCONNECTED,
+# CAN ALSO LEAD TO A CRASH
+#
+# Problem: Zombie dump threads on Master (>= MySQL-5.6 version)
+# that are created to server slaves which are on lower
+# versions than MySQL-5.6 version are not getting killed.
+# Steps to reproduce:
+#
+# 1) A simulation point on slave to fake that server MySQL version is lower
+# than MySQL-5.6 (i.e., no slave_uuid set in initial replication protocol)
+#
+# 2) Start IO thread on Slave which will start a dump thread on Master.
+#
+# 3) Restart the IO thread (Master should kill existing dump thread before
+# starting a new dump thread)
+#
+# 4) Now count the number of dump threads on Master, it should be only '1'.
+#
+###############################################################################
+--source include/have_debug.inc
+--source include/have_binlog_format_statement.inc
+--let rpl_skip_start_slave= 1
+--source include/master-slave.inc
+
+# When this test script is running in combination with other tests,
+# it is possible that dump threads from those tests are not killed.
+# (rpl_end.inc does not kill dump threads).
+# Hence doing the cleanup here as this test depends on counting the
+# active dump threads.
+--source include/stop_dump_threads.inc
+
+# Step-1) A simulation point on slave to fake that server MySQL version
+# is lower than MySQL-5.6 (i.e., no slave_uuid set in initial replication
+# protocol).
+--source include/rpl_connection_slave.inc
+SET @save_debug = @@GLOBAL.debug;
+SET GLOBAL debug="d,fake_5_5_version_slave";
+
+# Step-2) Start IO thread on Slave which will start a dump thread on Master.
+--source include/start_slave_io.inc
+
+# Step-3) Restart the IO thread (Master should kill existing dump thread before
+# starting a new dump thread)
+--source include/stop_slave_io.inc
+--source include/start_slave_io.inc
+
+# Step-4) Count the number of dump threads on Master, it should be eventually
+# become '1'.
+--source include/rpl_connection_master.inc
+--let $wait_condition= SELECT COUNT(*) = 1 FROM information_schema.processlist WHERE COMMAND LIKE 'Binlog Dump%'
+--source include/wait_condition.inc
+
+# Cleanup
+--source include/rpl_connection_slave.inc
+SET GLOBAL debug=@save_debug;
+# We do not care about SQL thread for this test scenario
+--let $rpl_only_running_threads= 1
+--source include/rpl_end.inc
SELECT id, insert(0x3a, 1, 0, d) FROM t1;
DROP TABLE t1;
+--echo #
+--echo # Bug#22888420 CONCAT_WS: ASSERTION FAILED: !S.USES_BUFFER_OWNED_BY(THIS)
+--echo #
+
+do concat('a',concat_ws('a', 0x2859, 'a' ,
+ trim(period_add('a',1) from (1&''))
+ )
+ );
+
--echo #
--echo # End of 5.6 tests
--echo #
set session default_storage_engine = InnoDB;
--let $innodb = 1
-# Next 2 variables control the JSON format output and validation in explain_utils.
+# Next variable controls the JSON format output in explain_utils.
# 1 = enable, 0 = disable
--let $json = 1
-# Validation disabled due to not having Python with JSON on all PB machines.
---let $validation = 0
---file_exists $MYSQL_TEST_DIR/suite/opt_trace/validate_json.py
+--file_exists $MYSQL_TEST_DIR/suite/opt_trace/validate_json.pl
--source include/explain_non_select.inc
set default_storage_engine= @save_storage_engine;
set @save_storage_engine= @@session.default_storage_engine;
set session default_storage_engine = InnoDB;
--let $innodb = 1
-# Next 2 variables control the JSON format output and validation in explain_utils.
+# Next variable controls the JSON format output in explain_utils.
# 1 = enable, 0 = disable
--let $json = 1
-# Validation disabled due to not having Python with JSON on all PB machines.
---let $validation = 0
--source include/explain_non_select.inc
set default_storage_engine= @save_storage_engine;
set session default_storage_engine = InnoDB;
--let $innodb = 1
-# json validation in explain_util.inc can be switched off by setting to zero.
+# json format in explain_util.inc can be switched off by setting to zero.
--let $json = 0
---let $validation = 0
--source include/explain_non_select.inc
set default_storage_engine= @save_storage_engine;
set session default_storage_engine = InnoDB;
--let $innodb = 1
--let $json = 0
---let $validation = 0
--source include/explain_non_select.inc
set default_storage_engine= @save_storage_engine;
UPDATE t1, t2 SET t1.fld1= t1.fld1 + 3;
DROP TABLE t2, t1;
+
+
+--echo #
+--echo # BUG#22037930: INSERT IGNORE FAILS TO IGNORE FOREIGN
+--echo # KEY CONSTRAINT
+
+CREATE TABLE t1 (fld1 INT PRIMARY KEY) ENGINE= INNODB;
+
+CREATE TABLE t2 (fld1 VARCHAR(10), fld2 INT NOT NULL,
+CONSTRAINT fk FOREIGN KEY (fld2) REFERENCES t1(fld1)) ENGINE= INNODB;
+
+--echo # Without patch, reports incorrect error.
+--error ER_NO_REFERENCED_ROW_2
+INSERT INTO t2 VALUES('abc', 2) ON DUPLICATE KEY UPDATE fld1= 'def';
+--error ER_NO_REFERENCED_ROW_2
+REPLACE INTO t2 VALUES('abc', 2);
+
+--enable_warnings
+INSERT IGNORE INTO t2 VALUES('abc', 2) ON DUPLICATE KEY UPDATE fld1= 'def';
+--disable_warnings
+
+DROP TABLE t2, t1;
--echo #
CREATE TABLE t1(f1 INT);
-EVAL SELECT 0xE1BB30 INTO OUTFILE 't1.dat';
+EVAL SELECT 0xE1C330 INTO OUTFILE 't1.dat';
--disable_warnings
LOAD DATA INFILE 't1.dat' IGNORE INTO TABLE t1 CHARACTER SET utf8;
--enable_warnings
--remove_file $MYSQLTEST_VARDIR/mysql
DROP TABLE t1;
+--echo
+--echo #
+--echo # Bug#23080148 - Backport of Bug#20683959.
+--echo # Bug#20683959 LOAD DATA INFILE IGNORES A SPECIFIC ROW SILENTLY
+--echo # UNDER DB CHARSET IS UTF8.
+--echo #
+
+CREATE DATABASE d1 CHARSET latin1;
+USE d1;
+CREATE TABLE t1 (val TEXT);
+LOAD DATA INFILE '../../std_data/bug20683959loaddata.txt' INTO TABLE t1;
+SELECT COUNT(*) FROM t1;
+SELECT HEX(val) FROM t1;
+
+CREATE DATABASE d2 CHARSET utf8;
+USE d2;
+CREATE TABLE t1 (val TEXT);
+--error ER_INVALID_CHARACTER_STRING
+LOAD DATA INFILE '../../std_data/bug20683959loaddata.txt' INTO TABLE t1;
+
+DROP TABLE d1.t1, d2.t1;
+DROP DATABASE d1;
+DROP DATABASE d2;
set @save_storage_engine= @@session.default_storage_engine;
set session default_storage_engine = MyISAM;
-# Next 2 variables control the JSON format output and validation in explain_utils.
+# Next variable controls the JSON format output in explain_utils.
# 1 = enable, 0 = disable
--let $json = 1
-# Validation disabled due to not having Python with JSON on all PB machines.
---let $validation = 0
--source include/explain_non_select.inc
set default_storage_engine= @save_storage_engine;
set @save_storage_engine= @@session.default_storage_engine;
set session default_storage_engine = MyISAM;
-# Next 2 variables control the JSON format output and validation in explain_utils.
+# Next variable controls the JSON format output in explain_utils.
# 1 = enable, 0 = disable
--let $json = 1
-# Validation disabled due to not having Python with JSON on all PB machines.
---let $validation = 0
--source include/explain_non_select.inc
set default_storage_engine= @save_storage_engine;
set @save_storage_engine= @@session.default_storage_engine;
set session default_storage_engine = MyISAM;
--let $json = 0
---let $validation = 0
--source include/explain_non_select.inc
set default_storage_engine= @save_storage_engine;
set @save_storage_engine= @@session.default_storage_engine;
set session default_storage_engine = MyISAM;
--let $json = 0
---let $validation = 0
--source include/explain_non_select.inc
set default_storage_engine= @save_storage_engine;
--- /dev/null
+--query_cache_type=1
--- /dev/null
+# This test should work in embedded server after we fix mysqltest
+-- source include/not_embedded.inc
+
+--echo # Bug#22559575 "the statement (1) has no open cursor" pops sometimes with
+--echo # prepared+query_cache
+--echo #
+--echo # Create relevent tables and call C API test cases
+--echo # Setup
+
+select VARIABLE_VALUE into @qcache_hit_val1 from
+ information_schema.GLOBAL_STATUS where VARIABLE_NAME = 'Qcache_hits';
+
+--echo
+--echo #Run C_API test case
+--exec echo "$MYSQL_CLIENT_TEST --silent test_bug22559575" > $MYSQLTEST_VARDIR/log/mysql_client_test_qcache.out.log 2>&1
+--exec $MYSQL_CLIENT_TEST --silent test_bug22559575 >> $MYSQLTEST_VARDIR/log/mysql_client_test_qcache.out.log 2>&1
+
+select VARIABLE_VALUE into @qcache_hit_val2 from
+ information_schema.GLOBAL_STATUS where VARIABLE_NAME = 'Qcache_hits';
+SELECT @qcache_hit_val2 - @qcache_hit_val1;
+
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
eval SELECT
(@a:=LOAD_FILE("$binlog_file"))
-IS NOT NULL;
+IS NOT NULL AS Loaded;
let $s_id_unsigned= `SELECT @a LIKE "%server id $s_id_max%" /* must return 1 */`;
echo *** Unsigned server_id $s_id_max is found: $s_id_unsigned ***;
--echo End of 5.0 tests
+--echo #
+--echo # Bug#21142859: FUNCTION UPDATING A VIEW FAILS TO FIND TABLE THAT ACTUALLY EXISTS
+--echo #
+
+CREATE TABLE t1 SELECT 1 AS fld1, 'A' AS fld2;
+CREATE TABLE t2 (fld3 INT, fld4 CHAR(1));
+
+CREATE VIEW v1 AS SELECT * FROM t1;
+
+CREATE TRIGGER t1_au AFTER UPDATE ON t1
+FOR EACH ROW INSERT INTO t2 VALUES (new.fld1, new.fld2);
+
+DELIMITER !;
+CREATE FUNCTION f1() RETURNS INT
+BEGIN
+ UPDATE v1 SET fld2='B' WHERE fld1=1;
+ RETURN row_count();
+END !
+DELIMITER ;!
+
+--echo # Without the patch, an error was getting reported.
+SELECT f1();
+
+DROP FUNCTION f1;
+DROP VIEW v1;
+DROP TABLE t1,t2;
+
+--echo #
+--echo # Bug #16672723 "CAN'T FIND TEMPORARY TABLE".
+--echo #
+CREATE FUNCTION f1() RETURNS INT RETURN 1;
+CREATE TEMPORARY TABLE tmp1(a INT);
+PREPARE stmt1 FROM "CREATE TEMPORARY TABLE tmp2 AS SELECT b FROM (SELECT f1() AS b FROM tmp1) AS t";
+--echo # The below statement failed before the fix.
+EXECUTE stmt1;
+DROP TEMPORARY TABLES tmp1, tmp2;
+DEALLOCATE PREPARE stmt1;
+DROP FUNCTION f1;
--- /dev/null
+--ssl-ca=$MYSQL_TEST_DIR/std_data/crl-ca-cert.pem
+--ssl-key=$MYSQL_TEST_DIR/std_data/crl-server-key.pem
+--ssl-cert=$MYSQL_TEST_DIR/std_data/crl-server-cert.pem
--- /dev/null
+--source include/have_ssl.inc
+--source include/not_embedded.inc
+
+--echo #
+--echo # Bug#21920657: SSL-CA FAILS SILENTLY IF THE PATH CANNOT BE FOUND
+--echo #
+
+--echo # try to connect with wrong '--ssl-ca' path : should fail
+--error 1
+--exec $MYSQL --ssl-ca=$MYSQL_TEST_DIR/std_data/wrong-crl-ca-cert.pem --ssl-key=$MYSQL_TEST_DIR/std_data/crl-client-key.pem --ssl-cert=$MYSQL_TEST_DIR/std_data/crl-client-cert.pem test -e "SHOW STATUS LIKE 'Ssl_cipher'" 2>&1
+
+--echo # try to connect with correct '--ssl-ca' path : should connect
+--exec $MYSQL --ssl-ca=$MYSQL_TEST_DIR/std_data/crl-ca-cert.pem --ssl-key=$MYSQL_TEST_DIR/std_data/crl-client-key.pem --ssl-cert=$MYSQL_TEST_DIR/std_data/crl-client-cert.pem test -e "SHOW STATUS LIKE 'Ssl_cipher'"
+
+--echo #
+--echo # Bug#21920678: SSL-CA DOES NOT ACCEPT ~USER TILDE HOME DIRECTORY
+--echo # PATH SUBSTITUTION
+--echo #
+
+--let $mysql_test_dir_path= `SELECT REPLACE('$MYSQL_TEST_DIR', '$HOME', '~')`
+
+--echo # try to connect with '--ssl-ca' option using tilde home directoy
+--echo # path substitution : should connect
+--exec $MYSQL --ssl-ca=$mysql_test_dir_path/std_data/crl-ca-cert.pem --ssl-key=$MYSQL_TEST_DIR/std_data/crl-client-key.pem --ssl-cert=$MYSQL_TEST_DIR/std_data/crl-client-cert.pem test -e "SHOW STATUS LIKE 'Ssl_cipher'"
+
+--echo # try to connect with '--ssl-key' option using tilde home directoy
+--echo # path substitution : should connect
+--exec $MYSQL --ssl-ca=$MYSQL_TEST_DIR/std_data/crl-ca-cert.pem --ssl-key=$mysql_test_dir_path/std_data/crl-client-key.pem --ssl-cert=$MYSQL_TEST_DIR/std_data/crl-client-cert.pem test -e "SHOW STATUS LIKE 'Ssl_cipher'"
+
+--echo # try to connect with '--ssl-cert' option using tilde home directoy
+--echo # path substitution : should connect
+--exec $MYSQL --ssl-ca=$MYSQL_TEST_DIR/std_data/crl-ca-cert.pem --ssl-key=$MYSQL_TEST_DIR/std_data/crl-client-key.pem --ssl-cert=$mysql_test_dir_path/std_data/crl-client-cert.pem test -e "SHOW STATUS LIKE 'Ssl_cipher'"
--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR
--error 1
--exec $MYSQL --ssl-ca=$MYSQL_TEST_DIR/std_data/crl-ca-cert.pem --ssl-key=$MYSQL_TEST_DIR/std_data/crl-client-revoked-key.pem --ssl-cert=$MYSQL_TEST_DIR/std_data/crl-client-revoked-cert.pem test -e "SHOW VARIABLES like '%ssl%';"
+
+--echo #
+--echo # Bug#21920678: SSL-CA DOES NOT ACCEPT ~USER TILDE HOME DIRECTORY
+--echo # PATH SUBSTITUTION
+--echo #
+
+--let $mysql_test_dir_path= `SELECT REPLACE('$MYSQL_TEST_DIR', '$HOME', '~')`
+
+--echo # try to connect with '--ssl-crl' option using tilde home directoy
+--echo # path substitution : should connect
+--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR
+--exec $MYSQL --ssl-ca=$MYSQL_TEST_DIR/std_data/crl-ca-cert.pem --ssl-key=$MYSQL_TEST_DIR/std_data/crl-client-key.pem --ssl-cert=$MYSQL_TEST_DIR/std_data/crl-client-cert.pem test --ssl-crl=$mysql_test_dir_path/std_data/crl-client-revoked.crl -e "SHOW STATUS LIKE 'Ssl_cipher'"
+
+--echo # try to connect with '--ssl-crlpath' option using tilde home directoy
+--echo # path substitution : should connect
+--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR
+--exec $MYSQL --ssl-ca=$MYSQL_TEST_DIR/std_data/crl-ca-cert.pem --ssl-key=$MYSQL_TEST_DIR/std_data/crl-client-key.pem --ssl-cert=$MYSQL_TEST_DIR/std_data/crl-client-cert.pem --ssl-crlpath=$mysql_test_dir_path/std_data/crldir test -e "SHOW STATUS LIKE 'Ssl_cipher'"
--- /dev/null
+$TESTUDFSERVICES_OPT
--- /dev/null
+--source include/not_embedded.inc
+
+--echo #
+--echo # Bug #20085672: CRYPTIC ERROR WHEN FAILING TO UNLOAD A DYNAMIC LIBRARY
+--echo #
+
+--echo # Install the plugin
+--replace_result $TESTUDFSERVICES TESTUDFSERVICES
+eval INSTALL PLUGIN test_udf_services SONAME '$TESTUDFSERVICES';
+
+--echo # Define the function
+--replace_result $TESTUDFSERVICES TESTUDFSERVICES
+eval CREATE FUNCTION test_udf_services_udf RETURNS INT
+ SONAME "$TESTUDFSERVICES";
+
+--echo # Uninstall the plugin
+UNINSTALL PLUGIN test_udf_services;
+
+--echo # Install the plugin again. Should not fail
+--replace_result $TESTUDFSERVICES TESTUDFSERVICES
+eval INSTALL PLUGIN test_udf_services SONAME '$TESTUDFSERVICES';
+
+--echo # Cleanup
+DROP FUNCTION test_udf_services_udf;
+UNINSTALL PLUGIN test_udf_services;
remove_file $MYSQLTEST_VARDIR/tmp/dictionary.txt;
remove_file $MYSQLTEST_VARDIR/tmp/dictionary2.txt;
+--echo #
+--echo # Bug#21616496: CREATE USER ACCEPTS PLUGIN AND PASSWORD HASH,
+--echo # BUT IGNORES THE PASSWORD HASH
+--echo #
+
+--error ER_NOT_VALID_PASSWORD
+CREATE USER 'user1'@'localhost' IDENTIFIED WITH 'mysql_native_password';
+
+--error ER_NOT_VALID_PASSWORD
+CREATE USER 'user1'@'localhost' IDENTIFIED WITH 'mysql_old_password';
+
+--error ER_NOT_VALID_PASSWORD
+CREATE USER 'user1'@'localhost' IDENTIFIED WITH 'mysql_native_password' AS '*0D3CED9BEC10A777AEC23CCC353A8C08A633045E';
+
+--error ER_NOT_VALID_PASSWORD
+CREATE USER 'user1'@'localhost' IDENTIFIED WITH 'mysql_old_password' AS '*0D3CED9BEC10A777AEC23CCC353A8C08A633045E';
+
--echo # clean up after the test
UNINSTALL PLUGIN validate_password;
--- /dev/null
+--source include/windows.inc
+
+
+--echo #
+--echo # Bug #23747899: @@basedir sysvar value not normalized if set through
+--echo # the command line/ini file
+
+--echo # There should be no slashes in @@basedir and just backslashes
+--echo # since it's normalized
+SELECT
+ LOCATE('/', @@basedir) <> 0 AS have_slashes,
+ LOCATE('\\', @@basedir) <> 0 AS have_backslashes;
+
+
+--echo End of the 5.6 tests
my $count_warnings= $count_warnings;
print "Deprecation warning count : $count_warnings\n";
close(FILE);
+ # Truncate the log file so that repititions of the test don't pick up deprecation warnings from previous runs
+ open(FILE,">$logf") or die("Unable to open $logf for truncation $!\n");
+ close(FILE);
EOF
-- source include/mysql_upgrade_preparation.inc
fun:malloc_info
}
-{
- GitHub codership/mysql-wsrep#176
- Memcheck:Leak
- fun:_Z16wsrep_get_paramsRKN6galera10ReplicatorE
- fun:galera_parameters_get
- fun:_ZL24refresh_provider_optionsv
- fun:_Z29wsrep_provider_options_updateP7sys_varP3THD13enum_var_type
- fun:_ZN7sys_var6updateEP3THDP7set_var
- fun:_ZN7set_var6updateEP3THD
- fun:_Z17sql_set_variablesP3THDP4ListI12set_var_baseE
- fun:_Z21mysql_execute_commandP3THD
- fun:_Z11mysql_parseP3THDPcjP12Parser_state
- fun:_ZL17wsrep_mysql_parseP3THDPcjP12Parser_state
- fun:_Z16dispatch_command19enum_server_commandP3THDPcj
- fun:_Z10do_commandP3THD
- fun:_Z24do_handle_one_connectionP3THD
- fun:handle_one_connection
-}
-
{
GitHub codership/galera#330
Memcheck:Leak
fun:_Z16wsrep_set_paramsRN6galera10ReplicatorEPKc
}
-{
- codership/mysql-wsrep/issues#176
- Memcheck:Leak
- fun:_Z16wsrep_get_paramsRKN6galera10ReplicatorE
-}
-
-{
- codership/mysql-wsrep/issues#176
- Memcheck:Leak
- fun:_Z16wsrep_get_paramsRKN6galera10ReplicatorE
- fun:galera_parameters_get
- fun:_ZL24refresh_provider_optionsv
- fun:_Z21wsrep_provider_updateP7sys_varP3THD13enum_var_type
- fun:_ZN7sys_var6updateEP3THDP7set_var
- fun:_ZN7set_var6updateEP3THD
- fun:_Z17sql_set_variablesP3THDP4ListI12set_var_baseE
- fun:_Z21mysql_execute_commandP3THD
- fun:_Z11mysql_parseP3THDPcjP12Parser_state
- fun:_ZL17wsrep_mysql_parseP3THDPcjP12Parser_state
- fun:_Z16dispatch_command19enum_server_commandP3THDPcj
- fun:_Z10do_commandP3THD
- fun:_Z24do_handle_one_connectionP3THD
- fun:handle_one_connection
-}
-
{
codership/mysql-wsrep/issues#176
Memcheck:Leak
fun:_Z24do_handle_one_connectionP3THD
}
-{
- codership/mysql-wsrep/issues#176
- Memcheck:Leak
- match-leak-kinds: possible
- fun:malloc
- fun:strdup
- fun:_Z16wsrep_get_paramsRKN6galera10ReplicatorE
- fun:galera_parameters_get
- fun:_ZL24refresh_provider_optionsv
- fun:_Z29wsrep_provider_options_updateP7sys_varP3THD13enum_var_type
- fun:_ZN7sys_var6updateEP3THDP7set_var
- fun:_ZN7set_var6updateEP3THD
- fun:_Z17sql_set_variablesP3THDP4ListI12set_var_baseE
- fun:_Z21mysql_execute_commandP3THD
- fun:_Z11mysql_parseP3THDPcjP12Parser_state
- fun:_ZL17wsrep_mysql_parseP3THDPcjP12Parser_state
- fun:_Z16dispatch_command19enum_server_commandP3THDPcj
- fun:_Z10do_commandP3THD
- fun:_Z24do_handle_one_connectionP3THD
- fun:handle_one_connection
-}
-
-{
- codership/mysql-wsrep/issues#176
- Memcheck:Leak
- match-leak-kinds: definite
- fun:malloc
- fun:strdup
- fun:_Z16wsrep_get_paramsRKN6galera10ReplicatorE
- fun:galera_parameters_get
- fun:_ZL24refresh_provider_optionsv
- fun:_Z29wsrep_provider_options_updateP7sys_varP3THD13enum_var_type
- fun:_ZN7sys_var6updateEP3THDP7set_var
- fun:_ZN7set_var6updateEP3THD
- fun:_Z17sql_set_variablesP3THDP4ListI12set_var_baseE
- fun:_Z21mysql_execute_commandP3THD
- fun:_Z11mysql_parseP3THDPcjP12Parser_state
- fun:_ZL17wsrep_mysql_parseP3THDPcjP12Parser_state
- fun:_Z16dispatch_command19enum_server_commandP3THDPcj
- fun:_Z10do_commandP3THD
- fun:_Z24do_handle_one_connectionP3THD
- fun:handle_one_connection
-}
-
-{
- codership/mysql-wsrep/issues#176
- Memcheck:Leak
- match-leak-kinds: definite
- fun:malloc
- fun:strdup
- fun:_Z16wsrep_get_paramsRKN6galera10ReplicatorE
- fun:galera_parameters_get
- fun:_ZL24refresh_provider_optionsv
- fun:_Z21wsrep_provider_updateP7sys_varP3THD13enum_var_type
- fun:_ZN7sys_var6updateEP3THDP7set_var
- fun:_ZN7set_var6updateEP3THD
- fun:_Z17sql_set_variablesP3THDP4ListI12set_var_baseE
- fun:_Z21mysql_execute_commandP3THD
- fun:_Z11mysql_parseP3THDPcjP12Parser_state
- fun:_ZL17wsrep_mysql_parseP3THDPcjP12Parser_state
- fun:_Z16dispatch_command19enum_server_commandP3THDPcj
- fun:_Z10do_commandP3THD
- fun:_Z24do_handle_one_connectionP3THD
- fun:handle_one_connection
-}
-
{
codership/galera#331
Memcheck:Leak
-/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2000, 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
#endif /* HAVE_UCA_COLLATIONS */
-my_bool init_compiled_charsets(myf flags __attribute__((unused)))
+my_bool init_compiled_charsets(myf flags MY_ATTRIBUTE((unused)))
{
CHARSET_INFO *cs;
-/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2000, 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
Be silent by default: no warnings on the client side.
*/
static void
-default_reporter(enum loglevel level __attribute__ ((unused)),
- const char *format __attribute__ ((unused)),
+default_reporter(enum loglevel level MY_ATTRIBUTE ((unused)),
+ const char *format MY_ATTRIBUTE ((unused)),
...)
{
}
*to= 0;
return overflow ? (ulong)~0 : (ulong) (to - to_start);
}
+
+#if defined(EXPORT_SYMVER16)
+#ifndef EMBEDDED_LIBRARY
+
+// Hack to provide Fedora symbols
+
+CHARSET_INFO *mysql_get_charset(uint cs_number, myf flags)
+{
+ return get_charset(cs_number, flags);
+}
+
+
+CHARSET_INFO * mysql_get_charset_by_csname(const char *cs_name, uint cs_flags, myf flags)
+{
+ return get_charset_by_csname(cs_name, cs_flags, flags);
+}
+
+#endif
+#endif /* EXPORT_SYMVER16 */
-/* Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2000, 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
-/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2000, 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
this, just remember the file name for later removal
*/
-static my_bool cache_remove_open_tmp(IO_CACHE *cache __attribute__((unused)),
+static my_bool cache_remove_open_tmp(IO_CACHE *cache MY_ATTRIBUTE((unused)),
const char *name)
{
#if O_TEMPORARY == 0
-/* Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2000, 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
my_bool reinit_io_cache(IO_CACHE *info, enum cache_type type,
my_off_t seek_offset,
- pbool use_async_io __attribute__((unused)),
+ pbool use_async_io MY_ATTRIBUTE((unused)),
pbool clear_cache)
{
DBUG_ENTER("reinit_io_cache");
while (write_length)
{
size_t copy_length= MY_MIN(write_length, write_cache->buffer_length);
- int __attribute__((unused)) rc;
+ int MY_ATTRIBUTE((unused)) rc;
rc= lock_io_cache(write_cache, write_cache->pos_in_file);
/* The writing thread does always have the lock when it awakes. */
unlock_append_buffer(info);
int my_b_flush_io_cache(IO_CACHE *info,
- int need_append_buffer_lock __attribute__((unused)))
+ int need_append_buffer_lock MY_ATTRIBUTE((unused)))
{
size_t length;
my_off_t pos_in_file;
-/* Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2000, 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
uchar *key_cache_read(KEY_CACHE *keycache,
File file, my_off_t filepos, int level,
uchar *buff, uint length,
- uint block_length __attribute__((unused)),
- int return_buffer __attribute__((unused)))
+ uint block_length MY_ATTRIBUTE((unused)),
+ int return_buffer MY_ATTRIBUTE((unused)))
{
my_bool locked_and_incremented= FALSE;
int error=0;
int key_cache_write(KEY_CACHE *keycache,
File file, my_off_t filepos, int level,
uchar *buff, uint length,
- uint block_length __attribute__((unused)),
+ uint block_length MY_ATTRIBUTE((unused)),
int dont_write)
{
my_bool locked_and_incremented= FALSE;
0 on success (always because it can't fail)
*/
-int reset_key_cache_counters(const char *name __attribute__((unused)),
+int reset_key_cache_counters(const char *name MY_ATTRIBUTE((unused)),
KEY_CACHE *key_cache)
{
DBUG_ENTER("reset_key_cache_counters");
/*
Test if disk-cache is ok
*/
-static void test_key_cache(KEY_CACHE *keycache __attribute__((unused)),
- const char *where __attribute__((unused)),
- my_bool lock __attribute__((unused)))
+static void test_key_cache(KEY_CACHE *keycache MY_ATTRIBUTE((unused)),
+ const char *where MY_ATTRIBUTE((unused)),
+ my_bool lock MY_ATTRIBUTE((unused)))
{
/* TODO */
}
-/* Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2003, 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
/* Get key and length for a SAFE_HASH_ENTRY */
static uchar *safe_hash_entry_get(SAFE_HASH_ENTRY *entry, size_t *length,
- my_bool not_used __attribute__((unused)))
+ my_bool not_used MY_ATTRIBUTE((unused)))
{
*length=entry->length;
return (uchar*) entry->key;
-/* Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2000, 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
*/
File create_temp_file(char *to, const char *dir, const char *prefix,
- int mode __attribute__((unused)),
- myf MyFlags __attribute__((unused)))
+ int mode MY_ATTRIBUTE((unused)),
+ myf MyFlags MY_ATTRIBUTE((unused)))
{
File file= -1;
#ifdef __WIN__
-/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2000, 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
@param to A pathname.
*/
-void to_unix_path(char *to __attribute__((unused)))
+void to_unix_path(char *to MY_ATTRIBUTE((unused)))
{
#if FN_LIBCHAR != '/'
{
-/* Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2000, 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
@return TRUE if the file name is allowed, FALSE otherwise.
*/
-my_bool is_filename_allowed(const char *name __attribute__((unused)),
- size_t length __attribute__((unused)),
- my_bool allow_current_dir __attribute__((unused)))
+my_bool is_filename_allowed(const char *name MY_ATTRIBUTE((unused)),
+ size_t length MY_ATTRIBUTE((unused)),
+ my_bool allow_current_dir MY_ATTRIBUTE((unused)))
{
/*
For Windows, check if the file name contains : character.
-/* Copyright (C) 2000 MySQL AB
- Use is subject to license terms
+/* Copyright (c) 2000, 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
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 */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/* Function to set a varible when we got a alarm */
/* Used by my_lock samt functions in m_alarm.h */
#ifdef HAVE_ALARM
/* ARGSUSED */
-sig_handler my_set_alarm_variable(int signo __attribute__((unused)))
+sig_handler my_set_alarm_variable(int signo MY_ATTRIBUTE((unused)))
{
my_have_got_alarm=1; /* Tell program that time expired */
return;
-/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2000, 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
*/
void init_alloc_root(MEM_ROOT *mem_root, size_t block_size,
- size_t pre_alloc_size __attribute__((unused)))
+ size_t pre_alloc_size MY_ATTRIBUTE((unused)))
{
DBUG_ENTER("init_alloc_root");
DBUG_PRINT("enter",("root: 0x%lx", (long) mem_root));
*/
void reset_root_defaults(MEM_ROOT *mem_root, size_t block_size,
- size_t pre_alloc_size __attribute__((unused)))
+ size_t pre_alloc_size MY_ATTRIBUTE((unused)))
{
DBUG_ASSERT(alloc_root_inited(mem_root));
/*
- Copyright (c) 2001, 2012, Oracle and/or its affiliates. All rights reserved.
+ Copyright (c) 2001, 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
}
-static inline void bitmap_lock(MY_BITMAP *map __attribute__((unused)))
+static inline void bitmap_lock(MY_BITMAP *map MY_ATTRIBUTE((unused)))
{
if (map->mutex)
mysql_mutex_lock(map->mutex);
}
-static inline void bitmap_unlock(MY_BITMAP *map __attribute__((unused)))
+static inline void bitmap_unlock(MY_BITMAP *map MY_ATTRIBUTE((unused)))
{
if (map->mutex)
mysql_mutex_unlock(map->mutex);
my_bool bitmap_init(MY_BITMAP *map, my_bitmap_map *buf, uint n_bits,
- my_bool thread_safe __attribute__((unused)))
+ my_bool thread_safe MY_ATTRIBUTE((unused)))
{
DBUG_ENTER("bitmap_init");
if (!buf)
-/* Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2000, 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
/* No close operation hook. */
-static int no_close(void *cookie __attribute__((unused)))
+static int no_close(void *cookie MY_ATTRIBUTE((unused)))
{
return 0;
}
-/* Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2000, 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
/* Seek to position in file */
my_off_t my_fseek(FILE *stream, my_off_t pos, int whence,
- myf MyFlags __attribute__((unused)))
+ myf MyFlags MY_ATTRIBUTE((unused)))
{
DBUG_ENTER("my_fseek");
DBUG_PRINT("my",("stream: 0x%lx pos: %lu whence: %d MyFlags: %d",
/* Tell current position of file */
-my_off_t my_ftell(FILE *stream, myf MyFlags __attribute__((unused)))
+my_off_t my_ftell(FILE *stream, myf MyFlags MY_ATTRIBUTE((unused)))
{
off_t pos;
DBUG_ENTER("my_ftell");
-/* Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2004, 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
#else /* __FreeBSD__ || __linux__ || __WIN__ */
/* just fail */
-my_bool my_gethwaddr(uchar *to __attribute__((unused)))
+my_bool my_gethwaddr(uchar *to MY_ATTRIBUTE((unused)))
{
return 1;
}
#endif
#else /* MAIN */
-int main(int argc __attribute__((unused)),char **argv)
+int main(int argc MY_ATTRIBUTE((unused)),char **argv)
{
uchar mac[6];
uint i;
-/* Copyright (c) 2004, 2011, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2004, 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
@retval current time.
*/
-time_t my_time_possible_from_micro(ulonglong microtime __attribute__((unused)))
+time_t my_time_possible_from_micro(ulonglong microtime MY_ATTRIBUTE((unused)))
{
#ifdef _WIN32
time_t t;
-/* Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2000, 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
int my_fstat(File Filedes, MY_STAT *stat_area,
- myf MyFlags __attribute__((unused)))
+ myf MyFlags MY_ATTRIBUTE((unused)))
{
DBUG_ENTER("my_fstat");
DBUG_PRINT("my",("fd: %d MyFlags: %d", Filedes, MyFlags));
-/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2000, 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
#include "mysys_priv.h"
-void my_message_stderr(uint error __attribute__((unused)),
+void my_message_stderr(uint error MY_ATTRIBUTE((unused)),
const char *str, myf MyFlags)
{
DBUG_ENTER("my_message_stderr");
-/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2000, 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
if MY_REDEL_MAKE_COPY is given, then the orginal file
is renamed to org_name-'current_time'.BAK
+
+ if MY_REDEL_NO_COPY_STAT is given, stats are not copied
+ from org_name to tmp_name.
*/
#define REDEL_EXT ".BAK"
DBUG_PRINT("my",("org_name: '%s' tmp_name: '%s' MyFlags: %d",
org_name,tmp_name,MyFlags));
- if (my_copystat(org_name,tmp_name,MyFlags) < 0)
- goto end;
+ if (!(MyFlags & MY_REDEL_NO_COPY_STAT))
+ {
+ if (my_copystat(org_name,tmp_name,MyFlags) < 0)
+ goto end;
+ }
if (MyFlags & MY_REDEL_MAKE_BACKUP)
{
char name_buff[FN_REFLEN+20];
-/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2000, 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
void (*fatal_error_handler_hook)(uint error, const char *str, myf MyFlags)=
my_message_stderr;
-static void proc_info_dummy(void *a __attribute__((unused)),
- const PSI_stage_info *b __attribute__((unused)),
- PSI_stage_info *c __attribute__((unused)),
- const char *d __attribute__((unused)),
- const char *e __attribute__((unused)),
- const unsigned int f __attribute__((unused)))
+static void proc_info_dummy(void *a MY_ATTRIBUTE((unused)),
+ const PSI_stage_info *b MY_ATTRIBUTE((unused)),
+ PSI_stage_info *c MY_ATTRIBUTE((unused)),
+ const char *d MY_ATTRIBUTE((unused)),
+ const char *e MY_ATTRIBUTE((unused)),
+ const unsigned int f MY_ATTRIBUTE((unused)))
{
return;
}
-/* Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2001, 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
#endif
-int my_is_symlink(const char *filename __attribute__((unused)))
+int my_is_symlink(const char *filename MY_ATTRIBUTE((unused)))
{
#if defined (HAVE_LSTAT) && defined (S_ISLNK)
struct stat stat_buff;
-/* Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2003, 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
#else /* NEED_EXPLICIT_SYNC_DIR */
-int my_sync_dir(const char *dir_name __attribute__((unused)),
- myf my_flags __attribute__((unused)))
+int my_sync_dir(const char *dir_name MY_ATTRIBUTE((unused)),
+ myf my_flags MY_ATTRIBUTE((unused)))
{
return 0;
}
#else /* NEED_EXPLICIT_SYNC_DIR */
-int my_sync_dir_by_file(const char *file_name __attribute__((unused)),
- myf my_flags __attribute__((unused)))
+int my_sync_dir_by_file(const char *file_name MY_ATTRIBUTE((unused)),
+ myf my_flags MY_ATTRIBUTE((unused)))
{
return 0;
}
-/* Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2000, 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
-/* Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2011, 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
C_MODE_START
-#define NNN __attribute__((unused))
+#define NNN MY_ATTRIBUTE((unused))
static void register_mutex_noop(const char *category NNN,
PSI_mutex_info *info NNN,
}
static int
-set_thread_connect_attrs_noop(const char *buffer __attribute__((unused)),
- uint length __attribute__((unused)),
- const void *from_cs __attribute__((unused)))
+set_thread_connect_attrs_noop(const char *buffer MY_ATTRIBUTE((unused)),
+ uint length MY_ATTRIBUTE((unused)),
+ const void *from_cs MY_ATTRIBUTE((unused)))
{
return 0;
}
-/* Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2000, 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
Special case for ORDER BY / GROUP BY CHAR(0) NOT NULL
*/
static
-int ptr_compare_zero_length(size_t *compare_length __attribute__((unused)),
- uchar **a __attribute__((unused)),
- uchar **b __attribute__((unused)))
+int ptr_compare_zero_length(size_t *compare_length MY_ATTRIBUTE((unused)),
+ uchar **a MY_ATTRIBUTE((unused)),
+ uchar **b MY_ATTRIBUTE((unused)))
{
return 0;
}
/* Get a pointer to a optimal byte-compare function for a given size */
#ifdef __sun
-qsort2_cmp get_ptr_compare (size_t size __attribute__((unused)))
+qsort2_cmp get_ptr_compare (size_t size MY_ATTRIBUTE((unused)))
{
return (qsort2_cmp) native_compare;
}
-/* Copyright (c) 2001, 2011, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2001, 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
/* Use Solaris' symbolic stack trace routine. */
#include <ucontext.h>
-void my_print_stacktrace(uchar* stack_bottom __attribute__((unused)),
- ulong thread_stack __attribute__((unused)))
+void my_print_stacktrace(uchar* stack_bottom MY_ATTRIBUTE((unused)),
+ ulong thread_stack MY_ATTRIBUTE((unused)))
{
if (printstack(fileno(stderr)) == -1)
my_safe_printf_stderr("%s",
#if BACKTRACE_DEMANGLE
-char __attribute__ ((weak)) *
-my_demangle(const char *mangled_name __attribute__((unused)),
- int *status __attribute__((unused)))
+char MY_ATTRIBUTE ((weak)) *
+my_demangle(const char *mangled_name MY_ATTRIBUTE((unused)),
+ int *status MY_ATTRIBUTE((unused)))
{
return NULL;
}
-/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2000, 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
void free_record(void *record);
static uchar *hash2_key(const uchar *rec,uint *length,
- my_bool not_used __attribute__((unused)))
+ my_bool not_used MY_ATTRIBUTE((unused)))
{
*length=(uint) (uchar) rec[reclength-1];
return (uchar*) rec;
-/* Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2000, 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
#define reschedule_alarms() pthread_kill(alarm_thread,THR_SERVER_ALARM)
#endif
-static sig_handler thread_alarm(int sig __attribute__((unused)));
+static sig_handler thread_alarm(int sig MY_ATTRIBUTE((unused)));
-static int compare_ulong(void *not_used __attribute__((unused)),
+static int compare_ulong(void *not_used MY_ATTRIBUTE((unused)),
uchar *a_ptr,uchar* b_ptr)
{
ulong a=*((ulong*) a_ptr),b= *((ulong*) b_ptr);
every second.
*/
-sig_handler process_alarm(int sig __attribute__((unused)))
+sig_handler process_alarm(int sig MY_ATTRIBUTE((unused)))
{
sigset_t old_mask;
/*
}
-static sig_handler process_alarm_part2(int sig __attribute__((unused)))
+static sig_handler process_alarm_part2(int sig MY_ATTRIBUTE((unused)))
{
ALARM *alarm_data;
DBUG_ENTER("process_alarm");
*/
-static sig_handler thread_alarm(int sig __attribute__((unused)))
+static sig_handler thread_alarm(int sig MY_ATTRIBUTE((unused)))
{
#ifdef MAIN
printf("thread_alarm\n"); fflush(stdout);
/* set up a alarm thread with uses 'sleep' to sleep between alarms */
#ifdef USE_ALARM_THREAD
-static void *alarm_handler(void *arg __attribute__((unused)))
+static void *alarm_handler(void *arg MY_ATTRIBUTE((unused)))
{
int error;
struct timespec abstime;
/* Can't do this yet */
}
-sig_handler process_alarm(int sig __attribute__((unused)))
+sig_handler process_alarm(int sig MY_ATTRIBUTE((unused)))
{
/* Can't do this yet */
}
#endif /* USE_ONE_SIGNAL_HAND */
-static void *signal_hand(void *arg __attribute__((unused)))
+static void *signal_hand(void *arg MY_ATTRIBUTE((unused)))
{
sigset_t set;
int sig,error,err_count=0;;
}
-int main(int argc __attribute__((unused)),char **argv __attribute__((unused)))
+int main(int argc MY_ATTRIBUTE((unused)),char **argv MY_ATTRIBUTE((unused)))
{
pthread_t tid;
pthread_attr_t thr_attr;
#else /* !defined(DONT_USE_ALARM_THREAD) */
-int main(int argc __attribute__((unused)),char **argv __attribute__((unused)))
+int main(int argc MY_ATTRIBUTE((unused)),char **argv MY_ATTRIBUTE((unused)))
{
printf("thr_alarm disabled with DONT_USE_THR_ALARM\n");
exit(1);
-/* Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2000, 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 following functions is for WRITE_CONCURRENT_INSERT */
-static void test_get_status(void* param __attribute__((unused)),
- int concurrent_insert __attribute__((unused)))
+static void test_get_status(void* param MY_ATTRIBUTE((unused)),
+ int concurrent_insert MY_ATTRIBUTE((unused)))
{
}
-static void test_update_status(void* param __attribute__((unused)))
+static void test_update_status(void* param MY_ATTRIBUTE((unused)))
{
}
-static void test_copy_status(void* to __attribute__((unused)) ,
- void *from __attribute__((unused)))
+static void test_copy_status(void* to MY_ATTRIBUTE((unused)) ,
+ void *from MY_ATTRIBUTE((unused)))
{
}
-static my_bool test_check_status(void* param __attribute__((unused)))
+static my_bool test_check_status(void* param MY_ATTRIBUTE((unused)))
{
return 0;
}
}
-int main(int argc __attribute__((unused)),char **argv __attribute__((unused)))
+int main(int argc MY_ATTRIBUTE((unused)),char **argv MY_ATTRIBUTE((unused)))
{
pthread_t tid;
pthread_attr_t thr_attr;
-/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2000, 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
int safe_mutex_init(safe_mutex_t *mp,
- const pthread_mutexattr_t *attr __attribute__((unused)),
+ const pthread_mutexattr_t *attr MY_ATTRIBUTE((unused)),
const char *file,
uint line)
{
This is ok, as this thread may not yet have been exited.
*/
-void safe_mutex_end(FILE *file __attribute__((unused)))
+void safe_mutex_end(FILE *file MY_ATTRIBUTE((unused)))
{
if (!safe_mutex_count) /* safetly */
pthread_mutex_destroy(&THR_LOCK_mutex);
-/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2000, 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
static int test_rb_tree(TREE_ELEMENT *element);
#endif
-void init_tree(TREE *tree, ulong default_alloc_size, ulong memory_limit,
+void init_tree(TREE *tree, size_t default_alloc_size, ulong memory_limit,
int size, qsort_cmp2 compare, my_bool with_delete,
tree_element_free free_element, const void *custom_arg)
{
}
if (!(tree->with_delete=with_delete))
{
- init_alloc_root(&tree->mem_root, (uint) default_alloc_size, 0);
+ init_alloc_root(&tree->mem_root, default_alloc_size, 0);
tree->mem_root.min_malloc=(sizeof(TREE_ELEMENT)+tree->size_of_element);
}
DBUG_VOID_RETURN;
-/* Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2008, 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
uint32 wt_success_stats;
static my_atomic_rwlock_t
- cycle_stats_lock __attribute__((unused)),
- wait_stats_lock __attribute__((unused)),
- success_stats_lock __attribute__((unused));
+ cycle_stats_lock MY_ATTRIBUTE((unused)),
+ wait_stats_lock MY_ATTRIBUTE((unused)),
+ success_stats_lock MY_ATTRIBUTE((unused));
#ifdef SAFE_STATISTICS
#define incr(VAR, LOCK) \
-/* Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2000, 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
static char my_defaults_file_buffer[FN_REFLEN];
static char my_defaults_extra_file_buffer[FN_REFLEN];
-static char my_login_file[FN_REFLEN];
-
static my_bool defaults_already_read= FALSE;
#ifdef WITH_WSREP
char wsrep_defaults_file[FN_REFLEN + 10]={0,};
char wsrep_defaults_group_suffix[FN_EXTLEN]={0,};
#endif /* WITH_WREP */
-/* Set to TRUE, if --no-defaults is found. */
-static my_bool found_no_defaults= FALSE;
-
-/* Set to TRUE, when login file is being processed. */
-static my_bool is_login_file= FALSE;
-
/* Which directories are searched for options (and in which order) */
#define MAX_DEFAULT_DIRS 6
};
static int search_default_file(Process_option_func func, void *func_ctx,
- const char *dir, const char *config_file);
+ const char *dir, const char *config_file,
+ my_bool is_login_file);
static int search_default_file_with_ext(Process_option_func func,
void *func_ctx,
const char *dir, const char *ext,
- const char *config_file, int recursion_level);
-static my_bool mysql_file_getline(char *str, int size, MYSQL_FILE *file);
-
+ const char *config_file,
+ int recursion_level,
+ my_bool is_login_file);
+static my_bool mysql_file_getline(char *str, int size, MYSQL_FILE *file,
+ my_bool is_login_file);
/**
Create the list of default directories.
func_ctx It's context. Usually it is the structure to
store additional options.
default_directories List of default directories.
+ found_no_defaults TRUE, if --no-defaults is specified.
DESCRIPTION
Process the default options from argc & argv
int my_search_option_files(const char *conf_file, int *argc, char ***argv,
uint *args_used, Process_option_func func,
- void *func_ctx, const char **default_directories)
+ void *func_ctx, const char **default_directories,
+ my_bool is_login_file, my_bool found_no_defaults)
{
const char **dirs, *forced_default_file, *forced_extra_defaults;
int error= 0;
(char **) &forced_default_file,
(char **) &forced_extra_defaults,
(char **) &my_defaults_group_suffix,
- (char **) &my_login_path);
+ (char **) &my_login_path, found_no_defaults);
if (! my_defaults_group_suffix)
my_defaults_group_suffix= getenv(STRINGIFY_ARG(DEFAULT_GROUP_SUFFIX_ENV));
// If conf_file is an absolute path, we only read it
if (dirname_length(conf_file))
{
- if ((error= search_default_file(func, func_ctx, NullS, conf_file)) < 0)
- goto err;
+ if ((error= search_default_file(func, func_ctx, NullS, conf_file,
+ is_login_file)) < 0)
+ goto err;
}
// If my defaults file is set (from a previous run), we read it
else if (my_defaults_file)
{
if ((error= search_default_file_with_ext(func, func_ctx, "", "",
- my_defaults_file, 0)) < 0)
+ my_defaults_file, 0,
+ is_login_file)) < 0)
goto err;
if (error > 0)
{
{
if (**dirs)
{
- if (search_default_file(func, func_ctx, *dirs, conf_file) < 0)
- goto err;
+ if (search_default_file(func, func_ctx, *dirs, conf_file,
+ is_login_file) < 0)
+ goto err;
}
else if (my_defaults_extra_file)
{
if ((error= search_default_file_with_ext(func, func_ctx, "", "",
- my_defaults_extra_file, 0)) < 0)
- goto err; /* Fatal error */
+ my_defaults_extra_file, 0,
+ is_login_file)) < 0)
+ goto err; /* Fatal error */
if (error > 0)
{
fprintf(stderr, "Could not open required defaults file: %s\n",
char **defaults,
char **extra_defaults,
char **group_suffix,
- char **login_path)
+ char **login_path,
+ my_bool found_no_defaults)
{
int org_argc= argc, prev_argc= 0, default_option_count= 0;
*defaults= *extra_defaults= *group_suffix= *login_path= 0;
char *ptr,**res;
struct handle_option_ctx ctx;
const char **dirs;
+ char my_login_file[FN_REFLEN];
+ my_bool found_no_defaults= false;
uint args_sep= my_getopt_use_args_separator ? 1 : 0;
DBUG_ENTER("load_defaults");
if ((error= my_search_option_files(conf_file, argc, argv,
&args_used, handle_default_option,
- (void *) &ctx, dirs)))
+ (void *) &ctx, dirs, false, found_no_defaults)))
{
free_root(&alloc,MYF(0));
DBUG_RETURN(error);
}
/* Read options from login group. */
- is_login_file= TRUE;
if (my_default_get_login_file(my_login_file, sizeof(my_login_file)) &&
(error= my_search_option_files(my_login_file,argc, argv, &args_used,
handle_default_option, (void *) &ctx,
- dirs)))
+ dirs, true, found_no_defaults)))
{
free_root(&alloc,MYF(0));
DBUG_RETURN(error);
}
- is_login_file= FALSE;
/*
Here error contains <> 0 only if we have a fully specified conf_file
static int search_default_file(Process_option_func opt_handler,
void *handler_ctx,
const char *dir,
- const char *config_file)
+ const char *config_file,
+ my_bool is_login_file)
{
char **ext;
const char *empty_list[]= { "", 0 };
int error;
if ((error= search_default_file_with_ext(opt_handler, handler_ctx,
dir, *ext,
- config_file, 0)) < 0)
+ config_file, 0, is_login_file)) < 0)
return error;
}
return 0;
group groups to read
recursion_level the level of recursion, got while processing
"!include" or "!includedir"
+ is_login_file TRUE, when login file is being processed.
RETURN
0 Success
const char *dir,
const char *ext,
const char *config_file,
- int recursion_level)
+ int recursion_level,
+ my_bool is_login_file)
{
char name[FN_REFLEN + 10], buff[4096], curr_gr[4096], *ptr, *end, **tmp_ext;
char *value, option[4096+2], tmp[FN_REFLEN];
}
fn_format(name,name,"","",4);
- if ((rc= check_file_permissions(name)) < 2)
+ if ((rc= check_file_permissions(name, is_login_file)) < 2)
return (int) rc;
if (is_login_file)
strncpy(wsrep_defaults_file, name, sizeof(wsrep_defaults_file) - 1);
#endif /* WITH_WSREP */
- while (mysql_file_getline(buff, sizeof(buff) - 1, fp))
+ while (mysql_file_getline(buff, sizeof(buff) - 1, fp, is_login_file))
{
line++;
/* Ignore comment and empty lines */
MY_UNPACK_FILENAME | MY_SAFE_PATH);
search_default_file_with_ext(opt_handler, handler_ctx, "", "", tmp,
- recursion_level + 1);
+ recursion_level + 1, is_login_file);
}
}
goto err;
search_default_file_with_ext(opt_handler, handler_ctx, "", "", ptr,
- recursion_level + 1);
+ recursion_level + 1, is_login_file);
}
continue;
of scrambled login file, the line read is first
decrypted and then returned.
- @param str [out] Buffer to store the read text.
- @param size [in] At max, size-1 bytes to be read.
- @param file [in] Source file.
+ @param str [out] Buffer to store the read text.
+ @param size [in] At max, size-1 bytes to be read.
+ @param file [in] Source file.
+ @param is_login_file [in] TRUE, when login file is being processed.
@return 1 Success
0 Error
*/
-static my_bool mysql_file_getline(char *str, int size, MYSQL_FILE *file)
+static my_bool mysql_file_getline(char *str, int size, MYSQL_FILE *file,
+ my_bool is_login_file)
{
uchar cipher[4096], len_buf[MAX_CIPHER_STORE_LEN];
static unsigned char my_key[LOGIN_KEY_LEN];
char buf[FN_REFLEN];
size_t len;
char *p;
- my_bool err __attribute__((unused));
+ my_bool err MY_ATTRIBUTE((unused));
len= normalize_dirname(buf, dir);
if (!(p= strmake_root(alloc, buf, len)))
/**
Check file permissions of the option file.
- @param file_name [in] Name of the option file.
+ @param file_name [in] Name of the option file.
+ @param is_login_file [in] TRUE, when login file is being processed.
@return 0 - Non-allowable file permissions.
1 - Failed to stat.
2 - Success.
*/
-int check_file_permissions(const char *file_name)
+int check_file_permissions(const char *file_name, my_bool is_login_file)
{
#if !defined(__WIN__)
MY_STAT stat_info;
-/* Copyright (c) 2002, 2015, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2002, 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
*/
static void fini_one_value(const struct my_option *option, void *variable,
- longlong value __attribute__ ((unused)))
+ longlong value MY_ATTRIBUTE ((unused)))
{
DBUG_ENTER("fini_one_value");
switch ((option->var_type & GET_TYPE_MASK)) {
xmlns:util="http://schemas.microsoft.com/wix/UtilExtension">\r
\r
<!--\r
- Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.\r
+ Copyright (c) 2010, 2016, 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
</InstallUISequence>\r
\r
<!-- Find previous installation -->\r
- <Property Id="INSTALLDIR">\r
+ <Property Id="GETINSTALLDIR">\r
<RegistrySearch Id="FindInstallLocation"\r
Root="HKLM"\r
Key="Software\Microsoft\Windows\CurrentVersion\Uninstall\[OLDERVERSIONBEINGUPGRADED]"\r
Name="InstallLocation"\r
Type="raw" />\r
</Property>\r
+ <CustomAction Id="SetInstall" Property="INSTALLDIR" Value="[GETINSTALLDIR]" />\r
+ <InstallUISequence>\r
+ <Custom Action="SetInstall" After="AppSearch">Installed</Custom>\r
+ </InstallUISequence>\r
<?if @Platform@ != "x64" ?>\r
<Property Id="OLDERVERSION"> \r
<RegistrySearch Id="FindOlderVersion"\r
-# Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2014, 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
debian/extra/qa_auth_server-plugin
debian/extra/semisync_master-plugin
debian/extra/semisync_slave-plugin
+debian/extra/test_udf_services-plugin
debian/extra/validate_password-plugin
-# Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2014, 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
debian/extra/qa_auth_server-plugin
debian/extra/semisync_master-plugin
debian/extra/semisync_slave-plugin
+debian/extra/test_udf_services-plugin
debian/extra/validate_password-plugin
-# Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2014, 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
debian/extra/qa_auth_server-plugin
debian/extra/semisync_master-plugin
debian/extra/semisync_slave-plugin
+debian/extra/test_udf_services-plugin
debian/extra/validate_password-plugin
-# Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2015, 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
debian/extra/qa_auth_server-plugin
debian/extra/semisync_master-plugin
debian/extra/semisync_slave-plugin
+debian/extra/test_udf_services-plugin
debian/extra/validate_password-plugin
-# Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2015, 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
debian/extra/qa_auth_server-plugin
debian/extra/semisync_master-plugin
debian/extra/semisync_slave-plugin
+debian/extra/test_udf_services-plugin
debian/extra/validate_password-plugin
-# Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2014, 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
debian/extra/qa_auth_server-plugin
debian/extra/semisync_master-plugin
debian/extra/semisync_slave-plugin
+debian/extra/test_udf_services-plugin
debian/extra/validate_password-plugin
-# Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2015, 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
debian/extra/qa_auth_server-plugin
debian/extra/semisync_master-plugin
debian/extra/semisync_slave-plugin
+debian/extra/test_udf_services-plugin
debian/extra/validate_password-plugin
--- /dev/null
+mysql-community (5.6.31-1ubuntu16.04) xenial; urgency=medium
+
+ * New upstream release
+
+ -- Lars Tangvald <ltangval@atum23> Tue, 03 May 2016 09:30:33 +0200
+
+mysql-community (5.6.28-1ubuntu15.10) wily; urgency=low
+
+ * New upstream release
+
+ -- Lars Tangvald <lars.tangvald@oracle.com> Thu, 12 Nov 2015 10:34:23 +0100
+
+mysql-community (5.6.26-1ubuntu15.04) vivid; urgency=low
+
+ * new upstream release
+ * mysql-commercial-server now depends on perl, psmisc
+ mysql-commercial-test now depends on python, libmysqlclient-dev
+ (Closes: #20893836)
+
+ -- Akhil Mohan <akhil.mohan@oracle.com> Thu, 18 Jun 2015 16:34:10 +0530
+
+mysql-community (5.6.25-3ubuntu15.04) vivid; urgency=low
+
+ * new upstream release
+ * mysql-common now conflicts with
+ mysql-server-5.6, mysql-server-core-5.6
+ mysql-client-5.6, mysql-client-core-5.6
+ * mysql-*-server no more provides
+ mysql-server-5.6, mysql-server-core-5.6
+ * mysql-*-client no more provides
+ mysql-client-5.6, mysql-client-core-5.6
+
+ -- Akhil Mohan <akhil.mohan@oracle.com> Mon, 15 Jun 2015 16:48:05 +0530
+
+mysql-community (5.6.24-3ubuntu15.04) vivid; urgency=low
+
+ * updated Standards-Version to 3.9.6 in d/control
+ * apparmor profile updated to allow read on all files under /etc/mysql
+ * added new conf files under d/extra/*.conf
+ * mysql_plugin moved from client to server pkg
+ * innochecksum moved from client to server pkg
+ * server pkg now replaces client pkg
+ * added systemd service profile and script
+ * new /etc/mysql/my.cnf management scheme added for Ubuntu 15.04
+ as discussed in Dec 2014 for native packaging source
+ * added dh "--with systemd" for enabling systemd
+
+ -- Akhil Mohan <akhil.mohan@oracle.com> Wed, 27 May 2015 11:35:35 +0530
+
+mysql-community (5.6.24-2ubuntu15.04) vivid; urgency=low
+
+ * new upstream release
+ * forked packaging source from utopic to vivid
+
+ -- Akhil Mohan <akhil.mohan@oracle.com> Wed, 15 Apr 2015 18:52:22 +0530
+
+mysql-community (5.6.24-1ubuntu14.10) utopic; urgency=low
+
+ * new upstream release
+
+ -- Akhil Mohan <akhil.mohan@oracle.com> Mon, 16 Feb 2014 15:45:09 +0530
+
+mysql-community (5.6.23-1ubuntu14.10) utopic; urgency=low
+
+ * new upstream release
+ * mysql-community-server now recommends mysql-client
+ * mysql-community-server now depends on apparmor
+ * removed template install-test-db; not installed by default
+ * d/compat incremented to 9 from 8
+ * d/control updated to build depend on debhelper 9
+ * added d/*.lintian-overrides and d/source/lintian-overrides
+ * d/rules updated to reflect correct file permissions
+
+ -- Akhil Mohan <akhil.mohan@oracle.com> Wed, 31 Dec 2014 10:51:07 +0530
+
+mysql-community (5.6.22-2ubuntu14.10) utopic; urgency=low
+
+ * new upstream release
+ * mysql-common now replaces mysql-server-{,core-}5.6
+
+ -- Akhil Mohan <akhil.mohan@oracle.com> Wed, 28 Nov 2014 15:18:07 +0530
+
+mysql-community (5.6.22-1ubuntu14.10) utopic; urgency=low
+
+ * new upstream release
+ * fixed d/*server.postinst to allow dropping test db without
+ setting root password
+ * init script will now run my_i_db if data dir is not present or empty
+ * updated init script to read app armor profile on startup
+ * forked packaging source from trusty and rebranded for utopic
+ * updated d/m-c-source.install to pack *.xz packaging source archive
+ * added more system resources to app armor profile
+ * dh_apparmor to now run before dh_installinit in d/rules
+ * libmysqlclient-dev now replaces mysql-client-{,core-}5.6
+
+ -- Akhil Mohan <akhil.mohan@oracle.com> Wed, 05 Nov 2014 17:04:07 +0530
+
+mysql-community (5.6.21-1ubuntu14.04) trusty; urgency=low
+
+ * new upstream release
+ * updated d/rules to increment -j8 as make option
+ * updated d/source/include-binaries to add mysql_no_login plugin
+ * updated CMake option WITH_EXTRA_CHARSETS from complex to all
+
+ -- Akhil Mohan <akhil.mohan@oracle.com> Wed, 20 Aug 2014 19:12:30 +0530
+
+mysql-community (5.6.20-1ubuntu14.04) trusty; urgency=low
+
+ * new upstream release
+ * added fakeroot as build-dep in d/control
+ * added d/*.dirs for bench, dev and test pkg
+ * updated d/rules to make compilation verbose
+ * removed default CFLAGS, CXXFLAGS in d/rules
+ * added patch for testsuite search paths under d/patches
+ * modified cmake option for testsuite in d/rules
+ * updated patch d/fix-mysql_install_db.patch
+ * enabled two patches in d/patches/series
+ * removed extra permissions check in d/rules when fixed in source
+ * modified d/mysql-*-server.postinst to stop removing /usr/my.cnf
+ * modified d/*-test.* for updated location of testsuite
+ * updated d/{mysql-*-server.install,rules} to include debug plugins
+ * updated d/rules to remove storage engine cmake options
+ * modified data dir permission in d/*server.{pre,post}inst
+ * updated d/source/include-binaries to add debug plugins
+ * updated d/rules to rename debug plugins
+
+ -- Akhil Mohan <akhil.mohan@oracle.com> Wed, 02 Jul 2014 17:45:30 +0530
+
+mysql-community (5.6.19-1ubuntu14.04) trusty; urgency=low
+
+ * new upstream release
+ * d/rules updated to rid of files removed from source
+ * modified path for source tar in source pkg
+ * obscured actual filenames in d/source/include-binaries
+ * modified d/rules to handle obscured filenames
+
+ -- Akhil Mohan <akhil.mohan@oracle.com> Mon, 05 May 2014 15:45:10 +0530
+
+mysql-community (5.6.17-1ubuntu14.04) trusty; urgency=low
+
+ * new upstream release
+
+ -- Akhil Mohan <akhil.mohan@oracle.com> Fri, 28 Feb 2014 18:06:30 +0530
--- /dev/null
+Source: mysql-community
+Maintainer: MySQL Release Engineering <mysql-build@oss.oracle.com>
+Section: database
+Priority: optional
+Standards-Version: 3.9.6
+Homepage: http://www.mysql.com/
+Build-Depends: debhelper (>= 9.0.0), libaio-dev[linux-any], libncurses5-dev (>= 5.0-6), perl, zlib1g-dev (>= 1:1.1.3-5), po-debconf, psmisc, bison, dh-apparmor, dh-systemd (>= 1.5), lsb-release, cmake, fakeroot, libnuma-dev
+
+Package: mysql-server
+Architecture: any
+Depends: mysql-community-server (= ${binary:Version}), ${misc:Depends}
+Description: MySQL Server meta package depending on latest version
+ The MySQL(TM) software delivers a very fast, multi-threaded, multi-user,
+ and robust SQL (Structured Query Language) database server. MySQL Server
+ is intended for mission-critical, heavy-load production systems as well
+ as for embedding into mass-deployed software. MySQL is a trademark of
+ Oracle. This is a meta package that depends on the latest mysql server
+ package available in the repository.
+
+Package: mysql-community-server
+Architecture: any
+Pre-depends: debconf (>= 0.2.17), adduser
+Depends: mysql-common (= ${binary:Version}), apparmor, perl, psmisc,
+ ${shlibs:Depends}, ${misc:Depends}
+Recommends: mysql-client (= ${binary:Version})
+Conflicts: mysql,
+ mysql-server-5.0, mysql-server-core-5.0,
+ mysql-server-5.1, mysql-server-core-5.1,
+ mysql-server-5.5, mysql-server-core-5.5,
+ mysql-server-5.6, mysql-server-core-5.6,
+ mysql-commercial-server
+Replaces: mysql,
+ mysql-server-5.0, mysql-server-core-5.0,
+ mysql-server-5.1, mysql-server-core-5.1,
+ mysql-server-5.5, mysql-server-core-5.5,
+ mysql-server-5.6, mysql-server-core-5.6,
+ mysql-commercial-server,
+ mysql-community-client
+Provides: virtual-mysql-server, virtual-mysql-server-core
+Description: MySQL Server
+ The MySQL(TM) software delivers a very fast, multi-threaded, multi-user,
+ and robust SQL (Structured Query Language) database server. MySQL Server
+ is intended for mission-critical, heavy-load production systems as well
+ as for embedding into mass-deployed software. MySQL is a trademark of
+ Oracle. This package includes the MySQL server binary as well as related
+ utilities to run and administer a MySQL server.
+
+Package: mysql-client
+Architecture: any
+Depends: mysql-community-client (= ${binary:Version}), ${misc:Depends}
+Description: MySQL Client meta package depending on latest version
+ The MySQL(TM) software delivers a very fast, multi-threaded, multi-user,
+ and robust SQL (Structured Query Language) database server. MySQL Server
+ is intended for mission-critical, heavy-load production systems as well
+ as for embedding into mass-deployed software. MySQL is a trademark of
+ Oracle. This is a meta package that depends on the latest mysql client
+ package available in the repository.
+
+Package: mysql-community-client
+Architecture: any
+Depends: mysql-common (= ${binary:Version}),
+ ${shlibs:Depends}, ${misc:Depends}
+Conflicts: mysql,
+ mysql-client-5.0, mysql-client-core-5.0,
+ mysql-client-5.1, mysql-client-core-5.1,
+ mysql-client-5.5, mysql-client-core-5.5,
+ mysql-client-5.6, mysql-client-core-5.6,
+ mysql-commercial-client
+Replaces: mysql,
+ mysql-client-5.0, mysql-client-core-5.0,
+ mysql-client-5.1, mysql-client-core-5.1,
+ mysql-client-5.5, mysql-client-core-5.5,
+ mysql-client-5.6, mysql-client-core-5.6,
+ mysql-commercial-client
+Provides: virtual-mysql-client, virtual-mysql-client-core
+Description: MySQL Client
+ The MySQL(TM) software delivers a very fast, multi-threaded, multi-user,
+ and robust SQL (Structured Query Language) database server. MySQL Server
+ is intended for mission-critical, heavy-load production systems as well
+ as for embedding into mass-deployed software. MySQL is a trademark of
+ Oracle. This package contains the standard MySQL clients and
+ administration tools.
+
+Package: libmysqlclient18
+Architecture: any
+Section: libs
+Pre-Depends: ${misc:Pre-Depends}
+Multi-Arch: same
+Depends: mysql-common (= ${binary:Version}),
+ ${shlibs:Depends}, ${misc:Depends}
+Description: MySQL shared client libraries
+ The MySQL(TM) software delivers a very fast, multi-threaded, multi-user,
+ and robust SQL (Structured Query Language) database server. MySQL Server
+ is intended for mission-critical, heavy-load production systems as well
+ as for embedding into mass-deployed software. MySQL is a trademark of
+ Oracle. This package contains the shared libraries for MySQL client
+ applications.
+
+Package: mysql-common
+Architecture: any
+Pre-depends: debconf (>= 0.2.17), ${misc:Pre-Depends}
+Multi-Arch: foreign
+Depends: ${shlibs:Depends}, ${misc:Depends}
+Conflicts: mysql, mysql-server-5.6, mysql-server-core-5.6,
+ mysql-client-5.6, mysql-client-core-5.6,
+ mariadb-server-5.5, percona-xtradb-cluster-common-5.5
+Replaces: mysql, mysql-server-5.5, mysql-server-core-5.5, libmysqlclient-dev,
+ mysql-server-5.6, mysql-server-core-5.6,
+ mariadb-server-5.5, percona-xtradb-cluster-common-5.5
+Provides: mysql-common, mysql-common-5.6
+Description: MySQL Common
+ The MySQL(TM) software delivers a very fast, multi-threaded, multi-user,
+ and robust SQL (Structured Query Language) database server. MySQL Server
+ is intended for mission-critical, heavy-load production systems as well
+ as for embedding into mass-deployed software. MySQL is a trademark of
+ Oracle. This package contains common files needed by MySQL client
+ library, MySQL database server, and MySQL embedded server.
+
+Package: libmysqlclient-dev
+Architecture: any
+Section: libdevel
+Depends: libmysqlclient18 (= ${binary:Version}),
+ ${shlibs:Depends}, ${misc:Depends}
+Replaces: mysql-client-5.6, mysql-client-core-5.6
+Description: MySQL development headers
+ The MySQL(TM) software delivers a very fast, multi-threaded, multi-user,
+ and robust SQL (Structured Query Language) database server. MySQL Server
+ is intended for mission-critical, heavy-load production systems as well
+ as for embedding into mass-deployed software. MySQL is a trademark of
+ Oracle. This package contains the development header files necessary
+ to develop MySQL client applications.
+
+Package: libmysqld-dev
+Architecture: any
+Section: libdevel
+Depends: libmysqlclient-dev (= ${binary:Version}),
+ ${shlibs:Depends}, ${misc:Depends}
+Description: MySQL embedded server library
+ The MySQL(TM) software delivers a very fast, multi-threaded, multi-user,
+ and robust SQL (Structured Query Language) database server. MySQL Server
+ is intended for mission-critical, heavy-load production systems as well
+ as for embedding into mass-deployed software. MySQL is a trademark of
+ Oracle. This package contains the MySQL server as an embedded library.
+
+Package: mysql-testsuite
+Architecture: any
+Depends: mysql-community-test (= ${binary:Version}), ${misc:Depends}
+Description: MySQL Testsuite meta package depending on latest version
+ The MySQL(TM) software delivers a very fast, multi-threaded, multi-user,
+ and robust SQL (Structured Query Language) database server. MySQL Server
+ is intended for mission-critical, heavy-load production systems as well
+ as for embedding into mass-deployed software. MySQL is a trademark of
+ Oracle. This is a meta package that depends on the latest mysql test
+ package available in the repository.
+
+Package: mysql-community-test
+Architecture: any
+Depends: mysql-community-server (= ${binary:Version}),
+ mysql-community-client (= ${binary:Version}), python,
+ libmysqlclient-dev, ${shlibs:Depends}, ${misc:Depends}
+Conflicts: mysql,
+ mysql-testsuite-5.0, mysql-testsuite-5.1, mysql-testsuite-5.5,
+ mysql-testsuite-5.6, mysql-commercial-test
+Description: MySQL Test Run MTR - The MySQL testsuite
+ The MySQL(TM) software delivers a very fast, multi-threaded, multi-user,
+ and robust SQL (Structured Query Language) database server. MySQL Server
+ is intended for mission-critical, heavy-load production systems as well
+ as for embedding into mass-deployed software. MySQL is a trademark of
+ Oracle. This package contains the MySQL regression test suite for MySQL
+ database server.
+
+Package: mysql-community-bench
+Architecture: any
+Depends: mysql-community-server (= ${binary:Version}),
+ ${shlibs:Depends}, ${misc:Depends}
+Conflicts: mysql, mysql-commercial-bench
+Description: MySQL Bench
+ The MySQL(TM) software delivers a very fast, multi-threaded, multi-user,
+ and robust SQL (Structured Query Language) database server. MySQL Server
+ is intended for mission-critical, heavy-load production systems as well
+ as for embedding into mass-deployed software. MySQL is a trademark of
+ Oracle.
+
+Package: mysql-community-source
+Architecture: any
+Depends: ${misc:Depends}, ${shlibs:Depends}
+Description: MySQL source
+ The MySQL(TM) software delivers a very fast, multi-threaded, multi-user,
+ and robust SQL (Structured Query Language) database server. MySQL Server
+ is intended for mission-critical, heavy-load production systems as well
+ as for embedding into mass-deployed software. MySQL is a trademark of
+ Oracle.
--- /dev/null
+Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
+Upstream-Name: MySQL Server 5.6
+Upstream-Contact: MySQL Release Engineering <mysql-build@oss.oracle.com>
+Source: http://dev.mysql.com/
+
+Copyright: 2000, 2016, 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
+ is released under the version 2 of the GNU General Public License.
+ MySQL is brought to you by Oracle.
+ .
+ MySQL FOSS License Exception
+ We want free and open source software applications under certain
+ licenses to be able to use specified GPL-licensed MySQL client
+ libraries despite the fact that not all such FOSS licenses are
+ compatible with version 2 of the GNU General Public License.
+ Therefore there are special exceptions to the terms and conditions
+ of the GPLv2 as applied to these client libraries, which are
+ identified and described in more detail in the FOSS License
+ Exception at
+ <http://www.mysql.com/about/legal/licensing/foss-exception.html>.
+ .
+ This distribution may include materials developed by third
+ parties. For license and attribution notices for these
+ materials, please refer to the documentation that accompanies
+ this distribution (see the "Licenses for Third-Party Components"
+ appendix) or view the online documentation at
+ <http://dev.mysql.com/doc/>.
+ .
+ GPLv2 Disclaimer
+ For the avoidance of doubt, except that if any license choice
+ other than GPL or LGPL is available it will apply instead,
+ Oracle elects to use only the General Public License version 2
+ (GPLv2) at this time for any software where a choice of GPL
+ license versions is made available with the language indicating
+ that GPLv2 or any later version may be used, or where a choice
+ .
+ The full text of the GNU General Public License version 2 can
+ be found in the file
+ `/usr/share/mysql/doc/COPYING'.
--- /dev/null
+# vim:syntax=apparmor
+# Last Modified: Fri Feb 28 18:06:30 2014
+#include <tunables/global>
+
+/usr/sbin/mysqld {
+ #include <abstractions/base>
+ #include <abstractions/nameservice>
+ #include <abstractions/user-tmp>
+
+# Allow system resource access
+ /sys/devices/system/cpu/ r,
+ capability sys_resource,
+ capability dac_override,
+ capability setuid,
+ capability setgid,
+
+# Allow config access
+ /etc/mysql/** r,
+
+# Allow pid and socket file access
+ /run/mysqld/mysqld.pid rw,
+ /run/mysqld/mysqld.sock rw,
+
+# Allow read/ write to /tmp
+ /tmp/ r,
+ /tmp/* rw,
+
+# Allow execution of server binary
+ /usr/sbin/mysqld mr,
+ /usr/sbin/mysqld-debug mr,
+
+# Allow plugin access
+ /usr/lib/mysql/plugin/ r,
+ /usr/lib/mysql/plugin/*.so* mr,
+
+# Allow error msg and charset access
+ /usr/share/mysql/ r,
+ /usr/share/mysql/** r,
+
+# Allow data dir access
+ /var/lib/mysql/ r,
+ /var/lib/mysql/** rwk,
+
+# Allow log file access
+ /var/log/mysql/ r,
+ /var/log/mysql/** rw,
+}
--- /dev/null
+# Copyright (c) 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
+
+#
+# The MySQL Commercial Server configuration file.
+#
+# For explanations see
+# http://dev.mysql.com/doc/mysql/en/server-system-variables.html
+
+# * IMPORTANT: Additional settings that can override those from this file!
+# The files must end with '.cnf', otherwise they'll be ignored.
+#
+!includedir /etc/mysql/conf.d/
--- /dev/null
+#!/bin/bash
+
+# Copyright (c) 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
+
+# Scripts to run by MySQL systemd service
+#
+# Needed argument: pre | post
+#
+# pre mode : try to perform sanity check for configuration, log, data
+# post mode : ping server until answer is received
+
+pinger () {
+ while /bin/true ; do
+ sleep 1
+ mysqladmin ping >/dev/null 2>&1 && break
+ done
+}
+
+sanity () {
+ MYSQLRUN=/var/run/mysqld
+ MYSQLDATA=/var/lib/mysql
+ MYSQLLOG=/var/log/mysql
+
+ if [ ! -d ${MYSQLDATA} -a ! -L ${MYSQLDATA} ];
+ then
+ mkdir ${MYSQLDATA}
+ chown mysql:mysql ${MYSQLDATA}
+ chmod 750 ${MYSQLDATA}
+ fi
+
+ if [ ! -d "${MYSQLDATA}/mysql" -a ! -L "${MYSQLDATA}/mysql" ];
+ then
+ mkdir ${MYSQLDATA}/mysql
+ chown mysql:mysql ${MYSQLDATA}/mysql
+ chmod 750 ${MYSQLDATA}/mysql
+ fi
+
+ if [ ! "$(ls -A ${MYSQLDATA}/mysql)" ];
+ then
+ mysql_install_db --user=mysql > /dev/null
+ fi
+
+ if [ ! -d ${MYSQLLOG} -a ! -L ${MYSQLLOG} ];
+ then
+ mkdir ${MYSQLLOG}
+ chown mysql:adm ${MYSQLLOG}
+ chmod 750 ${MYSQLLOG}
+ touch ${MYSQLLOG}/error.log
+ chmod 640 ${MYSQLLOG}/error.log
+ chown mysql:adm ${MYSQLLOG}/error.log
+ fi
+
+ if [ ! -d "${MYSQLRUN}" -a ! -L "${MYSQLRUN}" ];
+ then
+ mkdir ${MYSQLRUN}
+ chown mysql:mysql ${MYSQLRUN}
+ chmod 755 ${MYSQLRUN}
+ fi
+
+ /lib/init/apparmor-profile-load usr.sbin.mysqld
+
+ if [ ! -r /etc/mysql/my.cnf ]; then
+ echo "MySQL configuration not found at /etc/mysql/my.cnf. Please install one using update-alternatives."
+ exit 1
+ fi
+}
+
+case $1 in
+ "pre") sanity ;;
+ "post") pinger ;;
+esac
--- /dev/null
+# Copyright (c) 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
+
+#
+# The MySQL Community Server configuration file.
+#
+# For explanations see
+# http://dev.mysql.com/doc/mysql/en/server-system-variables.html
+
+# * IMPORTANT: Additional settings that can override those from this file!
+# The files must end with '.cnf', otherwise they'll be ignored.
+#
+!includedir /etc/mysql/conf.d/
+!includedir /etc/mysql/mysql.conf.d/
--- /dev/null
+# Copyright (c) 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
+
+#
+# The MySQL Commercial Client configuration file.
+#
+# For explanations see
+# http://dev.mysql.com/doc/mysql/en/server-system-variables.html
+
+[mysql]
--- /dev/null
+.so man1/mysql.1
--- /dev/null
+# Copyright (c) 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
+
+#
+# The MySQL Commercial Server configuration file.
+#
+# For explanations see
+# http://dev.mysql.com/doc/mysql/en/server-system-variables.html
+
+[mysqld_safe]
+pid-file = /var/run/mysqld/mysqld.pid
+socket = /var/run/mysqld/mysqld.sock
+nice = 0
+
+[mysqld]
+user = mysql
+pid-file = /var/run/mysqld/mysqld.pid
+socket = /var/run/mysqld/mysqld.sock
+port = 3306
+basedir = /usr
+datadir = /var/lib/mysql
+tmpdir = /tmp
+lc-messages-dir = /usr/share/mysql
+explicit_defaults_for_timestamp
+
+# Instead of skip-networking the default is now to listen only on
+# localhost which is more compatible and is not less secure.
+bind-address = 127.0.0.1
+
+log-error = /var/log/mysql/error.log
+
+# Recommended in standard MySQL setup
+sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES
+
+# Disabling symbolic-links is recommended to prevent assorted security risks
+symbolic-links=0
--- /dev/null
+# Copyright (c) 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
+
+usr/include/mysql/*.h
+usr/include/mysql/mysql/*.h
+usr/include/mysql/mysql/*.h.pp
+usr/include/mysql/mysql/psi/*.h
+usr/lib/*/libmysqlclient.a
+usr/lib/*/libmysqlclient.so
+usr/lib/*/libmysqlservices.a
+usr/bin/mysql_config
+usr/bin/mysql_config_editor
+usr/share/man/man1/mysql_config.1
+usr/share/man/man1/mysql_config_editor.1
+# legal
+usr/share/doc/libmysqlclient-dev/COPYING
+usr/share/doc/libmysqlclient-dev/README
--- /dev/null
+# Copyright (c) 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
+
+# Additional license file is needed so overriding this warning
+libmysqlclient-dev: extra-license-file usr/share/doc/libmysqlclient-dev/LICENSE.mysql
+libmysqlclient-dev: extra-license-file usr/share/doc/libmysqlclient-dev/COPYING.gz
+libmysqlclient-dev: copyright-should-refer-to-common-license-file-for-lgpl
+# Due to static linking this cannot be avoided and hence being overridden
+libmysqlclient-dev: embedded-library
--- /dev/null
+# Copyright (c) 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
+
+usr/lib/*/libmysqlclient.so.*
+# legal
+usr/share/doc/libmysqlclient18/COPYING
+usr/share/doc/libmysqlclient18/README
--- /dev/null
+# Copyright (c) 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
+
+# Additional license file is needed so overriding this warning
+libmysqlclient18: extra-license-file usr/share/doc/libmysqlclient18/LICENSE.mysql
+libmysqlclient18: extra-license-file usr/share/doc/libmysqlclient18/COPYING.gz
+libmysqlclient18: copyright-should-refer-to-common-license-file-for-lgpl
+# Due to static linking this cannot be avoided and hence being overridden
+libmysqlclient18: embedded-library
--- /dev/null
+# Copyright (c) 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
+
+usr/lib/*/libmysqld.a
+usr/lib/*/libmysqld-debug.a
+# legal
+usr/share/doc/libmysqld-dev/COPYING
+usr/share/doc/libmysqld-dev/README
--- /dev/null
+# Copyright (c) 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
+
+# Additional license file is needed so overriding this warning
+libmysqld-dev: extra-license-file usr/share/doc/libmysqld-dev/LICENSE.mysql
+libmysqld-dev: extra-license-file usr/share/doc/libmysqld-dev/COPYING.gz
+libmysqld-dev: copyright-should-refer-to-common-license-file-for-lgpl
--- /dev/null
+# Copyright (c) 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
+
+# legal
+usr/share/doc/mysql-client/COPYING
+usr/share/doc/mysql-client/README
--- /dev/null
+# Copyright (c) 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
+
+# Additional license file is needed so overriding this warning
+mysql-client: extra-license-file usr/share/doc/mysql-client/LICENSE.mysql
+mysql-client: extra-license-file usr/share/doc/mysql-client/COPYING.gz
+mysql-client: copyright-should-refer-to-common-license-file-for-lgpl
--- /dev/null
+# Copyright (c) 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
+
+etc/mysql/conf.d
--- /dev/null
+# Copyright (c) 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
+
+# configuration file and script
+debian/extra/my.cnf.fallback etc/mysql/
+debian/extra/mysql.conf.cnf etc/mysql/conf.d/mysql.cnf
+
+usr/share/aclocal/mysql.m4
+usr/share/mysql/docs/INFO_SRC
+usr/share/mysql/docs/INFO_BIN
+usr/share/mysql/docs/ChangeLog
+# localized error msgs
+usr/share/mysql/*/errmsg.sys
+usr/share/mysql/errmsg-utf8.txt
+# charsets
+usr/share/mysql/charsets/*.xml
+usr/share/mysql/charsets/README
+# legal
+usr/share/doc/mysql-common/COPYING
+usr/share/doc/mysql-common/README
--- /dev/null
+# Copyright (c) 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
+
+# Additional license file is needed so overriding this warning
+mysql-common: extra-license-file usr/share/doc/mysql-common/LICENSE.mysql
+mysql-common: extra-license-file usr/share/doc/mysql-common/COPYING.gz
+mysql-common: copyright-should-refer-to-common-license-file-for-lgpl
--- /dev/null
+#!/bin/sh
+
+# Copyright (c) 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
+
+set -e
+
+if [ "$1" = "configure" ]; then
+ # Low priority fallback for client use when no server is installed.
+ update-alternatives --install /etc/mysql/my.cnf my.cnf /etc/mysql/my.cnf.fallback 100
+fi
+
+#DEBHELPER#
--- /dev/null
+#!/bin/bash
+
+# Copyright (c) 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
+
+set -e
+
+if [ "$1" = "purge" ]; then
+ rmdir /etc/mysql 2>/dev/null || true
+ update-alternatives --remove-all my.cnf
+fi
+
+#DEBHELPER#
--- /dev/null
+# Copyright (c) 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
+
+usr/lib/mysql/sql-bench/*
+# legal
+usr/share/doc/mysql-community-bench/COPYING
+usr/share/doc/mysql-community-bench/README
--- /dev/null
+# Copyright (c) 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
+
+# Additional license file is needed so overriding this warning
+mysql-community-bench: extra-license-file usr/share/doc/mysql-community-bench/LICENSE.mysql
+mysql-community-bench: extra-license-file usr/share/doc/mysql-community-bench/COPYING.gz
+mysql-community-bench: copyright-should-refer-to-common-license-file-for-lgpl
--- /dev/null
+# Copyright (c) 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
+
+# binaries
+usr/bin/myisam_ftdump
+usr/bin/mysql
+usr/bin/mysql_embedded
+usr/bin/mysqlaccess
+usr/bin/mysqlaccess.conf
+usr/bin/mysqladmin
+usr/bin/mysqlbug
+usr/bin/mysqlcheck
+usr/bin/mysql_client_test
+usr/bin/mysql_client_test_embedded
+usr/bin/mysqldump
+usr/bin/mysqldumpslow
+usr/bin/mysql_find_rows
+usr/bin/mysql_fix_extensions
+usr/bin/mysqlimport
+usr/bin/mysqlshow
+usr/bin/mysqlslap
+usr/bin/mysql_waitpid
+# man pages
+usr/share/man/man1/myisam_ftdump.1
+usr/share/man/man1/mysql.1
+usr/share/man/man1/mysql_embedded.1
+usr/share/man/man1/mysqlaccess.1
+usr/share/man/man1/mysqladmin.1
+usr/share/man/man1/mysqlbug.1
+usr/share/man/man1/mysqlcheck.1
+usr/share/man/man1/mysql_client_test.1
+usr/share/man/man1/mysql_client_test_embedded.1
+usr/share/man/man1/mysqldump.1
+usr/share/man/man1/mysqldumpslow.1
+usr/share/man/man1/mysql_find_rows.1
+usr/share/man/man1/mysql_fix_extensions.1
+usr/share/man/man1/mysqlimport.1
+usr/share/man/man1/mysqlman.1
+usr/share/man/man1/mysqlshow.1
+usr/share/man/man1/mysqlslap.1
+usr/share/man/man1/mysql_waitpid.1
+# legal
+usr/share/doc/mysql-community-client/COPYING
+usr/share/doc/mysql-community-client/README
--- /dev/null
+# Copyright (c) 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
+
+# Additional license file is needed so overriding this warning
+mysql-community-client: extra-license-file usr/share/doc/mysql-community-client/LICENSE.mysql
+mysql-community-client: extra-license-file usr/share/doc/mysql-community-clienti/COPYING.gz
+mysql-community-client: copyright-should-refer-to-common-license-file-for-lgpl
+# Due to static linking this cannot be avoided and hence being overridden
+mysql-community-client: embedded-library
--- /dev/null
+#!/bin/bash
+
+# Copyright (c) 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
+
+. /usr/share/debconf/confmodule
+
+if [ "$1" = "configure" ] && [ -z "$2" ];
+then
+
+ set -e
+
+ PKG_LIST=mysql-server-5.5:mysql-server-5.6:mysql-community-server:mysql-commercial-server
+ INSTALLED_PKG=none
+ MYSQLDATA=/var/lib/mysql
+
+ IFS_BACKUP=${IFS}
+ IFS=":"
+ for PKG in ${PKG_LIST};
+ do
+ STATUS=$(dpkg -s ${PKG} 2> /dev/null | grep Status: | cut -d' ' -f4)
+ if [ "${STATUS}" = "installed" ];
+ then
+ INSTALLED_PKG=${PKG}
+ break
+ fi
+ done
+ IFS=${IFS_BACKUP}
+
+ if [ "${INSTALLED_PKG}" = "none" ];
+ then
+ if [ -d ${MYSQLDATA} -o -L ${MYSQLDATA} ];
+ then
+ db_input high mysql-community-server/data-dir || true
+ else
+ db_fset mysql-community-server/data-dir seen true
+ fi
+
+ while :; do
+ PASSWD=""
+ db_input high mysql-community-server/root-pass || true
+ db_go
+
+ db_get mysql-community-server/root-pass
+ if [ -z "${RET}" ];
+ then
+ db_fset mysql-community-server/root-pass seen true
+ db_fset mysql-community-server/re-root-pass seen true
+ break
+ fi
+ PASSWD="${RET}"
+
+ db_input high mysql-community-server/re-root-pass || true
+ db_go
+
+ db_get mysql-community-server/re-root-pass
+ if [ "${RET}" == "${PASSWD}" ];
+ then
+ PASSWD=""
+ break
+ fi
+
+ db_fset mysql-community-server/root-pass-mismatch seen false
+ db_input critical mysql-community-server/root-pass-mismatch
+ db_set mysql-community-server/root-pass ""
+ db_set mysql-community-server/re-root-pass ""
+ done
+
+ else
+ db_fset mysql-community-server/data-dir seen true
+ db_fset mysql-community-server/root-pass seen true
+ db_fset mysql-community-server/re-root-pass seen true
+ fi
+
+ set +e
+fi
--- /dev/null
+# Copyright (c) 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
+
+etc/mysql/mysql.conf.d
+etc/init.d
+usr/lib/mysql
+usr/lib/mysql/plugin
--- /dev/null
+# Copyright (c) 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
+
+# binaries
+usr/bin/innochecksum
+usr/bin/msql2mysql
+usr/bin/myisamchk
+usr/bin/myisamlog
+usr/bin/myisampack
+usr/bin/my_print_defaults
+usr/bin/mysqlbinlog
+usr/bin/mysql_convert_table_format
+usr/bin/mysqld_multi
+usr/bin/mysqld_safe
+usr/bin/mysqlhotcopy
+usr/bin/mysql_install_db
+usr/bin/mysql_plugin
+usr/bin/mysql_secure_installation
+usr/bin/mysql_setpermission
+usr/bin/mysqltest
+usr/bin/mysqltest_embedded
+usr/bin/mysql_tzinfo_to_sql
+usr/bin/mysql_upgrade
+usr/bin/mysql_zap
+usr/bin/perror
+usr/bin/replace
+usr/bin/resolveip
+usr/bin/resolve_stack_dump
+usr/sbin/mysqld
+# debug binary
+usr/sbin/mysqld-debug
+# man pages
+usr/share/man/man1/innochecksum.1
+usr/share/man/man1/comp_err.1
+usr/share/man/man1/msql2mysql.1
+usr/share/man/man1/myisamchk.1
+usr/share/man/man1/myisamlog.1
+usr/share/man/man1/myisampack.1
+usr/share/man/man1/my_print_defaults.1
+usr/share/man/man1/mysqlbinlog.1
+usr/share/man/man1/mysql_convert_table_format.1
+usr/share/man/man1/mysqld_multi.1
+usr/share/man/man1/mysqld_safe.1
+usr/share/man/man1/mysqlhotcopy.1
+usr/share/man/man1/mysql_install_db.1
+usr/share/man/man1/mysql_plugin.1
+usr/share/man/man1/mysql_secure_installation.1
+usr/share/man/man1/mysql.server.1
+usr/share/man/man1/mysql_setpermission.1
+usr/share/man/man1/mysql-stress-test.pl.1
+usr/share/man/man1/mysqltest.1
+usr/share/man/man1/mysqltest_embedded.1
+usr/share/man/man1/mysql_tzinfo_to_sql.1
+usr/share/man/man1/mysql_upgrade.1
+usr/share/man/man1/mysql_zap.1
+usr/share/man/man1/perror.1
+usr/share/man/man1/replace.1
+usr/share/man/man1/resolveip.1
+usr/share/man/man1/resolve_stack_dump.1
+usr/share/man/man8/mysqld.8
+# confguration files
+debian/extra/mysql.cnf etc/mysql/
+debian/extra/mysqld.cnf etc/mysql/mysql.conf.d/
+# app armor profile
+etc/apparmor.d/usr.sbin.mysqld
+# SQL files
+usr/share/mysql/*.sql
+# plugins
+usr/lib/mysql/plugin/*.so
+usr/lib/mysql/plugin/debug/*.so
+usr/lib/mysql/plugin/daemon_example.ini
+usr/lib/mysql/plugin/debug/daemon_example.ini
+# support files
+usr/share/mysql/mysqld_multi.server
+usr/share/mysql/magic
+usr/share/mysql/mysql-log-rotate
+usr/share/mysql/mysql-systemd-start
+usr/share/mysql/my-default.cnf
+usr/share/mysql/dictionary.txt
+# legal
+usr/share/doc/mysql-community-server/COPYING
+usr/share/doc/mysql-community-server/README
--- /dev/null
+# Copyright (c) 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
+
+# Additional license file is needed so overriding this warning
+mysql-community-server: extra-license-file usr/share/doc/mysql-community-server/LICENSE.mysql
+mysql-community-server: extra-license-file usr/share/doc/mysql-community-server/COPYING.gz
+mysql-community-server: copyright-should-refer-to-common-license-file-for-lgpl
+# Due to static linking this cannot be avoided and hence being overridden
+mysql-community-server: embedded-library
+# Since we ship debug plugins so this error is overridden
+mysql-community-server: unstripped-binary-or-object usr/lib/mysql/plugin/debug/*
--- /dev/null
+#!/bin/bash
+#
+### BEGIN INIT INFO
+# Provides: mysql
+# Required-Start: $remote_fs $syslog
+# Required-Stop: $remote_fs $syslog
+# Should-Start: $network $time
+# Should-Stop: $network $time
+# Default-Start: 2 3 4 5
+# Default-Stop: 0 1 6
+# Short-Description: Start/ Stop MySQL Community Server daemon
+# Description: This service script facilitates startup and shutdown of
+# mysqld daemon throught its wrapper script mysqld_safe
+### END INIT INFO
+#
+
+# Copyright (c) 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
+
+. /lib/lsb/init-functions
+
+cd /
+umask 077
+
+MYSQLDATA=/var/lib/mysql
+VERSION=$(mysqld --version | grep mysqld | cut -d' ' -f4)
+
+get_mysql_option() {
+ RESULT=$(my_print_defaults "$1" | sed -n "s/^--$2=//p" | tail -n 1)
+ if [ -z "$RESULT" ];
+ then
+ RESULT="$3"
+ fi
+ echo $RESULT
+}
+
+get_running () {
+ PIDFILE=$(get_mysql_option mysqld_safe pid-file "")
+ if [ -z "$PIDFILE" ];
+ then
+ PIDFILE=$(get_mysql_option mysqld pid-file "$MYSQLDATA/$(hostname).pid")
+ fi
+ if [ -e "$PIDFILE" ] && [ -d "/proc/$(cat "$PIDFILE")" ];
+ then
+ echo 1
+ else
+ echo 0
+ fi
+}
+
+server_stop () {
+ RUNNING=$(get_running)
+ COUNT=0
+ while :; do
+ COUNT=$(( COUNT+1 ))
+ echo -n .
+ if [ "${RUNNING}" -eq 0 ];
+ then
+ echo
+ break
+ fi
+ if [ "${COUNT}" -gt 15 ];
+ then
+ echo
+ return 1
+ fi
+ RUNNING=$(get_running)
+ sleep 1
+ done
+ return 0
+}
+
+case "$1" in
+ 'start')
+ RUNNING=$(get_running)
+ if [ "${RUNNING}" -eq 1 ];
+ then
+ log_action_msg "A MySQL Server is already started"
+ else
+ MYSQLRUN=/var/run/mysqld
+ MYSQLDATA=/var/lib/mysql
+ MYSQLLOG=/var/log/mysql
+
+ if [ ! -d ${MYSQLDATA} -a ! -L ${MYSQLDATA} ];
+ then
+ mkdir ${MYSQLDATA}
+ chown mysql:mysql ${MYSQLDATA}
+ chmod 750 ${MYSQLDATA}
+ fi
+
+ if [ ! -d "${MYSQLDATA}/mysql" -a ! -L "${MYSQLDATA}/mysql" ];
+ then
+ mkdir ${MYSQLDATA}/mysql
+ chown mysql:mysql ${MYSQLDATA}/mysql
+ chmod 750 ${MYSQLDATA}/mysql
+ fi
+
+ if [ ! "$(ls -A ${MYSQLDATA}/mysql)" ];
+ then
+ mysql_install_db --user=mysql > /dev/null
+ fi
+
+ if [ ! -d ${MYSQLLOG} -a ! -L ${MYSQLLOG} ];
+ then
+ mkdir ${MYSQLLOG}
+ chown mysql:adm ${MYSQLLOG}
+ chmod 750 ${MYSQLLOG}
+ touch ${MYSQLLOG}/error.log
+ chmod 640 ${MYSQLLOG}/error.log
+ chown mysql:adm ${MYSQLLOG}/error.log
+ fi
+
+ if [ ! -d "${MYSQLRUN}" -a ! -L "${MYSQLRUN}" ];
+ then
+ mkdir ${MYSQLRUN}
+ chown mysql:mysql ${MYSQLRUN}
+ chmod 755 ${MYSQLRUN}
+ fi
+
+ /lib/init/apparmor-profile-load usr.sbin.mysqld
+
+ su - mysql -s /bin/bash -c "mysqld_safe > /dev/null &"
+ for i in 1 2 3 4 5 6;
+ do
+ sleep 1
+ echo -n .
+ done
+ echo
+ RUNNING=$(get_running)
+ if [ "${RUNNING}" -eq 1 ];
+ then
+ log_action_msg "MySQL Community Server ${VERSION} is started"
+ else
+ log_action_msg "MySQL Community Server ${VERSION} did not start. Please check logs for more details."
+ fi
+ fi
+ ;;
+
+ 'stop')
+ RUNNING=$(get_running)
+ if [ "${RUNNING}" -eq 1 ];
+ then
+ killall -15 mysqld
+ server_stop
+ if [ "$?" -eq 0 ];
+ then
+ log_action_msg "MySQL Community Server ${VERSION} is stopped"
+ else
+ log_action_msg "Attempt to shutdown MySQL Community Server ${VERSION} timed out"
+ fi
+ else
+ log_action_msg "MySQL Community Server ${VERSION} is already stopped"
+ fi
+ ;;
+
+ 'restart'|'reload'|'force-reload')
+ log_action_msg "Stopping MySQL Community Server ${VERSION}"
+ $0 stop
+ log_action_msg "Re-starting MySQL Community Server ${VERSION}"
+ $0 start
+ ;;
+
+ 'status')
+ RUNNING=$(get_running)
+ if [ ${RUNNING} -eq 1 ];
+ then
+ log_action_msg "MySQL Community Server ${VERSION} is running"
+ else
+ log_action_msg "MySQL Community Server ${VERSION} is not running"
+ exit 3
+ fi
+ ;;
+
+ *)
+ echo "Usage: $SELF start|stop|restart|reload|force-reload|status"
+ exit 1
+ ;;
+esac
+
+exit 0
--- /dev/null
+# Copyright (c) 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
+
+# MySQL systemd service file
+
+[Unit]
+Description=MySQL Community Server
+After=network.target
+
+[Install]
+WantedBy=multi-user.target
+
+[Service]
+User=mysql
+Group=mysql
+PermissionsStartOnly=true
+ExecStartPre=/usr/share/mysql/mysql-systemd-start pre
+ExecStart=/usr/bin/mysqld_safe
+ExecStartPost=/usr/share/mysql/mysql-systemd-start post
+TimeoutSec=600
+Restart=on-failure
--- /dev/null
+#!/bin/bash
+
+# Copyright (c) 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
+
+. /usr/share/debconf/confmodule
+
+take_upstart_job_backup () {
+ if [ -e "/etc/init/mysql.conf" ] && [ -d "/var/lib/mysql" ];
+ then
+ mv /etc/init/mysql.conf /var/lib/mysql/.mysql.conf.backup
+ fi
+}
+
+case "$1" in
+ configure)
+
+ if [ -z "$2" ];
+ then
+ set -e
+
+ update-alternatives --install /etc/mysql/my.cnf my.cnf "/etc/mysql/mysql.cnf" 200
+
+ MYSQLDATA=/var/lib/mysql
+
+ if [ ! -d "${MYSQLDATA}/mysql" -a ! -L "${MYSQLDATA}/mysql" ];
+ then
+ mkdir ${MYSQLDATA}/mysql
+ chown mysql:mysql ${MYSQLDATA}/mysql
+ chmod 750 ${MYSQLDATA}/mysql
+ if [ ! "$(ls -A ${MYSQLDATA}/mysql)" ];
+ then
+ mysql_install_db --user=mysql > /dev/null
+ fi
+ fi
+
+ db_get mysql-community-server/root-pass && PASSWD=${RET}
+ if [ ! -z "${PASSWD}" ];
+ then
+ db_set mysql-community-server/root-pass ""
+ db_set mysql-community-server/re-root-pass ""
+ PASSWD="UPDATE user SET password=PASSWORD('${PASSWD}') WHERE user='root';"
+ else
+ PASSWD=""
+ fi
+
+ SQL=`mktemp`
+ if [ -f "${SQL}" ];
+ then
+ chmod 700 ${SQL}
+ cat << EOF > ${SQL}
+USE mysql;
+${PASSWD}
+DELETE FROM user WHERE user='';
+FLUSH PRIVILEGES;
+EOF
+ mysqld --basedir=/usr --bootstrap --user=mysql --skip-grant-tables < $SQL
+ PASSWD=""
+ rm -f ${SQL}
+ fi
+
+ set +e
+
+ fi
+
+ ;;
+
+ abort-upgrade|abort-remove|abort-configure)
+
+ ;;
+
+ *)
+ exit 1
+ ;;
+esac
+
+db_stop
+
+take_upstart_job_backup
+
+#DEBHELPER#
+
+exit 0
--- /dev/null
+#!/bin/bash
+
+# Copyright (c) 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 [ "$1" = purge ] && [ -e /usr/share/debconf/confmodule ];
+then
+. /usr/share/debconf/confmodule
+fi
+
+place_upstart_job_back () {
+ if [ -e "/var/lib/mysql/.mysql.conf.backup" ];
+ then
+ mv /var/lib/mysql/.mysql.conf.backup /etc/init/mysql.conf
+ fi
+}
+
+get_pcount () {
+ PSCOUNT=$(ps -ef | grep "/usr/sbin/mysqld" | wc -l)
+ echo "${PSCOUNT}"
+}
+
+server_stop () {
+ PSCOUNT=$(get_pcount)
+ COUNT=0
+ while :; do
+ COUNT=$(( COUNT+1 ))
+ echo -n .
+ if [ "${PSCOUNT}" -eq 1 ];
+ then
+ echo
+ break
+ fi
+ if [ "${COUNT}" -gt 15 ];
+ then
+ echo
+ return 1
+ fi
+ PSCOUNT=$(get_pcount)
+ sleep 1
+ done
+ return 0
+}
+
+case "$1" in
+ remove)
+
+ set -e
+
+ place_upstart_job_back
+ update-alternatives --remove my.cnf "/etc/mysql/mysql.cnf"
+
+ set +e
+
+ ;;
+
+ purge)
+
+ set -e
+
+ place_upstart_job_back
+
+ MYSQLDATA=/var/lib/mysql
+ MYSQLLOG=/var/log/mysql
+ MYSQLRUN=/var/run/mysqld
+
+ server_stop
+
+ db_input high mysql-community-server/remove-data-dir || true
+ db_go
+ db_get mysql-community-server/remove-data-dir && RMDATADIR=${RET}
+ if [ "${RMDATADIR}" = "true" ];
+ then
+ if [ -d ${MYSQLRUN} ] || [ -L ${MYSQLRUN} ];
+ then
+ rm -rf ${MYSQLRUN}
+ fi
+
+ if [ -d ${MYSQLLOG} ] || [ -L ${MYSQLLOG} ];
+ then
+ rm -rf ${MYSQLLOG}
+ fi
+
+ if [ -d ${MYSQLDATA} ] || [ -L ${MYSQLDATA} ];
+ then
+ rm -rf ${MYSQLDATA}
+ fi
+
+ if getent passwd mysql >/dev/null;
+ then
+ userdel mysql
+ fi
+ fi
+
+ set +e
+ ;;
+
+ abort-install)
+
+ set -e
+
+ place_upstart_job_back
+
+ if [ -x "/etc/init.d/mysql" ];
+ then
+ invoke-rc.d mysql start || exit $?
+ else
+ if [ -d ${MYSQLRUN} ] || [ -L ${MYSQLRUN} ];
+ then
+ rm -rf ${MYSQLRUN}
+ fi
+
+ if [ -d ${MYSQLLOG} ] || [ -L ${MYSQLLOG} ];
+ then
+ rm -rf ${MYSQLLOG}
+ fi
+
+ if [ -d ${MYSQLDATA} ] || [ -L ${MYSQLDATA} ];
+ then
+ rm -rf ${MYSQLDATA}
+ fi
+
+ if getent passwd mysql >/dev/null;
+ then
+ userdel mysql
+ fi
+ fi
+
+ set +e
+ ;;
+
+ upgrade|abort-upgrade)
+
+ ;;
+
+ *)
+ exit 1
+ ;;
+esac
+
+#DEBHELPER#
+
+exit 0
--- /dev/null
+#!/bin/bash
+
+# Copyright (c) 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
+
+get_pcount () {
+ PSCOUNT=$(ps -ef | grep "/usr/sbin/mysqld" | wc -l)
+ echo "${PSCOUNT}"
+}
+
+server_stop () {
+ PSCOUNT=$(get_pcount)
+ COUNT=0
+ while :; do
+ COUNT=$(( COUNT+1 ))
+ echo -n .
+ if [ "${PSCOUNT}" -eq 1 ];
+ then
+ echo
+ break
+ fi
+ if [ "${COUNT}" -gt 15 ];
+ then
+ echo
+ return 1
+ fi
+ PSCOUNT=$(get_pcount)
+ sleep 1
+ done
+ return 0
+}
+
+case "$1" in
+ install)
+
+ if [ -z "$2" ];
+ then
+
+ set -e
+
+ if [ -x "/etc/init.d/mysql" ];
+ then
+ invoke-rc.d mysql stop || exit $?
+ server_stop
+ fi
+
+ MYSQLDATA=/var/lib/mysql
+ MYSQLLOG=/var/log/mysql
+ MYSQLRUN=/var/run/mysqld
+
+ if ! getent group mysql >/dev/null;
+ then
+ addgroup --system mysql >/dev/null
+ fi
+
+ if ! getent passwd mysql >/dev/null;
+ then
+ adduser --ingroup mysql --system --disabled-login --no-create-home --home ${MYSQLDATA} --shell /bin/false --gecos "MySQL Server" mysql >/dev/null
+ fi
+
+ if [ ! -d ${MYSQLDATA} -a ! -L ${MYSQLDATA} ];
+ then
+ mkdir ${MYSQLDATA}
+ chown mysql:mysql ${MYSQLDATA}
+ chmod 750 ${MYSQLDATA}
+ fi
+
+ if [ ! -d ${MYSQLLOG} -a ! -L ${MYSQLLOG} ];
+ then
+ mkdir ${MYSQLLOG}
+ chown mysql:adm ${MYSQLLOG}
+ chmod 750 ${MYSQLLOG}
+ touch ${MYSQLLOG}/error.log
+ chmod 640 ${MYSQLLOG}/error.log
+ chown mysql:adm ${MYSQLLOG}/error.log
+ fi
+
+ if [ ! -d ${MYSQLRUN} -a ! -L ${MYSQLRUN} ];
+ then
+ mkdir ${MYSQLRUN}
+ chown mysql:mysql ${MYSQLRUN}
+ chmod 755 ${MYSQLRUN}
+ fi
+
+ set +e
+
+ fi
+
+ ;;
+
+ upgrade)
+
+ set -e
+
+ #DEBHELPER#
+ server_stop
+
+ set +e
+
+ ;;
+
+ abort-upgrade)
+
+ ;;
+
+ *)
+ exit 1
+ ;;
+esac
+
+exit 0
--- /dev/null
+#!/bin/bash
+
+# Copyright (c) 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
+
+set -e
+
+#DEBHELPER#
+
+set +e
+
+exit 0
--- /dev/null
+Template: mysql-community-server/root-pass
+Type: password
+Description: Enter root password:
+ Please provide a strong password that will be set for the root account of your MySQL database.
+ Leave it blank if you do not wish to set or change the root password at this time.
+
+Template: mysql-community-server/re-root-pass
+Type: password
+Description: Re-enter root password:
+ Now that you have selected a password for the root account, please confirm by typing it again. Do not share the password with anyone.
+
+Template: mysql-community-server/root-pass-mismatch
+Type: error
+Description: The two passwords did not match
+ Please try again. Make sure you type the exact same password twice.
+
+Template: mysql-community-server/remove-data-dir
+Type: boolean
+Default: false
+Description: Remove data directory at /var/lib/mysql ?
+ This operation will remove the data directory that stores all the databases, tables and related meta-data.
+ It is highly recommended to take data backup before removing the data directory.
+
+Template: mysql-community-server/data-dir
+Type: note
+Description: Data directory found when no MySQL server package is installed
+ A data directory '/var/lib/mysql' is present on this system when no MySQL server
+ package is currently installed on the system. The directory may be under control of
+ server package received from third-party vendors. It may also be an unclaimed data
+ directory from previous removal of mysql packages.
+ .
+ It is highly recommended to take data backup. If you have not done so, now would be
+ the time to take backup in another shell. Once completed, press 'Ok' to continue.
--- /dev/null
+# Copyright (c) 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
+
+../*.dsc usr/src/mysql/
+../*.tar.gz usr/src/mysql/
+../*.tar.xz usr/src/mysql/
+# legal
+usr/share/doc/mysql-community-source/COPYING
+usr/share/doc/mysql-community-source/README
--- /dev/null
+# Copyright (c) 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
+
+# Additional license file is needed so overriding this warning
+mysql-community-source: extra-license-file usr/share/doc/mysql-community-source/LICENSE.mysql
+mysql-community-source: extra-license-file usr/share/doc/mysql-community-source/COPYING.gz
+mysql-community-source: copyright-should-refer-to-common-license-file-for-lgpl
--- /dev/null
+# Copyright (c) 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
+
+usr/lib/mysql-test/*
+usr/share/man/man1/mysql-test-run.pl.1
+# legal
+usr/share/doc/mysql-community-test/COPYING
+usr/share/doc/mysql-community-test/README
--- /dev/null
+# Copyright (c) 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
+
+usr/lib/mysql-test/mysql-test-run.pl usr/lib/mysql-test/mysql-test-run
+usr/lib/mysql-test/mysql-test-run.pl usr/lib/mysql-test/mtr
--- /dev/null
+# Copyright (c) 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
+
+# Additional license file is needed so overriding this warning
+mysql-community-test: extra-license-file usr/share/doc/mysql-community-test/LICENSE.mysql
+mysql-community-test: extra-license-file usr/share/doc/mysql-community-test/COPYING.gz
+mysql-community-test: copyright-should-refer-to-common-license-file-for-lgpl
--- /dev/null
+# Copyright (c) 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
+
+# legal
+usr/share/doc/mysql-server/COPYING
+usr/share/doc/mysql-server/README
--- /dev/null
+# Copyright (c) 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
+
+# Additional license file is needed so overriding this warning
+mysql-server: extra-license-file usr/share/doc/mysql-server/LICENSE.mysql
+mysql-server: extra-license-file usr/share/doc/mysql-server/COPYING.gz
+mysql-server: copyright-should-refer-to-common-license-file-for-lgpl
--- /dev/null
+# Copyright (c) 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
+
+# legal
+usr/share/doc/mysql-testsuite/COPYING
+usr/share/doc/mysql-testsuite/README
--- /dev/null
+# Copyright (c) 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
+
+# Additional license file is needed so overriding this warning
+mysql-testsuite: extra-license-file usr/share/doc/mysql-testsuite/LICENSE.mysql
+mysql-testsuite: extra-license-file usr/share/doc/mysql-testsuite/COPYING.gz
+mysql-testsuite: copyright-should-refer-to-common-license-file-for-lgpl
--- /dev/null
+From: Akhil Mohan <akhil.mohan@oracle.com>
+Description: Fix path in man page link.
+Bug: http://bugs.mysql.com/bug.php?id=70952
+
+--- a/man/mysql_client_test_embedded.1 2013-11-08 19:00:22.000000000 +0530
++++ b/man/mysql_client_test_embedded.1 2013-11-14 19:29:56.768315219 +0530
+@@ -1 +1 @@
+-.so man-gpl-tmp2/mysql_client_test.1
++.so man1/mysql_client_test.1
+--- a/man/mysqltest_embedded.1 2013-11-08 19:00:22.000000000 +0530
++++ b/man/mysqltest_embedded.1 2013-11-14 19:31:19.079280675 +0530
+@@ -1 +1 @@
+-.so man-gpl-tmp2/mysqltest.1
++.so man1/mysqltest.1
--- /dev/null
+From: Akhil Mohan <akhil.mohan@oracle.com>
+Description: Adding extra search path for testsuite.
+
+--- a/mysql-test/lib/mtr_cases.pm 2014-02-24 13:14:37 +0530
++++ b/mysql-test/lib/mtr_cases.pm 2014-07-02 11:46:24 +0530
+@@ -288,6 +288,7 @@
+ {
+ $suitedir= my_find_dir($::basedir,
+ ["share/mysql-test/suite",
++ "lib/mysql-test/suite",
+ "mysql-test/suite",
+ "internal/mysql-test/suite",
+ "mysql-test",
--- /dev/null
+From: Terje Røsten <terje.rosten@oracle.com>
+Description: Maintains the pending --skip-my-cnf option in mainline
+Bug: <TODO>
+
+diff --git a/scripts/mysql_install_db.pl.in b/scripts/mysql_install_db.pl.in
+index 440a977..7d068fc 100644
+--- a/scripts/mysql_install_db.pl.in
++++ b/scripts/mysql_install_db.pl.in
+@@ -113,6 +113,7 @@ EOF2
+ print <<EOF3;
+ --rpm For internal use. This option is used by RPM files
+ during the MySQL installation process.
++ Implies --keep-my-cnf option.
+ --skip-name-resolve Use IP addresses rather than hostnames when creating
+ grant table entries. This option can be useful if
+ your DNS does not work.
+@@ -439,7 +440,7 @@ if ( $opt->{srcdir} and $opt->{basedir} )
+ {
+ error($opt,"Specify either --basedir or --srcdir, not both");
+ }
+-if ( $opt->{'keep-my-cnf'} )
++if ( $opt->{rpm} || $opt->{'keep-my-cnf'} )
+ {
+ $keep_my_cnf = 1;
+ }
+@@ -664,7 +665,7 @@ if ( $opt->{'skip-name-resolve'} and $resolved and $resolved =~ /\s/ )
+ }
+
+ # ----------------------------------------------------------------------
+-# Create database directories mysql & test
++# Create database directory mysql
+ # ----------------------------------------------------------------------
+
+ # FIXME The shell variant uses "mkdir -p":
+@@ -697,7 +698,7 @@ if ($opt_user)
+ }
+ }
+
+-foreach my $dir ( $opt->{ldata}, "$opt->{ldata}/mysql", "$opt->{ldata}/test" )
++foreach my $dir ( $opt->{ldata}, "$opt->{ldata}/mysql")
+ {
+ mkdir($dir, 0700) unless -d $dir;
+ if ($opt_user and -w "/")
--- /dev/null
+# Copyright (c) 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
+
+#fix-man-page-links.patch
+fix-mysql_install_db.patch
+fix-mtr-search-paths.patch
--- /dev/null
+#!/usr/bin/make -f
+
+# Copyright (c) 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
+
+%:
+ dh $@
+
+export DH_VERBOSE=1
+export CFLAGS=
+export CXXFLAGS=
+
+override_dh_auto_configure:
+ @echo "RULES.$@"
+ cmake . \
+ -DBUILD_CONFIG=mysql_release \
+ -DCMAKE_INSTALL_PREFIX=/usr \
+ -DINSTALL_DOCDIR=share/mysql/docs \
+ -DINSTALL_DOCREADMEDIR=share/mysql \
+ -DINSTALL_INCLUDEDIR=include/mysql \
+ -DINSTALL_INFODIR=share/mysql/docs \
+ -DINSTALL_LIBDIR=lib/$(DEB_HOST_MULTIARCH) \
+ -DINSTALL_MANDIR=share/man \
+ -DINSTALL_MYSQLSHAREDIR=share/mysql \
+ -DINSTALL_MYSQLTESTDIR=lib/mysql-test \
+ -DINSTALL_PLUGINDIR=lib/mysql/plugin \
+ -DINSTALL_SBINDIR=sbin \
+ -DINSTALL_SCRIPTDIR=bin \
+ -DINSTALL_SQLBENCHDIR=lib/mysql \
+ -DINSTALL_SUPPORTFILESDIR=share/mysql \
+ -DMYSQL_DATADIR=/var/lib/mysql \
+ -DSYSCONFDIR=/etc/mysql \
+ -DMYSQL_UNIX_ADDR=/var/run/mysqld/mysqld.sock \
+ -DWITH_SSL=bundled \
+ -DWITH_ZLIB=system \
+ -DWITH_EXTRA_CHARSETS=all \
+ -DWITH_INNODB_MEMCACHED=1 \
+ -DCOMPILATION_COMMENT="MySQL Community Server (GPL)" \
+ -DINSTALL_LAYOUT=DEB
+
+ cat CMakeCache.txt
+ touch $@
+
+override_dh_auto_build:
+ @echo "RULES.$@"
+ $(MAKE) -j8 VERBOSE=1
+ touch $@
+
+override_dh_auto_test:
+ @echo "RULES.$@"
+ echo "No tests run because test 9: pfs_connect_attr is failing unreasonably"
+ touch $@
+
+override_dh_auto_install:
+
+ @echo "RULES.$@"
+ # complete install first
+ $(MAKE) install DESTDIR=debian/tmp
+ # remove all redundant files and links
+ rm debian/tmp/usr/lib/*/*_r*
+ rm debian/tmp/usr/lib/mysql-test/cmake_install.cmake
+ rm debian/tmp/usr/lib/mysql-test/CTestTestfile.cmake
+ rm debian/tmp/usr/lib/mysql-test/Makefile
+ # add missing man pages
+ install -g root -o root -m 0644 debian/extra/mysql_embedded.1 debian/tmp/usr/share/man/man1
+ # add MySQL Server debug binary and library to package
+ install -g root -o root -m 0755 debian/extra/server-binary debian/tmp/usr/sbin/mysqld-debug
+ install -g root -o root -m 0755 debian/extra/embedded-server debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/libmysqld-debug.a
+ # add debug plugin libraries to package
+ install -g root -o root -m 0755 -d debian/tmp/usr/lib/mysql/plugin/debug
+ for file in debian/extra/*-plugin; do NEW=`echo $$file | cut -d- -f1`; mv $$file $$NEW.so; done
+ install -g root -o root -m 0755 debian/extra/*.so debian/tmp/usr/lib/mysql/plugin/debug
+ install -g root -o root -m 0755 debian/extra/daemon_example.ini debian/tmp/usr/lib/mysql/plugin/debug
+ # add apparmor profile
+ install -g root -o root -m 0644 -D debian/extra/apparmor-profile debian/tmp/etc/apparmor.d/usr.sbin.mysqld
+ # add systemd script
+ install -m 0755 debian/extra/mysql-systemd-start debian/tmp/usr/share/mysql/
+ # add directory for legal docs
+ install -g root -o root -m 0755 -d debian/tmp/usr/share/doc/mysql-server
+ install -g root -o root -m 0755 -d debian/tmp/usr/share/doc/mysql-community-server
+ install -g root -o root -m 0755 -d debian/tmp/usr/share/doc/mysql-client
+ install -g root -o root -m 0755 -d debian/tmp/usr/share/doc/mysql-community-client
+ install -g root -o root -m 0755 -d debian/tmp/usr/share/doc/mysql-common
+ install -g root -o root -m 0755 -d debian/tmp/usr/share/doc/libmysqlclient18
+ install -g root -o root -m 0755 -d debian/tmp/usr/share/doc/libmysqlclient-dev
+ install -g root -o root -m 0755 -d debian/tmp/usr/share/doc/libmysqld-dev
+ install -g root -o root -m 0755 -d debian/tmp/usr/share/doc/mysql-community-bench
+ install -g root -o root -m 0755 -d debian/tmp/usr/share/doc/mysql-testsuite
+ install -g root -o root -m 0755 -d debian/tmp/usr/share/doc/mysql-community-test
+ install -g root -o root -m 0755 -d debian/tmp/usr/share/doc/mysql-community-source
+ # add COPYING file to each package
+ install -g root -o root -m 0644 debian/tmp/usr/share/mysql/COPYING debian/tmp/usr/share/doc/mysql-server/COPYING
+ install -g root -o root -m 0644 debian/tmp/usr/share/mysql/COPYING debian/tmp/usr/share/doc/mysql-community-server/COPYING
+ install -g root -o root -m 0644 debian/tmp/usr/share/mysql/COPYING debian/tmp/usr/share/doc/mysql-client/COPYING
+ install -g root -o root -m 0644 debian/tmp/usr/share/mysql/COPYING debian/tmp/usr/share/doc/mysql-community-client/COPYING
+ install -g root -o root -m 0644 debian/tmp/usr/share/mysql/COPYING debian/tmp/usr/share/doc/mysql-common/COPYING
+ install -g root -o root -m 0644 debian/tmp/usr/share/mysql/COPYING debian/tmp/usr/share/doc/libmysqlclient18/COPYING
+ install -g root -o root -m 0644 debian/tmp/usr/share/mysql/COPYING debian/tmp/usr/share/doc/libmysqlclient-dev/COPYING
+ install -g root -o root -m 0644 debian/tmp/usr/share/mysql/COPYING debian/tmp/usr/share/doc/libmysqld-dev/COPYING
+ install -g root -o root -m 0644 debian/tmp/usr/share/mysql/COPYING debian/tmp/usr/share/doc/mysql-community-bench/COPYING
+ install -g root -o root -m 0644 debian/tmp/usr/share/mysql/COPYING debian/tmp/usr/share/doc/mysql-testsuite/COPYING
+ install -g root -o root -m 0644 debian/tmp/usr/share/mysql/COPYING debian/tmp/usr/share/doc/mysql-community-test/COPYING
+ install -g root -o root -m 0644 debian/tmp/usr/share/mysql/COPYING debian/tmp/usr/share/doc/mysql-community-source/COPYING
+ # add README file to each package
+ install -g root -o root -m 0644 debian/tmp/usr/share/mysql/README debian/tmp/usr/share/doc/mysql-server/README
+ install -g root -o root -m 0644 debian/tmp/usr/share/mysql/README debian/tmp/usr/share/doc/mysql-community-server/README
+ install -g root -o root -m 0644 debian/tmp/usr/share/mysql/README debian/tmp/usr/share/doc/mysql-client/README
+ install -g root -o root -m 0644 debian/tmp/usr/share/mysql/README debian/tmp/usr/share/doc/mysql-community-client/README
+ install -g root -o root -m 0644 debian/tmp/usr/share/mysql/README debian/tmp/usr/share/doc/mysql-common/README
+ install -g root -o root -m 0644 debian/tmp/usr/share/mysql/README debian/tmp/usr/share/doc/libmysqlclient18/README
+ install -g root -o root -m 0644 debian/tmp/usr/share/mysql/README debian/tmp/usr/share/doc/libmysqlclient-dev/README
+ install -g root -o root -m 0644 debian/tmp/usr/share/mysql/README debian/tmp/usr/share/doc/libmysqld-dev/README
+ install -g root -o root -m 0644 debian/tmp/usr/share/mysql/README debian/tmp/usr/share/doc/mysql-community-bench/README
+ install -g root -o root -m 0644 debian/tmp/usr/share/mysql/README debian/tmp/usr/share/doc/mysql-testsuite/README
+ install -g root -o root -m 0644 debian/tmp/usr/share/mysql/README debian/tmp/usr/share/doc/mysql-community-test/README
+ install -g root -o root -m 0644 debian/tmp/usr/share/mysql/README debian/tmp/usr/share/doc/mysql-community-source/README
+ touch $@
+
+override_dh_installinit:
+ @echo "RULES.$@"
+ dh_apparmor -pmysql-community-server --profile-name=usr.sbin.mysqld
+ dh_systemd_enable --name=mysql
+ dh_installinit --name=mysql -- defaults 19 21
+ dh_systemd_start --restart-after-upgrade
+ touch $@
--- /dev/null
+3.0 (quilt)
--- /dev/null
+# Copyright (c) 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
+
+# obscured filename for mysqld-debug, libmysqld-debug.a and debug plugins
+debian/extra/server-binary
+debian/extra/embedded-server
+debian/extra/adt_null-plugin
+debian/extra/auth-plugin
+debian/extra/auth_socket-plugin
+debian/extra/auth_test_plugin-plugin
+debian/extra/innodb_engine-plugin
+debian/extra/libdaemon_example-plugin
+debian/extra/libmemcached-plugin
+debian/extra/mypluglib-plugin
+debian/extra/mysql_no_login-plugin
+debian/extra/qa_auth_client-plugin
+debian/extra/qa_auth_interface-plugin
+debian/extra/qa_auth_server-plugin
+debian/extra/semisync_master-plugin
+debian/extra/semisync_slave-plugin
+debian/extra/test_udf_services-plugin
+debian/extra/validate_password-plugin
--- /dev/null
+version=3
+http://mysql.mirrors.pair.com/Downloads/MySQL-5.6/mysql-([\d\.]+).tar.gz
-# Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2000, 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
# Remove test plugins
for p in auth.so auth_test_plugin.so daemon_example.ini libdaemon_example.so qa_auth_client.so \
- qa_auth_interface.so qa_auth_server.so replication_observers_example_plugin.so ha_example.so ; do
+ qa_auth_interface.so qa_auth_server.so replication_observers_example_plugin.so ha_example.so \
+ test_udf_services.so ; do
rm -f %{buildroot}%{_libdir}/mysql/plugin/$p
done
%dir %attr(750, mysql, mysql) /var/lib/mysql-files
%changelog
+* Mon Mar 14 2016 Georgi Kodinov <georgi.kodinov@oracle.com> - 5.6.31-1
+- Add test_udf_services.so plugin
+
* Thu Jun 25 2015 Balasubramanian Kandasamy <balasubramanian.kandasamy@oracle.com> - 5.6.26-1
- Update package names
-# Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2012, 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
FOREACH(fedfile my.cnf my_config.h mysql_config.sh
mysqld.service mysql-systemd-start mysql.conf
- mysql-5.6.16-mysql-install.patch mysql-5.6-libmysqlclient-symbols.patch)
+ mysql-5.6.16-mysql-install.patch)
CONFIGURE_FILE(${fedfile} ${CMAKE_CURRENT_BINARY_DIR}/${fedfile} COPYONLY)
ENDFOREACH()
ENDIF()
+++ /dev/null
-diff -rup old/libmysql/libmysql.c new/libmysql/libmysql.c
---- old/libmysql/libmysql.c 2013-11-04 20:15:10.000000000 +0100
-+++ new/libmysql/libmysql.c 2014-01-14 12:10:27.148374504 +0100
-@@ -4898,3 +4898,612 @@ my_bool STDCALL mysql_read_query_result(
- return (*mysql->methods->read_query_result)(mysql);
- }
-
-+#ifndef EMBEDDED_LIBRARY
-+
-+// Hack to provide both libmysqlclient_16 and libmysqlclient_18 symbol versions
-+
-+#define SYM_16(_exportedsym) __asm__(".symver symver16_" #_exportedsym "," #_exportedsym "@libmysqlclient_16")
-+
-+void STDCALL symver16_myodbc_remove_escape(MYSQL *mysql,char *name)
-+{
-+ return myodbc_remove_escape(mysql, name);
-+}
-+SYM_16(myodbc_remove_escape);
-+
-+
-+my_ulonglong STDCALL symver16_mysql_affected_rows(MYSQL *mysql)
-+{
-+ return mysql_affected_rows(mysql);
-+}
-+SYM_16(mysql_affected_rows);
-+
-+
-+my_bool STDCALL symver16_mysql_autocommit(MYSQL * mysql, my_bool auto_mode)
-+{
-+ return mysql_autocommit(mysql, auto_mode);
-+}
-+SYM_16(mysql_autocommit);
-+
-+
-+my_bool STDCALL symver16_mysql_change_user(MYSQL *mysql, const char *user, const char *passwd, const char *db)
-+{
-+ return mysql_change_user(mysql, user, passwd, db);
-+}
-+SYM_16(mysql_change_user);
-+
-+
-+const char * STDCALL symver16_mysql_character_set_name(MYSQL *mysql)
-+{
-+ return mysql_character_set_name(mysql);
-+}
-+SYM_16(mysql_character_set_name);
-+
-+
-+my_bool STDCALL symver16_mysql_commit(MYSQL * mysql)
-+{
-+ return mysql_commit(mysql);
-+}
-+SYM_16(mysql_commit);
-+
-+
-+void STDCALL symver16_mysql_data_seek(MYSQL_RES *result, my_ulonglong row)
-+{
-+ return mysql_data_seek(result, row);
-+}
-+SYM_16(mysql_data_seek);
-+
-+
-+void STDCALL symver16_mysql_debug(const char *debug __attribute__((unused)))
-+{
-+ return mysql_debug(debug);
-+}
-+SYM_16(mysql_debug);
-+
-+
-+int STDCALL symver16_mysql_dump_debug_info(MYSQL *mysql)
-+{
-+ return mysql_dump_debug_info(mysql);
-+}
-+SYM_16(mysql_dump_debug_info);
-+
-+
-+my_bool STDCALL symver16_mysql_embedded(void)
-+{
-+ return mysql_embedded();
-+}
-+SYM_16(mysql_embedded);
-+
-+
-+my_bool STDCALL symver16_mysql_eof(MYSQL_RES *res)
-+{
-+ return mysql_eof(res);
-+}
-+SYM_16(mysql_eof);
-+
-+
-+ulong STDCALL symver16_mysql_escape_string(char *to,const char *from,ulong length)
-+{
-+ return mysql_escape_string(to, from, length);
-+}
-+SYM_16(mysql_escape_string);
-+
-+
-+MYSQL_FIELD * STDCALL symver16_mysql_fetch_field(MYSQL_RES *result)
-+{
-+ return mysql_fetch_field(result);
-+}
-+SYM_16(mysql_fetch_field);
-+
-+
-+MYSQL_FIELD * STDCALL symver16_mysql_fetch_field_direct(MYSQL_RES *res,uint fieldnr)
-+{
-+ return mysql_fetch_field_direct(res, fieldnr);
-+}
-+SYM_16(mysql_fetch_field_direct);
-+
-+
-+MYSQL_FIELD * STDCALL symver16_mysql_fetch_fields(MYSQL_RES *res)
-+{
-+ return mysql_fetch_fields(res);
-+}
-+SYM_16(mysql_fetch_fields);
-+
-+
-+unsigned int STDCALL symver16_mysql_field_count(MYSQL *mysql)
-+{
-+ return mysql_field_count(mysql);
-+}
-+SYM_16(mysql_field_count);
-+
-+
-+MYSQL_FIELD_OFFSET STDCALL symver16_mysql_field_seek(MYSQL_RES *result, MYSQL_FIELD_OFFSET field_offset)
-+{
-+ return mysql_field_seek(result, field_offset);
-+}
-+SYM_16(mysql_field_seek);
-+
-+
-+MYSQL_FIELD_OFFSET STDCALL symver16_mysql_field_tell(MYSQL_RES *res)
-+{
-+ return mysql_field_tell(res);
-+}
-+SYM_16(mysql_field_tell);
-+
-+
-+void STDCALL symver16_mysql_get_character_set_info(MYSQL *mysql, MY_CHARSET_INFO *csinfo)
-+{
-+ return mysql_get_character_set_info(mysql, csinfo);
-+}
-+SYM_16(mysql_get_character_set_info);
-+
-+
-+const char * STDCALL symver16_mysql_get_client_info(void)
-+{
-+ return mysql_get_client_info();
-+}
-+SYM_16(mysql_get_client_info);
-+
-+ulong STDCALL symver16_mysql_get_client_version(void)
-+{
-+ return mysql_get_client_version();
-+}
-+SYM_16(mysql_get_client_version);
-+
-+
-+const char * STDCALL symver16_mysql_get_host_info(MYSQL *mysql)
-+{
-+ return mysql_get_host_info(mysql);
-+}
-+SYM_16(mysql_get_host_info);
-+
-+
-+MYSQL_PARAMETERS *STDCALL symver16_mysql_get_parameters(void)
-+{
-+ return mysql_get_parameters();
-+}
-+SYM_16(mysql_get_parameters);
-+
-+
-+uint STDCALL symver16_mysql_get_proto_info(MYSQL *mysql)
-+{
-+ return mysql_get_proto_info(mysql);
-+}
-+SYM_16(mysql_get_proto_info);
-+
-+
-+const char * STDCALL symver16_mysql_get_server_info(MYSQL *mysql)
-+{
-+ return mysql_get_server_info(mysql);
-+}
-+SYM_16(mysql_get_server_info);
-+
-+
-+ulong STDCALL symver16_mysql_hex_string(char *to, const char *from, ulong length)
-+{
-+ return mysql_hex_string(to, from, length);
-+}
-+SYM_16(mysql_hex_string);
-+
-+
-+const char *STDCALL symver16_mysql_info(MYSQL *mysql)
-+{
-+ return mysql_info(mysql);
-+}
-+SYM_16(mysql_info);
-+
-+
-+my_ulonglong STDCALL symver16_mysql_insert_id(MYSQL *mysql)
-+{
-+ return mysql_insert_id(mysql);
-+}
-+SYM_16(mysql_insert_id);
-+
-+
-+int STDCALL symver16_mysql_kill(MYSQL *mysql,ulong pid)
-+{
-+ return mysql_kill(mysql, pid);
-+}
-+SYM_16(mysql_kill);
-+
-+
-+MYSQL_RES * STDCALL symver16_mysql_list_dbs(MYSQL *mysql, const char *wild)
-+{
-+ return mysql_list_dbs(mysql, wild);
-+}
-+SYM_16(mysql_list_dbs);
-+
-+
-+MYSQL_RES * STDCALL symver16_mysql_list_fields(MYSQL *mysql, const char *table, const char *wild)
-+{
-+ return mysql_list_fields(mysql, table, wild);
-+}
-+SYM_16(mysql_list_fields);
-+
-+
-+MYSQL_RES * STDCALL symver16_mysql_list_processes(MYSQL *mysql)
-+{
-+ return mysql_list_processes(mysql);
-+}
-+SYM_16(mysql_list_processes);
-+
-+
-+MYSQL_RES * STDCALL symver16_mysql_list_tables(MYSQL *mysql, const char *wild)
-+{
-+ return mysql_list_tables(mysql, wild);
-+}
-+SYM_16(mysql_list_tables);
-+
-+
-+my_bool STDCALL symver16_mysql_more_results(MYSQL *mysql)
-+{
-+ return mysql_more_results(mysql);
-+}
-+SYM_16(mysql_more_results);
-+
-+
-+int STDCALL symver16_mysql_next_result(MYSQL *mysql)
-+{
-+ return mysql_next_result(mysql);
-+}
-+SYM_16(mysql_next_result);
-+
-+
-+int STDCALL symver16_mysql_ping(MYSQL *mysql)
-+{
-+ return mysql_ping(mysql);
-+}
-+SYM_16(mysql_ping);
-+
-+
-+int STDCALL symver16_mysql_query(MYSQL *mysql, const char *query)
-+{
-+ return mysql_query(mysql, query);
-+}
-+SYM_16(mysql_query);
-+
-+
-+my_bool STDCALL symver16_mysql_read_query_result(MYSQL *mysql)
-+{
-+ return mysql_read_query_result(mysql);
-+}
-+SYM_16(mysql_read_query_result);
-+
-+
-+ulong STDCALL symver16_mysql_real_escape_string(MYSQL *mysql, char *to,const char *from, ulong length)
-+{
-+ return mysql_real_escape_string(mysql, to, from, length);
-+}
-+SYM_16(mysql_real_escape_string);
-+
-+
-+int STDCALL symver16_mysql_refresh(MYSQL *mysql,uint options)
-+{
-+ return mysql_refresh(mysql, options);
-+}
-+SYM_16(mysql_refresh);
-+
-+
-+my_bool STDCALL symver16_mysql_rollback(MYSQL * mysql)
-+{
-+ return mysql_rollback(mysql);
-+}
-+SYM_16(mysql_rollback);
-+
-+
-+MYSQL_ROW_OFFSET STDCALL symver16_mysql_row_seek(MYSQL_RES *result, MYSQL_ROW_OFFSET row)
-+{
-+ return mysql_row_seek(result, row);
-+}
-+SYM_16(mysql_row_seek);
-+
-+
-+MYSQL_ROW_OFFSET STDCALL symver16_mysql_row_tell(MYSQL_RES *res)
-+{
-+ return mysql_row_tell(res);
-+}
-+SYM_16(mysql_row_tell);
-+
-+
-+void STDCALL symver16_mysql_server_end()
-+{
-+ return mysql_server_end();
-+}
-+SYM_16(mysql_server_end);
-+
-+
-+int STDCALL symver16_mysql_server_init(int argc __attribute__((unused)), char **argv __attribute__((unused)), char **groups __attribute__((unused)))
-+{
-+ return mysql_server_init(argc, argv, groups);
-+}
-+SYM_16(mysql_server_init);
-+
-+
-+void symver16_mysql_set_local_infile_default(MYSQL *mysql)
-+{
-+ return mysql_set_local_infile_default(mysql);
-+}
-+SYM_16(mysql_set_local_infile_default);
-+
-+
-+void symver16_mysql_set_local_infile_handler(MYSQL *mysql, int (*local_infile_init)(void **, const char *, void *), int (*local_infile_read)(void *, char *, uint), void (*local_infile_end)(void *), int (*local_infile_error)(void *, char *, uint), void *userdata)
-+{
-+ return mysql_set_local_infile_handler(mysql, local_infile_init, local_infile_read, local_infile_end, local_infile_error, userdata);
-+}
-+SYM_16(mysql_set_local_infile_handler);
-+
-+
-+int STDCALL symver16_mysql_set_server_option(MYSQL *mysql, enum enum_mysql_set_option option)
-+{
-+ return mysql_set_server_option(mysql, option);
-+}
-+SYM_16(mysql_set_server_option);
-+
-+
-+int STDCALL symver16_mysql_shutdown(MYSQL *mysql, enum mysql_enum_shutdown_level shutdown_level)
-+{
-+ return mysql_shutdown(mysql, shutdown_level);
-+}
-+SYM_16(mysql_shutdown);
-+
-+
-+const char *STDCALL symver16_mysql_sqlstate(MYSQL *mysql)
-+{
-+ return mysql_sqlstate(mysql);
-+}
-+SYM_16(mysql_sqlstate);
-+
-+
-+const char * STDCALL symver16_mysql_stat(MYSQL *mysql)
-+{
-+ return mysql_stat(mysql);
-+}
-+SYM_16(mysql_stat);
-+
-+
-+my_ulonglong STDCALL symver16_mysql_stmt_affected_rows(MYSQL_STMT *stmt)
-+{
-+ return mysql_stmt_affected_rows(stmt);
-+}
-+SYM_16(mysql_stmt_affected_rows);
-+
-+
-+my_bool STDCALL symver16_mysql_stmt_attr_get(MYSQL_STMT *stmt, enum enum_stmt_attr_type attr_type, void *value)
-+{
-+ return mysql_stmt_attr_get(stmt, attr_type, value);
-+}
-+SYM_16(mysql_stmt_attr_get);
-+
-+
-+my_bool STDCALL symver16_mysql_stmt_attr_set(MYSQL_STMT *stmt, enum enum_stmt_attr_type attr_type, const void *value)
-+{
-+ return mysql_stmt_attr_set(stmt, attr_type, value);
-+}
-+SYM_16(mysql_stmt_attr_set);
-+
-+
-+my_bool STDCALL symver16_mysql_stmt_bind_param(MYSQL_STMT *stmt, MYSQL_BIND *my_bind)
-+{
-+ return mysql_stmt_bind_param(stmt, my_bind);
-+}
-+SYM_16(mysql_stmt_bind_param);
-+
-+
-+my_bool STDCALL symver16_mysql_stmt_bind_result(MYSQL_STMT *stmt, MYSQL_BIND *my_bind)
-+{
-+ return mysql_stmt_bind_result(stmt, my_bind);
-+}
-+SYM_16(mysql_stmt_bind_result);
-+
-+
-+my_bool STDCALL symver16_mysql_stmt_close(MYSQL_STMT *stmt)
-+{
-+ return mysql_stmt_close(stmt);
-+}
-+SYM_16(mysql_stmt_close);
-+
-+
-+void STDCALL symver16_mysql_stmt_data_seek(MYSQL_STMT *stmt, my_ulonglong row)
-+{
-+ return mysql_stmt_data_seek(stmt, row);
-+}
-+SYM_16(mysql_stmt_data_seek);
-+
-+
-+uint STDCALL symver16_mysql_stmt_errno(MYSQL_STMT * stmt)
-+{
-+ return mysql_stmt_errno(stmt);
-+}
-+SYM_16(mysql_stmt_errno);
-+
-+
-+const char *STDCALL symver16_mysql_stmt_error(MYSQL_STMT * stmt)
-+{
-+ return mysql_stmt_error(stmt);
-+}
-+SYM_16(mysql_stmt_error);
-+
-+
-+int STDCALL symver16_mysql_stmt_execute(MYSQL_STMT *stmt)
-+{
-+ return mysql_stmt_execute(stmt);
-+}
-+SYM_16(mysql_stmt_execute);
-+
-+
-+int STDCALL symver16_mysql_stmt_fetch(MYSQL_STMT *stmt)
-+{
-+ return mysql_stmt_fetch(stmt);
-+}
-+SYM_16(mysql_stmt_fetch);
-+
-+
-+int STDCALL symver16_mysql_stmt_fetch_column(MYSQL_STMT *stmt, MYSQL_BIND *my_bind, uint column, ulong offset)
-+{
-+ return mysql_stmt_fetch_column(stmt, my_bind, column, offset);
-+}
-+SYM_16(mysql_stmt_fetch_column);
-+
-+
-+unsigned int STDCALL symver16_mysql_stmt_field_count(MYSQL_STMT *stmt)
-+{
-+ return mysql_stmt_field_count(stmt);
-+}
-+SYM_16(mysql_stmt_field_count);
-+
-+
-+my_bool STDCALL symver16_mysql_stmt_free_result(MYSQL_STMT *stmt)
-+{
-+ return mysql_stmt_free_result(stmt);
-+}
-+SYM_16(mysql_stmt_free_result);
-+
-+
-+MYSQL_STMT * STDCALL symver16_mysql_stmt_init(MYSQL *mysql)
-+{
-+ return mysql_stmt_init(mysql);
-+}
-+SYM_16(mysql_stmt_init);
-+
-+
-+my_ulonglong STDCALL symver16_mysql_stmt_insert_id(MYSQL_STMT *stmt)
-+{
-+ return mysql_stmt_insert_id(stmt);
-+}
-+SYM_16(mysql_stmt_insert_id);
-+
-+
-+my_ulonglong STDCALL symver16_mysql_stmt_num_rows(MYSQL_STMT *stmt)
-+{
-+ return mysql_stmt_num_rows(stmt);
-+}
-+SYM_16(mysql_stmt_num_rows);
-+
-+
-+ulong STDCALL symver16_mysql_stmt_param_count(MYSQL_STMT * stmt)
-+{
-+ return mysql_stmt_param_count(stmt);
-+}
-+SYM_16(mysql_stmt_param_count);
-+
-+
-+MYSQL_RES * STDCALL symver16_mysql_stmt_param_metadata(MYSQL_STMT *stmt)
-+{
-+ return mysql_stmt_param_metadata(stmt);
-+}
-+SYM_16(mysql_stmt_param_metadata);
-+
-+
-+int STDCALL symver16_mysql_stmt_prepare(MYSQL_STMT *stmt, const char *query, ulong length)
-+{
-+ return mysql_stmt_prepare(stmt, query, length);
-+}
-+SYM_16(mysql_stmt_prepare);
-+
-+
-+my_bool STDCALL symver16_mysql_stmt_reset(MYSQL_STMT *stmt)
-+{
-+ return mysql_stmt_reset(stmt);
-+}
-+SYM_16(mysql_stmt_reset);
-+
-+
-+MYSQL_RES * STDCALL symver16_mysql_stmt_result_metadata(MYSQL_STMT *stmt)
-+{
-+ return mysql_stmt_result_metadata(stmt);
-+}
-+SYM_16(mysql_stmt_result_metadata);
-+
-+
-+MYSQL_ROW_OFFSET STDCALL symver16_mysql_stmt_row_seek(MYSQL_STMT *stmt, MYSQL_ROW_OFFSET row)
-+{
-+ return mysql_stmt_row_seek(stmt, row);
-+}
-+SYM_16(mysql_stmt_row_seek);
-+
-+
-+MYSQL_ROW_OFFSET STDCALL symver16_mysql_stmt_row_tell(MYSQL_STMT *stmt)
-+{
-+ return mysql_stmt_row_tell(stmt);
-+}
-+SYM_16(mysql_stmt_row_tell);
-+
-+
-+my_bool STDCALL symver16_mysql_stmt_send_long_data(MYSQL_STMT *stmt, uint param_number, const char *data, ulong length)
-+{
-+ return mysql_stmt_send_long_data(stmt, param_number, data, length);
-+}
-+SYM_16(mysql_stmt_send_long_data);
-+
-+
-+const char *STDCALL symver16_mysql_stmt_sqlstate(MYSQL_STMT * stmt)
-+{
-+ return mysql_stmt_sqlstate(stmt);
-+}
-+SYM_16(mysql_stmt_sqlstate);
-+
-+
-+int STDCALL symver16_mysql_stmt_store_result(MYSQL_STMT *stmt)
-+{
-+ return mysql_stmt_store_result(stmt);
-+}
-+SYM_16(mysql_stmt_store_result);
-+
-+
-+void STDCALL symver16_mysql_thread_end()
-+{
-+ return mysql_thread_end();
-+}
-+SYM_16(mysql_thread_end);
-+
-+
-+ulong STDCALL symver16_mysql_thread_id(MYSQL *mysql)
-+{
-+ return mysql_thread_id(mysql);
-+}
-+SYM_16(mysql_thread_id);
-+
-+
-+my_bool STDCALL symver16_mysql_thread_init()
-+{
-+ return mysql_thread_init();
-+}
-+SYM_16(mysql_thread_init);
-+
-+
-+uint STDCALL symver16_mysql_thread_safe(void)
-+{
-+ return mysql_thread_safe();
-+}
-+SYM_16(mysql_thread_safe);
-+
-+
-+MYSQL_RES * STDCALL symver16_mysql_use_result(MYSQL *mysql)
-+{
-+ return mysql_use_result(mysql);
-+}
-+SYM_16(mysql_use_result);
-+
-+
-+uint STDCALL symver16_mysql_warning_count(MYSQL *mysql)
-+{
-+ return mysql_warning_count(mysql);
-+}
-+SYM_16(mysql_warning_count);
-+
-+/*****/
-+
-+MYSQL * STDCALL symver16_mysql_real_connect(MYSQL *mysql,const char *host, const char *user, const char *passwd, const char *db, uint port, const char *unix_socket,ulong client_flag)
-+{
-+ return mysql_real_connect(mysql, host, user, passwd, db, port, unix_socket, client_flag);
-+}
-+SYM_16(mysql_real_connect);
-+
-+/*****/
-+
-+my_bool symver16_my_init(void)
-+{
-+ return my_init();
-+}
-+SYM_16(my_init);
-+
-+#endif
-diff -rup old/libmysql/libmysql.ver.in new/libmysql/libmysql.ver.in
---- old/libmysql/libmysql.ver.in 2013-11-04 20:15:10.000000000 +0100
-+++ new/libmysql/libmysql.ver.in 2014-01-14 12:10:27.148374504 +0100
-@@ -1 +1,136 @@
--libmysqlclient_@SHARED_LIB_MAJOR_VERSION@ { global: *; };
-+libmysqlclient_16
-+{
-+ local:
-+ symver16_*;
-+};
-+
-+libmysqlclient_18
-+{
-+ global:
-+ my_init;
-+ myodbc_remove_escape;
-+ mysql_affected_rows;
-+ mysql_autocommit;
-+ mysql_change_user;
-+ mysql_character_set_name;
-+ mysql_close;
-+ mysql_commit;
-+ mysql_data_seek;
-+ mysql_debug;
-+ mysql_dump_debug_info;
-+ mysql_embedded;
-+ mysql_eof;
-+ mysql_errno;
-+ mysql_error;
-+ mysql_escape_string;
-+ mysql_fetch_field;
-+ mysql_fetch_field_direct;
-+ mysql_fetch_fields;
-+ mysql_fetch_lengths;
-+ mysql_fetch_row;
-+ mysql_field_count;
-+ mysql_field_seek;
-+ mysql_field_tell;
-+ mysql_free_result;
-+ mysql_get_character_set_info;
-+ mysql_get_client_info;
-+ mysql_get_client_version;
-+ mysql_get_host_info;
-+ mysql_get_parameters;
-+ mysql_get_proto_info;
-+ mysql_get_server_info;
-+ mysql_get_server_version;
-+ mysql_get_ssl_cipher;
-+ mysql_hex_string;
-+ mysql_info;
-+ mysql_init;
-+ mysql_insert_id;
-+ mysql_kill;
-+ mysql_list_dbs;
-+ mysql_list_fields;
-+ mysql_list_processes;
-+ mysql_list_tables;
-+ mysql_more_results;
-+ mysql_next_result;
-+ mysql_num_fields;
-+ mysql_num_rows;
-+ mysql_options;
-+ mysql_ping;
-+ mysql_query;
-+ mysql_read_query_result;
-+ mysql_real_connect;
-+ mysql_real_escape_string;
-+ mysql_real_query;
-+ mysql_refresh;
-+ mysql_rollback;
-+ mysql_row_seek;
-+ mysql_row_tell;
-+ mysql_select_db;
-+ mysql_send_query;
-+ mysql_server_end;
-+ mysql_server_init;
-+ mysql_set_character_set;
-+ mysql_set_local_infile_default;
-+ mysql_set_local_infile_handler;
-+ mysql_set_server_option;
-+ mysql_shutdown;
-+ mysql_sqlstate;
-+ mysql_ssl_set;
-+ mysql_stat;
-+ mysql_stmt_affected_rows;
-+ mysql_stmt_attr_get;
-+ mysql_stmt_attr_set;
-+ mysql_stmt_bind_param;
-+ mysql_stmt_bind_result;
-+ mysql_stmt_close;
-+ mysql_stmt_data_seek;
-+ mysql_stmt_errno;
-+ mysql_stmt_error;
-+ mysql_stmt_execute;
-+ mysql_stmt_fetch;
-+ mysql_stmt_fetch_column;
-+ mysql_stmt_field_count;
-+ mysql_stmt_free_result;
-+ mysql_stmt_init;
-+ mysql_stmt_insert_id;
-+ mysql_stmt_num_rows;
-+ mysql_stmt_param_count;
-+ mysql_stmt_param_metadata;
-+ mysql_stmt_prepare;
-+ mysql_stmt_reset;
-+ mysql_stmt_result_metadata;
-+ mysql_stmt_row_seek;
-+ mysql_stmt_row_tell;
-+ mysql_stmt_send_long_data;
-+ mysql_stmt_sqlstate;
-+ mysql_stmt_store_result;
-+ mysql_store_result;
-+ mysql_thread_end;
-+ mysql_thread_id;
-+ mysql_thread_init;
-+ mysql_thread_safe;
-+ mysql_use_result;
-+ mysql_warning_count;
-+
-+ free_defaults;
-+ handle_options;
-+ load_defaults;
-+ my_print_help;
-+
-+ #my_make_scrambled_password;
-+ THR_KEY_mysys;
-+
-+ mysql_client_find_plugin;
-+ mysql_client_register_plugin;
-+ mysql_load_plugin;
-+ mysql_load_plugin_v;
-+ mysql_plugin_options;
-+ mysql_stmt_next_result;
-+
-+ #mysql_default_charset_info;
-+ mysql_get_charset;
-+ mysql_get_charset_by_csname;
-+ mysql_net_realloc;
-+ #mysql_client_errors;
-+ *;
-+} libmysqlclient_16;
-diff -rup old/mysys/charset.c new/mysys/charset.c
---- old/mysys/charset.c 2013-11-04 20:15:10.000000000 +0100
-+++ new/mysys/charset.c 2014-01-14 12:10:27.197377417 +0100
-@@ -1040,3 +1040,20 @@ size_t escape_quotes_for_mysql(CHARSET_I
- *to= 0;
- return overflow ? (ulong)~0 : (ulong) (to - to_start);
- }
-+
-+#ifndef EMBEDDED_LIBRARY
-+
-+// Hack to provide Fedora symbols
-+
-+CHARSET_INFO *mysql_get_charset(uint cs_number, myf flags)
-+{
-+ return get_charset(cs_number, flags);
-+}
-+
-+
-+CHARSET_INFO * mysql_get_charset_by_csname(const char *cs_name, uint cs_flags, myf flags)
-+{
-+ return get_charset_by_csname(cs_name, cs_flags, flags);
-+}
-+
-+#endif
-diff -rup old/sql/net_serv.cc new/sql/net_serv.cc
---- old/sql/net_serv.cc 2013-11-04 20:15:10.000000000 +0100
-+++ new/sql/net_serv.cc 2014-01-14 12:10:27.252380688 +0100
-@@ -1047,3 +1047,15 @@ void my_net_set_write_timeout(NET *net,
- DBUG_VOID_RETURN;
- }
-
-+#ifndef EMBEDDED_LIBRARY
-+C_MODE_START
-+
-+// Hack to provide Fedora symbols
-+
-+my_bool mysql_net_realloc(NET *net, size_t length)
-+{
-+ return net_realloc(net, length);
-+}
-+
-+C_MODE_END
-+#endif
-diff -rup old/sql/password.c new/sql/password.c
---- old/sql/password.c 2013-11-04 20:15:10.000000000 +0100
-+++ new/sql/password.c 2014-01-14 12:10:27.309384078 +0100
-@@ -584,3 +584,16 @@ void make_password_from_salt(char *to, c
- octet2hex(to, (const char*) hash_stage2, SHA1_HASH_SIZE);
- }
-
-+#ifndef EMBEDDED_LIBRARY
-+
-+// Hack to provide both libmysqlclient_16 and libmysqlclient_18 symbol versions
-+
-+#define SYM_16(_exportedsym) __asm__(".symver symver16_" #_exportedsym "," #_exportedsym "@libmysqlclient_16")
-+
-+void symver16_my_make_scrambled_password(char *to, const char *password, size_t pass_len)
-+{
-+ my_make_scrambled_password(to, password, pass_len);
-+}
-+SYM_16(my_make_scrambled_password);
-+
-+#endif
-diff -rup old/sql-common/client.c new/sql-common/client.c
---- old/sql-common/client.c 2013-11-04 20:15:10.000000000 +0100
-+++ new/sql-common/client.c 2014-01-14 12:10:27.199377537 +0100
-@@ -4847,3 +4847,136 @@ static int clear_password_auth_client(MY
-
- return res ? CR_ERROR : CR_OK;
- }
-+
-+#ifndef EMBEDDED_LIBRARY
-+
-+// Hack to provide both libmysqlclient_16 and libmysqlclient_18 symbol versions
-+
-+#define SYM_16(_exportedsym) __asm__(".symver symver16_" #_exportedsym "," #_exportedsym "@libmysqlclient_16")
-+
-+void STDCALL symver16_mysql_close(MYSQL *mysql)
-+{
-+ return mysql_close(mysql);
-+}
-+SYM_16(mysql_close);
-+
-+
-+uint STDCALL symver16_mysql_errno(MYSQL *mysql)
-+{
-+ return mysql_errno(mysql);
-+}
-+SYM_16(mysql_errno);
-+
-+
-+const char * STDCALL symver16_mysql_error(MYSQL *mysql)
-+{
-+ return mysql_error(mysql);
-+}
-+SYM_16(mysql_error);
-+
-+
-+ulong * STDCALL symver16_mysql_fetch_lengths(MYSQL_RES *res)
-+{
-+ return mysql_fetch_lengths(res);
-+}
-+SYM_16(mysql_fetch_lengths);
-+
-+
-+MYSQL_ROW STDCALL symver16_mysql_fetch_row(MYSQL_RES *res)
-+{
-+ return mysql_fetch_row(res);
-+}
-+SYM_16(mysql_fetch_row);
-+
-+
-+void STDCALL symver16_mysql_free_result(MYSQL_RES *result)
-+{
-+ return mysql_free_result(result);
-+}
-+SYM_16(mysql_free_result);
-+
-+
-+ulong STDCALL symver16_mysql_get_server_version(MYSQL *mysql)
-+{
-+ return mysql_get_server_version(mysql);
-+}
-+SYM_16(mysql_get_server_version);
-+
-+
-+const char * STDCALL symver16_mysql_get_ssl_cipher(MYSQL *mysql __attribute__((unused)))
-+{
-+ return mysql_get_ssl_cipher(mysql);
-+}
-+SYM_16(mysql_get_ssl_cipher);
-+
-+
-+MYSQL * STDCALL symver16_mysql_init(MYSQL *mysql)
-+{
-+ return mysql_init(mysql);
-+}
-+SYM_16(mysql_init);
-+
-+
-+unsigned int STDCALL symver16_mysql_num_fields(MYSQL_RES *res)
-+{
-+ return mysql_num_fields(res);
-+}
-+SYM_16(mysql_num_fields);
-+
-+
-+my_ulonglong STDCALL symver16_mysql_num_rows(MYSQL_RES *res)
-+{
-+ return mysql_num_rows(res);
-+}
-+SYM_16(mysql_num_rows);
-+
-+
-+int STDCALL symver16_mysql_options(MYSQL *mysql,enum mysql_option option, const void *arg)
-+{
-+ return mysql_options(mysql, option, arg);
-+}
-+SYM_16(mysql_options);
-+
-+
-+int STDCALL symver16_mysql_real_query(MYSQL *mysql, const char *query, ulong length)
-+{
-+ return mysql_real_query(mysql, query, length);
-+}
-+SYM_16(mysql_real_query);
-+
-+
-+int STDCALL symver16_mysql_select_db(MYSQL *mysql, const char *db)
-+{
-+ return mysql_select_db(mysql, db);
-+}
-+SYM_16(mysql_select_db);
-+
-+
-+int STDCALL symver16_mysql_send_query(MYSQL* mysql, const char* query, ulong length)
-+{
-+ return mysql_send_query(mysql, query, length);
-+}
-+SYM_16(mysql_send_query);
-+
-+
-+int STDCALL symver16_mysql_set_character_set(MYSQL *mysql, const char *cs_name)
-+{
-+ return mysql_set_character_set(mysql, cs_name);
-+}
-+SYM_16(mysql_set_character_set);
-+
-+
-+my_bool STDCALL symver16_mysql_ssl_set(MYSQL *mysql __attribute__((unused)), const char *key __attribute__((unused)), const char *cert __attribute__((unused)), const char *ca __attribute__((unused)), const char *capath __attribute__((unused)), const char *cipher __attribute__((unused)))
-+{
-+ return mysql_ssl_set(mysql, key, cert, ca, capath, cipher);
-+}
-+SYM_16(mysql_ssl_set);
-+
-+
-+MYSQL_RES * STDCALL symver16_mysql_store_result(MYSQL *mysql)
-+{
-+ return mysql_store_result(mysql);
-+}
-+SYM_16(mysql_store_result);
-+
-+#endif
-# Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2000, 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
%global license_type GPLv2
%endif
+%global min 5.6.10
+
Name: mysql-%{product_suffix}
Summary: A very fast and reliable SQL database server
Group: Applications/Databases
Source3: mysql.conf
Source4: my_config.h
Source6: mysql_config.sh
-Patch0: mysql-5.6-libmysqlclient-symbols.patch
-Patch1: mysql-5.6.16-mysql-install.patch
+Patch0: mysql-5.6.16-mysql-install.patch
BuildRequires: cmake
BuildRequires: perl
BuildRequires: time
Requires: net-tools
%if 0%{?commercial}
Obsoletes: mysql-community-server < %{version}-%{release}
-Requires: mysql-commercial-client%{?_isa} = %{version}-%{release}
+Requires: mysql-commercial-client%{?_isa} >= %{min}
Requires: mysql-commercial-common%{?_isa} = %{version}-%{release}
%else
-Requires: mysql-community-client%{?_isa} = %{version}-%{release}
+Requires: mysql-community-client%{?_isa} >= %{min}
Requires: mysql-community-common%{?_isa} = %{version}-%{release}
%endif
Obsoletes: mariadb-server
Obsoletes: mariadb-galera-server
+Obsoletes: mariadb-server-galera
Obsoletes: community-mysql-server < %{version}-%{release}
Obsoletes: mysql-server < %{version}-%{release}
Provides: mysql-server = %{version}-%{release}
Group: Applications/Databases
%if 0%{?commercial}
Obsoletes: mysql-community-client < %{version}-%{release}
-Requires: mysql-commercial-libs%{?_isa} = %{version}-%{release}
+Requires: mysql-commercial-libs%{?_isa} >= %{min}
%else
-Requires: mysql-community-libs%{?_isa} = %{version}-%{release}
+Requires: mysql-community-libs%{?_isa} >= %{min}
%endif
Obsoletes: mariadb
Obsoletes: community-mysql < %{version}-%{release}
Summary: Test suite for the MySQL database server
Group: Applications/Databases
%if 0%{?commercial}
-Requires: mysql-commercial-server%{?_isa} = %{version}-%{release}
+Requires: mysql-commercial-server%{?_isa} >= %{min}
Obsoletes: mysql-community-test < %{version}-%{release}
%else
-Requires: mysql-community-server%{?_isa} = %{version}-%{release}
+Requires: mysql-community-server%{?_isa} >= %{min}
%endif
Obsoletes: mariadb-test
Obsoletes: community-mysql-test < %{version}-%{release}
Group: Applications/Databases
%if 0%{?commercial}
Obsoletes: mysql-community-bench < %{version}-%{release}
-Requires: mysql-commercial-server%{?_isa} = %{version}-%{release}
+Requires: mysql-commercial-server%{?_isa} >= %{min}
%else
-Requires: mysql-community-server%{?_isa} = %{version}-%{release}
+Requires: mysql-community-server%{?_isa} >= %{min}
%endif
Obsoletes: mariadb-bench
Obsoletes: community-mysql-bench < %{obs_ver}
Group: Applications/Databases
%if 0%{?commercial}
Obsoletes: mysql-community-devel < %{version}-%{release}
-Requires: mysql-enterprise-libs%{?_isa} = %{version}-%{release}
+Requires: mysql-commercial-libs%{?_isa} >= %{min}
%else
-Requires: mysql-community-libs%{?_isa} = %{version}-%{release}
+Requires: mysql-community-libs%{?_isa} >= %{min}
%endif
Obsoletes: mariadb-devel
Obsoletes: community-mysql-devel < %{obs_ver}
Group: Applications/Databases
%if 0%{?commercial}
Obsoletes: mysql-community-libs < %{version}-%{release}
-Requires: mysql-commercial-common%{?_isa} = %{version}-%{release}
+Requires: mysql-commercial-common%{?_isa} >= %{min}
%else
-Requires: mysql-community-common%{?_isa} = %{version}-%{release}
+Requires: mysql-community-common%{?_isa} >= %{min}
%endif
Obsoletes: mariadb-libs
Obsoletes: community-mysql-libs < %{version}-%{release}
Group: Applications/Databases
%if 0%{?commercial}
Obsoletes: mysql-community-embedded-devel < %{version}-%{release}
-Requires: mysql-commercial-devel%{?_isa} = %{version}-%{release}
-Requires: mysql-commercial-embedded%{?_isa} = %{version}-%{release}
+Requires: mysql-commercial-devel%{?_isa} >= %{min}
+Requires: mysql-commercial-embedded%{?_isa} >= %{min}
%else
-Requires: mysql-community-devel%{?_isa} = %{version}-%{release}
-Requires: mysql-community-embedded%{?_isa} = %{version}-%{release}
+Requires: mysql-community-devel%{?_isa} >= %{min}
+Requires: mysql-community-embedded%{?_isa} >= %{min}
%endif
Obsoletes: mariadb-embedded-devel
Obsoletes: community-mysql-embedded-devel < %{version}-%{release}
%setup -q -T -a 0 -c -n %{src_dir}
pushd %{src_dir}
%patch0 -p1
-%patch1 -p1
%build
# Fail quickly and obviously if user tries to build as root
-DINSTALL_SQLBENCHDIR=share \
-DMYSQL_UNIX_ADDR="%{mysqldatadir}/mysql.sock" \
-DFEATURE_SET="%{feature_set}" \
+ -DWITH_SYMVER16=1 \
-DWITH_EMBEDDED_SERVER=1 \
-DWITH_EMBEDDED_SHARED_LIBRARY=1 \
%{?ssl_option} \
-DINSTALL_SQLBENCHDIR=share \
-DMYSQL_UNIX_ADDR="%{mysqldatadir}/mysql.sock" \
-DFEATURE_SET="%{feature_set}" \
+ -DWITH_SYMVER16=1 \
-DWITH_EMBEDDED_SERVER=1 \
-DWITH_EMBEDDED_SHARED_LIBRARY=1 \
%{?ssl_option} \
datadir=$(/usr/bin/my_print_defaults server mysqld | grep '^--datadir=' | sed -n 's/--datadir=//p' | tail -n 1)
/bin/chmod 0755 "$datadir" >/dev/null 2>&1 || :
/bin/touch /var/log/mysqld.log >/dev/null 2>&1 || :
+/bin/chown mysql:mysql /var/log/mysqld.log >/dev/null 2>&1 || :
%systemd_post mysqld.service
/usr/bin/systemctl enable mysqld >/dev/null 2>&1 || :
%attr(755, root, root) %{_bindir}/mysqlimport
%attr(755, root, root) %{_bindir}/mysqlshow
%attr(755, root, root) %{_bindir}/mysqlslap
-%attr(755, root, root) %{_bindir}/mysql_config
-%attr(755, root, root) %{_bindir}/mysql_config-%{__isa_bits}
%attr(755, root, root) %{_bindir}/mysql_config_editor
%attr(644, root, root) %{_mandir}/man1/msql2mysql.1*
%attr(755, root, root) %{_libdir}/mysql/plugin/auth_test_plugin.so
%attr(644, root, root) %{_libdir}/mysql/plugin/daemon_example.ini
%attr(755, root, root) %{_libdir}/mysql/plugin/libdaemon_example.so
+%attr(755, root, root) %{_libdir}/mysql/plugin/test_udf_services.so
%attr(755, root, root) %{_libdir}/mysql/plugin/qa_auth_client.so
%attr(755, root, root) %{_libdir}/mysql/plugin/qa_auth_interface.so
%attr(755, root, root) %{_libdir}/mysql/plugin/qa_auth_server.so
%attr(755, root, root) %{_libdir}/mysql/plugin/debug/auth.so
%attr(755, root, root) %{_libdir}/mysql/plugin/debug/auth_test_plugin.so
%attr(755, root, root) %{_libdir}/mysql/plugin/debug/libdaemon_example.so
+%attr(755, root, root) %{_libdir}/mysql/plugin/debug/test_udf_services.so
%attr(755, root, root) %{_libdir}/mysql/plugin/debug/qa_auth_client.so
%attr(755, root, root) %{_libdir}/mysql/plugin/debug/qa_auth_interface.so
%attr(755, root, root) %{_libdir}/mysql/plugin/debug/qa_auth_server.so
%attr(755, root, root) %{_libdir}/mysql/libmysqld.so
%changelog
+* Tue Jul 05 2016 Balasubramanian Kandasamy <balasubramanian.kandasamy@oracle.com> - 5.6.32-1
+- Remove mysql_config from client subpackage
+
+* Mon Mar 14 2016 Georgi Kodinov <georgi.kodinov@oracle.com> - 5.6.31-1
+- Add test_udf_services.so plugin
+
* Wed Jan 14 2015 Balasubramanian Kandasamy <balasubramanian.kandasamy@oracle.com> - 5.6.24-1
- Add mysql_no_login.so plugin
-# Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2012, 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
FOREACH(fedfile my.cnf my_config.h mysql_config.sh
mysqld.service mysql-systemd-start mysql.conf
mysql-5.6.16-mysql-install.patch mysql.init
- filter-requires.sh filter-provides.sh
- mysql-5.6-libmysqlclient-symbols.patch)
+ filter-requires.sh filter-provides.sh)
CONFIGURE_FILE(${fedfile} ${CMAKE_CURRENT_BINARY_DIR}/${fedfile} COPYONLY)
ENDFOREACH()
ENDIF()
+++ /dev/null
-diff -rup old/libmysql/libmysql.c new/libmysql/libmysql.c
---- old/libmysql/libmysql.c 2013-11-04 20:15:10.000000000 +0100
-+++ new/libmysql/libmysql.c 2014-01-14 12:10:27.148374504 +0100
-@@ -4898,3 +4898,612 @@ my_bool STDCALL mysql_read_query_result(
- return (*mysql->methods->read_query_result)(mysql);
- }
-
-+#ifndef EMBEDDED_LIBRARY
-+
-+// Hack to provide both libmysqlclient_16 and libmysqlclient_18 symbol versions
-+
-+#define SYM_16(_exportedsym) __asm__(".symver symver16_" #_exportedsym "," #_exportedsym "@libmysqlclient_16")
-+
-+void STDCALL symver16_myodbc_remove_escape(MYSQL *mysql,char *name)
-+{
-+ return myodbc_remove_escape(mysql, name);
-+}
-+SYM_16(myodbc_remove_escape);
-+
-+
-+my_ulonglong STDCALL symver16_mysql_affected_rows(MYSQL *mysql)
-+{
-+ return mysql_affected_rows(mysql);
-+}
-+SYM_16(mysql_affected_rows);
-+
-+
-+my_bool STDCALL symver16_mysql_autocommit(MYSQL * mysql, my_bool auto_mode)
-+{
-+ return mysql_autocommit(mysql, auto_mode);
-+}
-+SYM_16(mysql_autocommit);
-+
-+
-+my_bool STDCALL symver16_mysql_change_user(MYSQL *mysql, const char *user, const char *passwd, const char *db)
-+{
-+ return mysql_change_user(mysql, user, passwd, db);
-+}
-+SYM_16(mysql_change_user);
-+
-+
-+const char * STDCALL symver16_mysql_character_set_name(MYSQL *mysql)
-+{
-+ return mysql_character_set_name(mysql);
-+}
-+SYM_16(mysql_character_set_name);
-+
-+
-+my_bool STDCALL symver16_mysql_commit(MYSQL * mysql)
-+{
-+ return mysql_commit(mysql);
-+}
-+SYM_16(mysql_commit);
-+
-+
-+void STDCALL symver16_mysql_data_seek(MYSQL_RES *result, my_ulonglong row)
-+{
-+ return mysql_data_seek(result, row);
-+}
-+SYM_16(mysql_data_seek);
-+
-+
-+void STDCALL symver16_mysql_debug(const char *debug __attribute__((unused)))
-+{
-+ return mysql_debug(debug);
-+}
-+SYM_16(mysql_debug);
-+
-+
-+int STDCALL symver16_mysql_dump_debug_info(MYSQL *mysql)
-+{
-+ return mysql_dump_debug_info(mysql);
-+}
-+SYM_16(mysql_dump_debug_info);
-+
-+
-+my_bool STDCALL symver16_mysql_embedded(void)
-+{
-+ return mysql_embedded();
-+}
-+SYM_16(mysql_embedded);
-+
-+
-+my_bool STDCALL symver16_mysql_eof(MYSQL_RES *res)
-+{
-+ return mysql_eof(res);
-+}
-+SYM_16(mysql_eof);
-+
-+
-+ulong STDCALL symver16_mysql_escape_string(char *to,const char *from,ulong length)
-+{
-+ return mysql_escape_string(to, from, length);
-+}
-+SYM_16(mysql_escape_string);
-+
-+
-+MYSQL_FIELD * STDCALL symver16_mysql_fetch_field(MYSQL_RES *result)
-+{
-+ return mysql_fetch_field(result);
-+}
-+SYM_16(mysql_fetch_field);
-+
-+
-+MYSQL_FIELD * STDCALL symver16_mysql_fetch_field_direct(MYSQL_RES *res,uint fieldnr)
-+{
-+ return mysql_fetch_field_direct(res, fieldnr);
-+}
-+SYM_16(mysql_fetch_field_direct);
-+
-+
-+MYSQL_FIELD * STDCALL symver16_mysql_fetch_fields(MYSQL_RES *res)
-+{
-+ return mysql_fetch_fields(res);
-+}
-+SYM_16(mysql_fetch_fields);
-+
-+
-+unsigned int STDCALL symver16_mysql_field_count(MYSQL *mysql)
-+{
-+ return mysql_field_count(mysql);
-+}
-+SYM_16(mysql_field_count);
-+
-+
-+MYSQL_FIELD_OFFSET STDCALL symver16_mysql_field_seek(MYSQL_RES *result, MYSQL_FIELD_OFFSET field_offset)
-+{
-+ return mysql_field_seek(result, field_offset);
-+}
-+SYM_16(mysql_field_seek);
-+
-+
-+MYSQL_FIELD_OFFSET STDCALL symver16_mysql_field_tell(MYSQL_RES *res)
-+{
-+ return mysql_field_tell(res);
-+}
-+SYM_16(mysql_field_tell);
-+
-+
-+void STDCALL symver16_mysql_get_character_set_info(MYSQL *mysql, MY_CHARSET_INFO *csinfo)
-+{
-+ return mysql_get_character_set_info(mysql, csinfo);
-+}
-+SYM_16(mysql_get_character_set_info);
-+
-+
-+const char * STDCALL symver16_mysql_get_client_info(void)
-+{
-+ return mysql_get_client_info();
-+}
-+SYM_16(mysql_get_client_info);
-+
-+ulong STDCALL symver16_mysql_get_client_version(void)
-+{
-+ return mysql_get_client_version();
-+}
-+SYM_16(mysql_get_client_version);
-+
-+
-+const char * STDCALL symver16_mysql_get_host_info(MYSQL *mysql)
-+{
-+ return mysql_get_host_info(mysql);
-+}
-+SYM_16(mysql_get_host_info);
-+
-+
-+MYSQL_PARAMETERS *STDCALL symver16_mysql_get_parameters(void)
-+{
-+ return mysql_get_parameters();
-+}
-+SYM_16(mysql_get_parameters);
-+
-+
-+uint STDCALL symver16_mysql_get_proto_info(MYSQL *mysql)
-+{
-+ return mysql_get_proto_info(mysql);
-+}
-+SYM_16(mysql_get_proto_info);
-+
-+
-+const char * STDCALL symver16_mysql_get_server_info(MYSQL *mysql)
-+{
-+ return mysql_get_server_info(mysql);
-+}
-+SYM_16(mysql_get_server_info);
-+
-+
-+ulong STDCALL symver16_mysql_hex_string(char *to, const char *from, ulong length)
-+{
-+ return mysql_hex_string(to, from, length);
-+}
-+SYM_16(mysql_hex_string);
-+
-+
-+const char *STDCALL symver16_mysql_info(MYSQL *mysql)
-+{
-+ return mysql_info(mysql);
-+}
-+SYM_16(mysql_info);
-+
-+
-+my_ulonglong STDCALL symver16_mysql_insert_id(MYSQL *mysql)
-+{
-+ return mysql_insert_id(mysql);
-+}
-+SYM_16(mysql_insert_id);
-+
-+
-+int STDCALL symver16_mysql_kill(MYSQL *mysql,ulong pid)
-+{
-+ return mysql_kill(mysql, pid);
-+}
-+SYM_16(mysql_kill);
-+
-+
-+MYSQL_RES * STDCALL symver16_mysql_list_dbs(MYSQL *mysql, const char *wild)
-+{
-+ return mysql_list_dbs(mysql, wild);
-+}
-+SYM_16(mysql_list_dbs);
-+
-+
-+MYSQL_RES * STDCALL symver16_mysql_list_fields(MYSQL *mysql, const char *table, const char *wild)
-+{
-+ return mysql_list_fields(mysql, table, wild);
-+}
-+SYM_16(mysql_list_fields);
-+
-+
-+MYSQL_RES * STDCALL symver16_mysql_list_processes(MYSQL *mysql)
-+{
-+ return mysql_list_processes(mysql);
-+}
-+SYM_16(mysql_list_processes);
-+
-+
-+MYSQL_RES * STDCALL symver16_mysql_list_tables(MYSQL *mysql, const char *wild)
-+{
-+ return mysql_list_tables(mysql, wild);
-+}
-+SYM_16(mysql_list_tables);
-+
-+
-+my_bool STDCALL symver16_mysql_more_results(MYSQL *mysql)
-+{
-+ return mysql_more_results(mysql);
-+}
-+SYM_16(mysql_more_results);
-+
-+
-+int STDCALL symver16_mysql_next_result(MYSQL *mysql)
-+{
-+ return mysql_next_result(mysql);
-+}
-+SYM_16(mysql_next_result);
-+
-+
-+int STDCALL symver16_mysql_ping(MYSQL *mysql)
-+{
-+ return mysql_ping(mysql);
-+}
-+SYM_16(mysql_ping);
-+
-+
-+int STDCALL symver16_mysql_query(MYSQL *mysql, const char *query)
-+{
-+ return mysql_query(mysql, query);
-+}
-+SYM_16(mysql_query);
-+
-+
-+my_bool STDCALL symver16_mysql_read_query_result(MYSQL *mysql)
-+{
-+ return mysql_read_query_result(mysql);
-+}
-+SYM_16(mysql_read_query_result);
-+
-+
-+ulong STDCALL symver16_mysql_real_escape_string(MYSQL *mysql, char *to,const char *from, ulong length)
-+{
-+ return mysql_real_escape_string(mysql, to, from, length);
-+}
-+SYM_16(mysql_real_escape_string);
-+
-+
-+int STDCALL symver16_mysql_refresh(MYSQL *mysql,uint options)
-+{
-+ return mysql_refresh(mysql, options);
-+}
-+SYM_16(mysql_refresh);
-+
-+
-+my_bool STDCALL symver16_mysql_rollback(MYSQL * mysql)
-+{
-+ return mysql_rollback(mysql);
-+}
-+SYM_16(mysql_rollback);
-+
-+
-+MYSQL_ROW_OFFSET STDCALL symver16_mysql_row_seek(MYSQL_RES *result, MYSQL_ROW_OFFSET row)
-+{
-+ return mysql_row_seek(result, row);
-+}
-+SYM_16(mysql_row_seek);
-+
-+
-+MYSQL_ROW_OFFSET STDCALL symver16_mysql_row_tell(MYSQL_RES *res)
-+{
-+ return mysql_row_tell(res);
-+}
-+SYM_16(mysql_row_tell);
-+
-+
-+void STDCALL symver16_mysql_server_end()
-+{
-+ return mysql_server_end();
-+}
-+SYM_16(mysql_server_end);
-+
-+
-+int STDCALL symver16_mysql_server_init(int argc __attribute__((unused)), char **argv __attribute__((unused)), char **groups __attribute__((unused)))
-+{
-+ return mysql_server_init(argc, argv, groups);
-+}
-+SYM_16(mysql_server_init);
-+
-+
-+void symver16_mysql_set_local_infile_default(MYSQL *mysql)
-+{
-+ return mysql_set_local_infile_default(mysql);
-+}
-+SYM_16(mysql_set_local_infile_default);
-+
-+
-+void symver16_mysql_set_local_infile_handler(MYSQL *mysql, int (*local_infile_init)(void **, const char *, void *), int (*local_infile_read)(void *, char *, uint), void (*local_infile_end)(void *), int (*local_infile_error)(void *, char *, uint), void *userdata)
-+{
-+ return mysql_set_local_infile_handler(mysql, local_infile_init, local_infile_read, local_infile_end, local_infile_error, userdata);
-+}
-+SYM_16(mysql_set_local_infile_handler);
-+
-+
-+int STDCALL symver16_mysql_set_server_option(MYSQL *mysql, enum enum_mysql_set_option option)
-+{
-+ return mysql_set_server_option(mysql, option);
-+}
-+SYM_16(mysql_set_server_option);
-+
-+
-+int STDCALL symver16_mysql_shutdown(MYSQL *mysql, enum mysql_enum_shutdown_level shutdown_level)
-+{
-+ return mysql_shutdown(mysql, shutdown_level);
-+}
-+SYM_16(mysql_shutdown);
-+
-+
-+const char *STDCALL symver16_mysql_sqlstate(MYSQL *mysql)
-+{
-+ return mysql_sqlstate(mysql);
-+}
-+SYM_16(mysql_sqlstate);
-+
-+
-+const char * STDCALL symver16_mysql_stat(MYSQL *mysql)
-+{
-+ return mysql_stat(mysql);
-+}
-+SYM_16(mysql_stat);
-+
-+
-+my_ulonglong STDCALL symver16_mysql_stmt_affected_rows(MYSQL_STMT *stmt)
-+{
-+ return mysql_stmt_affected_rows(stmt);
-+}
-+SYM_16(mysql_stmt_affected_rows);
-+
-+
-+my_bool STDCALL symver16_mysql_stmt_attr_get(MYSQL_STMT *stmt, enum enum_stmt_attr_type attr_type, void *value)
-+{
-+ return mysql_stmt_attr_get(stmt, attr_type, value);
-+}
-+SYM_16(mysql_stmt_attr_get);
-+
-+
-+my_bool STDCALL symver16_mysql_stmt_attr_set(MYSQL_STMT *stmt, enum enum_stmt_attr_type attr_type, const void *value)
-+{
-+ return mysql_stmt_attr_set(stmt, attr_type, value);
-+}
-+SYM_16(mysql_stmt_attr_set);
-+
-+
-+my_bool STDCALL symver16_mysql_stmt_bind_param(MYSQL_STMT *stmt, MYSQL_BIND *my_bind)
-+{
-+ return mysql_stmt_bind_param(stmt, my_bind);
-+}
-+SYM_16(mysql_stmt_bind_param);
-+
-+
-+my_bool STDCALL symver16_mysql_stmt_bind_result(MYSQL_STMT *stmt, MYSQL_BIND *my_bind)
-+{
-+ return mysql_stmt_bind_result(stmt, my_bind);
-+}
-+SYM_16(mysql_stmt_bind_result);
-+
-+
-+my_bool STDCALL symver16_mysql_stmt_close(MYSQL_STMT *stmt)
-+{
-+ return mysql_stmt_close(stmt);
-+}
-+SYM_16(mysql_stmt_close);
-+
-+
-+void STDCALL symver16_mysql_stmt_data_seek(MYSQL_STMT *stmt, my_ulonglong row)
-+{
-+ return mysql_stmt_data_seek(stmt, row);
-+}
-+SYM_16(mysql_stmt_data_seek);
-+
-+
-+uint STDCALL symver16_mysql_stmt_errno(MYSQL_STMT * stmt)
-+{
-+ return mysql_stmt_errno(stmt);
-+}
-+SYM_16(mysql_stmt_errno);
-+
-+
-+const char *STDCALL symver16_mysql_stmt_error(MYSQL_STMT * stmt)
-+{
-+ return mysql_stmt_error(stmt);
-+}
-+SYM_16(mysql_stmt_error);
-+
-+
-+int STDCALL symver16_mysql_stmt_execute(MYSQL_STMT *stmt)
-+{
-+ return mysql_stmt_execute(stmt);
-+}
-+SYM_16(mysql_stmt_execute);
-+
-+
-+int STDCALL symver16_mysql_stmt_fetch(MYSQL_STMT *stmt)
-+{
-+ return mysql_stmt_fetch(stmt);
-+}
-+SYM_16(mysql_stmt_fetch);
-+
-+
-+int STDCALL symver16_mysql_stmt_fetch_column(MYSQL_STMT *stmt, MYSQL_BIND *my_bind, uint column, ulong offset)
-+{
-+ return mysql_stmt_fetch_column(stmt, my_bind, column, offset);
-+}
-+SYM_16(mysql_stmt_fetch_column);
-+
-+
-+unsigned int STDCALL symver16_mysql_stmt_field_count(MYSQL_STMT *stmt)
-+{
-+ return mysql_stmt_field_count(stmt);
-+}
-+SYM_16(mysql_stmt_field_count);
-+
-+
-+my_bool STDCALL symver16_mysql_stmt_free_result(MYSQL_STMT *stmt)
-+{
-+ return mysql_stmt_free_result(stmt);
-+}
-+SYM_16(mysql_stmt_free_result);
-+
-+
-+MYSQL_STMT * STDCALL symver16_mysql_stmt_init(MYSQL *mysql)
-+{
-+ return mysql_stmt_init(mysql);
-+}
-+SYM_16(mysql_stmt_init);
-+
-+
-+my_ulonglong STDCALL symver16_mysql_stmt_insert_id(MYSQL_STMT *stmt)
-+{
-+ return mysql_stmt_insert_id(stmt);
-+}
-+SYM_16(mysql_stmt_insert_id);
-+
-+
-+my_ulonglong STDCALL symver16_mysql_stmt_num_rows(MYSQL_STMT *stmt)
-+{
-+ return mysql_stmt_num_rows(stmt);
-+}
-+SYM_16(mysql_stmt_num_rows);
-+
-+
-+ulong STDCALL symver16_mysql_stmt_param_count(MYSQL_STMT * stmt)
-+{
-+ return mysql_stmt_param_count(stmt);
-+}
-+SYM_16(mysql_stmt_param_count);
-+
-+
-+MYSQL_RES * STDCALL symver16_mysql_stmt_param_metadata(MYSQL_STMT *stmt)
-+{
-+ return mysql_stmt_param_metadata(stmt);
-+}
-+SYM_16(mysql_stmt_param_metadata);
-+
-+
-+int STDCALL symver16_mysql_stmt_prepare(MYSQL_STMT *stmt, const char *query, ulong length)
-+{
-+ return mysql_stmt_prepare(stmt, query, length);
-+}
-+SYM_16(mysql_stmt_prepare);
-+
-+
-+my_bool STDCALL symver16_mysql_stmt_reset(MYSQL_STMT *stmt)
-+{
-+ return mysql_stmt_reset(stmt);
-+}
-+SYM_16(mysql_stmt_reset);
-+
-+
-+MYSQL_RES * STDCALL symver16_mysql_stmt_result_metadata(MYSQL_STMT *stmt)
-+{
-+ return mysql_stmt_result_metadata(stmt);
-+}
-+SYM_16(mysql_stmt_result_metadata);
-+
-+
-+MYSQL_ROW_OFFSET STDCALL symver16_mysql_stmt_row_seek(MYSQL_STMT *stmt, MYSQL_ROW_OFFSET row)
-+{
-+ return mysql_stmt_row_seek(stmt, row);
-+}
-+SYM_16(mysql_stmt_row_seek);
-+
-+
-+MYSQL_ROW_OFFSET STDCALL symver16_mysql_stmt_row_tell(MYSQL_STMT *stmt)
-+{
-+ return mysql_stmt_row_tell(stmt);
-+}
-+SYM_16(mysql_stmt_row_tell);
-+
-+
-+my_bool STDCALL symver16_mysql_stmt_send_long_data(MYSQL_STMT *stmt, uint param_number, const char *data, ulong length)
-+{
-+ return mysql_stmt_send_long_data(stmt, param_number, data, length);
-+}
-+SYM_16(mysql_stmt_send_long_data);
-+
-+
-+const char *STDCALL symver16_mysql_stmt_sqlstate(MYSQL_STMT * stmt)
-+{
-+ return mysql_stmt_sqlstate(stmt);
-+}
-+SYM_16(mysql_stmt_sqlstate);
-+
-+
-+int STDCALL symver16_mysql_stmt_store_result(MYSQL_STMT *stmt)
-+{
-+ return mysql_stmt_store_result(stmt);
-+}
-+SYM_16(mysql_stmt_store_result);
-+
-+
-+void STDCALL symver16_mysql_thread_end()
-+{
-+ return mysql_thread_end();
-+}
-+SYM_16(mysql_thread_end);
-+
-+
-+ulong STDCALL symver16_mysql_thread_id(MYSQL *mysql)
-+{
-+ return mysql_thread_id(mysql);
-+}
-+SYM_16(mysql_thread_id);
-+
-+
-+my_bool STDCALL symver16_mysql_thread_init()
-+{
-+ return mysql_thread_init();
-+}
-+SYM_16(mysql_thread_init);
-+
-+
-+uint STDCALL symver16_mysql_thread_safe(void)
-+{
-+ return mysql_thread_safe();
-+}
-+SYM_16(mysql_thread_safe);
-+
-+
-+MYSQL_RES * STDCALL symver16_mysql_use_result(MYSQL *mysql)
-+{
-+ return mysql_use_result(mysql);
-+}
-+SYM_16(mysql_use_result);
-+
-+
-+uint STDCALL symver16_mysql_warning_count(MYSQL *mysql)
-+{
-+ return mysql_warning_count(mysql);
-+}
-+SYM_16(mysql_warning_count);
-+
-+/*****/
-+
-+MYSQL * STDCALL symver16_mysql_real_connect(MYSQL *mysql,const char *host, const char *user, const char *passwd, const char *db, uint port, const char *unix_socket,ulong client_flag)
-+{
-+ return mysql_real_connect(mysql, host, user, passwd, db, port, unix_socket, client_flag);
-+}
-+SYM_16(mysql_real_connect);
-+
-+/*****/
-+
-+my_bool symver16_my_init(void)
-+{
-+ return my_init();
-+}
-+SYM_16(my_init);
-+
-+#endif
-diff -rup old/libmysql/libmysql.ver.in new/libmysql/libmysql.ver.in
---- old/libmysql/libmysql.ver.in 2013-11-04 20:15:10.000000000 +0100
-+++ new/libmysql/libmysql.ver.in 2014-01-14 12:10:27.148374504 +0100
-@@ -1 +1,136 @@
--libmysqlclient_@SHARED_LIB_MAJOR_VERSION@ { global: *; };
-+libmysqlclient_16
-+{
-+ local:
-+ symver16_*;
-+};
-+
-+libmysqlclient_18
-+{
-+ global:
-+ my_init;
-+ myodbc_remove_escape;
-+ mysql_affected_rows;
-+ mysql_autocommit;
-+ mysql_change_user;
-+ mysql_character_set_name;
-+ mysql_close;
-+ mysql_commit;
-+ mysql_data_seek;
-+ mysql_debug;
-+ mysql_dump_debug_info;
-+ mysql_embedded;
-+ mysql_eof;
-+ mysql_errno;
-+ mysql_error;
-+ mysql_escape_string;
-+ mysql_fetch_field;
-+ mysql_fetch_field_direct;
-+ mysql_fetch_fields;
-+ mysql_fetch_lengths;
-+ mysql_fetch_row;
-+ mysql_field_count;
-+ mysql_field_seek;
-+ mysql_field_tell;
-+ mysql_free_result;
-+ mysql_get_character_set_info;
-+ mysql_get_client_info;
-+ mysql_get_client_version;
-+ mysql_get_host_info;
-+ mysql_get_parameters;
-+ mysql_get_proto_info;
-+ mysql_get_server_info;
-+ mysql_get_server_version;
-+ mysql_get_ssl_cipher;
-+ mysql_hex_string;
-+ mysql_info;
-+ mysql_init;
-+ mysql_insert_id;
-+ mysql_kill;
-+ mysql_list_dbs;
-+ mysql_list_fields;
-+ mysql_list_processes;
-+ mysql_list_tables;
-+ mysql_more_results;
-+ mysql_next_result;
-+ mysql_num_fields;
-+ mysql_num_rows;
-+ mysql_options;
-+ mysql_ping;
-+ mysql_query;
-+ mysql_read_query_result;
-+ mysql_real_connect;
-+ mysql_real_escape_string;
-+ mysql_real_query;
-+ mysql_refresh;
-+ mysql_rollback;
-+ mysql_row_seek;
-+ mysql_row_tell;
-+ mysql_select_db;
-+ mysql_send_query;
-+ mysql_server_end;
-+ mysql_server_init;
-+ mysql_set_character_set;
-+ mysql_set_local_infile_default;
-+ mysql_set_local_infile_handler;
-+ mysql_set_server_option;
-+ mysql_shutdown;
-+ mysql_sqlstate;
-+ mysql_ssl_set;
-+ mysql_stat;
-+ mysql_stmt_affected_rows;
-+ mysql_stmt_attr_get;
-+ mysql_stmt_attr_set;
-+ mysql_stmt_bind_param;
-+ mysql_stmt_bind_result;
-+ mysql_stmt_close;
-+ mysql_stmt_data_seek;
-+ mysql_stmt_errno;
-+ mysql_stmt_error;
-+ mysql_stmt_execute;
-+ mysql_stmt_fetch;
-+ mysql_stmt_fetch_column;
-+ mysql_stmt_field_count;
-+ mysql_stmt_free_result;
-+ mysql_stmt_init;
-+ mysql_stmt_insert_id;
-+ mysql_stmt_num_rows;
-+ mysql_stmt_param_count;
-+ mysql_stmt_param_metadata;
-+ mysql_stmt_prepare;
-+ mysql_stmt_reset;
-+ mysql_stmt_result_metadata;
-+ mysql_stmt_row_seek;
-+ mysql_stmt_row_tell;
-+ mysql_stmt_send_long_data;
-+ mysql_stmt_sqlstate;
-+ mysql_stmt_store_result;
-+ mysql_store_result;
-+ mysql_thread_end;
-+ mysql_thread_id;
-+ mysql_thread_init;
-+ mysql_thread_safe;
-+ mysql_use_result;
-+ mysql_warning_count;
-+
-+ free_defaults;
-+ handle_options;
-+ load_defaults;
-+ my_print_help;
-+
-+ #my_make_scrambled_password;
-+ THR_KEY_mysys;
-+
-+ mysql_client_find_plugin;
-+ mysql_client_register_plugin;
-+ mysql_load_plugin;
-+ mysql_load_plugin_v;
-+ mysql_plugin_options;
-+ mysql_stmt_next_result;
-+
-+ #mysql_default_charset_info;
-+ mysql_get_charset;
-+ mysql_get_charset_by_csname;
-+ mysql_net_realloc;
-+ #mysql_client_errors;
-+ *;
-+} libmysqlclient_16;
-diff -rup old/mysys/charset.c new/mysys/charset.c
---- old/mysys/charset.c 2013-11-04 20:15:10.000000000 +0100
-+++ new/mysys/charset.c 2014-01-14 12:10:27.197377417 +0100
-@@ -1040,3 +1040,20 @@ size_t escape_quotes_for_mysql(CHARSET_I
- *to= 0;
- return overflow ? (ulong)~0 : (ulong) (to - to_start);
- }
-+
-+#ifndef EMBEDDED_LIBRARY
-+
-+// Hack to provide Fedora symbols
-+
-+CHARSET_INFO *mysql_get_charset(uint cs_number, myf flags)
-+{
-+ return get_charset(cs_number, flags);
-+}
-+
-+
-+CHARSET_INFO * mysql_get_charset_by_csname(const char *cs_name, uint cs_flags, myf flags)
-+{
-+ return get_charset_by_csname(cs_name, cs_flags, flags);
-+}
-+
-+#endif
-diff -rup old/sql/net_serv.cc new/sql/net_serv.cc
---- old/sql/net_serv.cc 2013-11-04 20:15:10.000000000 +0100
-+++ new/sql/net_serv.cc 2014-01-14 12:10:27.252380688 +0100
-@@ -1047,3 +1047,15 @@ void my_net_set_write_timeout(NET *net,
- DBUG_VOID_RETURN;
- }
-
-+#ifndef EMBEDDED_LIBRARY
-+C_MODE_START
-+
-+// Hack to provide Fedora symbols
-+
-+my_bool mysql_net_realloc(NET *net, size_t length)
-+{
-+ return net_realloc(net, length);
-+}
-+
-+C_MODE_END
-+#endif
-diff -rup old/sql/password.c new/sql/password.c
---- old/sql/password.c 2013-11-04 20:15:10.000000000 +0100
-+++ new/sql/password.c 2014-01-14 12:10:27.309384078 +0100
-@@ -584,3 +584,16 @@ void make_password_from_salt(char *to, c
- octet2hex(to, (const char*) hash_stage2, SHA1_HASH_SIZE);
- }
-
-+#ifndef EMBEDDED_LIBRARY
-+
-+// Hack to provide both libmysqlclient_16 and libmysqlclient_18 symbol versions
-+
-+#define SYM_16(_exportedsym) __asm__(".symver symver16_" #_exportedsym "," #_exportedsym "@libmysqlclient_16")
-+
-+void symver16_my_make_scrambled_password(char *to, const char *password, size_t pass_len)
-+{
-+ my_make_scrambled_password(to, password, pass_len);
-+}
-+SYM_16(my_make_scrambled_password);
-+
-+#endif
-diff -rup old/sql-common/client.c new/sql-common/client.c
---- old/sql-common/client.c 2013-11-04 20:15:10.000000000 +0100
-+++ new/sql-common/client.c 2014-01-14 12:10:27.199377537 +0100
-@@ -4847,3 +4847,136 @@ static int clear_password_auth_client(MY
-
- return res ? CR_ERROR : CR_OK;
- }
-+
-+#ifndef EMBEDDED_LIBRARY
-+
-+// Hack to provide both libmysqlclient_16 and libmysqlclient_18 symbol versions
-+
-+#define SYM_16(_exportedsym) __asm__(".symver symver16_" #_exportedsym "," #_exportedsym "@libmysqlclient_16")
-+
-+void STDCALL symver16_mysql_close(MYSQL *mysql)
-+{
-+ return mysql_close(mysql);
-+}
-+SYM_16(mysql_close);
-+
-+
-+uint STDCALL symver16_mysql_errno(MYSQL *mysql)
-+{
-+ return mysql_errno(mysql);
-+}
-+SYM_16(mysql_errno);
-+
-+
-+const char * STDCALL symver16_mysql_error(MYSQL *mysql)
-+{
-+ return mysql_error(mysql);
-+}
-+SYM_16(mysql_error);
-+
-+
-+ulong * STDCALL symver16_mysql_fetch_lengths(MYSQL_RES *res)
-+{
-+ return mysql_fetch_lengths(res);
-+}
-+SYM_16(mysql_fetch_lengths);
-+
-+
-+MYSQL_ROW STDCALL symver16_mysql_fetch_row(MYSQL_RES *res)
-+{
-+ return mysql_fetch_row(res);
-+}
-+SYM_16(mysql_fetch_row);
-+
-+
-+void STDCALL symver16_mysql_free_result(MYSQL_RES *result)
-+{
-+ return mysql_free_result(result);
-+}
-+SYM_16(mysql_free_result);
-+
-+
-+ulong STDCALL symver16_mysql_get_server_version(MYSQL *mysql)
-+{
-+ return mysql_get_server_version(mysql);
-+}
-+SYM_16(mysql_get_server_version);
-+
-+
-+const char * STDCALL symver16_mysql_get_ssl_cipher(MYSQL *mysql __attribute__((unused)))
-+{
-+ return mysql_get_ssl_cipher(mysql);
-+}
-+SYM_16(mysql_get_ssl_cipher);
-+
-+
-+MYSQL * STDCALL symver16_mysql_init(MYSQL *mysql)
-+{
-+ return mysql_init(mysql);
-+}
-+SYM_16(mysql_init);
-+
-+
-+unsigned int STDCALL symver16_mysql_num_fields(MYSQL_RES *res)
-+{
-+ return mysql_num_fields(res);
-+}
-+SYM_16(mysql_num_fields);
-+
-+
-+my_ulonglong STDCALL symver16_mysql_num_rows(MYSQL_RES *res)
-+{
-+ return mysql_num_rows(res);
-+}
-+SYM_16(mysql_num_rows);
-+
-+
-+int STDCALL symver16_mysql_options(MYSQL *mysql,enum mysql_option option, const void *arg)
-+{
-+ return mysql_options(mysql, option, arg);
-+}
-+SYM_16(mysql_options);
-+
-+
-+int STDCALL symver16_mysql_real_query(MYSQL *mysql, const char *query, ulong length)
-+{
-+ return mysql_real_query(mysql, query, length);
-+}
-+SYM_16(mysql_real_query);
-+
-+
-+int STDCALL symver16_mysql_select_db(MYSQL *mysql, const char *db)
-+{
-+ return mysql_select_db(mysql, db);
-+}
-+SYM_16(mysql_select_db);
-+
-+
-+int STDCALL symver16_mysql_send_query(MYSQL* mysql, const char* query, ulong length)
-+{
-+ return mysql_send_query(mysql, query, length);
-+}
-+SYM_16(mysql_send_query);
-+
-+
-+int STDCALL symver16_mysql_set_character_set(MYSQL *mysql, const char *cs_name)
-+{
-+ return mysql_set_character_set(mysql, cs_name);
-+}
-+SYM_16(mysql_set_character_set);
-+
-+
-+my_bool STDCALL symver16_mysql_ssl_set(MYSQL *mysql __attribute__((unused)), const char *key __attribute__((unused)), const char *cert __attribute__((unused)), const char *ca __attribute__((unused)), const char *capath __attribute__((unused)), const char *cipher __attribute__((unused)))
-+{
-+ return mysql_ssl_set(mysql, key, cert, ca, capath, cipher);
-+}
-+SYM_16(mysql_ssl_set);
-+
-+
-+MYSQL_RES * STDCALL symver16_mysql_store_result(MYSQL *mysql)
-+{
-+ return mysql_store_result(mysql);
-+}
-+SYM_16(mysql_store_result);
-+
-+#endif
# alarms, per bug #547485
$exec --datadir="$datadir" --socket="$socketfile" \
--pid-file="$mypidfile" \
- --basedir=/usr --user=mysql >/dev/null 2>&1 &
+ --basedir=/usr --user=mysql >/dev/null &
safe_pid=$!
# Spin for a maximum of N seconds waiting for the server to come up;
# exit the loop immediately if mysqld_safe process disappears.
-# Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2000, 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
%global license_type GPLv2
%endif
+%global min 5.6.10
+
Name: mysql-%{product_suffix}
Summary: A very fast and reliable SQL database server
Group: Applications/Databases
Source90: filter-provides.sh
Source91: filter-requires.sh
Patch0: mysql-5.6.16-mysql-install.patch
-Patch1: mysql-5.6-libmysqlclient-symbols.patch
BuildRequires: cmake
BuildRequires: perl
%{?el7:BuildRequires: perl(Time::HiRes)}
Provides: MySQL-server-advanced%{?_isa} = %{version}-%{release}
Obsoletes: MySQL-server-advanced < %{version}-%{release}
Obsoletes: mysql-community-server < %{version}-%{release}
-Requires: mysql-commercial-client%{?_isa} = %{version}-%{release}
+Requires: mysql-commercial-client%{?_isa} >= %{min}
Requires: mysql-commercial-common%{?_isa} = %{version}-%{release}
%else
Provides: MySQL-server%{?_isa} = %{version}-%{release}
-Requires: mysql-community-client%{?_isa} = %{version}-%{release}
+Requires: mysql-community-client%{?_isa} >= %{min}
Requires: mysql-community-common%{?_isa} = %{version}-%{release}
%endif
Obsoletes: MySQL-server < %{version}-%{release}
Provides: MySQL-client-advanced%{?_isa} = %{version}-%{release}
Obsoletes: MySQL-client-advanced < %{version}-%{release}
Obsoletes: mysql-community-client < %{version}-%{release}
-Requires: mysql-commercial-libs%{?_isa} = %{version}-%{release}
+Requires: mysql-commercial-libs%{?_isa} >= %{min}
%else
Provides: MySQL-client%{?_isa} = %{version}-%{release}
-Requires: mysql-community-libs%{?_isa} = %{version}-%{release}
+Requires: mysql-community-libs%{?_isa} >= %{min}
%endif
Obsoletes: MySQL-client < %{version}-%{release}
Obsoletes: mariadb
%endif
Provides: mysql-common = %{version}-%{release}
Provides: mysql-common%{?_isa} = %{version}-%{release}
-%{?el5:Requires: mysql%{?_isa} = %{version}-%{release}}
+%{?el5:Requires: mysql%{?_isa} >= %{min}}
%description common
This packages contains common files needed by MySQL client library,
Provides: MySQL-test-advanced%{?_isa} = %{version}-%{release}
Obsoletes: MySQL-test-advanced < %{version}-%{release}
Obsoletes: mysql-community-test < %{version}-%{release}
-Requires: mysql-commercial-server%{?_isa} = %{version}-%{release}
+Requires: mysql-commercial-server%{?_isa} >= %{min}
%else
Provides: MySQL-test%{?_isa} = %{version}-%{release}
-Requires: mysql-community-server%{?_isa} = %{version}-%{release}
+Requires: mysql-community-server%{?_isa} >= %{min}
%endif
Obsoletes: MySQL-test < %{version}-%{release}
Obsoletes: mysql-test < %{version}-%{release}
Group: Applications/Databases
%if 0%{?commercial}
Obsoletes: mysql-community-bench < %{version}-%{release}
-Requires: mysql-commercial-server%{?_isa} = %{version}-%{release}
+Requires: mysql-commercial-server%{?_isa} >= %{min}
%else
-Requires: mysql-community-server%{?_isa} = %{version}-%{release}
+Requires: mysql-community-server%{?_isa} >= %{min}
%endif
Obsoletes: mariadb-bench
Obsoletes: community-mysql-bench < %{version}-%{release}
Provides: MySQL-devel-advanced%{?_isa} = %{version}-%{release}
Obsoletes: MySQL-devel-advanced < %{version}-%{release}
Obsoletes: mysql-community-devel < %{version}-%{release}
-Requires: mysql-commercial-libs%{?_isa} = %{version}-%{release}
+Requires: mysql-commercial-libs%{?_isa} >= %{min}
%else
Provides: MySQL-devel%{?_isa} = %{version}-%{release}
-Requires: mysql-community-libs%{?_isa} = %{version}-%{release}
+Requires: mysql-community-libs%{?_isa} >= %{min}
%endif
Obsoletes: MySQL-devel < %{version}-%{release}
Obsoletes: mysql-devel < %{version}-%{release}
Provides: MySQL-shared-advanced%{?_isa} = %{version}-%{release}
Obsoletes: MySQL-shared-advanced < %{version}-%{release}
Obsoletes: mysql-community-libs < %{version}-%{release}
-Requires: mysql-commercial-common%{?_isa} = %{version}-%{release}
+Requires: mysql-commercial-common%{?_isa} >= %{min}
%else
Provides: MySQL-shared%{?_isa} = %{version}-%{release}
-Requires: mysql-community-common%{?_isa} = %{version}-%{release}
+Requires: mysql-community-common%{?_isa} >= %{min}
%endif
Obsoletes: MySQL-shared < %{version}-%{release}
Obsoletes: mysql-libs < %{version}-%{release}
Provides: MySQL-shared-compat-advanced%{?_isa} = %{version}-%{release}
Obsoletes: MySQL-shared-compat-advanced < %{version}-%{release}
Obsoletes: mysql-community-libs-compat < %{version}-%{release}
-Requires: mysql-commercial-libs%{?_isa} = %{version}-%{release}
+Requires: mysql-commercial-libs%{?_isa} >= %{min}
%else
Provides: MySQL-shared-compat%{?_isa} = %{version}-%{release}
-Requires: mysql-community-libs%{?_isa} = %{version}-%{release}
+Requires: mysql-community-libs%{?_isa} >= %{min}
%endif
Obsoletes: MySQL-shared-compat < %{version}-%{release}
%if 0%{?rhel} > 5
Group: Applications/Databases
%if 0%{?commercial}
Obsoletes: mysql-community-embedded-devel < %{version}-%{release}
-Requires: mysql-commercial-devel%{?_isa} = %{version}-%{release}
-Requires: mysql-commercial-embedded%{?_isa} = %{version}-%{release}
+Requires: mysql-commercial-devel%{?_isa} >= %{min}
+Requires: mysql-commercial-embedded%{?_isa} >= %{min}
%else
-Requires: mysql-community-devel%{?_isa} = %{version}-%{release}
-Requires: mysql-community-embedded%{?_isa} = %{version}-%{release}
+Requires: mysql-community-devel%{?_isa} >= %{min}
+Requires: mysql-community-embedded%{?_isa} >= %{min}
%endif
Obsoletes: mariadb-embedded-devel
Obsoletes: mysql-embedded-devel < %{version}-%{release}
Summary: Convenience package for easy upgrades of MySQL package set
Group: Applications/Databases
%if 0%{?commercial}
-Requires: mysql-commercial-client%{?_isa} = %{version}-%{release}
-Requires: mysql-commercial-libs%{?_isa} = %{version}-%{release}
-Requires: mysql-commercial-libs-compat%{?_isa} = %{version}-%{release}
+Requires: mysql-commercial-client%{?_isa} >= %{min}
+Requires: mysql-commercial-libs%{?_isa} >= %{min}
+Requires: mysql-commercial-libs-compat%{?_isa} >= %{min}
%else
-Requires: mysql-community-client%{?_isa} = %{version}-%{release}
-Requires: mysql-community-libs%{?_isa} = %{version}-%{release}
-Requires: mysql-community-libs-compat%{?_isa} = %{version}-%{release}
+Requires: mysql-community-client%{?_isa} >= %{min}
+Requires: mysql-community-libs%{?_isa} >= %{min}
+Requires: mysql-community-libs-compat%{?_isa} >= %{min}
%endif
%description -n mysql
%endif # 0%{?compatlib}
pushd %{src_dir}
%patch0 -p1
-%{?el7:%patch1 -p1}
%build
# Fail quickly and obviously if user tries to build as root
-DINSTALL_SQLBENCHDIR=share \
-DMYSQL_UNIX_ADDR="%{mysqldatadir}/mysql.sock" \
-DFEATURE_SET="%{feature_set}" \
+ %{?el7:-DWITH_SYMVER16=1} \
-DWITH_EMBEDDED_SERVER=1 \
-DWITH_EMBEDDED_SHARED_LIBRARY=1 \
%{?ssl_option} \
-DINSTALL_SQLBENCHDIR=share \
-DMYSQL_UNIX_ADDR="%{mysqldatadir}/mysql.sock" \
-DFEATURE_SET="%{feature_set}" \
+ %{?el7:-DWITH_SYMVER16=1} \
-DWITH_EMBEDDED_SERVER=1 \
-DWITH_EMBEDDED_SHARED_LIBRARY=1 \
%{?ssl_option} \
datadir=$(/usr/bin/my_print_defaults server mysqld | grep '^--datadir=' | sed -n 's/--datadir=//p' | tail -n 1)
/bin/chmod 0755 "$datadir" >/dev/null 2>&1 || :
/bin/touch /var/log/mysqld.log >/dev/null 2>&1 || :
+/bin/chown mysql:mysql /var/log/mysqld.log >/dev/null 2>&1 || :
%if 0%{?systemd}
%systemd_post mysqld.service
/usr/bin/systemctl enable mysqld >/dev/null 2>&1 || :
%attr(755, root, root) %{_libdir}/mysql/plugin/auth_test_plugin.so
%attr(644, root, root) %{_libdir}/mysql/plugin/daemon_example.ini
%attr(755, root, root) %{_libdir}/mysql/plugin/libdaemon_example.so
+%attr(755, root, root) %{_libdir}/mysql/plugin/test_udf_services.so
%attr(755, root, root) %{_libdir}/mysql/plugin/qa_auth_client.so
%attr(755, root, root) %{_libdir}/mysql/plugin/qa_auth_interface.so
%attr(755, root, root) %{_libdir}/mysql/plugin/qa_auth_server.so
%attr(755, root, root) %{_libdir}/mysql/plugin/debug/auth.so
%attr(755, root, root) %{_libdir}/mysql/plugin/debug/auth_test_plugin.so
%attr(755, root, root) %{_libdir}/mysql/plugin/debug/libdaemon_example.so
+%attr(755, root, root) %{_libdir}/mysql/plugin/debug/test_udf_services.so
%attr(755, root, root) %{_libdir}/mysql/plugin/debug/qa_auth_client.so
%attr(755, root, root) %{_libdir}/mysql/plugin/debug/qa_auth_interface.so
%attr(755, root, root) %{_libdir}/mysql/plugin/debug/qa_auth_server.so
%attr(755, root, root) %{_bindir}/mysqlimport
%attr(755, root, root) %{_bindir}/mysqlshow
%attr(755, root, root) %{_bindir}/mysqlslap
-%attr(755, root, root) %{_bindir}/mysql_config
-%attr(755, root, root) %{_bindir}/mysql_config-%{__isa_bits}
%attr(755, root, root) %{_bindir}/mysql_config_editor
%attr(644, root, root) %{_mandir}/man1/msql2mysql.1*
%endif
%changelog
+* Tue Jul 05 2016 Balasubramanian Kandasamy <balasubramanian.kandasamy@oracle.com> - 5.6.32-1
+- Remove mysql_config from client subpackage
+
+* Mon Mar 14 2016 Georgi Kodinov <georgi.kodinov@oracle.com> - 5.6.31-1
+- Add test_udf_services.so plugin
+
* Tue Sep 29 2015 Balasubramanian Kandasamy <balasubramanian.kandasamy@oracle.com> - 5.6.28-1
- Added conflicts to mysql-connector-c-shared dependencies
rc_failed 6 ; rc_status -v ; rc_exit
fi
- $PROG --basedir=/usr --datadir="$datadir" --pid-file="$pidfile" >/dev/null 2>&1 &
+ $PROG --basedir=/usr --datadir="$datadir" --pid-file="$pidfile" >/dev/null &
if pinger $! ; then
echo -n "Starting service MySQL:"
touch $lockfile
-# Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2000, 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
%{?sles12: %global systemd 1}
%{!?_tmpfilesdir: %global _tmpfilesdir /usr/lib/tmpfiles.d}
+%global min 5.6.10
+
Name: mysql-%{product_suffix}
Summary: A very fast and reliable SQL database server
Group: Applications/Databases
Provides: MySQL-server-advanced = %{version}-%{release}
Obsoletes: MySQL-server-advanced < %{version}-%{release}
Obsoletes: mysql-community-server < %{version}-%{release}
-Requires: mysql-commercial-client = %{version}-%{release}
-Requires: mysql-commercial-common = %{version}-%{release}
+Requires: mysql-commercial-client >= %{min}
+Requires: mysql-commercial-common >= %{min}
%else
Provides: MySQL-server = %{version}-%{release}
-Requires: mysql-community-client = %{version}-%{release}
-Requires: mysql-community-common = %{version}-%{release}
+Requires: mysql-community-client >= %{min}
+Requires: mysql-community-common >= %{min}
%endif
Obsoletes: MySQL-server < %{version}-%{release}
Obsoletes: mysql < %{version}-%{release}
Provides: MySQL-client-advanced = %{version}-%{release}
Obsoletes: MySQL-client-advanced < %{version}-%{release}
Obsoletes: mysql-community-client < %{version}-%{release}
-Requires: mysql-commercial-libs = %{version}-%{release}
+Requires: mysql-commercial-libs >= %{min}
%else
Provides: MySQL-client = %{version}-%{release}
-Requires: mysql-community-libs = %{version}-%{release}
+Requires: mysql-community-libs >= %{min}
%endif
Obsoletes: MySQL-client < %{version}-%{release}
Provides: mysql-client = %{version}-%{release}
Provides: MySQL-test-advanced = %{version}-%{release}
Obsoletes: MySQL-test-advanced < %{version}-%{release}
Obsoletes: mysql-community-test < %{version}-%{release}
-Requires: mysql-commercial-server = %{version}-%{release}
+Requires: mysql-commercial-server >= %{min}
%else
Provides: MySQL-test = %{version}-%{release}
-Requires: mysql-community-server = %{version}-%{release}
+Requires: mysql-community-server >= %{min}
%endif
Obsoletes: MySQL-test < %{version}-%{release}
Obsoletes: mysql-test < %{version}-%{release}
Group: Applications/Databases
%if 0%{?commercial}
Obsoletes: mysql-community-bench < %{version}-%{release}
-Requires: mysql-commercial-server = %{version}-%{release}
+Requires: mysql-commercial-server >= %{min}
%else
-Requires: mysql-community-server = %{version}-%{release}
+Requires: mysql-community-server >= %{min}
%endif
Obsoletes: mariadb-bench
Obsoletes: community-mysql-bench < %{version}-%{release}
Provides: MySQL-devel-advanced = %{version}-%{release}
Obsoletes: MySQL-devel-advanced < %{version}-%{release}
Obsoletes: mysql-community-devel < %{version}-%{release}
-Requires: mysql-commercial-libs = %{version}-%{release}
+Requires: mysql-commercial-libs >= %{min}
%else
Provides: MySQL-devel = %{version}-%{release}
-Requires: mysql-community-libs = %{version}-%{release}
+Requires: mysql-community-libs >= %{min}
%endif
Obsoletes: MySQL-devel < %{version}-%{release}
Obsoletes: mysql-devel < %{version}-%{release}
Provides: MySQL-shared-advanced = %{version}-%{release}
Obsoletes: MySQL-shared-advanced < %{version}-%{release}
Obsoletes: mysql-community-libs < %{version}-%{release}
-Requires: mysql-commercial-common = %{version}-%{release}
+Requires: mysql-commercial-common >= %{min}
%else
Provides: MySQL-shared = %{version}-%{release}
-Requires: mysql-community-common = %{version}-%{release}
+Requires: mysql-community-common >= %{min}
%endif
Obsoletes: MySQL-shared < %{version}-%{release}
Obsoletes: mysql-libs < %{version}-%{release}
Provides: MySQL-embedded-advanced = %{version}-%{release}
Obsoletes: MySQL-embedded-advanced < %{version}-%{release}
Obsoletes: mysql-community-embedded < %{version}-%{release}
-Requires: mysql-commercial-common = %{version}-%{release}
+Requires: mysql-commercial-common >= %{min}
%else
Provides: MySQL-embedded = %{version}-%{release}
-Requires: mysql-community-common = %{version}-%{release}
+Requires: mysql-community-common >= %{min}
%endif
Obsoletes: mariadb-embedded
Obsoletes: MySQL-embedded < %{version}-%{release}
Group: Applications/Databases
%if 0%{?commercial}
Obsoletes: mysql-community-embedded-devel < %{version}-%{release}
-Requires: mysql-commercial-devel = %{version}-%{release}
-Requires: mysql-commercial-embedded = %{version}-%{release}
+Requires: mysql-commercial-devel >= %{min}
+Requires: mysql-commercial-embedded >= %{min}
%else
-Requires: mysql-community-devel = %{version}-%{release}
-Requires: mysql-community-embedded = %{version}-%{release}
+Requires: mysql-community-devel >= %{min}
+Requires: mysql-community-embedded >= %{min}
%endif
Obsoletes: mariadb-embedded-devel
Obsoletes: mysql-embedded-devel < %{version}-%{release}
datadir=$(/usr/bin/my_print_defaults server mysqld | grep '^--datadir=' | sed -n 's/--datadir=//p' | tail -n 1)
/bin/chmod 0755 "$datadir"
/bin/touch /var/log/mysql/mysqld.log
+/bin/chown mysql:mysql /var/log/mysql/mysqld.log >/dev/null 2>&1 || :
%if 0%{?systemd}
%service_add_post mysql.service
/usr/bin/systemd-tmpfiles --create %{_tmpfilesdir}/mysql.conf >/dev/null 2>&1 || :
%attr(755, root, root) %{_bindir}/mysqlimport
%attr(755, root, root) %{_bindir}/mysqlshow
%attr(755, root, root) %{_bindir}/mysqlslap
-%attr(755, root, root) %{_bindir}/mysql_config
%attr(755, root, root) %{_bindir}/mysql_config_editor
%attr(644, root, root) %{_mandir}/man1/msql2mysql.1*
%attr(755, root, root) %{_libdir}/mysql/plugin/auth_test_plugin.so
%attr(644, root, root) %{_libdir}/mysql/plugin/daemon_example.ini
%attr(755, root, root) %{_libdir}/mysql/plugin/libdaemon_example.so
+%attr(755, root, root) %{_libdir}/mysql/plugin/test_udf_services.so
%attr(755, root, root) %{_libdir}/mysql/plugin/qa_auth_client.so
%attr(755, root, root) %{_libdir}/mysql/plugin/qa_auth_interface.so
%attr(755, root, root) %{_libdir}/mysql/plugin/qa_auth_server.so
%attr(755, root, root) %{_libdir}/mysql/plugin/debug/auth.so
%attr(755, root, root) %{_libdir}/mysql/plugin/debug/auth_test_plugin.so
%attr(755, root, root) %{_libdir}/mysql/plugin/debug/libdaemon_example.so
+%attr(755, root, root) %{_libdir}/mysql/plugin/debug/test_udf_services.so
%attr(755, root, root) %{_libdir}/mysql/plugin/debug/qa_auth_client.so
%attr(755, root, root) %{_libdir}/mysql/plugin/debug/qa_auth_interface.so
%attr(755, root, root) %{_libdir}/mysql/plugin/debug/qa_auth_server.so
%attr(755, root, root) %{_libdir}/mysql/libmysqld.so
%changelog
+* Mon Mar 14 2016 Georgi Kodinov <georgi.kodinov@oracle.com> - 5.6.31-1
+- Add test_udf_services.so plugin
+
* Tue Sep 29 2015 Balasubramanian Kandasamy <balasubramanian.kandasamy@oracle.com> - 5.6.28-1
- Added conflicts to mysql-connector-c-shared dependencies
-/* Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2009, 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
#include <mysql/plugin.h>
#include <mysql/plugin_audit.h>
-#if !defined(__attribute__) && (defined(__cplusplus) || !defined(__GNUC__) || __GNUC__ == 2 && __GNUC_MINOR__ < 8)
-#define __attribute__(A)
-#endif
+#include "my_attribute.h"
static volatile int number_of_calls; /* for SHOW STATUS, see below */
/* Count MYSQL_AUDIT_GENERAL_CLASS event instances */
1 failure (cannot happen)
*/
-static int audit_null_plugin_init(void *arg __attribute__((unused)))
+static int audit_null_plugin_init(void *arg MY_ATTRIBUTE((unused)))
{
number_of_calls= 0;
number_of_calls_general_log= 0;
*/
-static int audit_null_plugin_deinit(void *arg __attribute__((unused)))
+static int audit_null_plugin_deinit(void *arg MY_ATTRIBUTE((unused)))
{
return(0);
}
DESCRIPTION
*/
-static void audit_null_notify(MYSQL_THD thd __attribute__((unused)),
+static void audit_null_notify(MYSQL_THD thd MY_ATTRIBUTE((unused)),
unsigned int event_class,
const void *event)
{
-/* Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved.
+/* 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
static mysql_authentication_dialog_ask_t ask;
-static char *builtin_ask(MYSQL *mysql __attribute__((unused)),
- int type __attribute__((unused)),
+static char *builtin_ask(MYSQL *mysql MY_ATTRIBUTE((unused)),
+ int type MY_ATTRIBUTE((unused)),
const char *prompt,
char *buf, int buf_len)
{
or fall back to the default implementation.
*/
-static int init_dialog(char *unused1 __attribute__((unused)),
- size_t unused2 __attribute__((unused)),
- int unused3 __attribute__((unused)),
- va_list unused4 __attribute__((unused)))
+static int init_dialog(char *unused1 MY_ATTRIBUTE((unused)),
+ size_t unused2 MY_ATTRIBUTE((unused)),
+ int unused3 MY_ATTRIBUTE((unused)),
+ va_list unused4 MY_ATTRIBUTE((unused)))
{
void *sym= dlsym(RTLD_DEFAULT, "mysql_authentication_dialog_ask");
ask= sym ? (mysql_authentication_dialog_ask_t) sym : builtin_ask;
-/* Copyright (c) 2014, 2015 Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2014, 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
#include <stdlib.h>
static int mysql_no_login(
- MYSQL_PLUGIN_VIO *vio __attribute__((unused)),
- MYSQL_SERVER_AUTH_INFO *info __attribute__((unused)))
+ MYSQL_PLUGIN_VIO *vio MY_ATTRIBUTE((unused)),
+ MYSQL_SERVER_AUTH_INFO *info MY_ATTRIBUTE((unused)))
{
return CR_ERROR;
}
-/* Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2006, 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
#include "sql_plugin.h" // st_plugin_int
/*
- Disable __attribute__() on non-gcc compilers.
+ Disable MY_ATTRIBUTE() on non-gcc compilers.
*/
-#if !defined(__attribute__) && !defined(__GNUC__)
-#define __attribute__(A)
+#if !defined(MY_ATTRIBUTE) && !defined(__GNUC__)
+#define MY_ATTRIBUTE(A)
#endif
-/* Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2005, 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
#include <ctype.h>
#include <mysql/plugin.h>
-#if !defined(__attribute__) && (defined(__cplusplus) || !defined(__GNUC__) || __GNUC__ == 2 && __GNUC_MINOR__ < 8)
-#define __attribute__(A)
-#endif
+#include "my_attribute.h"
static long number_of_calls= 0; /* for SHOW STATUS, see below */
1 failure (cannot happen)
*/
-static int simple_parser_plugin_init(void *arg __attribute__((unused)))
+static int simple_parser_plugin_init(void *arg MY_ATTRIBUTE((unused)))
{
return(0);
}
*/
-static int simple_parser_plugin_deinit(void *arg __attribute__((unused)))
+static int simple_parser_plugin_deinit(void *arg MY_ATTRIBUTE((unused)))
{
return(0);
}
*/
static int simple_parser_init(MYSQL_FTPARSER_PARAM *param
- __attribute__((unused)))
+ MY_ATTRIBUTE((unused)))
{
return(0);
}
*/
static int simple_parser_deinit(MYSQL_FTPARSER_PARAM *param
- __attribute__((unused)))
+ MY_ATTRIBUTE((unused)))
{
return(0);
}
offset += nw;
for (int ii = 0; ii < info->num_features; ++ii) {
if (info->features[ii].description != NULL) {
+ // We don't want to write partially from source
+ if (sizeof(message)-offset <=
+ 2+strlen(info->features[ii].description))
+ {
+ return;
+ }
nw = snprintf(message + offset, sizeof(message) - offset,
"%s%s", comma ? ", " : "",
info->features[ii].description);
/***********************************************************************
-Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
+Copyright (c) 2011, 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
&col_value->value_int,
col_value->value_len,
col_value->is_unsigned);
+
+ assert(int_len <= conn_data->mul_col_buf_len);
+
memcpy(c_value, int_buf, int_len);
c_value += int_len;
} else {
-/* Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2012, 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
/*
- __attribute__(A) needs to be defined for Windows else complier
+ MY_ATTRIBUTE(A) needs to be defined for Windows else complier
do not recognise it. Argument in plugin_init and plugin_deinit
Used in other plugins as well.
*/
-#if !defined(__attribute__) && (defined(__cplusplus) || !defined(__GNUC__) || __GNUC__ == 2 && __GNUC_MINOR__ < 8)
-#define __attribute__(A)
+#if !defined(MY_ATTRIBUTE) && (defined(__cplusplus) || !defined(__GNUC__) || __GNUC__ == 2 && __GNUC_MINOR__ < 8)
+#define MY_ATTRIBUTE(A)
#endif
#define MAX_DICTIONARY_FILE_LENGTH 1024 * 1024
It empty the std::set and returns 0
*/
-static int validate_password_deinit(void *arg __attribute__((unused)))
+static int validate_password_deinit(void *arg MY_ATTRIBUTE((unused)))
{
free_dictionary_file();
mysql_rwlock_destroy(&LOCK_dict_file);
the cache and re-load the new dictionary file.
*/
static void
-dictionary_update(MYSQL_THD thd __attribute__((unused)),
- struct st_mysql_sys_var *var __attribute__((unused)),
+dictionary_update(MYSQL_THD thd MY_ATTRIBUTE((unused)),
+ struct st_mysql_sys_var *var MY_ATTRIBUTE((unused)),
void *var_ptr, const void *save)
{
*(const char**)var_ptr= *(const char**)save;
4. validate_password_special_char_count
*/
static void
-length_update(MYSQL_THD thd __attribute__((unused)),
- struct st_mysql_sys_var *var __attribute__((unused)),
+length_update(MYSQL_THD thd MY_ATTRIBUTE((unused)),
+ struct st_mysql_sys_var *var MY_ATTRIBUTE((unused)),
void *var_ptr, const void *save)
{
int new_validate_password_length;
--- /dev/null
+# Copyright (c) 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
+
+MYSQL_ADD_PLUGIN(test_udf_services test_udf_services.cc MODULE_ONLY)
--- /dev/null
+/* Copyright (c) 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 */
+
+#include <my_global.h>
+#include <mysql_version.h>
+#include <mysql/plugin.h>
+#include <mysql_com.h>
+
+/**
+ @file test_udf_services.cc
+
+ This is a test suite plugin to verify that plugins can co-exist with UDFs.
+ The file defines one DAEMON plugin @ref test_udf_services_plugin and one
+ UDF function: @ref test_udf_services_udf.
+ The test then checks if the plugin can be unloaded and loaded while the
+ UDF is defined.
+
+ No user-facing functionality in this plugin. Just test material !
+*/
+
+static struct st_mysql_daemon test_udf_services_plugin=
+{ MYSQL_DAEMON_INTERFACE_VERSION };
+
+mysql_declare_plugin(test_udf_services)
+{
+ MYSQL_DAEMON_PLUGIN,
+ &test_udf_services_plugin,
+ "test_udf_services",
+ "Georgi Kodinov",
+ "MySQL mtr test framework",
+ PLUGIN_LICENSE_GPL,
+ NULL, /* Plugin Init */
+ NULL, /* Plugin Deinit */
+ 0x0100, /* Plugin version: 1.0 */
+ NULL, /* status variables */
+ NULL, /* system variables */
+ NULL, /* config options */
+ 0, /* flags */
+}
+mysql_declare_plugin_end;
+
+#ifdef WIN32
+#define PLUGIN_EXPORT extern "C" __declspec(dllexport)
+#else
+#define PLUGIN_EXPORT extern "C"
+#endif
+
+
+/**
+ Initialization function for @ref test_udf_services_udf
+
+ Must be present otherwise the server refuses to load
+
+ @param initrd Return value from xxxx_init
+ @param args Array of arguments
+ @param[out] message Error message in case of error.
+ @retval FALSE success
+ @retval TRUE Failure. Error in the message argument
+*/
+PLUGIN_EXPORT my_bool
+test_udf_services_udf_init(UDF_INIT *initid MY_ATTRIBUTE((unused)),
+ UDF_ARGS *args MY_ATTRIBUTE((unused)),
+ char *message MY_ATTRIBUTE((unused)))
+{
+ return FALSE;
+}
+
+
+/**
+ A UDF function returning 0.
+
+ @param initrd Return value from xxxx_init
+ @param args Array of arguments
+ @param[out] is_null If the result is null, store 1 here
+ @param[out] error On error store 1 here
+*/
+PLUGIN_EXPORT longlong
+test_udf_services_udf(UDF_INIT *initid MY_ATTRIBUTE((unused)),
+ UDF_ARGS *args MY_ATTRIBUTE((unused)),
+ char *is_null MY_ATTRIBUTE((unused)),
+ char *error MY_ATTRIBUTE((unused)))
+{
+ char buffer[10];
+ *is_null= 0;
+ *error= 0;
+ /* use a plugin service function */
+ my_snprintf(buffer, sizeof(buffer), "test");
+ return 0;
+}
This file was modified by Oracle on 2015-05-18 for 32-bit compatibility.
- Modifications copyright (c) 2015, Oracle and/or its affiliates. All rights
+ Modifications copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights
reserved. */
#include <my_global.h>
*/
static void
mcinvert(p, cs)
- register struct parse *p __attribute__((unused));
- register cset *cs __attribute__((unused));
+ register struct parse *p MY_ATTRIBUTE((unused));
+ register cset *cs MY_ATTRIBUTE((unused));
{
assert(cs->multis == NULL); /* xxx */
}
*/
static void
mccase(p, cs)
-register struct parse *p __attribute__((unused));
-register cset *cs __attribute__((unused));
+register struct parse *p MY_ATTRIBUTE((unused));
+register cset *cs MY_ATTRIBUTE((unused));
{
assert(cs->multis == NULL); /* xxx */
}
if (argc > 4)
for (n = atoi(argv[3]); n > 0; n--) {
+ if(sizeof(buf)-1 < strlen(argv[1]))
+ {
+ exit(EXIT_FAILURE);
+ }
(void) strcpy(buf, argv[1]);
}
else if (argc > 3)
for (n = atoi(argv[3]); n > 0; n--) {
+ if(sizeof(buf)-1 < strlen(argv[1]))
+ {
+ exit(EXIT_FAILURE);
+ }
(void) strcpy(buf, argv[1]);
(void) split(buf, fields, MNF, argv[2]);
}
#!/usr/bin/perl
-# Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2000, 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 Library General Public
my ($command) = @_;
my (@paths, $path);
- return $command if (-f $command && -x $command);
+ # If the argument is not 'my_print_defaults' then it would be of the format
+ # <absolute_path>/<program>
+ return $command if ($command ne 'my_print_defaults' && -f $command &&
+ -x $command);
+
@paths = split(':', $ENV{'PATH'});
foreach $path (@paths)
{
--core-file-size=*) core_file_size="$val" ;;
--ledir=*) ledir="$val" ;;
--malloc-lib=*) set_malloc_lib "$val" ;;
- --mysqld=*) MYSQLD="$val" ;;
+ --mysqld=*)
+ if [ -z "$pick_args" ]; then
+ log_error "--mysqld option can only be used as command line option, found in config file"
+ exit 1
+ fi
+ MYSQLD="$val" ;;
--mysqld-version=*)
+ if [ -z "$pick_args" ]; then
+ log_error "--mysqld-version option can only be used as command line option, found in config file"
+ exit 1
+ fi
if test -n "$val"
then
MYSQLD="mysqld-$val"
echo "$text"
}
-
-mysql_config=
-get_mysql_config() {
- if [ -z "$mysql_config" ]; then
- mysql_config=`echo "$0" | sed 's,/[^/][^/]*$,/mysql_config,'`
- if [ ! -x "$mysql_config" ]; then
- log_error "Can not run mysql_config $@ from '$mysql_config'"
- exit 1
- fi
- fi
-
- "$mysql_config" "$@"
-}
-
-
# set_malloc_lib LIB
# - If LIB is empty, do nothing and return
-# - If LIB is 'tcmalloc', look for tcmalloc shared library in /usr/lib
-# then pkglibdir. tcmalloc is part of the Google perftools project.
+# - If LIB is 'tcmalloc', look for tcmalloc shared library in $malloc_dirs.
+# tcmalloc is part of the Google perftools project.
# - If LIB is an absolute path, assume it is a malloc shared library
#
# Put LIB in mysqld_ld_preload, which will be added to LD_PRELOAD when
# running mysqld. See ld.so for details.
set_malloc_lib() {
+ # This list is kept intentionally simple.
+ malloc_dirs="/usr/lib /usr/lib64 /usr/lib/i386-linux-gnu /usr/lib/x86_64-linux-gnu"
malloc_lib="$1"
if [ "$malloc_lib" = tcmalloc ]; then
- pkglibdir=`get_mysql_config --variable=pkglibdir`
malloc_lib=
- # This list is kept intentionally simple. Simply set --malloc-lib
- # to a full path if another location is desired.
- for libdir in /usr/lib "$pkglibdir" "$pkglibdir/mysql"; do
+ for libdir in `echo $malloc_dirs`; do
for flavor in _minimal '' _and_profiler _debug; do
tmp="$libdir/libtcmalloc$flavor.so"
#log_notice "DEBUG: Checking for malloc lib '$tmp'"
done
if [ -z "$malloc_lib" ]; then
- log_error "no shared library for --malloc-lib=tcmalloc found in /usr/lib or $pkglibdir"
+ log_error "no shared library for --malloc-lib=tcmalloc found in $malloc_dirs"
exit 1
fi
fi
case "$malloc_lib" in
/*)
if [ ! -r "$malloc_lib" ]; then
- log_error "--malloc-lib '$malloc_lib' can not be read and will not be used"
+ log_error "--malloc-lib can not be read and will not be used"
exit 1
fi
+
+ # Restrict to a the list in $malloc_dirs above
+ case "`dirname "$malloc_lib"`" in
+ /usr/lib) ;;
+ /usr/lib64) ;;
+ /usr/lib/i386-linux-gnu) ;;
+ /usr/lib/x86_64-linux-gnu) ;;
+ *)
+ log_error "--malloc-lib must be located in one of the directories: $malloc_dirs"
+ exit 1
+ ;;
+ esac
;;
*)
log_error "--malloc-lib must be an absolute path or 'tcmalloc'; " \
log_notice "Logging to '$err_log'."
logging=file
- if [ ! -f "$err_log" ]; then # if error log already exists,
+ if [ ! -f "$err_log" -a ! -h "$err_log" ]; then # if error log already exists,
touch "$err_log" # we just append. otherwise,
chmod "$fmode" "$err_log" # fix the permissions here!
fi
USER_OPTION="--user=$user"
fi
# Change the err log to the right user, if it is in use
- if [ $want_syslog -eq 0 ]; then
+ if [ $want_syslog -eq 0 -a ! -h "$err_log" ]; then
touch "$err_log"
chown $user "$err_log"
fi
mysql_unix_port_dir=`dirname $safe_mysql_unix_port`
if [ ! -d $mysql_unix_port_dir ]
then
- mkdir $mysql_unix_port_dir
- chown $user $mysql_unix_port_dir
- chmod 755 $mysql_unix_port_dir
+ if [ ! -h $mysql_unix_port_dir ]; then
+ mkdir $mysql_unix_port_dir
+ chown $user $mysql_unix_port_dir
+ chmod 755 $mysql_unix_port_dir
+ fi
fi
# If the user doesn't specify a binary, we assume name "mysqld"
exit 1
fi
fi
- rm -f "$pid_file"
+ if [ ! -h "$pid_file" ]; then
+ rm -f "$pid_file"
+ fi
if test -f "$pid_file"
then
log_error "Fatal error: Can't remove the pid file:
while true
do
- rm -f $safe_mysql_unix_port "$pid_file" # Some extra safety
+ # Some extra safety
+ if [ ! -h "$safe_mysql_unix_port" ]; then
+ rm -f "$safe_mysql_unix_port"
+ fi
+ if [ ! -h "$pid_file" ]; then
+ rm -f "$pid_file"
+ fi
start_time=`date +%M%S`
eval_log_error "$cmd $wsrep_start_position_opt --wsrep_cluster_address=$url $nohup_redir"
fi
- if [ $want_syslog -eq 0 -a ! -f "$err_log" ]; then
+ if [ $want_syslog -eq 0 -a ! -f "$err_log" -a ! -h "$err_log" ]; then
touch "$err_log" # hypothetical: log was renamed but not
chown $user "$err_log" # flushed yet. we'd recreate it with
chmod "$fmode" "$err_log" # wrong owner next time we log, so set
} while(0)
#endif
+static char *set_ssl_option_unpack_path(struct st_mysql_options *options,
+ const char *arg)
+{
+ char *opt_var= NULL;
+ if (arg)
+ {
+ char *buff= (char *)my_malloc(FN_REFLEN + 1, MYF(MY_WME));
+ unpack_filename(buff, (char *)arg);
+ opt_var= my_strdup(buff, MYF(MY_WME));
+ options->use_ssl= 1;
+ my_free(buff);
+ }
+ return opt_var;
+}
+
+
void mysql_read_default_options(struct st_mysql_options *options,
const char *filename,const char *group)
{
#define strdup_if_not_null(A) (A) == 0 ? 0 : my_strdup((A),MYF(MY_WME))
my_bool STDCALL
-mysql_ssl_set(MYSQL *mysql __attribute__((unused)) ,
- const char *key __attribute__((unused)),
- const char *cert __attribute__((unused)),
- const char *ca __attribute__((unused)),
- const char *capath __attribute__((unused)),
- const char *cipher __attribute__((unused)))
+mysql_ssl_set(MYSQL *mysql MY_ATTRIBUTE((unused)) ,
+ const char *key MY_ATTRIBUTE((unused)),
+ const char *cert MY_ATTRIBUTE((unused)),
+ const char *ca MY_ATTRIBUTE((unused)),
+ const char *capath MY_ATTRIBUTE((unused)),
+ const char *cipher MY_ATTRIBUTE((unused)))
{
my_bool result= 0;
DBUG_ENTER("mysql_ssl_set");
#if defined(HAVE_OPENSSL) && !defined(EMBEDDED_LIBRARY)
static void
-mysql_ssl_free(MYSQL *mysql __attribute__((unused)))
+mysql_ssl_free(MYSQL *mysql MY_ATTRIBUTE((unused)))
{
struct st_VioSSLFd *ssl_fd= (struct st_VioSSLFd*) mysql->connector_fd;
DBUG_ENTER("mysql_ssl_free");
*/
const char * STDCALL
-mysql_get_ssl_cipher(MYSQL *mysql __attribute__((unused)))
+mysql_get_ssl_cipher(MYSQL *mysql MY_ATTRIBUTE((unused)))
{
DBUG_ENTER("mysql_get_ssl_cipher");
#if defined(HAVE_OPENSSL) && !defined(EMBEDDED_LIBRARY)
should also be reflected there.
*/
-void mysql_detach_stmt_list(LIST **stmt_list __attribute__((unused)),
- const char *func_name __attribute__((unused)))
+void mysql_detach_stmt_list(LIST **stmt_list MY_ATTRIBUTE((unused)),
+ const char *func_name MY_ATTRIBUTE((unused)))
{
#ifdef MYSQL_CLIENT
/* Reset connection handle in all prepared statements. */
case MYSQL_DEFAULT_AUTH:
EXTENSION_SET_STRING(&mysql->options, default_auth, arg);
break;
- case MYSQL_OPT_SSL_KEY: SET_SSL_OPTION(ssl_key, arg); break;
- case MYSQL_OPT_SSL_CERT: SET_SSL_OPTION(ssl_cert, arg); break;
- case MYSQL_OPT_SSL_CA: SET_SSL_OPTION(ssl_ca, arg); break;
- case MYSQL_OPT_SSL_CAPATH: SET_SSL_OPTION(ssl_capath, arg); break;
+ case MYSQL_OPT_SSL_KEY:
+ if (mysql->options.ssl_key)
+ my_free(mysql->options.ssl_key);
+ mysql->options.ssl_key= set_ssl_option_unpack_path(&mysql->options, arg);
+ break;
+ case MYSQL_OPT_SSL_CERT:
+ if (mysql->options.ssl_cert)
+ my_free(mysql->options.ssl_cert);
+ mysql->options.ssl_cert= set_ssl_option_unpack_path(&mysql->options, arg);
+ break;
+ case MYSQL_OPT_SSL_CA:
+ if (mysql->options.ssl_ca)
+ my_free(mysql->options.ssl_ca);
+ mysql->options.ssl_ca= set_ssl_option_unpack_path(&mysql->options, arg);
+ break;
+ case MYSQL_OPT_SSL_CAPATH:
+ if (mysql->options.ssl_capath)
+ my_free(mysql->options.ssl_capath);
+ mysql->options.ssl_capath= set_ssl_option_unpack_path(&mysql->options, arg);
+ break;
case MYSQL_OPT_SSL_CIPHER: SET_SSL_OPTION(ssl_cipher, arg); break;
- case MYSQL_OPT_SSL_CRL: EXTENSION_SET_SSL_STRING(&mysql->options,
- ssl_crl, arg);
- break;
- case MYSQL_OPT_SSL_CRLPATH: EXTENSION_SET_SSL_STRING(&mysql->options,
- ssl_crlpath, arg);
- break;
+ case MYSQL_OPT_SSL_CRL:
+ 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);
+ break;
+ case MYSQL_OPT_SSL_CRLPATH:
+ 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);
+ break;
case MYSQL_SERVER_PUBLIC_KEY:
EXTENSION_SET_STRING(&mysql->options, server_public_key_path, arg);
break;
*/
uchar *
get_attr_key(LEX_STRING *part, size_t *length,
- my_bool not_used __attribute__((unused)))
+ my_bool not_used MY_ATTRIBUTE((unused)))
{
*length= part[0].length;
return (uchar *) part[0].str;
return res ? CR_ERROR : CR_OK;
}
+
+#if defined(EXPORT_SYMVER16)
+#ifndef EMBEDDED_LIBRARY
+
+// Hack to provide both libmysqlclient_16 and libmysqlclient_18 symbol versions
+
+#define SYM_16(_exportedsym) __asm__(".symver symver16_" #_exportedsym "," #_exportedsym "@libmysqlclient_16")
+
+void STDCALL symver16_mysql_close(MYSQL *mysql)
+{
+ return mysql_close(mysql);
+}
+SYM_16(mysql_close);
+
+
+uint STDCALL symver16_mysql_errno(MYSQL *mysql)
+{
+ return mysql_errno(mysql);
+}
+SYM_16(mysql_errno);
+
+
+const char * STDCALL symver16_mysql_error(MYSQL *mysql)
+{
+ return mysql_error(mysql);
+}
+SYM_16(mysql_error);
+
+
+ulong * STDCALL symver16_mysql_fetch_lengths(MYSQL_RES *res)
+{
+ return mysql_fetch_lengths(res);
+}
+SYM_16(mysql_fetch_lengths);
+
+
+MYSQL_ROW STDCALL symver16_mysql_fetch_row(MYSQL_RES *res)
+{
+ return mysql_fetch_row(res);
+}
+SYM_16(mysql_fetch_row);
+
+
+void STDCALL symver16_mysql_free_result(MYSQL_RES *result)
+{
+ return mysql_free_result(result);
+}
+SYM_16(mysql_free_result);
+
+
+ulong STDCALL symver16_mysql_get_server_version(MYSQL *mysql)
+{
+ return mysql_get_server_version(mysql);
+}
+SYM_16(mysql_get_server_version);
+
+
+const char * STDCALL symver16_mysql_get_ssl_cipher(MYSQL *mysql __attribute__((unused)))
+{
+ return mysql_get_ssl_cipher(mysql);
+}
+SYM_16(mysql_get_ssl_cipher);
+
+
+MYSQL * STDCALL symver16_mysql_init(MYSQL *mysql)
+{
+ return mysql_init(mysql);
+}
+SYM_16(mysql_init);
+
+
+unsigned int STDCALL symver16_mysql_num_fields(MYSQL_RES *res)
+{
+ return mysql_num_fields(res);
+}
+SYM_16(mysql_num_fields);
+
+
+my_ulonglong STDCALL symver16_mysql_num_rows(MYSQL_RES *res)
+{
+ return mysql_num_rows(res);
+}
+SYM_16(mysql_num_rows);
+
+
+int STDCALL symver16_mysql_options(MYSQL *mysql,enum mysql_option option, const void *arg)
+{
+ return mysql_options(mysql, option, arg);
+}
+SYM_16(mysql_options);
+
+
+int STDCALL symver16_mysql_real_query(MYSQL *mysql, const char *query, ulong length)
+{
+ return mysql_real_query(mysql, query, length);
+}
+SYM_16(mysql_real_query);
+
+
+int STDCALL symver16_mysql_select_db(MYSQL *mysql, const char *db)
+{
+ return mysql_select_db(mysql, db);
+}
+SYM_16(mysql_select_db);
+
+
+int STDCALL symver16_mysql_send_query(MYSQL* mysql, const char* query, ulong length)
+{
+ return mysql_send_query(mysql, query, length);
+}
+SYM_16(mysql_send_query);
+
+
+int STDCALL symver16_mysql_set_character_set(MYSQL *mysql, const char *cs_name)
+{
+ return mysql_set_character_set(mysql, cs_name);
+}
+SYM_16(mysql_set_character_set);
+
+
+my_bool STDCALL symver16_mysql_ssl_set(MYSQL *mysql __attribute__((unused)), const char *key __attribute__((unused)), const char *cert __attribute__((unused)), const char *ca __attribute__((unused)), const char *capath __attribute__((unused)), const char *cipher __attribute__((unused)))
+{
+ return mysql_ssl_set(mysql, key, cert, ca, capath, cipher);
+}
+SYM_16(mysql_ssl_set);
+
+
+MYSQL_RES * STDCALL symver16_mysql_store_result(MYSQL *mysql)
+{
+ return mysql_store_result(mysql);
+}
+SYM_16(mysql_store_result);
+
+#endif
+#endif /* EXPORT_SYMVER16 */
-/* Copyright (c) 2009, 2015, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2009, 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
This function checks if a transactional table was updated by the
current statement.
- @param thd The client thread that executed the current statement.
+ @param ha_list Registered storage engine handler list.
@return
@c true if a transactional table was updated, @c false otherwise.
*/
bool
-stmt_has_updated_trans_table(const THD *thd)
+stmt_has_updated_trans_table(Ha_trx_info* ha_list)
{
Ha_trx_info *ha_info;
- for (ha_info= thd->transaction.stmt.ha_list; ha_info;
- ha_info= ha_info->next())
+ for (ha_info= ha_list; ha_info; ha_info= ha_info->next())
{
if (ha_info->is_trx_read_write() && ha_info->ht() != binlog_hton)
return (TRUE);
if (mysql_file_close(index_file.file, MYF(0)) < 0)
{
error= -1;
- sql_print_error("MYSQL_BIN_LOG::move_crash_safe_index_file_to_index_file "
- "failed to close the index file.");
- goto err;
+ sql_print_error("While rebuilding index file %s: "
+ "Failed to close the index file.", index_file_name);
+ /*
+ Delete Crash safe index file here and recover the binlog.index
+ state(index_file io_cache) from old binlog.index content.
+ */
+ mysql_file_delete(key_file_binlog_index, crash_safe_index_file_name,
+ MYF(0));
+
+ goto recoverable_err;
+ }
+ if (DBUG_EVALUATE_IF("force_index_file_delete_failure", 1, 0) ||
+ mysql_file_delete(key_file_binlog_index, index_file_name, MYF(MY_WME)))
+ {
+ error= -1;
+ sql_print_error("While rebuilding index file %s: "
+ "Failed to delete the existing index file. It could be "
+ "that file is being used by some other process.",
+ index_file_name);
+ /*
+ Delete Crash safe file index file here and recover the binlog.index
+ state(index_file io_cache) from old binlog.index content.
+ */
+ mysql_file_delete(key_file_binlog_index, crash_safe_index_file_name,
+ MYF(0));
+
+ goto recoverable_err;
}
- mysql_file_delete(key_file_binlog_index, index_file_name, MYF(MY_WME));
}
DBUG_EXECUTE_IF("crash_create_before_rename_index_file", DBUG_SUICIDE(););
if (my_rename(crash_safe_index_file_name, index_file_name, MYF(MY_WME)))
{
error= -1;
- sql_print_error("MYSQL_BIN_LOG::move_crash_safe_index_file_to_index_file "
- "failed to move crash_safe_index_file to index file.");
- goto err;
+ sql_print_error("While rebuilding index file %s: "
+ "Failed to rename the new index file to the existing "
+ "index file.", index_file_name);
+ goto fatal_err;
}
DBUG_EXECUTE_IF("crash_create_after_rename_index_file", DBUG_SUICIDE(););
+recoverable_err:
if ((fd= mysql_file_open(key_file_binlog_index,
index_file_name,
O_RDWR | O_CREAT | O_BINARY,
mysql_file_seek(fd, 0L, MY_SEEK_END, MYF(0)),
0, MYF(MY_WME | MY_WAIT_IF_FULL)))
{
- error= -1;
- sql_print_error("MYSQL_BIN_LOG::move_crash_safe_index_file_to_index_file "
- "failed to open the index file.");
- goto err;
+ sql_print_error("After rebuilding the index file %s: "
+ "Failed to open the index file.", index_file_name);
+ goto fatal_err;
}
-err:
if (need_lock_index)
mysql_mutex_unlock(&LOCK_index);
DBUG_RETURN(error);
+
+fatal_err:
+ /*
+ This situation is very very rare to happen (unless there is some serious
+ memory related issues like OOM) and should be treated as fatal error.
+ Hence it is better to bring down the server without respecting
+ 'binlog_error_action' value here.
+ */
+ exec_binlog_error_action_abort("MySQL server failed to update the "
+ "binlog.index file's content properly. "
+ "It might not be in sync with available "
+ "binlogs and the binlog.index file state is in "
+ "unrecoverable state. Aborting the server.");
+ /*
+ Server is aborted in the above function.
+ This is dead code to make compiler happy.
+ */
+ DBUG_RETURN(error);
}
int error_index= 0, close_error_index= 0;
/* Read each entry from purge_index_file and delete the file. */
- if (is_inited_purge_index_file() &&
+ if (!error && is_inited_purge_index_file() &&
(error_index= purge_index_entry(thd, decrease_log_space, false/*need_lock_index=false*/)))
sql_print_error("MYSQL_BIN_LOG::purge_logs failed to process registered files"
" that would be purged.");
*check_purge= false;
- if (force_rotate || (my_b_tell(&log_file) >= (my_off_t) max_size))
+ if (DBUG_EVALUATE_IF("force_rotate", 1, 0) || force_rotate ||
+ (my_b_tell(&log_file) >= (my_off_t) max_size))
{
error= new_file_without_locking(NULL);
*check_purge= true;
If we need to rotate, we do it without commit error.
Otherwise the thd->commit_error will be possibly reset.
*/
- if (do_rotate && thd->commit_error == THD::CE_NONE)
+ if (DBUG_EVALUATE_IF("force_rotate", 1, 0) ||
+ (do_rotate && thd->commit_error == THD::CE_NONE))
{
/*
Do not force the rotate as several consecutive groups may
return 0;
}
+#ifndef DBUG_OFF
+const char * get_locked_tables_mode_name(enum_locked_tables_mode locked_tables_mode)
+{
+ switch (locked_tables_mode)
+ {
+ case LTM_NONE:
+ return "LTM_NONE";
+ case LTM_LOCK_TABLES:
+ return "LTM_LOCK_TABLES";
+ case LTM_PRELOCKED:
+ return "LTM_PRELOCKED";
+ case LTM_PRELOCKED_UNDER_LOCK_TABLES:
+ return "LTM_PRELOCKED_UNDER_LOCK_TABLES";
+ default:
+ return "Unknown table lock mode";
+ }
+}
+#endif
+
+
/**
Decide on logging format to use for the statement and issue errors
or warnings as needed. The decision depends on the following
THD::binlog_prepare_pending_rows_event(TABLE* table, uint32 serv_id,
size_t needed,
bool is_transactional,
- RowsEventT *hint __attribute__((unused)),
+ RowsEventT *hint MY_ATTRIBUTE((unused)),
const uchar* extra_row_info)
{
DBUG_ENTER("binlog_prepare_pending_rows_event");
#ifndef BINLOG_H_INCLUDED
-/* Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved.
+/* 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
/** Lock for protecting the queue. */
mysql_mutex_t m_lock;
- } __attribute__((aligned(CPU_LEVEL1_DCACHE_LINESIZE)));
+ } MY_ATTRIBUTE((aligned(CPU_LEVEL1_DCACHE_LINESIZE)));
public:
Stage_manager()
extern MYSQL_PLUGIN_IMPORT MYSQL_BIN_LOG mysql_bin_log;
bool trans_has_updated_trans_table(const THD* thd);
-bool stmt_has_updated_trans_table(const THD *thd);
+bool stmt_has_updated_trans_table(Ha_trx_info* ha_list);
bool ending_trans(THD* thd, const bool all);
bool ending_single_stmt_trans(THD* thd, const bool all);
bool trans_cannot_safely_rollback(const THD* thd);
/*
- Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
+ Copyright (c) 2000, 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
*/
type_conversion_status
Field_num::store_time(MYSQL_TIME *ltime,
- uint8 dec_arg __attribute__((unused)))
+ uint8 dec_arg MY_ATTRIBUTE((unused)))
{
longlong nr= TIME_to_ulonglong_round(ltime);
return store(ltime->neg ? -nr : nr, 0);
master's field size, @c false otherwise.
*/
bool Field::compatible_field_size(uint field_metadata,
- Relay_log_info *rli_arg __attribute__((unused)),
- uint16 mflags __attribute__((unused)),
+ Relay_log_info *rli_arg MY_ATTRIBUTE((unused)),
+ uint16 mflags MY_ATTRIBUTE((unused)),
int *order_var)
{
uint const source_size= pack_length_from_metadata(field_metadata);
*/
uchar *
Field::pack(uchar *to, const uchar *from, uint max_length,
- bool low_byte_first __attribute__((unused)))
+ bool low_byte_first MY_ATTRIBUTE((unused)))
{
uint32 length= pack_length();
set_if_smaller(length, max_length);
*/
const uchar *
Field::unpack(uchar* to, const uchar *from, uint param_data,
- bool low_byte_first __attribute__((unused)))
+ bool low_byte_first MY_ATTRIBUTE((unused)))
{
uint length=pack_length();
int from_type= 0;
Field *Field::new_field(MEM_ROOT *root, TABLE *new_table,
- bool keep_type __attribute__((unused)))
+ bool keep_type MY_ATTRIBUTE((unused)))
{
Field *tmp= clone(root);
if (tmp == NULL)
}
-String *Field_decimal::val_str(String *val_buffer __attribute__((unused)),
+String *Field_decimal::val_str(String *val_buffer MY_ATTRIBUTE((unused)),
String *val_ptr)
{
ASSERT_COLUMN_MARKED_FOR_READ;
type_conversion_status
Field_new_decimal::store_time(MYSQL_TIME *ltime,
- uint8 dec_arg __attribute__((unused)))
+ uint8 dec_arg MY_ATTRIBUTE((unused)))
{
my_decimal decimal_value;
return store_value(date2my_decimal(ltime, &decimal_value));
String *Field_new_decimal::val_str(String *val_buffer,
- String *val_ptr __attribute__((unused)))
+ String *val_ptr MY_ATTRIBUTE((unused)))
{
ASSERT_COLUMN_MARKED_FOR_READ;
my_decimal decimal_value;
@return @c true
*/
bool Field_new_decimal::compatible_field_size(uint field_metadata,
- Relay_log_info * __attribute__((unused)),
- uint16 mflags __attribute__((unused)),
+ Relay_log_info * MY_ATTRIBUTE((unused)),
+ uint16 mflags MY_ATTRIBUTE((unused)),
int *order_var)
{
uint const source_precision= (field_metadata >> 8U) & 0x00ff;
String *Field_tiny::val_str(String *val_buffer,
- String *val_ptr __attribute__((unused)))
+ String *val_ptr MY_ATTRIBUTE((unused)))
{
ASSERT_COLUMN_MARKED_FOR_READ;
const CHARSET_INFO *cs= &my_charset_numeric;
String *Field_short::val_str(String *val_buffer,
- String *val_ptr __attribute__((unused)))
+ String *val_ptr MY_ATTRIBUTE((unused)))
{
ASSERT_COLUMN_MARKED_FOR_READ;
const CHARSET_INFO *cs= &my_charset_numeric;
String *Field_medium::val_str(String *val_buffer,
- String *val_ptr __attribute__((unused)))
+ String *val_ptr MY_ATTRIBUTE((unused)))
{
ASSERT_COLUMN_MARKED_FOR_READ;
const CHARSET_INFO *cs= &my_charset_numeric;
}
String *Field_long::val_str(String *val_buffer,
- String *val_ptr __attribute__((unused)))
+ String *val_ptr MY_ATTRIBUTE((unused)))
{
ASSERT_COLUMN_MARKED_FOR_READ;
const CHARSET_INFO *cs= &my_charset_numeric;
String *Field_longlong::val_str(String *val_buffer,
- String *val_ptr __attribute__((unused)))
+ String *val_ptr MY_ATTRIBUTE((unused)))
{
const CHARSET_INFO *cs= &my_charset_numeric;
uint length;
type_conversion_status
Field_real::store_time(MYSQL_TIME *ltime,
- uint8 dec_arg __attribute__((unused)))
+ uint8 dec_arg MY_ATTRIBUTE((unused)))
{
double nr= TIME_to_double(ltime);
return store(ltime->neg ? -nr : nr);
String *Field_float::val_str(String *val_buffer,
- String *val_ptr __attribute__((unused)))
+ String *val_ptr MY_ATTRIBUTE((unused)))
{
ASSERT_COLUMN_MARKED_FOR_READ;
DBUG_ASSERT(!zerofill || field_length <= MAX_FIELD_CHARLENGTH);
String *Field_double::val_str(String *val_buffer,
- String *val_ptr __attribute__((unused)))
+ String *val_ptr MY_ATTRIBUTE((unused)))
{
ASSERT_COLUMN_MARKED_FOR_READ;
DBUG_ASSERT(!zerofill || field_length <= MAX_FIELD_CHARLENGTH);
type_conversion_status
Field_temporal_with_date::store_time(MYSQL_TIME *ltime,
- uint8 dec_arg __attribute__((unused)))
+ uint8 dec_arg MY_ATTRIBUTE((unused)))
{
ASSERT_COLUMN_MARKED_FOR_WRITE;
type_conversion_status error;
}
-void Field_timestamp::make_sort_key(uchar *to,uint length __attribute__((unused)))
+void Field_timestamp::make_sort_key(uchar *to,uint length MY_ATTRIBUTE((unused)))
{
#ifdef WORDS_BIGENDIAN
if (!table || !table->s->db_low_byte_first)
type_conversion_status
Field_time_common::store_time(MYSQL_TIME *ltime,
- uint8 dec_arg __attribute__((unused)))
+ uint8 dec_arg MY_ATTRIBUTE((unused)))
{
/* Check if seconds or minutes are out of range */
if (ltime->second >= 60 || ltime->minute >= 60)
String *Field_time_common::val_str(String *val_buffer,
- String *val_ptr __attribute__((unused)))
+ String *val_ptr MY_ATTRIBUTE((unused)))
{
ASSERT_COLUMN_MARKED_FOR_READ;
MYSQL_TIME ltime;
type_conversion_status
Field_year::store_time(MYSQL_TIME *ltime,
- uint8 dec_arg __attribute__((unused)))
+ uint8 dec_arg MY_ATTRIBUTE((unused)))
{
if (ltime->time_type != MYSQL_TIMESTAMP_DATETIME &&
ltime->time_type != MYSQL_TIMESTAMP_DATE)
String *Field_year::val_str(String *val_buffer,
- String *val_ptr __attribute__((unused)))
+ String *val_ptr MY_ATTRIBUTE((unused)))
{
DBUG_ASSERT(field_length < 5);
val_buffer->alloc(5);
String *Field_newdate::val_str(String *val_buffer,
- String *val_ptr __attribute__((unused)))
+ String *val_ptr MY_ATTRIBUTE((unused)))
{
ASSERT_COLUMN_MARKED_FOR_READ;
val_buffer->alloc(field_length);
Using my_datetime_number_to_str() instead of my_datetime_to_str().
*/
String *Field_datetime::val_str(String *val_buffer,
- String *val_ptr __attribute__((unused)))
+ String *val_ptr MY_ATTRIBUTE((unused)))
{
ASSERT_COLUMN_MARKED_FOR_READ;
val_buffer->alloc(field_length + 1);
}
-String *Field_string::val_str(String *val_buffer __attribute__((unused)),
+String *Field_string::val_str(String *val_buffer MY_ATTRIBUTE((unused)),
String *val_ptr)
{
ASSERT_COLUMN_MARKED_FOR_READ;
bool
Field_string::compatible_field_size(uint field_metadata,
Relay_log_info *rli_arg,
- uint16 mflags __attribute__((unused)),
+ uint16 mflags MY_ATTRIBUTE((unused)),
int *order_var)
{
#ifdef HAVE_REPLICATION
void Field_string::make_sort_key(uchar *to, uint length)
{
- uint tmp __attribute__((unused))=
+ uint tmp MY_ATTRIBUTE((unused))=
field_charset->coll->strnxfrm(field_charset,
to, length, char_length(),
ptr, field_length,
uchar *Field_string::pack(uchar *to, const uchar *from,
uint max_length,
- bool low_byte_first __attribute__((unused)))
+ bool low_byte_first MY_ATTRIBUTE((unused)))
{
uint length= min(field_length,max_length);
uint local_char_length= max_length/field_charset->mbmaxlen;
Field_string::unpack(uchar *to,
const uchar *from,
uint param_data,
- bool low_byte_first __attribute__((unused)))
+ bool low_byte_first MY_ATTRIBUTE((unused)))
{
uint from_length, length;
return result;
}
-String *Field_varstring::val_str(String *val_buffer __attribute__((unused)),
+String *Field_varstring::val_str(String *val_buffer MY_ATTRIBUTE((unused)),
String *val_ptr)
{
ASSERT_COLUMN_MARKED_FOR_READ;
uchar *Field_varstring::pack(uchar *to, const uchar *from,
uint max_length,
- bool low_byte_first __attribute__((unused)))
+ bool low_byte_first MY_ATTRIBUTE((unused)))
{
uint length= length_bytes == 1 ? (uint) *from : uint2korr(from);
set_if_smaller(max_length, field_length);
const uchar *
Field_varstring::unpack(uchar *to, const uchar *from,
uint param_data,
- bool low_byte_first __attribute__((unused)))
+ bool low_byte_first MY_ATTRIBUTE((unused)))
{
uint length;
uint l_bytes= (param_data && (param_data < field_length)) ?
return my_strntoll(charset(),blob,length,10,NULL,¬_used);
}
-String *Field_blob::val_str(String *val_buffer __attribute__((unused)),
+String *Field_blob::val_str(String *val_buffer MY_ATTRIBUTE((unused)),
String *val_ptr)
{
ASSERT_COLUMN_MARKED_FOR_READ;
}
-String *Field_enum::val_str(String *val_buffer __attribute__((unused)),
+String *Field_enum::val_str(String *val_buffer MY_ATTRIBUTE((unused)),
String *val_ptr)
{
uint tmp=(uint) Field_enum::val_int();
String *Field_set::val_str(String *val_buffer,
- String *val_ptr __attribute__((unused)))
+ String *val_ptr MY_ATTRIBUTE((unused)))
{
ulonglong tmp=(ulonglong) Field_enum::val_int();
uint bitnr=0;
String *Field_bit::val_str(String *val_buffer,
- String *val_ptr __attribute__((unused)))
+ String *val_ptr MY_ATTRIBUTE((unused)))
{
ASSERT_COLUMN_MARKED_FOR_READ;
char buff[sizeof(longlong)];
*/
bool
Field_bit::compatible_field_size(uint field_metadata,
- Relay_log_info * __attribute__((unused)),
+ Relay_log_info * MY_ATTRIBUTE((unused)),
uint16 mflags,
int *order_var)
{
uchar *
Field_bit::pack(uchar *to, const uchar *from, uint max_length,
- bool low_byte_first __attribute__((unused)))
+ bool low_byte_first MY_ATTRIBUTE((unused)))
{
DBUG_ASSERT(max_length > 0);
uint length;
*/
const uchar *
Field_bit::unpack(uchar *to, const uchar *from, uint param_data,
- bool low_byte_first __attribute__((unused)))
+ bool low_byte_first MY_ATTRIBUTE((unused)))
{
DBUG_ENTER("Field_bit::unpack");
DBUG_PRINT("enter", ("to: %p, from: %p, param_data: 0x%x",
#ifndef FIELD_INCLUDED
#define FIELD_INCLUDED
-/* Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2000, 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
return new Field_long(*this);
}
virtual uchar *pack(uchar* to, const uchar *from,
- uint max_length __attribute__((unused)),
+ uint max_length MY_ATTRIBUTE((unused)),
bool low_byte_first)
{
return pack_int32(to, from, low_byte_first);
}
virtual const uchar *unpack(uchar* to, const uchar *from,
- uint param_data __attribute__((unused)),
+ uint param_data MY_ATTRIBUTE((unused)),
bool low_byte_first)
{
return unpack_int32(to, from, low_byte_first);
return new Field_longlong(*this);
}
virtual uchar *pack(uchar* to, const uchar *from,
- uint max_length __attribute__((unused)),
+ uint max_length MY_ATTRIBUTE((unused)),
bool low_byte_first)
{
return pack_int64(to, from, low_byte_first);
}
virtual const uchar *unpack(uchar* to, const uchar *from,
- uint param_data __attribute__((unused)),
+ uint param_data MY_ATTRIBUTE((unused)),
bool low_byte_first)
{
return unpack_int64(to, from, low_byte_first);
return new Field_timestamp(*this);
}
uchar *pack(uchar *to, const uchar *from,
- uint max_length __attribute__((unused)), bool low_byte_first)
+ uint max_length MY_ATTRIBUTE((unused)), bool low_byte_first)
{
return pack_int32(to, from, low_byte_first);
}
const uchar *unpack(uchar* to, const uchar *from,
- uint param_data __attribute__((unused)),
+ uint param_data MY_ATTRIBUTE((unused)),
bool low_byte_first)
{
return unpack_int32(to, from, low_byte_first);
return new Field_datetime(*this);
}
uchar *pack(uchar* to, const uchar *from,
- uint max_length __attribute__((unused)), bool low_byte_first)
+ uint max_length MY_ATTRIBUTE((unused)), bool low_byte_first)
{
return pack_int64(to, from, low_byte_first);
}
const uchar *unpack(uchar* to, const uchar *from,
- uint param_data __attribute__((unused)),
+ uint param_data MY_ATTRIBUTE((unused)),
bool low_byte_first)
{
return unpack_int64(to, from, low_byte_first);
}
-static void do_skip(Copy_field *copy __attribute__((unused)))
+static void do_skip(Copy_field *copy MY_ATTRIBUTE((unused)))
{
}
/*
- Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
+ Copyright (c) 2000, 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
if (sort_field->need_strxnfrm)
{
char *from=(char*) res->ptr();
- uint tmp_length __attribute__((unused));
+ uint tmp_length MY_ATTRIBUTE((unused));
if ((uchar*) from == to)
{
DBUG_ASSERT(sort_field->length >= length);
/*
- Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
+ Copyright (c) 2011, 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
}
pthread_handler_t
-ndb_index_stat_thread_func(void *arg __attribute__((unused)))
+ndb_index_stat_thread_func(void *arg MY_ATTRIBUTE((unused)))
{
THD *thd; /* needs to be first for thread_stack */
struct timespec abstime;
-/* Copyright (c) 2004, 2015, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2004, 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
HASH ndbcluster_open_tables;
static uchar *ndbcluster_get_key(NDB_SHARE *share, size_t *length,
- my_bool not_used __attribute__((unused)));
+ my_bool not_used MY_ATTRIBUTE((unused)));
static void modify_shared_stats(NDB_SHARE *share,
Ndb_local_table_statistics *local_stat);
} THD_NDB_SHARE;
static
uchar *thd_ndb_share_get_key(THD_NDB_SHARE *thd_ndb_share, size_t *length,
- my_bool not_used __attribute__((unused)))
+ my_bool not_used MY_ATTRIBUTE((unused)))
{
*length= sizeof(thd_ndb_share->key);
return (uchar*) &thd_ndb_share->key;
extern "C" uchar* tables_get_key(const char *entry, size_t *length,
- my_bool not_used __attribute__((unused)))
+ my_bool not_used MY_ATTRIBUTE((unused)))
{
*length= strlen(entry);
return (uchar*) entry;
*/
static uchar *ndbcluster_get_key(NDB_SHARE *share, size_t *length,
- my_bool not_used __attribute__((unused)))
+ my_bool not_used MY_ATTRIBUTE((unused)))
{
*length= share->key_length;
return (uchar*) share->key;
/**
Utility thread main loop.
*/
-pthread_handler_t ndb_util_thread_func(void *arg __attribute__((unused)))
+pthread_handler_t ndb_util_thread_func(void *arg MY_ATTRIBUTE((unused)))
{
THD *thd; /* needs to be first for thread_stack */
struct timespec abstime;
/*
- Copyright (c) 2006, 2015, Oracle and/or its affiliates. All rights reserved.
+ Copyright (c) 2006, 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
static uchar *
ndb_schema_objects_get_key(NDB_SCHEMA_OBJECT *schema_object,
size_t *length,
- my_bool not_used __attribute__((unused)))
+ my_bool not_used MY_ATTRIBUTE((unused)))
{
*length= schema_object->key_length;
return (uchar*) schema_object->key;
/*
- Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved.
+ Copyright (c) 2005, 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
return HA_CAN_PARTITION;
}
-static uint alter_table_flags(uint flags __attribute__((unused)))
+static uint alter_table_flags(uint flags MY_ATTRIBUTE((unused)))
{
return (HA_PARTITION_FUNCTION_SUPPORTED |
HA_FAST_CHANGE_PARTITION);
ulonglong * const copied,
ulonglong * const deleted,
const uchar *pack_frm_data
- __attribute__((unused)),
+ MY_ATTRIBUTE((unused)),
size_t pack_frm_len
- __attribute__((unused)))
+ MY_ATTRIBUTE((unused)))
{
List_iterator<partition_element> part_it(m_part_info->partitions);
List_iterator <partition_element> t_it(m_part_info->temp_partitions);
*/
static uchar *get_part_name(PART_NAME_DEF *part, size_t *length,
- my_bool not_used __attribute__((unused)))
+ my_bool not_used MY_ATTRIBUTE((unused)))
{
*length= part->length;
return part->partition_name;
DEBUG_SYNC(thd, "ha_commit_trans_after_acquire_commit_lock");
}
- if (rw_trans &&
+ if (rw_trans && stmt_has_updated_trans_table(ha_info) &&
opt_readonly &&
!(thd->security_ctx->master_access & SUPER_ACL) &&
!thd->slave_thread)
ha_rows DsMrr_impl::dsmrr_info(uint keyno, uint n_ranges, uint rows,
uint *bufsz, uint *flags, Cost_estimate *cost)
{
- ha_rows res __attribute__((unused));
+ ha_rows res MY_ATTRIBUTE((unused));
uint def_flags= *flags;
uint def_bufsz= *bufsz;
if (unlikely(error= binlog_log_row(table, 0, buf, log_func)))
DBUG_RETURN(error); /* purecov: inspected */
+#ifdef WITH_WSREP
+ current_thd->wsrep_affected_rows++;
+ if (wsrep_max_ws_rows &&
+ current_thd->wsrep_exec_mode != REPL_RECV &&
+ current_thd->wsrep_affected_rows > wsrep_max_ws_rows)
+ {
+ trans_rollback_stmt(current_thd) || trans_rollback(current_thd);
+ my_message(ER_ERROR_DURING_COMMIT, "wsrep_max_ws_rows exceeded", MYF(0));
+ DBUG_RETURN(ER_ERROR_DURING_COMMIT);
+ }
+#endif /* WITH_WSREP */
DEBUG_SYNC_C("ha_write_row_end");
DBUG_RETURN(0);
return error;
if (unlikely(error= binlog_log_row(table, old_data, new_data, log_func)))
return error;
+#ifdef WITH_WSREP
+ current_thd->wsrep_affected_rows++;
+ if (wsrep_max_ws_rows &&
+ current_thd->wsrep_exec_mode != REPL_RECV &&
+ current_thd->wsrep_affected_rows > wsrep_max_ws_rows)
+ {
+ trans_rollback_stmt(current_thd) || trans_rollback(current_thd);
+ my_message(ER_ERROR_DURING_COMMIT, "wsrep_max_ws_rows exceeded", MYF(0));
+ return ER_ERROR_DURING_COMMIT;
+ }
+#endif /* WITH_WSREP */
return 0;
}
return error;
if (unlikely(error= binlog_log_row(table, buf, 0, log_func)))
return error;
+#ifdef WITH_WSREP
+ current_thd->wsrep_affected_rows++;
+ if (wsrep_max_ws_rows &&
+ current_thd->wsrep_exec_mode != REPL_RECV &&
+ current_thd->wsrep_affected_rows > wsrep_max_ws_rows)
+ {
+ trans_rollback_stmt(current_thd) || trans_rollback(current_thd);
+ my_message(ER_ERROR_DURING_COMMIT, "wsrep_max_ws_rows exceeded", MYF(0));
+ return ER_ERROR_DURING_COMMIT;
+ }
+#endif /* WITH_WSREP */
return 0;
}
*/
virtual int rnd_init(bool scan)= 0;
virtual int rnd_end() { return 0; }
- virtual int write_row(uchar *buf __attribute__((unused)))
+ virtual int write_row(uchar *buf MY_ATTRIBUTE((unused)))
{
return HA_ERR_WRONG_COMMAND;
}
the columns required for the error message are not read, the error
message will contain garbage.
*/
- virtual int update_row(const uchar *old_data __attribute__((unused)),
- uchar *new_data __attribute__((unused)))
+ virtual int update_row(const uchar *old_data MY_ATTRIBUTE((unused)),
+ uchar *new_data MY_ATTRIBUTE((unused)))
{
return HA_ERR_WRONG_COMMAND;
}
- virtual int delete_row(const uchar *buf __attribute__((unused)))
+ virtual int delete_row(const uchar *buf MY_ATTRIBUTE((unused)))
{
return HA_ERR_WRONG_COMMAND;
}
@return non-0 in case of failure, 0 in case of success.
When lock_type is F_UNLCK, the return value is ignored.
*/
- virtual int external_lock(THD *thd __attribute__((unused)),
- int lock_type __attribute__((unused)))
+ virtual int external_lock(THD *thd MY_ATTRIBUTE((unused)),
+ int lock_type MY_ATTRIBUTE((unused)))
{
return 0;
}
-/* Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2000, 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
{
const struct sockaddr *ip= (const sockaddr *) ip_storage;
int err_code;
- bool err_status __attribute__((unused));
+ bool err_status MY_ATTRIBUTE((unused));
Host_errors errors;
DBUG_ENTER("ip_to_hostname");
-/* Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2006, 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
#include "my_global.h" /* ulong */
void unireg_init(ulong options);
-void unireg_end(void) __attribute__((noreturn));
+void unireg_end(void) MY_ATTRIBUTE((noreturn));
#endif /* INIT_INCLUDED */
*/
String *Item::val_str_ascii(String *str)
{
- if (!(collation.collation->state & MY_CS_NONASCII))
- return val_str(str);
-
DBUG_ASSERT(str != &str_value);
uint errors;
if (!res)
return 0;
- if ((null_value= str->copy(res->ptr(), res->length(),
- collation.collation, &my_charset_latin1,
- &errors)))
- return 0;
-
+ if (!(res->charset()->state & MY_CS_NONASCII))
+ str= res;
+ else
+ {
+ if ((null_value= str->copy(res->ptr(), res->length(), collation.collation,
+ &my_charset_latin1, &errors)))
+ return 0;
+ }
+
return str;
}
}
-table_map Item_field::resolved_used_tables() const
+bool Item_field::used_tables_for_level(uchar *arg)
{
- if (field->table->const_table)
- return 0; // const item
- return field->table->map;
+ // Used by resolver only, so can never reach a "const" table.
+ DBUG_ASSERT(!field->orig_table->const_table);
+ TABLE_LIST *tr= field->orig_table->pos_in_table_list;
+ Used_tables *const ut= (Used_tables *)(arg);
+
+ /*
+ When the qualifying query for the field (table_ref->select_lex) is the
+ same level as the requested level, add the table's map. When the qualifying
+ query for the field is outer relative to the requested level, add an outer
+ reference.
+ */
+ if (ut->select == tr->select_lex)
+ ut->used_tables|= tr->table->map;
+ else if (ut->select->nest_level > tr->select_lex->nest_level)
+ ut->used_tables|= OUTER_REF_TABLE_BIT;
+ return false;
}
void Item_ident::fix_after_pullout(st_select_lex *parent_select,
*/
Item_subselect *subq_predicate= child_select->master_unit()->item;
- subq_predicate->used_tables_cache|= this->resolved_used_tables();
+ Used_tables ut(depended_from);
+ (void) walk(&Item::used_tables_for_level, true, (uchar *)(&ut));
+ subq_predicate->used_tables_cache|= ut.used_tables;
subq_predicate->const_item_cache&= this->const_item();
}
}
static void
default_set_param_func(Item_param *param,
- uchar **pos __attribute__((unused)),
- ulong len __attribute__((unused)))
+ uchar **pos MY_ATTRIBUTE((unused)),
+ ulong len MY_ATTRIBUTE((unused)))
{
param->set_null();
}
if (found_field == view_ref_found)
{
Item::Type type= found_item->type();
- prev_subselect_item->used_tables_cache|=
- found_item->used_tables();
+ Used_tables ut(last_select);
+ (void) found_item->walk(&Item::used_tables_for_level, true,
+ (uchar *)(&ut));
+ prev_subselect_item->used_tables_cache|= ut.used_tables;
dependent= ((type == Item::REF_ITEM || type == Item::FIELD_ITEM) ?
(Item_ident*) found_item :
0);
else
{
Item::Type ref_type= (*reference)->type();
- prev_subselect_item->used_tables_cache|=
- (*reference)->used_tables();
+ Used_tables ut(select);
+ (void) (*reference)->walk(&Item::used_tables_for_level, true,
+ (uchar *)(&ut));
+ prev_subselect_item->used_tables_cache|= ut.used_tables;
prev_subselect_item->const_item_cache&=
(*reference)->const_item();
mark_as_dependent(thd, last_checked_context->select_lex,
}
}
};
+/**
+ Class used as argument to Item::walk() together with used_tables_for_level()
+*/
+class Used_tables
+{
+public:
+ explicit Used_tables(st_select_lex *select) :
+ select(select), used_tables(0)
+ {}
+
+ st_select_lex *const select; ///< Level for which data is accumulated
+ table_map used_tables; ///< Accumulated used tables data
+};
/*************************************************************************/
/* bit map of tables used by item */
virtual table_map used_tables() const { return (table_map) 0L; }
- /**
- Return used table information for the level this item is resolved on.
- - For fields, this returns the table the item is resolved from.
- - For all other items, this behaves like used_tables().
-
- @note: Use this function with caution. External calls to this function
- should only be made for class objects derived from Item_ident.
- Item::resolved_used_tables is for internal use only, in order to
- process fields underlying a view column reference.
- */
- virtual table_map resolved_used_tables() const
- {
- // As this is the level this item was resolved on, it cannot be outer:
- DBUG_ASSERT(!(used_tables() & OUTER_REF_TABLE_BIT));
-
- return used_tables();
- }
/*
Return table map of tables that can't be NULL tables (tables that are
used in a context where if they would contain a NULL row generated
virtual bool reset_query_id_processor(uchar *query_id_arg) { return 0; }
virtual bool find_item_processor(uchar *arg) { return this == (void *) arg; }
virtual bool register_field_in_read_map(uchar *arg) { return 0; }
+/**
+ Return used table information for the specified query block (level).
+ For a field that is resolved from this query block, return the table number.
+ For a field that is resolved from a query block outer to the specified one,
+ return OUTER_REF_TABLE_BIT
+
+ @param[in,out] arg pointer to an instance of class Used_tables, which is
+ constructed with the query block as argument.
+ The used tables information is accumulated in the field
+ used_tables in this class.
+
+ @note This function is used to update used tables information after
+ merging a query block (a subquery) with its parent.
+ */
+ virtual bool used_tables_for_level(uchar *arg) { return false; }
virtual bool inform_item_in_cond_of_tab(uchar *join_tab_index) { return false; }
/**
Clean up after removing the item from the item tree.
type_conversion_status save_in_field(Field *field,bool no_conversions);
void save_org_in_field(Field *field);
table_map used_tables() const;
- virtual table_map resolved_used_tables() const;
enum Item_result result_type () const
{
return field->result_type();
bool add_field_to_set_processor(uchar * arg);
bool remove_column_from_bitmap(uchar * arg);
bool find_item_in_field_list_processor(uchar *arg);
+ bool used_tables_for_level(uchar *arg);
bool register_field_in_read_map(uchar *arg);
bool check_partition_func_processor(uchar *int_arg) {return FALSE;}
void cleanup();
(*ref)->update_used_tables();
}
- virtual table_map resolved_used_tables() const
- { return (*ref)->resolved_used_tables(); }
-
table_map not_null_tables() const
{
/*
void set_used_tables(table_map map) { used_table_map= map; }
- virtual table_map resolved_used_tables() const
- {
- return example ? example->resolved_used_tables() : used_table_map;
- }
-
virtual bool allocate(uint i) { return 0; }
virtual bool setup(Item *item)
{
-/* Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2000, 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
void Item_func::fix_after_pullout(st_select_lex *parent_select,
st_select_lex *removed_select)
{
+ if (const_item())
+ {
+ /*
+ Pulling out a const item changes nothing to it. Moreover, some items may
+ have decided that they're const by some other logic than the generic
+ one below, and we must preserve that decision.
+ */
+ return;
+ }
+
Item **arg,**arg_end;
used_tables_cache= get_initial_pseudo_tables();
};
uchar *ull_get_key(const User_level_lock *ull, size_t *length,
- my_bool not_used __attribute__((unused)))
+ my_bool not_used MY_ATTRIBUTE((unused)))
{
*length= ull->key_length;
return ull->key;
-/* Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2003, 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
/* String will not move */
str->copy(geom->get_class_info()->m_name.str,
geom->get_class_info()->m_name.length,
- default_charset());
+ &my_charset_latin1);
return str;
}
Gcalc_function func;
Gcalc_scan_iterator scan_it;
public:
- Item_func_distance(Item *a, Item *b): Item_real_func(a, b) {}
+ Item_func_distance(Item *a, Item *b): Item_real_func(a, b)
+ {
+ /*
+ Distance could be NULL, if either of the operands are
+ not geometries.
+ */
+ maybe_null= true;
+ }
+
+ void fix_length_and_dec()
+ {
+ Item_real_func::fix_length_and_dec();
+ maybe_null= true;
+ }
+
double val_real();
const char *func_name() const { return "st_distance"; }
};
-/* Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
rights reserved.
This program is free software; you can redistribute it and/or modify
*/
extern "C"
-int dump_leaf_key(void* key_arg, element_count count __attribute__((unused)),
+int dump_leaf_key(void* key_arg, element_count count MY_ATTRIBUTE((unused)),
void* item_arg)
{
Item_func_group_concat *item= (Item_func_group_concat *) item_arg;
#ifndef ITEM_SUM_INCLUDED
#define ITEM_SUM_INCLUDED
-/* Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved. reserved.
+/* Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved. reserved.
reserved.
This program is free software; you can redistribute it and/or modify
int group_concat_key_cmp_with_order(const void* arg, const void* key1,
const void* key2);
int dump_leaf_key(void* key_arg,
- element_count count __attribute__((unused)),
+ element_count count MY_ATTRIBUTE((unused)),
void* item_arg);
C_MODE_END
const void* key1,
const void* key2);
friend int dump_leaf_key(void* key_arg,
- element_count count __attribute__((unused)),
+ element_count count MY_ATTRIBUTE((unused)),
void* item_arg);
public:
/*
- Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
+ Copyright (c) 2000, 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
time zone. Defines time zone (local) used for whole SYSDATE function.
*/
bool Item_func_sysdate_local::get_date(MYSQL_TIME *now_time,
- uint fuzzy_date __attribute__((unused)))
+ uint fuzzy_date MY_ATTRIBUTE((unused)))
{
THD *thd= current_thd;
ulonglong tmp= my_micro_time();
bool Item_func_from_unixtime::get_date(MYSQL_TIME *ltime,
- uint fuzzy_date __attribute__((unused)))
+ uint fuzzy_date MY_ATTRIBUTE((unused)))
{
lldiv_t lld;
if (decimals)
bool Item_func_convert_tz::get_date(MYSQL_TIME *ltime,
- uint fuzzy_date __attribute__((unused)))
+ uint fuzzy_date MY_ATTRIBUTE((unused)))
{
my_time_t my_time_tmp;
String str;
-/* Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2000, 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
}
+bool is_valid_log_name(const char *name, size_t len)
+{
+ if (len > 3)
+ {
+ const char *tail= name + len - 4;
+ if (my_strcasecmp(system_charset_info, tail, ".ini") == 0 ||
+ my_strcasecmp(system_charset_info, tail, ".cnf") == 0)
+ {
+ return false;
+ }
+ }
+ return true;
+}
+
+
+/**
+ Get the real log file name, and possibly reopen file.
+
+ Use realpath() to get the path with symbolic links
+ expanded. Then, close the file, and reopen the real path using the
+ O_NOFOLLOW flag. This will reject following symbolic links.
+
+ @param file File descriptor.
+ @param log_file_key Key for P_S instrumentation.
+ @param open_flags Flags to use for opening the file.
+ @param opened_file_name Name of the open fd.
+
+ @retval file descriptor to open file with 'real_file_name', or '-1'
+ in case of errors.
+*/
+
+#ifndef _WIN32
+static File mysql_file_real_name_reopen(File file,
+#ifdef HAVE_PSI_INTERFACE
+ PSI_file_key log_file_key,
+#endif
+ int open_flags,
+ const char *opened_file_name)
+{
+ DBUG_ASSERT(file);
+ DBUG_ASSERT(opened_file_name);
+
+ /* Buffer for realpath must have capacity for PATH_MAX. */
+ char real_file_name[PATH_MAX];
+
+ /* Get realpath, validate, open realpath with O_NOFOLLOW. */
+ if (realpath(opened_file_name, real_file_name) == NULL)
+ {
+ (void) mysql_file_close(file, MYF(0));
+ return -1;
+ }
+
+ if (mysql_file_close(file, MYF(0)))
+ return -1;
+
+ if (strlen(real_file_name) > FN_REFLEN)
+ return -1;
+
+ if (!is_valid_log_name(real_file_name, strlen(real_file_name)))
+ {
+ sql_print_error("Invalid log file name after expanding symlinks: '%s'",
+ real_file_name);
+ return -1;
+ }
+
+ return mysql_file_open(log_file_key, real_file_name,
+ open_flags | O_NOFOLLOW,
+ MYF(MY_WME | ME_WAITTANG));
+}
+#endif // _WIN32
+
+
/*
Open a (new) log file.
MYF(MY_WME | ME_WAITTANG))) < 0)
goto err;
+#ifndef _WIN32
+ /* Reopen and validate path. */
+ if ((log_type_arg == LOG_UNKNOWN || log_type_arg == LOG_NORMAL) &&
+ (file= mysql_file_real_name_reopen(file,
+#ifdef HAVE_PSI_INTERFACE
+ log_file_key,
+#endif
+ open_flags,
+ log_file_name)) < 0)
+ goto err;
+#endif // _WIN32
+
if ((pos= mysql_file_tell(file, MYF(MY_WME))) == MY_FILEPOS_ERROR)
{
if (my_errno == ESPIPE)
-/* Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2005, 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
char *make_log_name(char *buff, const char *name, const char* log_ext);
+/**
+ Check given log name against certain blacklisted names/extensions.
+
+ @param name Log name to check
+ @param len Length of log name
+
+ @returns true if name is valid, false otherwise.
+*/
+bool is_valid_log_name(const char *name, size_t len);
+
extern LOGGER logger;
#endif /* LOG_H */
Ignore error code specified on command line.
*/
-inline int ignored_error_code(int err_code)
+int ignored_error_code(int err_code)
{
#ifdef HAVE_NDB_BINLOG
/*
void Log_event::print_header(IO_CACHE* file,
PRINT_EVENT_INFO* print_event_info,
- bool is_more __attribute__((unused)))
+ bool is_more MY_ATTRIBUTE((unused)))
{
char llbuff[22];
my_off_t hexdump_from= print_event_info->hexdump_from;
{
if (!rli->curr_group_seen_gtid && !rli->curr_group_seen_begin)
{
- ulong gaq_idx __attribute__((unused));
+ ulong gaq_idx MY_ATTRIBUTE((unused));
rli->mts_groups_assigned++;
rli->curr_group_isolated= FALSE;
if (cmd_can_generate_row_events)
{
cmd_must_go_to_trx_cache= cmd_must_go_to_trx_cache || using_trans;
- if (cmd_must_go_to_trx_cache || stmt_has_updated_trans_table(thd) ||
+ if (cmd_must_go_to_trx_cache ||
+ stmt_has_updated_trans_table(thd->transaction.stmt.ha_list) ||
thd->lex->is_mixed_stmt_unsafe(thd->in_multi_stmt_transaction_mode(),
thd->variables.binlog_direct_non_trans_update,
trans_has_updated_trans_table(thd),
int Rows_log_event::do_apply_event(Relay_log_info const *rli)
{
DBUG_ENTER("Rows_log_event::do_apply_event(Relay_log_info*)");
+ TABLE *table= NULL;
int error= 0;
if (opt_bin_log)
#endif
if (thd->is_slave_error || thd->is_fatal_error)
{
- /*
- Error reporting borrowed from Query_log_event with many excessive
- simplifications.
- We should not honour --slave-skip-errors at this point as we are
- having severe errors which should not be skiped.
- */
- rli->report(ERROR_LEVEL, actual_error,
- "Error executing row event: '%s'",
- (actual_error ? thd->get_stmt_da()->message() :
- "unexpected success or fatal error"));
- thd->is_slave_error= 1;
+ if (ignored_error_code(actual_error))
+ {
+ if (log_warnings > 1)
+ rli->report(WARNING_LEVEL, actual_error,
+ "Error executing row event: '%s'",
+ (actual_error ? thd->get_stmt_da()->message() :
+ "unexpected success or fatal error"));
+ thd->get_stmt_da()->clear_warning_info(thd->query_id);
+ clear_all_errors(thd, const_cast<Relay_log_info*>(rli));
+ error= 0;
+ goto end;
+ }
+ else
+ {
+ rli->report(ERROR_LEVEL, actual_error,
+ "Error executing row event: '%s'",
+ (actual_error ? thd->get_stmt_da()->message() :
+ "unexpected success or fatal error"));
+ thd->is_slave_error= 1;
+ const_cast<Relay_log_info*>(rli)->slave_close_thread_tables(thd);
+ DBUG_RETURN(actual_error);
+ }
}
- const_cast<Relay_log_info*>(rli)->slave_close_thread_tables(thd);
- DBUG_RETURN(actual_error);
}
-
/*
When the open and locking succeeded, we check all tables to
ensure that they still have the correct type.
-
- We can use a down cast here since we know that every table added
- to the tables_to_lock is a RPL_TABLE_LIST.
*/
{
NOTE: The base tables are added here are removed when
close_thread_tables is called.
*/
- RPL_TABLE_LIST *ptr= rli->tables_to_lock;
- for (uint i= 0 ; ptr && (i < rli->tables_to_lock_count);
- ptr= static_cast<RPL_TABLE_LIST*>(ptr->next_global), i++)
+ TABLE_LIST *table_list_ptr= rli->tables_to_lock;
+ for (uint i=0 ; table_list_ptr && (i < rli->tables_to_lock_count);
+ table_list_ptr= table_list_ptr->next_global, i++)
{
+ /*
+ Below if condition takes care of skipping base tables that
+ make up the MERGE table (which are added by open_tables()
+ call). They are added next to the merge table in the list.
+ For eg: If RPL_TABLE_LIST is t3->t1->t2 (where t1 and t2
+ are base tables for merge table 't3'), open_tables will modify
+ the list by adding t1 and t2 again immediately after t3 in the
+ list (*not at the end of the list*). New table_to_lock list will
+ look like t3->t1'->t2'->t1->t2 (where t1' and t2' are TABLE_LIST
+ objects added by open_tables() call). There is no flag(or logic) in
+ open_tables() that can skip adding these base tables to the list.
+ So the logic here should take care of skipping them.
+
+ tables_to_lock_count logic will take care of skipping base tables
+ that are added at the end of the list.
+ For eg: If RPL_TABLE_LIST is t1->t2->t3, open_tables will modify
+ the list into t1->t2->t3->t1'->t2'. t1' and t2' will be skipped
+ because tables_to_lock_count logic in this for loop.
+ */
+ if (table_list_ptr->parent_l)
+ continue;
+ /*
+ We can use a down cast here since we know that every table added
+ to the tables_to_lock is a RPL_TABLE_LIST (or child table which is
+ skipped above).
+ */
+ RPL_TABLE_LIST *ptr= static_cast<RPL_TABLE_LIST*>(table_list_ptr);
DBUG_ASSERT(ptr->m_tabledef_valid);
TABLE *conv_table;
if (!ptr->m_tabledef.compatible_with(thd, const_cast<Relay_log_info*>(rli),
DBUG_PRINT("debug", ("Table: %s.%s is not compatible with master",
ptr->table->s->db.str,
ptr->table->s->table_name.str));
- /*
- We should not honour --slave-skip-errors at this point as we are
- having severe errors which should not be skiped.
- */
- thd->is_slave_error= 1;
- const_cast<Relay_log_info*>(rli)->slave_close_thread_tables(thd);
- DBUG_RETURN(ERR_BAD_TABLE_DEF);
+ if (thd->is_slave_error)
+ {
+ const_cast<Relay_log_info*>(rli)->slave_close_thread_tables(thd);
+ DBUG_RETURN(ERR_BAD_TABLE_DEF);
+ }
+ else
+ {
+ thd->get_stmt_da()->clear_warning_info(thd->query_id);
+ clear_all_errors(thd, const_cast<Relay_log_info*>(rli));
+ error= 0;
+ goto end;
+ }
}
DBUG_PRINT("debug", ("Table: %s.%s is compatible with master"
" - conv_table: %p",
*/
TABLE_LIST *ptr= rli->tables_to_lock;
for (uint i=0 ; ptr && (i < rli->tables_to_lock_count); ptr= ptr->next_global, i++)
+ {
+ /*
+ Please see comment in above 'for' loop to know the reason
+ for this if condition
+ */
+ if (ptr->parent_l)
+ continue;
const_cast<Relay_log_info*>(rli)->m_table_map.set_table(ptr->table_id, ptr->table);
+ }
#ifdef HAVE_QUERY_CACHE
#ifdef WITH_WSREP
#endif
}
- TABLE*
- table=
+ table=
m_table= const_cast<Relay_log_info*>(rli)->m_table_map.get_table(m_table_id);
DBUG_PRINT("debug", ("m_table: 0x%lx, m_table_id: %llu", (ulong) m_table,
thd->is_slave_error= 1;
DBUG_RETURN(error);
}
-
+end:
if (get_flags(STMT_END_F))
{
#endif /* WITH_WSREP && HAVE_QUERY_CACHE */
if((error= rows_event_stmt_cleanup(rli, thd)))
- slave_rows_error_report(ERROR_LEVEL,
- thd->is_error() ? 0 : error,
- rli, thd, table,
- get_type_str(),
- const_cast<Relay_log_info*>(rli)->get_rpl_log_name(),
- (ulong) log_pos);
+ {
+ if (table)
+ slave_rows_error_report(ERROR_LEVEL,
+ thd->is_error() ? 0 : error,
+ rli, thd, table,
+ get_type_str(),
+ const_cast<Relay_log_info*>(rli)->get_rpl_log_name(),
+ (ulong) log_pos);
+ else
+ {
+ rli->report(ERROR_LEVEL,
+ thd->is_error() ? thd->get_stmt_da()->sql_errno() : error,
+ "Error in cleaning up after an event of type:%s; %s; the group"
+ " log file/position: %s %lu", get_type_str(),
+ thd->is_error() ? thd->get_stmt_da()->message() : "unexpected error",
+ const_cast<Relay_log_info*>(rli)->get_rpl_log_name(),
+ (ulong) log_pos);
+ }
+ }
/* We are at end of the statement (STMT_END_F flag), lets clean
the memory which was used from thd's mem_root now.
This needs to be done only if we are here in SQL thread context.
static int rows_event_stmt_cleanup(Relay_log_info const *rli, THD * thd)
{
+ DBUG_EXECUTE_IF("simulate_rows_event_cleanup_failure",
+ {
+ my_error(ER_ERROR_DURING_COMMIT, MYF(0), 1);
+ return (1);
+ });
int error;
{
/*
thd->reset_current_stmt_binlog_format_row();
const_cast<Relay_log_info*>(rli)->cleanup_context(thd, 0);
+
+ /*
+ Clean sql_command value
+ */
+ thd->lex->sql_command= SQLCOM_END;
+
}
return error;
}
if (get_flags(STMT_END_F))
status_var_increment(thd->status_var.com_stat[SQLCOM_INSERT]);
+ /*
+ Let storage engines treat this event as an INSERT command.
+
+ Set 'sql_command' as SQLCOM_INSERT after the tables are locked.
+ When locking the tables, it should be SQLCOM_END.
+ THD::decide_binlog_format which is called from "lock tables"
+ assumes that row_events will have 'sql_command' as SQLCOM_END.
+ */
+ thd->lex->sql_command= SQLCOM_INSERT;
+
/**
todo: to introduce a property for the event (handler?) which forces
applying the event in the replace (idempotent) fashion.
*/
if (get_flags(STMT_END_F))
status_var_increment(thd->status_var.com_stat[SQLCOM_DELETE]);
+
+ /*
+ Let storage engines treat this event as a DELETE command.
+
+ Set 'sql_command' as SQLCOM_UPDATE after the tables are locked.
+ When locking the tables, it should be SQLCOM_END.
+ THD::decide_binlog_format which is called from "lock tables"
+ assumes that row_events will have 'sql_command' as SQLCOM_END.
+ */
+ thd->lex->sql_command= SQLCOM_DELETE;
+
error= row_operations_scan_and_key_setup();
DBUG_RETURN(error);
*/
if (get_flags(STMT_END_F))
status_var_increment(thd->status_var.com_stat[SQLCOM_UPDATE]);
+
+ /*
+ Let storage engines treat this event as an UPDATE command.
+
+ Set 'sql_command' as SQLCOM_UPDATE after the tables are locked.
+ When locking the tables, it should be SQLCOM_END.
+ THD::decide_binlog_format which is called from "lock tables"
+ assumes that row_events will have 'sql_command' as SQLCOM_END.
+ */
+ thd->lex->sql_command= SQLCOM_UPDATE;
+
error= row_operations_scan_and_key_setup();
DBUG_RETURN(error);
-/* Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2000, 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
class String;
typedef ulonglong sql_mode_t;
typedef struct st_db_worker_hash_entry db_worker_hash_entry;
-
+#if defined(HAVE_REPLICATION) && !defined(MYSQL_CLIENT)
+int ignored_error_code(int err_code);
+#endif
#define PREFIX_SQL_LOAD "SQL_LOAD-"
/**
}
virtual bool write_data_header(IO_CACHE* file)
{ return 0; }
- virtual bool write_data_body(IO_CACHE* file __attribute__((unused)))
+ virtual bool write_data_body(IO_CACHE* file MY_ATTRIBUTE((unused)))
{ return 0; }
inline time_t get_time()
{
static bool binlog_row_logging_function(THD *thd, TABLE *table,
bool is_transactional,
const uchar *before_record
- __attribute__((unused)),
+ MY_ATTRIBUTE((unused)),
const uchar *after_record)
{
return thd->binlog_write_row(table, is_transactional,
bool is_transactional,
const uchar *before_record,
const uchar *after_record
- __attribute__((unused)))
+ MY_ATTRIBUTE((unused)))
{
return thd->binlog_delete_row(table, is_transactional,
before_record, NULL);
-/* Copyright (c) 2007, 2015, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2007, 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
/*
When the open and locking succeeded, we check all tables to
ensure that they still have the correct type.
-
- We can use a down cast here since we know that every table added
- to the tables_to_lock is a RPL_TABLE_LIST.
*/
{
- RPL_TABLE_LIST *ptr= rli->tables_to_lock;
- for (uint i= 0 ; ptr&& (i< rli->tables_to_lock_count);
- ptr= static_cast<RPL_TABLE_LIST*>(ptr->next_global), i++)
+ TABLE_LIST *table_list_ptr= rli->tables_to_lock;
+ for (uint i=0 ; table_list_ptr&& (i< rli->tables_to_lock_count);
+ table_list_ptr= table_list_ptr->next_global, i++)
{
+ /*
+ Please see comment in log_event.cc-Rows_log_event::do_apply_event()
+ function for the explanation of the below if condition
+ */
+ if (table_list_ptr->parent_l)
+ continue;
+ /*
+ We can use a down cast here since we know that every table added
+ to the tables_to_lock is a RPL_TABLE_LIST(or child table which is
+ skipped above).
+ */
+ RPL_TABLE_LIST *ptr=static_cast<RPL_TABLE_LIST*>(table_list_ptr);
DBUG_ASSERT(ptr->m_tabledef_valid);
TABLE *conv_table;
if (!ptr->m_tabledef.compatible_with(thd, const_cast<Relay_log_info*>(rli),
*/
TABLE_LIST *ptr= rli->tables_to_lock;
for (uint i=0; ptr && (i < rli->tables_to_lock_count); ptr= ptr->next_global, i++)
+ {
+ /*
+ Please see comment in log_event.cc-Rows_log_event::do_apply_event()
+ function for the explanation of the below if condition
+ */
+ if (ptr->parent_l)
+ continue;
const_cast<Relay_log_info*>(rli)->m_table_map.set_table(ptr->table_id, ptr->table);
+ }
#ifdef HAVE_QUERY_CACHE
query_cache.invalidate_locked_for_write(rli->tables_to_lock);
#endif
/*
When the open and locking succeeded, we check all tables to
ensure that they still have the correct type.
-
- We can use a down cast here since we know that every table added
- to the tables_to_lock is a RPL_TABLE_LIST.
*/
{
- RPL_TABLE_LIST *ptr= rli->tables_to_lock;
- for (uint i= 0 ; ptr&& (i< rli->tables_to_lock_count);
- ptr= static_cast<RPL_TABLE_LIST*>(ptr->next_global), i++)
+ TABLE_LIST *table_list_ptr= rli->tables_to_lock;
+ for (uint i=0; table_list_ptr&& (i< rli->tables_to_lock_count);
+ table_list_ptr= static_cast<RPL_TABLE_LIST*>(table_list_ptr->next_global), i++)
{
+ /*
+ Please see comment in log_event.cc-Rows_log_event::do_apply_event()
+ function for the explanation of the below if condition
+ */
+ if (table_list_ptr->parent_l)
+ continue;
+ /*
+ We can use a down cast here since we know that every table added
+ to the tables_to_lock is a RPL_TABLE_LIST (or child table which is
+ skipped above).
+ */
+ RPL_TABLE_LIST *ptr=static_cast<RPL_TABLE_LIST*>(table_list_ptr);
TABLE *conv_table;
if (ptr->m_tabledef.compatible_with(thd, const_cast<Relay_log_info*>(rli),
ptr->table, &conv_table))
-/* Copyright (c) 2007, 2013, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2007, 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
static bool binlog_row_logging_function(THD *thd, TABLE *table,
bool is_transactional,
const uchar *before_record
- __attribute__((unused)),
+ MY_ATTRIBUTE((unused)),
const uchar *after_record)
{
return thd->binlog_write_row(table, is_transactional,
bool is_transactional,
const uchar *before_record,
const uchar *after_record
- __attribute__((unused)))
+ MY_ATTRIBUTE((unused)))
{
return thd->binlog_delete_row(table, is_transactional,
before_record, NULL);
-/* Copyright (c) 2007, 2015, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2007, 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
{
int i;
int count;
- PSI_stage_info *info __attribute__((unused));
+ PSI_stage_info *info MY_ATTRIBUTE((unused));
count= array_elements(MDL_key::m_namespace_to_wait_state_name);
for (i= 0; i<count; i++)
{
static uchar *
mdl_locks_key(const uchar *record, size_t *length,
- my_bool not_used __attribute__((unused)))
+ my_bool not_used MY_ATTRIBUTE((unused)))
{
MDL_lock *lock=(MDL_lock*) record;
*length= lock->key.length();
-/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2000, 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
int _my_b_net_read(register IO_CACHE *info, uchar *Buffer,
- size_t Count __attribute__((unused)))
+ size_t Count MY_ATTRIBUTE((unused)))
{
ulong read_length;
NET *net= &(current_thd)->net;
-/* Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights
+/* Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights
reserved.
This program is free software; you can redistribute it and/or modify
static void clean_up_mutexes(void);
static void wait_for_signal_thread_to_end(void);
static void create_pid_file();
-static void mysqld_exit(int exit_code) __attribute__((noreturn));
+static void mysqld_exit(int exit_code) MY_ATTRIBUTE((noreturn));
#endif
static void delete_pid_file(myf flags);
static void end_ssl();
#if defined(USE_ONE_SIGNAL_HAND)
-pthread_handler_t kill_server_thread(void *arg __attribute__((unused)))
+pthread_handler_t kill_server_thread(void *arg MY_ATTRIBUTE((unused)))
{
my_thread_init(); // Initialize new thread
kill_server(0);
/** Called when a thread is aborted. */
/* ARGSUSED */
-extern "C" sig_handler end_thread_signal(int sig __attribute__((unused)))
+extern "C" sig_handler end_thread_signal(int sig MY_ATTRIBUTE((unused)))
{
THD *thd=current_thd;
my_safe_printf_stderr("end_thread_signal %p", thd);
@todo
One should have to fix that thr_alarm know about this thread too.
*/
-extern "C" sig_handler abort_thread(int sig __attribute__((unused)))
+extern "C" sig_handler abort_thread(int sig MY_ATTRIBUTE((unused)))
{
THD *thd=current_thd;
DBUG_ENTER("abort_thread");
/** This threads handles all signals and alarms. */
/* ARGSUSED */
-pthread_handler_t signal_hand(void *arg __attribute__((unused)))
+pthread_handler_t signal_hand(void *arg MY_ATTRIBUTE((unused)))
{
sigset_t set;
int sig;
if (!opt_slow_logname || !*opt_slow_logname)
opt_slow_logname= make_default_log_name(slow_logname_path, "-slow.log");
+ if (opt_logname &&
+ !is_valid_log_name(opt_logname, strlen(opt_logname)))
+ {
+ sql_print_error("Invalid value for --general_log_file: %s",
+ opt_logname);
+ return 1;
+ }
+
+ if (opt_slow_logname &&
+ !is_valid_log_name(opt_slow_logname, strlen(opt_slow_logname)))
+ {
+ sql_print_error("Invalid value for --slow_query_log_file: %s",
+ opt_slow_logname);
+ return 1;
+ }
+
#if defined(ENABLED_DEBUG_SYNC)
/* Initialize the debug sync facility. See debug_sync.cc. */
if (debug_sync_init())
/* load_defaults require argv[0] is not null */
char **argv= &name;
int argc= 1;
- if (!check_file_permissions(fname))
+ if (!check_file_permissions(fname, false))
{
/*
Found a world writable file hence removing it as it is dangerous to write
sql_print_error("The server_uuid stored in auto.cnf file is not a valid UUID.");
goto err;
}
+ /*
+ Uuid::is_valid() cannot do strict check on the length as it will be
+ called by GTID::is_valid() as well (GTID = UUID:seq_no). We should
+ explicitly add the *length check* here in this function.
+
+ If UUID length is less than '36' (UUID_LENGTH), that error case would have
+ got caught in above is_valid check. The below check is to make sure that
+ length is not greater than UUID_LENGTH i.e., there are no extra characters
+ (Garbage) at the end of the valid UUID.
+ */
+ if (strlen(uuid) > UUID_LENGTH)
+ {
+ sql_print_error("Garbage characters found at the end of the server_uuid "
+ "value in auto.cnf file. It should be of length '%d' "
+ "(UUID_LENGTH). Clear it and restart the server. ",
+ UUID_LENGTH);
+ goto err;
+ }
strcpy(server_uuid, uuid);
}
else
proc_info_hook= set_thd_stage_info;
-#ifdef WITH_PERFSCHEMA_STORAGE_ENGINE
/*
- Parsing the performance schema command line option may have reported
+ Parsing the performance schema command line option and
+ adjusting the values for options such as "open_files_limit",
+ "max_connections", and "table_cache_size" may have reported
warnings/information messages.
Now that the logger is finally available, and redirected
to the proper file when the --log--error option is used,
*/
buffered_logs.print();
buffered_logs.cleanup();
-#endif /* WITH_PERFSCHEMA_STORAGE_ENGINE */
/*
Now that the logger is available, redirect character set
if (WSREP_ON)
tc_log= &tc_log_dummy;
else
-#endif /* WITH_WSREP */
+ /*
+ * wsrep hton grows total_ha_2pc count to 2, even in native mysql mode.
+ * Have to force using tc_log_dummy here, as tc_log_mmap segfaults
+ */
+ tc_log= &tc_log_dummy;
+#else
tc_log= &tc_log_mmap;
+#endif /* WITH_WSREP */
}
else
tc_log= &tc_log_dummy;
(void) strmake(mysql_home, tmpenv, sizeof(mysql_home)-1);
#endif
#ifdef WITH_WSREP
- if (WSREP_ON && wsrep_init_vars())
+ if (wsrep_init_vars())
return 1;
#endif
return 0;
my_bool
mysqld_get_one_option(int optid,
- const struct my_option *opt __attribute__((unused)),
+ const struct my_option *opt MY_ATTRIBUTE((unused)),
char *argument)
{
switch(optid) {
break;
case 'b':
strmake(mysql_home,argument,sizeof(mysql_home)-1);
+ mysql_home_ptr= mysql_home;
break;
case 'C':
if (default_collation_name == compiled_default_collation_name)
it evaluates to. Should be used for error messages, so that they
don't reveal values.
*/
- QT_NO_DATA_EXPANSION= (1 << 9),
+ QT_NO_DATA_EXPANSION= (1 << 9)
};
/* query_id */
extern query_id_t global_query_id;
extern my_atomic_rwlock_t global_query_id_lock;
-void unireg_end(void) __attribute__((noreturn));
+void unireg_end(void) MY_ATTRIBUTE((noreturn));
/* increment query_id and return it. */
-inline __attribute__((warn_unused_result)) query_id_t next_query_id()
+inline MY_ATTRIBUTE((warn_unused_result)) query_id_t next_query_id()
{
query_id_t id;
my_atomic_rwlock_wrlock(&global_query_id_lock);
TODO: Replace this with an inline function.
*/
#ifndef EMBEDDED_LIBRARY
-extern "C" void unireg_abort(int exit_code) __attribute__((noreturn));
+extern "C" void unireg_abort(int exit_code) MY_ATTRIBUTE((noreturn));
#else
extern "C" void unireg_clear(int exit_code);
#define unireg_abort(exit_code) do { unireg_clear(exit_code); DBUG_RETURN(exit_code); } while(0)
-/* Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2000, 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
*/
void net_clear(NET *net,
- my_bool check_buffer __attribute__((unused)))
+ my_bool check_buffer MY_ATTRIBUTE((unused)))
{
DBUG_ENTER("net_clear");
*/
static my_bool
-net_should_retry(NET *net, uint *retry_count __attribute__((unused)))
+net_should_retry(NET *net, uint *retry_count MY_ATTRIBUTE((unused)))
{
my_bool retry;
-#if !defined(MYSQL_SERVER) && defined(THREAD_SAFE_CLIENT)
+#ifndef MYSQL_SERVER
/*
- In the thread safe client library, interrupted I/O operations
- are always retried. Otherwise, its either a timeout or a
- unrecoverable error.
+ In the client library, interrupted I/O operations are always retried.
+ Otherwise, it's either a timeout or an unrecoverable error.
*/
retry= vio_should_retry(net->vio);
#else
/*
- In the non-thread safe client library, or in the server,
- interrupted I/O operations are retried up to a limit.
+ In the server, interrupted I/O operations are retried up to a limit.
In this scenario, pthread_kill can be used to wake up
(interrupt) threads waiting for I/O.
*/
DBUG_VOID_RETURN;
}
+#if defined(EXPORT_SYMVER16)
+#ifndef EMBEDDED_LIBRARY
+C_MODE_START
+
+// Hack to provide Fedora symbols
+
+my_bool mysql_net_realloc(NET *net, size_t length)
+{
+ return net_realloc(net, length);
+}
+
+C_MODE_END
+#endif
+#endif // EXPORT_SYMVER16
}
if (quick_prefix_select && quick_prefix_select->reset())
DBUG_RETURN(1);
+
result= head->file->ha_index_last(record);
- if (result == HA_ERR_END_OF_FILE)
- DBUG_RETURN(0);
+ if (result != 0)
+ {
+ if (result == HA_ERR_END_OF_FILE)
+ DBUG_RETURN(0);
+ else
+ DBUG_RETURN(result);
+ }
+
/* Save the prefix of the last group. */
key_copy(last_prefix, record, index_info, group_prefix_len);
-/* Copyright (c) 2006, 2015, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2006, 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
*/
static const char *get_part_name_from_elem(const char *name, size_t *length,
- my_bool not_used __attribute__((unused)))
+ my_bool not_used MY_ATTRIBUTE((unused)))
{
*length= strlen(name);
return name;
/*
- Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
+ Copyright (c) 2000, 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
octet2hex(to, (const char*) hash_stage2, SHA1_HASH_SIZE);
}
+#if defined(EXPORT_SYMVER16)
+#ifndef EMBEDDED_LIBRARY
+
+// Hack to provide both libmysqlclient_16 and libmysqlclient_18 symbol versions
+
+#define SYM_16(_exportedsym) __asm__(".symver symver16_" #_exportedsym "," #_exportedsym "@libmysqlclient_16")
+
+void symver16_my_make_scrambled_password(char *to, const char *password, size_t pass_len)
+{
+ my_make_scrambled_password(to, password, pass_len);
+}
+SYM_16(my_make_scrambled_password);
+
+#endif
+#endif /* EXPORT_SYMVER16 */
-/* Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2000, 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
extern "C" void free_table_ent(void* a);
uchar *get_table_key(const uchar* a, size_t *len,
- my_bool __attribute__((unused)))
+ my_bool MY_ATTRIBUTE((unused)))
{
TABLE_RULE_ENT *e= (TABLE_RULE_ENT *) a;
-/* Copyright (c) 2010, 2012, Oracle and/or its affiliates. All rights reserved.
+/* 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
{
}
-int Rpl_info_dummy::do_init_info(uint instance __attribute__((unused)))
+int Rpl_info_dummy::do_init_info(uint instance MY_ATTRIBUTE((unused)))
{
return 0;
}
return REPOSITORY_DOES_NOT_EXIST;
}
-enum_return_check Rpl_info_dummy::do_check_info(uint instance __attribute__((unused)))
+enum_return_check Rpl_info_dummy::do_check_info(uint instance MY_ATTRIBUTE((unused)))
{
DBUG_ASSERT(!abort);
return REPOSITORY_DOES_NOT_EXIST;
}
-int Rpl_info_dummy::do_flush_info(const bool force __attribute__((unused)))
+int Rpl_info_dummy::do_flush_info(const bool force MY_ATTRIBUTE((unused)))
{
DBUG_ASSERT(!abort);
return 0;
return INFO_REPOSITORY_DUMMY;
}
-bool Rpl_info_dummy::do_set_info(const int pos __attribute__((unused)),
- const char *value __attribute__((unused)))
+bool Rpl_info_dummy::do_set_info(const int pos MY_ATTRIBUTE((unused)),
+ const char *value MY_ATTRIBUTE((unused)))
{
DBUG_ASSERT(!abort);
return FALSE;
}
-bool Rpl_info_dummy::do_set_info(const int pos __attribute__((unused)),
- const uchar *value __attribute__((unused)),
- const size_t size __attribute__((unused)))
+bool Rpl_info_dummy::do_set_info(const int pos MY_ATTRIBUTE((unused)),
+ const uchar *value MY_ATTRIBUTE((unused)),
+ const size_t size MY_ATTRIBUTE((unused)))
{
DBUG_ASSERT(!abort);
return FALSE;
}
-bool Rpl_info_dummy::do_set_info(const int pos __attribute__((unused)),
- const ulong value __attribute__((unused)))
+bool Rpl_info_dummy::do_set_info(const int pos MY_ATTRIBUTE((unused)),
+ const ulong value MY_ATTRIBUTE((unused)))
{
DBUG_ASSERT(!abort);
return FALSE;
}
-bool Rpl_info_dummy::do_set_info(const int pos __attribute__((unused)),
- const int value __attribute__((unused)))
+bool Rpl_info_dummy::do_set_info(const int pos MY_ATTRIBUTE((unused)),
+ const int value MY_ATTRIBUTE((unused)))
{
DBUG_ASSERT(!abort);
return FALSE;
}
-bool Rpl_info_dummy::do_set_info(const int pos __attribute__((unused)),
- const float value __attribute__((unused)))
+bool Rpl_info_dummy::do_set_info(const int pos MY_ATTRIBUTE((unused)),
+ const float value MY_ATTRIBUTE((unused)))
{
DBUG_ASSERT(!abort);
return FALSE;
}
-bool Rpl_info_dummy::do_set_info(const int pos __attribute__((unused)),
- const Dynamic_ids *value __attribute__((unused)))
+bool Rpl_info_dummy::do_set_info(const int pos MY_ATTRIBUTE((unused)),
+ const Dynamic_ids *value MY_ATTRIBUTE((unused)))
{
DBUG_ASSERT(!abort);
return FALSE;
}
-bool Rpl_info_dummy::do_get_info(const int pos __attribute__((unused)),
- char *value __attribute__((unused)),
- const size_t size __attribute__((unused)),
- const char *default_value __attribute__((unused)))
+bool Rpl_info_dummy::do_get_info(const int pos MY_ATTRIBUTE((unused)),
+ char *value MY_ATTRIBUTE((unused)),
+ const size_t size MY_ATTRIBUTE((unused)),
+ const char *default_value MY_ATTRIBUTE((unused)))
{
DBUG_ASSERT(!abort);
return FALSE;
}
-bool Rpl_info_dummy::do_get_info(const int pos __attribute__((unused)),
- uchar *value __attribute__((unused)),
- const size_t size __attribute__((unused)),
- const uchar *default_value __attribute__((unused)))
+bool Rpl_info_dummy::do_get_info(const int pos MY_ATTRIBUTE((unused)),
+ uchar *value MY_ATTRIBUTE((unused)),
+ const size_t size MY_ATTRIBUTE((unused)),
+ const uchar *default_value MY_ATTRIBUTE((unused)))
{
DBUG_ASSERT(!abort);
return FALSE;
}
-bool Rpl_info_dummy::do_get_info(const int pos __attribute__((unused)),
- ulong *value __attribute__((unused)),
- const ulong default_value __attribute__((unused)))
+bool Rpl_info_dummy::do_get_info(const int pos MY_ATTRIBUTE((unused)),
+ ulong *value MY_ATTRIBUTE((unused)),
+ const ulong default_value MY_ATTRIBUTE((unused)))
{
DBUG_ASSERT(!abort);
return FALSE;
}
-bool Rpl_info_dummy::do_get_info(const int pos __attribute__((unused)),
- int *value __attribute__((unused)),
- const int default_value __attribute__((unused)))
+bool Rpl_info_dummy::do_get_info(const int pos MY_ATTRIBUTE((unused)),
+ int *value MY_ATTRIBUTE((unused)),
+ const int default_value MY_ATTRIBUTE((unused)))
{
DBUG_ASSERT(!abort);
return FALSE;
}
-bool Rpl_info_dummy::do_get_info(const int pos __attribute__((unused)),
- float *value __attribute__((unused)),
- const float default_value __attribute__((unused)))
+bool Rpl_info_dummy::do_get_info(const int pos MY_ATTRIBUTE((unused)),
+ float *value MY_ATTRIBUTE((unused)),
+ const float default_value MY_ATTRIBUTE((unused)))
{
DBUG_ASSERT(!abort);
return FALSE;
}
-bool Rpl_info_dummy::do_get_info(const int pos __attribute__((unused)),
- Dynamic_ids *value __attribute__((unused)),
- const Dynamic_ids *default_value __attribute__((unused)))
+bool Rpl_info_dummy::do_get_info(const int pos MY_ATTRIBUTE((unused)),
+ Dynamic_ids *value MY_ATTRIBUTE((unused)),
+ const Dynamic_ids *default_value MY_ATTRIBUTE((unused)))
{
DBUG_ASSERT(!abort);
-/* Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved.
+/* 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
}
bool Rpl_info_file::do_get_info(const int pos, Dynamic_ids *value,
- const Dynamic_ids *default_value __attribute__((unused)))
+ const Dynamic_ids *default_value MY_ATTRIBUTE((unused)))
{
/*
Static buffer to use most of the times. However, if it is not big
-/* Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
+/* 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
}
bool Rpl_info_table::do_get_info(const int pos, uchar *value, const size_t size,
- const uchar *default_value __attribute__((unused)))
+ const uchar *default_value MY_ATTRIBUTE((unused)))
{
if (field_values->value[pos].length() == size)
return (!memcpy((char *) value, (char *)
}
bool Rpl_info_table::do_get_info(const int pos, Dynamic_ids *value,
- const Dynamic_ids *default_value __attribute__((unused)))
+ const Dynamic_ids *default_value MY_ATTRIBUTE((unused)))
{
if (value->unpack_dynamic_ids(field_values->value[pos].c_ptr_safe()))
return TRUE;
-/* Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved.
+/* 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
extern "C" uint32
*slave_list_key(SLAVE_INFO* si, size_t *len,
- my_bool not_used __attribute__((unused)))
+ my_bool not_used MY_ATTRIBUTE((unused)))
{
*len = 4;
return &si->server_id;
{
DBUG_ENTER("com_binlog_dump");
ulong pos;
- String slave_uuid;
ushort flags= 0;
const uchar* packet_position= (uchar *) packet;
uint packet_bytes_todo= packet_length;
DBUG_PRINT("info", ("pos=%lu flags=%d server_id=%d", pos, flags, thd->server_id));
- get_slave_uuid(thd, &slave_uuid);
- kill_zombie_dump_threads(&slave_uuid);
+ kill_zombie_dump_threads(thd);
general_log_print(thd, thd->get_command(), "Log: '%s' Pos: %ld",
packet + 10, (long) pos);
Before going GA, we need to make this protocol extensible without
breaking compatitibilty. /Alfranio.
*/
- String slave_uuid;
ushort flags= 0;
uint32 data_size= 0;
uint64 pos= 0;
DBUG_PRINT("info", ("Slave %d requested to read %s at position %llu gtid set "
"'%s'.", thd->server_id, name, pos, gtid_string));
- get_slave_uuid(thd, &slave_uuid);
- kill_zombie_dump_threads(&slave_uuid);
+ kill_zombie_dump_threads(thd);
general_log_print(thd, thd->get_command(), "Log: '%s' Pos: %llu GTIDs: '%s'",
name, pos, gtid_string);
my_free(gtid_string);
Diagnostics_area temp_da;
Diagnostics_area *saved_da= thd->get_stmt_da();
thd->set_stmt_da(&temp_da);
- bool was_killed_by_duplicate_slave_uuid= false;
+ bool was_killed_by_duplicate_slave_id= false;
DBUG_ENTER("mysql_binlog_send");
DBUG_PRINT("enter",("log_ident: '%s' pos: %ld", log_ident, (long) pos));
reconnect anymore.
*/
mysql_mutex_lock(&thd->LOCK_thd_data);
- was_killed_by_duplicate_slave_uuid= thd->duplicate_slave_uuid;
+ was_killed_by_duplicate_slave_id= thd->duplicate_slave_id;
mysql_mutex_unlock(&thd->LOCK_thd_data);
- if (was_killed_by_duplicate_slave_uuid)
+ if (was_killed_by_duplicate_slave_id)
{
- errmsg= "A slave with the same server_uuid as this slave "
+ errmsg= "A slave with the same server_uuid/server_id as this slave "
"has connected to the master";
my_errno= ER_MASTER_FATAL_ERROR_READING_BINLOG;
goto err;
/*
Kill all Binlog_dump threads which previously talked to the same slave
- ("same" means with the same server id). Indeed, if the slave stops, if the
+ ("same" means with the same UUID(for slave versions >= 5.6) or same server id
+ (for slave versions < 5.6). Indeed, if the slave stops, if the
Binlog_dump thread is waiting (mysql_cond_wait) for binlog update, then it
will keep existing until a query is written to the binlog. If the master is
idle, then this could last long, and if the slave reconnects, we could have 2
Binlog_dump threads in SHOW PROCESSLIST, until a query is written to the
binlog. To avoid this, when the slave reconnects and sends COM_BINLOG_DUMP,
- the master kills any existing thread with the slave's server id (if this id is
+ the master kills any existing thread with the slave's UUID/server id (if this id is
not zero; it will be true for real slaves, but false for mysqlbinlog when it
sends COM_BINLOG_DUMP to get a remote binlog dump).
SYNOPSIS
kill_zombie_dump_threads()
- slave_uuid the slave's UUID
+ @param thd newly connected dump thread object
*/
-
-void kill_zombie_dump_threads(String *slave_uuid)
+void kill_zombie_dump_threads(THD *thd)
{
- if (slave_uuid->length() == 0)
+ String slave_uuid;
+ get_slave_uuid(thd, &slave_uuid);
+ if (slave_uuid.length() == 0 && thd->server_id == 0)
return;
- DBUG_ASSERT(slave_uuid->length() == UUID_LENGTH);
mysql_mutex_lock(&LOCK_thread_count);
THD *tmp= NULL;
Thread_iterator it= global_thread_list_begin();
Thread_iterator end= global_thread_list_end();
+ bool is_zombie_thread= false;
for (; it != end; ++it)
{
- if ((*it) != current_thd && ((*it)->get_command() == COM_BINLOG_DUMP ||
- (*it)->get_command() == COM_BINLOG_DUMP_GTID))
+ if ((*it) != thd && ((*it)->get_command() == COM_BINLOG_DUMP ||
+ (*it)->get_command() == COM_BINLOG_DUMP_GTID))
{
String tmp_uuid;
- if (get_slave_uuid((*it), &tmp_uuid) != NULL &&
- !strncmp(slave_uuid->c_ptr(), tmp_uuid.c_ptr(), UUID_LENGTH))
+ get_slave_uuid((*it), &tmp_uuid);
+ if (slave_uuid.length())
+ {
+ is_zombie_thread= (tmp_uuid.length() &&
+ !strncmp(slave_uuid.c_ptr(),
+ tmp_uuid.c_ptr(), UUID_LENGTH));
+ }
+ else
+ {
+ /*
+ Check if it is a 5.5 slave's dump thread i.e., server_id should be
+ same && dump thread should not contain 'UUID'.
+ */
+ is_zombie_thread= (((*it)->server_id == thd->server_id) &&
+ !tmp_uuid.length());
+ }
+ if (is_zombie_thread)
{
tmp= *it;
mysql_mutex_lock(&tmp->LOCK_thd_data); // Lock from delete
again. We just to do kill the thread ourselves.
*/
if (log_warnings > 1)
- sql_print_information("While initializing dump thread for slave with "
- "UUID <%s>, found a zombie dump thread with "
- "the same UUID. Master is killing the zombie dump "
- "thread(%lu).", slave_uuid->c_ptr(), tmp->thread_id);
- tmp->duplicate_slave_uuid= true;
+ {
+ if (slave_uuid.length())
+ {
+ sql_print_information("While initializing dump thread for slave with "
+ "UUID <%s>, found a zombie dump thread with the "
+ "same UUID. Master is killing the zombie dump "
+ "thread(%lu).", slave_uuid.c_ptr(),
+ tmp->thread_id);
+ }
+ else
+ {
+ sql_print_information("While initializing dump thread for slave with "
+ "server_id <%u>, found a zombie dump thread with the "
+ "same server_id. Master is killing the zombie dump "
+ "thread(%lu).", thd->server_id,
+ tmp->thread_id);
+ }
+ }
+ tmp->duplicate_slave_id= true;
tmp->awake(THD::KILL_QUERY);
mysql_mutex_unlock(&tmp->LOCK_thd_data);
}
}
-
/**
Execute a RESET MASTER statement.
#ifndef RPL_MASTER_H_INCLUDED
-/* Copyright (c) 2010, 2014, Oracle and/or its affiliates. All rights reserved.
+/* 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
String *get_slave_uuid(THD *thd, String *value);
bool show_master_status(THD* thd);
bool show_binlogs(THD* thd);
-void kill_zombie_dump_threads(String *slave_uuid);
+void kill_zombie_dump_threads(THD* thd);
/**
Process a COM_BINLOG_DUMP_GTID packet.
-/* Copyright (c) 2006, 2013, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2006, 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
}
bool Master_info::set_password(const char* password_arg,
- int password_arg_size __attribute__((unused)))
+ int password_arg_size MY_ATTRIBUTE((unused)))
{
bool ret= true;
DBUG_ENTER("Master_info::set_password");
-/* Copyright (c) 2006, 2015, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2006, 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
cur_log_fd(-1), relay_log(&sync_relaylog_period),
is_relay_log_recovery(is_slave_recovery),
save_temporary_tables(0),
- cur_log_old_open_count(0), group_relay_log_pos(0), event_relay_log_pos(0),
+ cur_log_old_open_count(0), error_on_rli_init_info(false),
+ group_relay_log_pos(0), event_relay_log_pos(0),
group_master_log_pos(0),
gtid_set(global_sid_map, global_sid_lock),
log_space_total(0), ignore_log_space_limit(0),
mts_group_status(MTS_NOT_IN_GROUP), reported_unsafe_warning(false),
rli_description_event(NULL),
sql_delay(0), sql_delay_end(0), m_flags(0), row_stmt_start_timestamp(0),
- long_find_row_note_printed(false), error_on_rli_init_info(false)
+ long_find_row_note_printed(false)
{
DBUG_ENTER("Relay_log_info::Relay_log_info");
break;
case UNTIL_SQL_AFTER_MTS_GAPS:
-#ifndef DBUG_OFF
case UNTIL_DONE:
-#endif
/*
TODO: this condition is actually post-execution or post-scheduling
so the proper place to check it before SQL thread goes
"UNTIL SQL_AFTER_MTS_GAPS as it has "
"processed all gap transactions left from "
"the previous slave session.");
-#ifndef DBUG_OFF
until_condition= UNTIL_DONE;
-#endif
DBUG_RETURN(true);
}
else
goto err;
}
- is_relay_log_recovery= FALSE;
+ /*
+ In case of MTS the recovery is deferred until the end of global_init_info.
+ */
+ if (!mi->rli->mts_recovery_group_cnt)
+ is_relay_log_recovery= FALSE;
DBUG_RETURN(error);
err:
*/
uint32 cur_log_old_open_count;
+ /*
+ If on init_info() call error_on_rli_init_info is true that means
+ that previous call to init_info() terminated with an error, RESET
+ SLAVE must be executed and the problem fixed manually.
+ */
+ bool error_on_rli_init_info;
+
/*
Let's call a group (of events) :
- a transaction
*/
enum {UNTIL_NONE= 0, UNTIL_MASTER_POS, UNTIL_RELAY_POS,
UNTIL_SQL_BEFORE_GTIDS, UNTIL_SQL_AFTER_GTIDS,
- UNTIL_SQL_AFTER_MTS_GAPS
-#ifndef DBUG_OFF
- , UNTIL_DONE
-#endif
+ UNTIL_SQL_AFTER_MTS_GAPS, UNTIL_DONE
}
until_condition;
char until_log_name[FN_REFLEN];
time_t row_stmt_start_timestamp;
bool long_find_row_note_printed;
- /*
- If on init_info() call error_on_rli_init_info is true that means
- that previous call to init_info() terminated with an error, RESET
- SLAVE must be executed and the problem fixed manually.
- */
- bool error_on_rli_init_info;
};
bool mysql_show_relaylog_events(THD* thd);
-/* Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2011, 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
extern "C" uchar *get_key(const uchar *record, size_t *length,
- my_bool not_used __attribute__((unused)))
+ my_bool not_used MY_ATTRIBUTE((unused)))
{
DBUG_ENTER("get_key");
Slave_worker *w_i;
Slave_job_group *ptr_g, g;
char grl_name[FN_REFLEN];
- ulong ind __attribute__((unused));
+ ulong ind MY_ATTRIBUTE((unused));
#ifndef DBUG_OFF
if (DBUG_EVALUATE_IF("check_slave_debug_group", 1, 0) &&
DBUG_RETURN(error);
}
+/*
+ Updates the master info based on the information stored in the
+ relay info and ignores relay logs previously retrieved by the IO
+ thread, which thus starts fetching again based on to the
+ master_log_pos and master_log_name. Eventually, the old
+ relay logs will be purged by the normal purge mechanism.
+
+ When GTID's are enabled the "Retrieved GTID" set should be cleared
+ so that partial read events are discarded and they are
+ fetched once again
+
+ @param mi pointer to Master_info instance
+*/
+static void recover_relay_log(Master_info *mi)
+{
+ Relay_log_info *rli=mi->rli;
+ // Set Receiver Thread's positions as per the recovered Applier Thread.
+ mi->set_master_log_pos(max<ulonglong>(BIN_LOG_HEADER_SIZE,
+ rli->get_group_master_log_pos()));
+ mi->set_master_log_name(rli->get_group_master_log_name());
+
+ sql_print_warning("Recovery from master pos %ld and file %s. "
+ "Previous relay log pos and relay log file had "
+ "been set to %lld, %s respectively.",
+ (ulong) mi->get_master_log_pos(), mi->get_master_log_name(),
+ rli->get_group_relay_log_pos(), rli->get_group_relay_log_name());
+
+ // Start with a fresh relay log.
+ rli->set_group_relay_log_name(rli->relay_log.get_log_fname());
+ rli->set_event_relay_log_name(rli->relay_log.get_log_fname());
+ rli->set_group_relay_log_pos(BIN_LOG_HEADER_SIZE);
+ rli->set_event_relay_log_pos(BIN_LOG_HEADER_SIZE);
+ /*
+ Clear the retrieved GTID set so that events that are written partially
+ will be fetched again.
+ */
+ if (gtid_mode == GTID_MODE_ON)
+ {
+ global_sid_lock->wrlock();
+ (const_cast<Gtid_set *>(rli->get_gtid_set()))->clear();
+ global_sid_lock->unlock();
+ }
+}
+
+
/*
Updates the master info based on the information stored in the
relay info and ignores relay logs previously retrieved by the IO
rli->clear_mts_recovery_groups();
}
else
- {
- error= 1;
- sql_print_error("--relay-log-recovery cannot be executed when the slave "
- "was stopped with an error or killed in MTS mode; "
- "consider using RESET SLAVE or restart the server "
- "with --relay-log-recovery = 0 followed by "
- "START SLAVE UNTIL SQL_AFTER_MTS_GAPS");
- }
+ DBUG_RETURN(error);
}
}
if (error)
DBUG_RETURN(error);
}
- mi->set_master_log_pos(max<ulonglong>(BIN_LOG_HEADER_SIZE,
- rli->get_group_master_log_pos()));
- mi->set_master_log_name(rli->get_group_master_log_name());
+ recover_relay_log(mi);
+ }
+ DBUG_RETURN(error);
+}
+
+/*
+ Relay log recovery in the case of MTS, is handled by the following function.
+ Gaps in MTS execution are filled using implicit execution of
+ START SLAVE UNTIL SQL_AFTER_MTS_GAPS call. Once slave reaches a consistent
+ gapless state receiver thread's positions are initialized to applier thread's
+ positions and the old relay logs are discarded. This completes the recovery
+ process.
- sql_print_warning("Recovery from master pos %ld and file %s. "
- "Previous relay log pos and relay log file had "
- "been set to %lld, %s respectively.",
- (ulong) mi->get_master_log_pos(), mi->get_master_log_name(),
- rli->get_group_relay_log_pos(), rli->get_group_relay_log_name());
+ @param mi pointer to Master_info instance.
- rli->set_group_relay_log_name(rli->relay_log.get_log_fname());
- rli->set_event_relay_log_name(rli->relay_log.get_log_fname());
- rli->set_group_relay_log_pos(BIN_LOG_HEADER_SIZE);
- rli->set_event_relay_log_pos(BIN_LOG_HEADER_SIZE);
+ @retval 0 success
+ @retval 1 error
+*/
+static inline int fill_mts_gaps_and_recover(Master_info* mi)
+{
+ DBUG_ENTER("fill_mts_gaps_and_recover");
+ Relay_log_info *rli= mi->rli;
+ int recovery_error= 0;
+ rli->is_relay_log_recovery= FALSE;
+ rli->until_condition= Relay_log_info::UNTIL_SQL_AFTER_MTS_GAPS;
+ rli->opt_slave_parallel_workers= rli->recovery_parallel_workers;
+ sql_print_information("MTS recovery: starting coordinator thread to fill MTS "
+ "gaps.");
+ recovery_error= start_slave_thread(
+#ifdef HAVE_PSI_INTERFACE
+ key_thread_slave_sql,
+#endif
+ handle_slave_sql, &rli->run_lock,
+ &rli->run_lock,
+ &rli->start_cond,
+ &rli->slave_running,
+ &rli->slave_run_id,
+ mi);
+
+ if (recovery_error)
+ {
+ sql_print_warning("MTS recovery: failed to start the coordinator "
+ "thread. Check the error log for additional"
+ " details.");
+ goto err;
+ }
+ mysql_mutex_lock(&rli->run_lock);
+ mysql_cond_wait(&rli->stop_cond, &rli->run_lock);
+ mysql_mutex_unlock(&rli->run_lock);
+ if (rli->until_condition != Relay_log_info::UNTIL_DONE)
+ {
+ sql_print_warning("MTS recovery: automatic recovery failed. Either the "
+ "slave server had stopped due to an error during an "
+ "earlier session or relay logs are corrupted."
+ "Fix the cause of the slave side error and restart the "
+ "slave server or consider using RESET SLAVE.");
+ goto err;
}
/*
- Clear the retrieved GTID set so that events that are written partially
- will be fetched again.
- */
- global_sid_lock->wrlock();
- (const_cast<Gtid_set *>(rli->get_gtid_set()))->clear();
- global_sid_lock->unlock();
- DBUG_RETURN(error);
+ We need a mutex while we are changing master info parameters to
+ keep other threads from reading bogus info
+ */
+ mysql_mutex_lock(&mi->data_lock);
+ mysql_mutex_lock(&rli->data_lock);
+ recover_relay_log(mi);
+
+ const char* msg;
+ if (rli->init_relay_log_pos(rli->get_group_relay_log_name(),
+ rli->get_group_relay_log_pos(),
+ false/*need_data_lock=false*/,
+ &msg, 0))
+ {
+ char llbuf[22];
+ sql_print_error("Failed to open the relay log '%s' (relay_log_pos %s).",
+ rli->get_group_relay_log_name(),
+ llstr(rli->get_group_relay_log_pos(), llbuf));
+
+ recovery_error=1;
+ mysql_mutex_unlock(&mi->data_lock);
+ mysql_mutex_unlock(&rli->data_lock);
+ goto err;
+ }
+ if (mi->flush_info(true) || rli->flush_info(true))
+ {
+ recovery_error= 1;
+ mysql_mutex_unlock(&mi->data_lock);
+ mysql_mutex_unlock(&rli->data_lock);
+ goto err;
+ }
+ rli->inited=1;
+ rli->error_on_rli_init_info= false;
+ mysql_mutex_unlock(&mi->data_lock);
+ mysql_mutex_unlock(&rli->data_lock);
+ sql_print_information("MTS recovery: completed successfully.\n");
+ DBUG_RETURN(recovery_error);
+err:
+ /*
+ If recovery failed means we failed to initialize rli object in the case
+ of MTS. We should not allow the START SLAVE command to work as we do in
+ the case of STS. i.e if init_recovery call fails then we set inited=0.
+ */
+ rli->end_info();
+ rli->inited=0;
+ rli->error_on_rli_init_info= true;
+ DBUG_RETURN(recovery_error);
}
int global_init_info(Master_info* mi, bool ignore_if_no_info, int thread_mask)
*/
check_return= mi->check_info();
if (check_return == ERROR_CHECKING_REPOSITORY)
+ {
+ init_error= 1;
goto end;
+ }
if (!(ignore_if_no_info && check_return == REPOSITORY_DOES_NOT_EXIST))
{
check_return= mi->rli->check_info();
if (check_return == ERROR_CHECKING_REPOSITORY)
+ {
+ init_error= 1;
goto end;
+ }
if (!(ignore_if_no_info && check_return == REPOSITORY_DOES_NOT_EXIST))
{
if (((thread_mask & SLAVE_SQL) != 0 || !(mi->rli->inited))
mysql_mutex_unlock(&mi->rli->data_lock);
mysql_mutex_unlock(&mi->data_lock);
- DBUG_RETURN(check_return == ERROR_CHECKING_REPOSITORY || init_error);
+
+ /*
+ Handling MTS Relay-log recovery after successful initialization of mi and
+ rli objects.
+
+ MTS Relay-log recovery is handled by SSUG command. In order to start the
+ slave applier thread rli needs to be inited and mi->rli->data_lock should
+ be in released state. Hence we do the MTS recovery at this point of time
+ where both conditions are satisfied.
+ */
+ if (!init_error && mi->rli->is_relay_log_recovery
+ && mi->rli->mts_recovery_group_cnt)
+ init_error= fill_mts_gaps_and_recover(mi);
+ DBUG_RETURN(init_error);
}
void end_info(Master_info* mi)
while (*slave_running) // Should always be true
{
- int error __attribute__((unused));
+ int error MY_ATTRIBUTE((unused));
DBUG_PRINT("loop", ("killing slave thread"));
mysql_mutex_lock(&thd->LOCK_thd_data);
EINVAL: invalid signal number (can't happen)
ESRCH: thread already killed (can happen, should be ignored)
*/
- int err __attribute__((unused))= pthread_kill(thd->real_id, thr_client_alarm);
+ int err MY_ATTRIBUTE((unused))= pthread_kill(thd->real_id, thr_client_alarm);
DBUG_ASSERT(err != EINVAL);
#endif
thd->awake(THD::NOT_KILLED);
errorno == ER_CON_COUNT_ERROR ||
errorno == ER_SERVER_SHUTDOWN)
return TRUE;
+#ifdef WITH_WSREP
+ if (errorno == ER_UNKNOWN_COM_ERROR)
+ return TRUE;
+#endif /* WITH_WSREP */
return FALSE;
}
{
char query[256];
int ret= 0;
+ DBUG_EXECUTE_IF("fake_5_5_version_slave", return ret;);
sprintf(query, "SET @slave_uuid= '%s'", server_uuid);
if (mysql_real_query(mysql, query, strlen(query))
break;
case Relay_log_info::UNTIL_SQL_AFTER_MTS_GAPS:
until_type= "SQL_AFTER_MTS_GAPS";
-#ifndef DBUG_OFF
case Relay_log_info::UNTIL_DONE:
until_type= "DONE";
break;
-#endif
default:
DBUG_ASSERT(0);
}
rli->get_group_relay_log_pos(),
rli->get_group_master_log_name(),
rli->get_group_master_log_pos());
-#ifndef DBUG_OFF
- /*
+ /*
Few tests wait for UNTIL_SQL_AFTER_MTS_GAPS completion.
- Due to exisiting convention the status won't change
+ Due to exisiting convention the status won't change
prior to slave restarts.
So making of UNTIL_SQL_AFTER_MTS_GAPS completion isdone here,
and only in the debug build to make the test to catch the change
{
rli->until_condition= Relay_log_info::UNTIL_DONE;
}
-#endif
// reset the Worker tables to remove last slave session time info
if ((error= rli->mts_finalize_recovery()))
{
Hence deferred events wont be deleted here.
They will be deleted in Deferred_log_events::rewind() funciton.
*/
- WSREP_DEBUG("apply_event_and_update_pos result: %d", exec_res);
if (*ptr_ev)
{
DBUG_ASSERT(*ptr_ev == ev); // event remains to belong to Coordinator
/**
Reads next event from the relay log. Should be called from the
- slave IO thread.
+ slave SQL thread.
- @param rli Relay_log_info structure for the slave IO thread.
+ @param rli Relay_log_info structure for the slave SQL thread.
@return The event read, or NULL on error. If an error occurs, the
error is reported through the sql_print_information() or
We just have a read only log that nobody else will be updating.
*/
bool hot_log;
- if ((hot_log = (cur_log != &rli->cache_buf)))
+ if ((hot_log = (cur_log != &rli->cache_buf)) ||
+ DBUG_EVALUATE_IF("force_sql_thread_error", 1, 0))
{
DBUG_ASSERT(rli->cur_log_fd == -1); // foreign descriptor
mysql_mutex_lock(log_lock);
Reading xxx_file_id is safe because the log will only
be rotated when we hold relay_log.LOCK_log
*/
- if (rli->relay_log.get_open_count() != rli->cur_log_old_open_count)
+ if (rli->relay_log.get_open_count() != rli->cur_log_old_open_count &&
+ DBUG_EVALUATE_IF("force_sql_thread_error", 0, 1))
{
// The master has switched to a new log file; Reopen the old log file
cur_log=reopen_relay_log(rli, &errmsg);
error during a write by the slave I/O thread may have closed it), we
have to test it.
*/
- if (!my_b_inited(cur_log))
+ if (!my_b_inited(cur_log) ||
+ DBUG_EVALUATE_IF("force_sql_thread_error", 1, 0))
+ {
+ if (hot_log)
+ mysql_mutex_unlock(log_lock);
goto err;
+ }
#ifndef DBUG_OFF
{
DBUG_PRINT("info", ("assertion skip %lu file pos %lu event relay log pos %lu file %s\n",
(memcmp(fixed_in, master_ver, 3) > 0) &&
(pred == NULL || (*pred)(param)))
{
+ enum loglevel report_level= INFORMATION_LEVEL;
if (!report)
return TRUE;
// a short message for SHOW SLAVE STATUS (message length constraints)
" so slave stops; check error log on slave"
" for more info", MYF(0), bug_id);
// a verbose message for the error log
- rli->report(ERROR_LEVEL, ER_UNKNOWN_ERROR,
- "According to the master's version ('%s'),"
- " it is probable that master suffers from this bug:"
- " http://bugs.mysql.com/bug.php?id=%u"
- " and thus replicating the current binary log event"
- " may make the slave's data become different from the"
- " master's data."
- " To take no risk, slave refuses to replicate"
- " this event and stops."
- " We recommend that all updates be stopped on the"
- " master and slave, that the data of both be"
- " manually synchronized,"
- " that master's binary logs be deleted,"
- " that master be upgraded to a version at least"
- " equal to '%d.%d.%d'. Then replication can be"
- " restarted.",
- rli->get_rli_description_event()->server_version,
- bug_id,
- fixed_in[0], fixed_in[1], fixed_in[2]);
+ if (!ignored_error_code(ER_UNKNOWN_ERROR))
+ {
+ report_level= ERROR_LEVEL;
+ current_thd->is_slave_error= 1;
+ }
+ /* In case of ignored errors report warnings only if log_warnings > 1. */
+ else if (log_warnings > 1)
+ report_level= WARNING_LEVEL;
+
+ if (report_level != INFORMATION_LEVEL)
+ rli->report(report_level, ER_UNKNOWN_ERROR,
+ "According to the master's version ('%s'),"
+ " it is probable that master suffers from this bug:"
+ " http://bugs.mysql.com/bug.php?id=%u"
+ " and thus replicating the current binary log event"
+ " may make the slave's data become different from the"
+ " master's data."
+ " To take no risk, slave refuses to replicate"
+ " this event and stops."
+ " We recommend that all updates be stopped on the"
+ " master and slave, that the data of both be"
+ " manually synchronized,"
+ " that master's binary logs be deleted,"
+ " that master be upgraded to a version at least"
+ " equal to '%d.%d.%d'. Then replication can be"
+ " restarted.",
+ rli->get_rli_description_event()->server_version,
+ bug_id,
+ fixed_in[0], fixed_in[1], fixed_in[2]);
return TRUE;
}
}
-/* Copyright (c) 2006, 2014, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2006, 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
return length;
}
-#ifndef MYSQL_CLIENT
+#if defined(MYSQL_SERVER) && defined(HAVE_REPLICATION)
/**
*/
static void show_sql_type(enum_field_types type, uint16 metadata, String *str,
const char *tbl_name= table->s->table_name.str;
char source_buf[MAX_FIELD_WIDTH];
char target_buf[MAX_FIELD_WIDTH];
+ enum loglevel report_level= INFORMATION_LEVEL;
+
String source_type(source_buf, sizeof(source_buf), &my_charset_latin1);
String target_type(target_buf, sizeof(target_buf), &my_charset_latin1);
show_sql_type(type(col), field_metadata(col), &source_type, field->charset());
field->sql_type(target_type);
- rli->report(ERROR_LEVEL, ER_SLAVE_CONVERSION_FAILED,
- ER(ER_SLAVE_CONVERSION_FAILED),
- col, db_name, tbl_name,
- source_type.c_ptr_safe(), target_type.c_ptr_safe());
+ if (!ignored_error_code(ER_SLAVE_CONVERSION_FAILED))
+ {
+ report_level= ERROR_LEVEL;
+ thd->is_slave_error= 1;
+ }
+ /* In case of ignored errors report warnings only if log_warnings > 1. */
+ else if (log_warnings > 1)
+ report_level= WARNING_LEVEL;
+
+ if (report_level != INFORMATION_LEVEL)
+ rli->report(report_level, ER_SLAVE_CONVERSION_FAILED,
+ ER(ER_SLAVE_CONVERSION_FAILED),
+ col, db_name, tbl_name,
+ source_type.c_ptr_safe(), target_type.c_ptr_safe());
return false;
}
}
err:
if (conv_table == NULL)
- rli->report(ERROR_LEVEL, ER_SLAVE_CANT_CREATE_CONVERSION,
- ER(ER_SLAVE_CANT_CREATE_CONVERSION),
- target_table->s->db.str,
- target_table->s->table_name.str);
+ {
+ enum loglevel report_level= INFORMATION_LEVEL;
+ if (!ignored_error_code(ER_SLAVE_CANT_CREATE_CONVERSION))
+ {
+ report_level= ERROR_LEVEL;
+ thd->is_slave_error= 1;
+ }
+ /* In case of ignored errors report warnings only if log_warnings > 1. */
+ else if (log_warnings > 1)
+ report_level= WARNING_LEVEL;
+
+ if (report_level != INFORMATION_LEVEL)
+ rli->report(report_level, ER_SLAVE_CANT_CREATE_CONVERSION,
+ ER(ER_SLAVE_CANT_CREATE_CONVERSION),
+ target_table->s->db.str,
+ target_table->s->table_name.str);
+ }
DBUG_RETURN(conv_table);
}
static uchar*
hash_slave_rows_get_key(const uchar *record,
size_t *length,
- my_bool not_used __attribute__((unused)))
+ my_bool not_used MY_ATTRIBUTE((unused)))
{
DBUG_ENTER("get_key");
/*
- Copyright (c) 2002, 2015, Oracle and/or its affiliates. All rights reserved.
+ Copyright (c) 2002, 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
bool sp_check_name(LEX_STRING *ident)
{
- if (!ident || !ident->str || !ident->str[0] ||
- ident->str[ident->length-1] == ' ')
+ DBUG_ASSERT(ident != NULL && ident->str != NULL);
+
+ if (!ident->str[0] || ident->str[ident->length-1] == ' ')
{
my_error(ER_SP_WRONG_NAME, MYF(0), ident->str);
return true;
/* Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
-
+sql_authenticate
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.
static uchar* acl_entry_get_key(acl_entry *entry, size_t *length,
- my_bool not_used __attribute__((unused)))
+ my_bool not_used MY_ATTRIBUTE((unused)))
{
*length=(uint) entry->length;
return (uchar*) entry->key;
}
static uchar* check_get_key(ACL_USER *buff, size_t *length,
- my_bool not_used __attribute__((unused)))
+ my_bool not_used MY_ATTRIBUTE((unused)))
{
*length=buff->host.get_host_len();
return (uchar*) buff->host.get_host();
goto end;
}
- if (!combo->uses_identified_by_clause &&
- !combo->uses_identified_with_clause &&
- !combo->uses_identified_by_password_clause)
+ if ((!combo->uses_identified_by_clause &&
+ !combo->uses_identified_with_clause &&
+ !combo->uses_identified_by_password_clause) ||
+ (combo->uses_identified_with_clause &&
+ (!my_strcasecmp(system_charset_info, combo->plugin.str,
+ native_password_plugin_name.str) ||
+ !my_strcasecmp(system_charset_info, combo->plugin.str,
+ old_password_plugin_name.str))))
{
if (check_password_policy(NULL))
{
static uchar* get_key_column(GRANT_COLUMN *buff, size_t *length,
- my_bool not_used __attribute__((unused)))
+ my_bool not_used MY_ATTRIBUTE((unused)))
{
*length=buff->key_length;
return (uchar*) buff->column;
static uchar* get_grant_table(GRANT_NAME *buff, size_t *length,
- my_bool not_used __attribute__((unused)))
+ my_bool not_used MY_ATTRIBUTE((unused)))
{
*length=buff->key_length;
return (uchar*) buff->hash_key;
thd->variables.sql_mode|= MODE_IGNORE_SPACE;
}
+/**
+ Assign priv_user and priv_host fields of the Security_context.
+
+ @param sctx Security context, which priv_user and priv_host fields are
+ updated.
+ @param user Authenticated user data.
+*/
+inline void
+assign_priv_user_host(Security_context *sctx, const ACL_USER *user)
+{
+ if (user->user)
+ strmake(sctx->priv_user, user->user, USERNAME_LENGTH - 1);
+ else
+ *sctx->priv_user= 0;
+
+ if (user->host.get_host())
+ strmake(sctx->priv_host, user->host.get_host(), MAX_HOSTNAME - 1);
+ else
+ *sctx->priv_host= 0;
+}
+
/**
Perform the handshake, authorize the client and update thd sctx variables.
res= CR_ERROR;
}
+ if (mpvio.can_authenticate())
+ assign_priv_user_host(sctx, acl_user);
+
if (res > CR_OK && mpvio.status != MPVIO_EXT::SUCCESS)
{
Host_errors errors;
#endif
sctx->master_access= acl_user->access;
- if (acl_user->user)
- strmake(sctx->priv_user, acl_user->user, USERNAME_LENGTH - 1);
- else
- *sctx->priv_user= 0;
-
- if (acl_user->host.get_host())
- strmake(sctx->priv_host, acl_user->host.get_host(), MAX_HOSTNAME - 1);
- else
- *sctx->priv_host= 0;
+ assign_priv_user_host(sctx, acl_user);
#ifndef NO_EMBEDDED_ACCESS_CHECKS
/*
/*
- Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
+ Copyright (c) 2000, 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
using std::min;
using std::max;
-int sortcmp2(void* cmp_arg __attribute__((unused)),
+int sortcmp2(void* cmp_arg MY_ATTRIBUTE((unused)),
const String *a,const String *b)
{
return sortcmp(a,b,a->charset());
}
-int compare_double2(void* cmp_arg __attribute__((unused)),
+int compare_double2(void* cmp_arg MY_ATTRIBUTE((unused)),
const double *s, const double *t)
{
return compare_double(s,t);
}
-int compare_longlong2(void* cmp_arg __attribute__((unused)),
+int compare_longlong2(void* cmp_arg MY_ATTRIBUTE((unused)),
const longlong *s, const longlong *t)
{
return compare_longlong(s,t);
}
-int compare_ulonglong2(void* cmp_arg __attribute__((unused)),
+int compare_ulonglong2(void* cmp_arg MY_ATTRIBUTE((unused)),
const ulonglong *s, const ulonglong *t)
{
return compare_ulonglong(s,t);
void field_real::get_opt_type(String *answer,
- ha_rows total_rows __attribute__((unused)))
+ ha_rows total_rows MY_ATTRIBUTE((unused)))
{
char buff[MAX_FIELD_WIDTH];
void field_longlong::get_opt_type(String *answer,
- ha_rows total_rows __attribute__((unused)))
+ ha_rows total_rows MY_ATTRIBUTE((unused)))
{
char buff[MAX_FIELD_WIDTH];
void field_ulonglong::get_opt_type(String *answer,
- ha_rows total_rows __attribute__((unused)))
+ ha_rows total_rows MY_ATTRIBUTE((unused)))
{
char buff[MAX_FIELD_WIDTH];
void field_decimal::get_opt_type(String *answer,
- ha_rows total_rows __attribute__((unused)))
+ ha_rows total_rows MY_ATTRIBUTE((unused)))
{
my_decimal zero;
char buff[MAX_FIELD_WIDTH];
int collect_string(String *element,
- element_count count __attribute__((unused)),
+ element_count count MY_ATTRIBUTE((unused)),
TREE_INFO *info)
{
if (info->found)
} // collect_string
-int collect_real(double *element, element_count count __attribute__((unused)),
+int collect_real(double *element, element_count count MY_ATTRIBUTE((unused)),
TREE_INFO *info)
{
char buff[MAX_FIELD_WIDTH];
int collect_longlong(longlong *element,
- element_count count __attribute__((unused)),
+ element_count count MY_ATTRIBUTE((unused)),
TREE_INFO *info)
{
char buff[MAX_FIELD_WIDTH];
int collect_ulonglong(ulonglong *element,
- element_count count __attribute__((unused)),
+ element_count count MY_ATTRIBUTE((unused)),
TREE_INFO *info)
{
char buff[MAX_FIELD_WIDTH];
#ifndef SQL_ANALYSE_INCLUDED
#define SQL_ANALYSE_INCLUDED
-/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2000, 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
bool get_ev_num_info(EV_NUM_INFO *ev_info, NUM_INFO *info, const char *num);
bool test_if_number(NUM_INFO *info, const char *str, uint str_len);
int compare_double(const double *s, const double *t);
-int compare_double2(void* cmp_arg __attribute__((unused)),
+int compare_double2(void* cmp_arg MY_ATTRIBUTE((unused)),
const double *s, const double *t);
int compare_longlong(const longlong *s, const longlong *t);
-int compare_longlong2(void* cmp_arg __attribute__((unused)),
+int compare_longlong2(void* cmp_arg MY_ATTRIBUTE((unused)),
const longlong *s, const longlong *t);
int compare_ulonglong(const ulonglong *s, const ulonglong *t);
-int compare_ulonglong2(void* cmp_arg __attribute__((unused)),
+int compare_ulonglong2(void* cmp_arg MY_ATTRIBUTE((unused)),
const ulonglong *s, const ulonglong *t);
int compare_decimal2(int* len, const char *s, const char *t);
void free_string(String*);
int collect_string(String *element, element_count count,
TREE_INFO *info);
-int sortcmp2(void* cmp_arg __attribute__((unused)),
+int sortcmp2(void* cmp_arg MY_ATTRIBUTE((unused)),
const String *a,const String *b);
class field_str :public field_info
void add();
void get_opt_type(String*, ha_rows);
- String *get_min_arg(String *not_used __attribute__((unused)))
+ String *get_min_arg(String *not_used MY_ATTRIBUTE((unused)))
{ return &min_arg; }
- String *get_max_arg(String *not_used __attribute__((unused)))
+ String *get_max_arg(String *not_used MY_ATTRIBUTE((unused)))
{ return &max_arg; }
String *avg(String *s, ha_rows rows)
{
TREE_INFO *info);
tree_walk_action collect_enum()
{ return (tree_walk_action) collect_string; }
- String *std(String *s __attribute__((unused)),
- ha_rows rows __attribute__((unused)))
+ String *std(String *s MY_ATTRIBUTE((unused)),
+ ha_rows rows MY_ATTRIBUTE((unused)))
{ return (String*) 0; }
};
-/* Copyright (c) 2007, 2015, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2007, 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
/** There's at least one active audit plugin tracking the general events */
-bool is_any_audit_plugin_active(THD *thd __attribute__((unused)))
+bool is_any_audit_plugin_active(THD *thd MY_ATTRIBUTE((unused)))
{
return (mysql_global_audit_mask[0] & MYSQL_AUDIT_GENERAL_CLASSMASK);
}
-/* Copyright (c) 2007, 2015, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2007, 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
#ifndef EMBEDDED_LIBRARY
extern void mysql_audit_notify(THD *thd, uint event_class,
uint event_subtype, ...);
-bool is_any_audit_plugin_active(THD *thd __attribute__((unused)));
+bool is_any_audit_plugin_active(THD *thd MY_ATTRIBUTE((unused)));
#else
#define mysql_audit_notify(...)
#endif
*****************************************************************************/
extern "C" uchar *table_def_key(const uchar *record, size_t *length,
- my_bool not_used __attribute__((unused)))
+ my_bool not_used MY_ATTRIBUTE((unused)))
{
TABLE_SHARE *entry=(TABLE_SHARE*) record;
*length= entry->table_cache_key.length;
while (found && ! thd->killed)
{
- WSREP_DEBUG("close_cached_tables, wait loop");
TABLE_SHARE *share;
found= FALSE;
/*
}
extern "C" uchar *schema_set_get_key(const uchar *record, size_t *length,
- my_bool not_used __attribute__((unused)))
+ my_bool not_used MY_ATTRIBUTE((unused)))
{
TABLE_LIST *table=(TABLE_LIST*) record;
*length= table->db_length;
&table_list->view->sroutines_list,
table_list->top_table());
}
+
+ /*
+ If a trigger was defined on one of the associated tables then assign the
+ 'trg_event_map' value of the view to the next table in table_list. When a
+ Stored function is invoked, all the associated tables including the tables
+ associated with the trigger are prelocked.
+ */
+ if (table_list->trg_event_map && table_list->next_global)
+ table_list->next_global->trg_event_map= table_list->trg_event_map;
return FALSE;
}
-/* Copyright (c) 2000, 2013, 2015, Oracle and/or its affiliates. All rights
+/* Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights
reserved.
This program is free software; you can redistribute it and/or modify
extern "C"
{
uchar *query_cache_table_get_key(const uchar *record, size_t *length,
- my_bool not_used __attribute__((unused)))
+ my_bool not_used MY_ATTRIBUTE((unused)))
{
Query_cache_block* table_block = (Query_cache_block*) record;
*length = (table_block->used - table_block->headers_len() -
****************************************************************************/
extern "C" uchar *get_var_key(user_var_entry *entry, size_t *length,
- my_bool not_used __attribute__((unused)))
+ my_bool not_used MY_ATTRIBUTE((unused)))
{
*length= entry->entry_name.length();
return (uchar*) entry->entry_name.ptr();
extern "C" void wsrep_thd_set_conflict_state(
THD *thd, enum wsrep_conflict_state state)
{
- thd->wsrep_conflict_state= state;
+ if (WSREP(thd)) thd->wsrep_conflict_state= state;
}
owned_gtid_set(global_sid_map),
main_da(0, false),
m_stmt_da(&main_da),
- duplicate_slave_uuid(false)
+ duplicate_slave_id(false)
{
ulong tmp;
wsrep_mysql_replicated = 0;
wsrep_TOI_pre_query = NULL;
wsrep_TOI_pre_query_len = 0;
- wsrep_sync_wait_gtid= WSREP_GTID_UNDEFINED;
+ wsrep_sync_wait_gtid = WSREP_GTID_UNDEFINED;
+ wsrep_affected_rows = 0;
#endif
/* Call to init() below requires fully initialized Open_tables_state. */
reset_open_tables_state();
wsrep_mysql_replicated = 0;
wsrep_TOI_pre_query = NULL;
wsrep_TOI_pre_query_len = 0;
- wsrep_sync_wait_gtid= WSREP_GTID_UNDEFINED;
+ wsrep_sync_wait_gtid = WSREP_GTID_UNDEFINED;
+ wsrep_affected_rows = 0;
#endif
binlog_row_event_extra_data= 0;
#ifdef WITH_WSREP
wsrep_sync_wait_gtid= WSREP_GTID_UNDEFINED;
+ if (!in_active_multi_stmt_transaction())
+ wsrep_affected_rows= 0;
#endif /* WITH_WSREP */
}
int
-select_dump::prepare(List<Item> &list __attribute__((unused)),
+select_dump::prepare(List<Item> &list MY_ATTRIBUTE((unused)),
SELECT_LEX_UNIT *u)
{
unit= u;
static uchar *
get_statement_id_as_hash_key(const uchar *record, size_t *key_length,
- my_bool not_used __attribute__((unused)))
+ my_bool not_used MY_ATTRIBUTE((unused)))
{
const Statement *statement= (const Statement *) record;
*key_length= sizeof(statement->id);
}
static uchar *get_stmt_name_hash_key(Statement *entry, size_t *length,
- my_bool not_used __attribute__((unused)))
+ my_bool not_used MY_ATTRIBUTE((unused)))
{
*length= entry->name.length;
return (uchar*) entry->name.str;
extern "C" void xid_free_hash(void *);
uchar *xid_get_hash_key(const uchar *ptr, size_t *length,
- my_bool not_used __attribute__((unused)))
+ my_bool not_used MY_ATTRIBUTE((unused)))
{
*length=((XID_STATE*)ptr)->xid.key_length();
return ((XID_STATE*)ptr)->xid.key();
ulong tx_isolation;
char *db;
size_t db_length;
+ struct timeval user_time;
};
#endif
class Reprepare_observer;
/**
Type of locked tables mode.
See comment for THD::locked_tables_mode for complete description.
+ While adding new enum values add them to the getter method for this enum
+ declared below and defined in sql_class.cc as well.
*/
enum enum_locked_tables_mode
LTM_PRELOCKED_UNDER_LOCK_TABLES
};
+#ifndef DBUG_OFF
+/**
+ Getter for the enum enum_locked_tables_mode
+ @param locked_tables_mode enum for types of locked tables mode
+
+ @return The string represantation of that enum value
+*/
+const char * get_locked_tables_mode_name(enum_locked_tables_mode locked_tables_mode);
+#endif
/**
Class that holds information about tables which were opened and locked
void* wsrep_apply_format;
bool wsrep_apply_toi; /* applier processing in TOI */
wsrep_gtid_t wsrep_sync_wait_gtid;
+ ulong wsrep_affected_rows;
#endif /* WITH_WSREP */
/**
Internal parser state.
public:
/**
This is only used by master dump threads.
- When the master receives a new connection from a slave with a UUID that
- is already connected, it will set this flag TRUE before killing the old
- slave connection.
+ When the master receives a new connection from a slave with a
+ UUID (for slave versions >= 5.6)/server_id(for slave versions < 5.6)
+ that is already connected, it will set this flag TRUE
+ before killing the old slave connection.
*/
- bool duplicate_slave_uuid;
+ bool duplicate_slave_id;
};
/*
- Copyright (c) 2007, 2013, Oracle and/or its affiliates. All rights reserved.
+ Copyright (c) 2007, 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
*/
extern "C" uchar *get_key_conn(user_conn *buff, size_t *length,
- my_bool not_used __attribute__((unused)))
+ my_bool not_used MY_ATTRIBUTE((unused)))
{
*length= buff->len;
return (uchar*) buff->user;
-/* Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2005, 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
int send_result_set_metadata(THD *thd, List<Item> &send_result_set_metadata);
virtual bool is_open() const { return table != 0; }
- virtual int open(JOIN *join __attribute__((unused)));
+ virtual int open(JOIN *join MY_ATTRIBUTE((unused)));
virtual void fetch(ulong num_rows);
virtual void close();
virtual ~Materialized_cursor();
}
-int Materialized_cursor::open(JOIN *join __attribute__((unused)))
+int Materialized_cursor::open(JOIN *join MY_ATTRIBUTE((unused)))
{
THD *thd= fake_unit.thd;
int rc;
/*
- Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
+ Copyright (c) 2000, 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
my_bool not_used);
uchar* dboptions_get_key(my_dbopt_t *opt, size_t *length,
- my_bool not_used __attribute__((unused)))
+ my_bool not_used MY_ATTRIBUTE((unused)))
{
*length= opt->name_length;
return (uchar*) opt->name;
-/* Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2000, 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
static void
update_tmptable_sum_func(Item_sum **func_ptr,
- TABLE *tmp_table __attribute__((unused)))
+ TABLE *tmp_table MY_ATTRIBUTE((unused)))
{
Item_sum *func;
while ((func= *(func_ptr++)))
/* ARGSUSED */
static int
-join_no_more_records(READ_RECORD *info __attribute__((unused)))
+join_no_more_records(READ_RECORD *info MY_ATTRIBUTE((unused)))
{
return -1;
}
/* ARGSUSED */
enum_nested_loop_state
-end_send_group(JOIN *join, JOIN_TAB *join_tab __attribute__((unused)),
+end_send_group(JOIN *join, JOIN_TAB *join_tab MY_ATTRIBUTE((unused)),
bool end_of_records)
{
int idx= -1;
Item *pos;
List_iterator_fast<Item> li(all_fields);
Copy_field *copy= NULL;
- Copy_field *copy_start __attribute__((unused));
+ Copy_field *copy_start MY_ATTRIBUTE((unused));
res_selected_fields.empty();
res_all_fields.empty();
List_iterator_fast<Item> itr(res_all_fields);
#ifndef SQL_EXECUTOR_INCLUDED
#define SQL_EXECUTOR_INCLUDED
-/* Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights
+/* Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights
reserved.
This program is free software; you can redistribute it and/or modify
/** Write function that would be used for saving records in tmp table. */
Next_select_func write_func;
enum_nested_loop_state put_record(bool end_of_records);
- __attribute__((warn_unused_result))
+ MY_ATTRIBUTE((warn_unused_result))
bool prepare_tmp_table();
};
-/* Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2001, 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
*/
static char *mysql_ha_hash_get_key(TABLE_LIST *tables, size_t *key_len_p,
- my_bool first __attribute__((unused)))
+ my_bool first MY_ATTRIBUTE((unused)))
{
*key_len_p= strlen(tables->alias) + 1 ; /* include '\0' in comparisons */
return tables->alias;
insert_id_for_cur_row= table->file->insert_id_for_cur_row;
else
table->file->insert_id_for_cur_row= insert_id_for_cur_row;
- bool is_duplicate_key_error;
- if (table->file->is_fatal_error(error, HA_CHECK_DUP | HA_CHECK_FK_ERROR))
+
+ /*
+ If it is a FK constraint violation and 'ignore' flag is set,
+ report a warning instead of error.
+ */
+ if (ignore_errors && !table->file->is_fatal_error(error,
+ HA_CHECK_FK_ERROR))
+ goto ok_or_after_trg_err;
+
+ if (table->file->is_fatal_error(error, HA_CHECK_DUP))
goto err;
- is_duplicate_key_error= table->file->is_fatal_error(error, 0);
- if (!is_duplicate_key_error)
+
+ if (!table->file->is_fatal_error(error, 0))
{
/*
- We come here when we had an ignorable error which is not a duplicate
- key error. In this we ignore error if ignore flag is set, otherwise
- report error as usual. We will not do any duplicate key processing.
+ We come here when we have an ignorable error which is not a duplicate
+ key error or FK error(Ex: Partition related errors). In this case we
+ ignore the error if ignore flag is set, otherwise report error as usual.
+ We will not do any duplicate key processing.
*/
if (ignore_errors)
goto ok_or_after_trg_err; /* Ignoring a not fatal error, return 0 */
if (query_tables_last == &first_table->next_global)
query_tables_last= first_table->prev_global;
+ if (query_tables_own_last == &first_table->next_global)
+ query_tables_own_last= first_table->prev_global;
+
if ((next= *first_table->prev_global= first_table->next_global))
next->prev_global= first_table->prev_global;
/* include in new place */
*/
char *tdb= thd->db ? thd->db : db; // Result is never null
ulong skip_lines= ex->skip_lines;
- bool transactional_table __attribute__((unused));
+ bool transactional_table MY_ATTRIBUTE((unused));
DBUG_ENTER("mysql_load");
/*
set_if_bigger(length,line_start.length());
stack=stack_pos=(int*) sql_alloc(sizeof(int)*length);
- if (!(buffer=(uchar*) my_malloc(buff_length+1,MYF(0))))
- error=1; /* purecov: inspected */
+ if (!(buffer=(uchar*) my_malloc(buff_length+1,MYF(MY_WME))))
+ error= true; /* purecov: inspected */
else
{
end_of_buff=buffer+buff_length;
}
}
#ifdef USE_MB
- if (my_mbcharlen(read_charset, chr) > 1 &&
- to + my_mbcharlen(read_charset, chr) <= end_of_buff)
- {
- uchar* p= to;
- int ml, i;
- *to++ = chr;
-
- ml= my_mbcharlen(read_charset, chr);
+ uint ml= my_mbcharlen(read_charset, chr);
+ if (ml == 0)
+ {
+ *to= '\0';
+ my_error(ER_INVALID_CHARACTER_STRING, MYF(0),
+ read_charset->csname, buffer);
+ error= true;
+ return 1;
+ }
- for (i= 1; i < ml; i++)
+ if (ml > 1 &&
+ to + ml <= end_of_buff)
{
- chr= GET;
- if (chr == my_b_EOF)
+ uchar* p= to;
+ *to++ = chr;
+
+ for (uint i= 1; i < ml; i++)
{
- /*
- Need to back up the bytes already ready from illformed
- multi-byte char
- */
- to-= i;
- goto found_eof;
+ chr= GET;
+ if (chr == my_b_EOF)
+ {
+ /*
+ Need to back up the bytes already ready from illformed
+ multi-byte char
+ */
+ to-= i;
+ goto found_eof;
+ }
+ *to++ = chr;
}
- *to++ = chr;
- }
- if (my_ismbchar(read_charset,
+ if (my_ismbchar(read_charset,
(const char *)p,
(const char *)to))
- continue;
- for (i= 0; i < ml; i++)
- PUSH(*--to);
- chr= GET;
- }
+ continue;
+ for (uint i= 0; i < ml; i++)
+ PUSH(*--to);
+ chr= GET;
+ }
+ else if (ml > 1)
+ {
+ // Buffer is too small, exit while loop, and reallocate.
+ PUSH(chr);
+ break;
+ }
#endif
*to++ = (uchar) chr;
}
for (chr= GET; my_tospace(chr) != delim && chr != my_b_EOF;)
{
#ifdef USE_MB
- if (my_mbcharlen(read_charset, chr) > 1)
+ uint ml= my_mbcharlen(read_charset, chr);
+ if (ml == 0)
+ {
+ chr= my_b_EOF;
+ val->length(0);
+ return chr;
+ }
+
+ if (ml > 1)
{
DBUG_PRINT("read_xml",("multi byte"));
int i, ml= my_mbcharlen(read_charset, chr);
-/* Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2000, 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
return result;
}
-pthread_handler_t handle_manager(void *arg __attribute__((unused)))
+pthread_handler_t handle_manager(void *arg MY_ATTRIBUTE((unused)))
{
int error = 0;
struct timespec abstime;
-/* Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2000, 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
{
return (void*) sql_alloc((uint) size);
}
- static void operator delete(void *ptr __attribute__((unused)),
- size_t size __attribute__((unused)))
+ static void operator delete(void *ptr MY_ATTRIBUTE((unused)),
+ size_t size MY_ATTRIBUTE((unused)))
{ TRASH(ptr, size); }
Item *and_level;
-/* Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2000, 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
void init_update_queries(void)
{
/* Initialize the server command flags array. */
-#ifdef WITH_WSREP
memset(server_command_flags, 0, sizeof(server_command_flags));
- server_command_flags[COM_STATISTICS]= CF_SKIP_QUESTIONS |
- CF_SKIP_WSREP_CHECK;
- server_command_flags[COM_PING]= CF_SKIP_QUESTIONS |
- CF_SKIP_WSREP_CHECK;
- server_command_flags[COM_STMT_PREPARE]= CF_SKIP_QUESTIONS |
- CF_SKIP_WSREP_CHECK;
- server_command_flags[COM_STMT_EXECUTE]= CF_SKIP_WSREP_CHECK;
- server_command_flags[COM_STMT_FETCH]= CF_SKIP_WSREP_CHECK;
- server_command_flags[COM_STMT_CLOSE]= CF_SKIP_QUESTIONS |
- CF_SKIP_WSREP_CHECK;
- server_command_flags[COM_STMT_RESET]= CF_SKIP_QUESTIONS |
- CF_SKIP_WSREP_CHECK;
- server_command_flags[COM_STMT_SEND_LONG_DATA] = CF_SKIP_WSREP_CHECK;
-
- server_command_flags[COM_QUIT]= CF_SKIP_WSREP_CHECK;
- server_command_flags[COM_PROCESS_INFO]= CF_SKIP_WSREP_CHECK;
- server_command_flags[COM_PROCESS_KILL]= CF_SKIP_WSREP_CHECK;
- server_command_flags[COM_SHUTDOWN]= CF_SKIP_WSREP_CHECK;
- server_command_flags[COM_SLEEP]= CF_SKIP_WSREP_CHECK;
- server_command_flags[COM_TIME]= CF_SKIP_WSREP_CHECK;
- server_command_flags[COM_INIT_DB]= CF_SKIP_WSREP_CHECK;
- server_command_flags[COM_END]= CF_SKIP_WSREP_CHECK;
- /*
- COM_QUERY and COM_SET_OPTION are allowed to pass the early COM_xxx filter,
- they're checked later in mysql_execute_command().
- */
- server_command_flags[COM_QUERY]= CF_SKIP_WSREP_CHECK;
- server_command_flags[COM_SET_OPTION]= CF_SKIP_WSREP_CHECK;
-#else
server_command_flags[COM_STATISTICS]= CF_SKIP_QUESTIONS;
server_command_flags[COM_PING]= CF_SKIP_QUESTIONS;
server_command_flags[COM_STMT_PREPARE]= CF_SKIP_QUESTIONS;
server_command_flags[COM_STMT_CLOSE]= CF_SKIP_QUESTIONS;
server_command_flags[COM_STMT_RESET]= CF_SKIP_QUESTIONS;
+#ifdef WITH_WSREP
+ server_command_flags[COM_STATISTICS]|= CF_SKIP_WSREP_CHECK;
+ server_command_flags[COM_PING]|= CF_SKIP_WSREP_CHECK;
+ server_command_flags[COM_STMT_PREPARE]|= CF_SKIP_WSREP_CHECK;
+ server_command_flags[COM_STMT_EXECUTE]|= CF_SKIP_WSREP_CHECK;
+ server_command_flags[COM_STMT_FETCH]|= CF_SKIP_WSREP_CHECK;
+ server_command_flags[COM_STMT_CLOSE]|= CF_SKIP_WSREP_CHECK;
+ server_command_flags[COM_STMT_RESET]|= CF_SKIP_WSREP_CHECK;
+ server_command_flags[COM_STMT_SEND_LONG_DATA]|= CF_SKIP_WSREP_CHECK;
+ server_command_flags[COM_QUIT]|= CF_SKIP_WSREP_CHECK;
+ server_command_flags[COM_PROCESS_INFO]|= CF_SKIP_WSREP_CHECK;
+ server_command_flags[COM_PROCESS_KILL]|= CF_SKIP_WSREP_CHECK;
+ server_command_flags[COM_SHUTDOWN]|= CF_SKIP_WSREP_CHECK;
+ server_command_flags[COM_SLEEP]|= CF_SKIP_WSREP_CHECK;
+ server_command_flags[COM_TIME]|= CF_SKIP_WSREP_CHECK;
+ server_command_flags[COM_INIT_DB]|= CF_SKIP_WSREP_CHECK;
+ server_command_flags[COM_END]|= CF_SKIP_WSREP_CHECK;
+
+ /*
+ COM_QUERY and COM_SET_OPTION are allowed to pass the early COM_xxx filter,
+ they're checked later in mysql_execute_command().
+ */
+ server_command_flags[COM_QUERY]|= CF_SKIP_WSREP_CHECK;
+ server_command_flags[COM_SET_OPTION]|= CF_SKIP_WSREP_CHECK;
#endif /* WITH_WSREP */
/* Initialize the sql command flags array. */
{
STATUS_VAR current_global_status_var;
ulong uptime;
- uint length __attribute__((unused));
+ uint length MY_ATTRIBUTE((unused));
ulonglong queries_per_second1000;
char buff[250];
uint buff_len= sizeof(buff);
/* DTRACE instrumentation, end */
if (MYSQL_QUERY_DONE_ENABLED() || MYSQL_COMMAND_DONE_ENABLED())
{
- int res __attribute__((unused));
+ int res MY_ATTRIBUTE((unused));
res= (int) thd->is_error();
if (command == COM_QUERY)
{
- Passing to check_stack_overrun() prevents the compiler from removing it.
*/
bool check_stack_overrun(THD *thd, long margin,
- uchar *buf __attribute__((unused)))
+ uchar *buf MY_ATTRIBUTE((unused)))
{
long stack_used;
DBUG_ASSERT(thd == current_thd);
void mysql_parse(THD *thd, char *rawbuf, uint length,
Parser_state *parser_state)
{
- int error __attribute__((unused));
+ int error MY_ATTRIBUTE((unused));
DBUG_ENTER("mysql_parse");
DBUG_EXECUTE_IF("parser_debug", turn_parser_debug_on(););
#define WSREP_TO_ISOLATION_BEGIN(db_, table_, table_list_)
#define WSREP_TO_ISOLATION_END
+#define WSREP_TO_ISOLATION_BEGIN_WRTCHK(db_, table_, table_list_)
#endif /* WITH_WSREP */
join state will not be reverted back to its initial state because we
don't "pop" tables already present in the partial plan.
*/
- bool is_interleave_error __attribute__((unused))=
+ bool is_interleave_error MY_ATTRIBUTE((unused))=
check_interleaving_with_nj (best_table);
/* This has been already checked by best_extension_by_limited_search */
DBUG_ASSERT(!is_interleave_error);
/*
- Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved.
+ Copyright (c) 2005, 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
if ((sym= dlsym(plugin_dl.handle, list_of_services[i].name)))
{
uint ver= (uint)(intptr)*(void**)sym;
- if (ver > list_of_services[i].version ||
- (ver >> 8) < (list_of_services[i].version >> 8))
+ if ((*(void**)sym) != list_of_services[i].service && /* already replaced */
+ (ver > list_of_services[i].version ||
+ (ver >> 8) < (list_of_services[i].version >> 8)))
{
char buf[MYSQL_ERRMSG_SIZE];
my_snprintf(buf, sizeof(buf),
uchar *get_plugin_hash_key(const uchar *buff, size_t *length,
- my_bool not_used __attribute__((unused)))
+ my_bool not_used MY_ATTRIBUTE((unused)))
{
struct st_plugin_int *plugin= (st_plugin_int *)buff;
*length= (uint)plugin->name.length;
uchar *get_bookmark_hash_key(const uchar *buff, size_t *length,
- my_bool not_used __attribute__((unused)))
+ my_bool not_used MY_ATTRIBUTE((unused)))
{
struct st_bookmark *var= (st_bookmark *)buff;
*length= var->name_len + 1;
extern "C" my_bool get_one_plugin_option(int optid, const struct my_option *,
char *);
-my_bool get_one_plugin_option(int optid __attribute__((unused)),
+my_bool get_one_plugin_option(int optid MY_ATTRIBUTE((unused)),
const struct my_option *opt,
char *argument)
{
static my_bool check_if_option_is_deprecated(int optid,
const struct my_option *opt,
- char *argument __attribute__((unused)))
+ char *argument MY_ATTRIBUTE((unused)))
{
if (optid == -1)
{
LEX_STRING plugin_name;
char *varname;
int error;
- sys_var *v __attribute__((unused));
+ sys_var *v MY_ATTRIBUTE((unused));
struct st_bookmark *var;
uint len, count= EXTRA_OPTIONS;
DBUG_ENTER("test_plugin_options");
-/* Copyright (c) 2002, 2015, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2002, 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
}
#else
static bool send_prep_stmt(Prepared_statement *stmt,
- uint columns __attribute__((unused)))
+ uint columns MY_ATTRIBUTE((unused)))
{
THD *thd= stmt->thd;
static bool insert_params_from_vars(Prepared_statement *stmt,
List<LEX_STRING>& varnames,
- String *query __attribute__((unused)))
+ String *query MY_ATTRIBUTE((unused)))
{
Item_param **begin= stmt->param_array;
Item_param **end= begin + stmt->param_count;
/* Go! */
if (open_cursor)
+ {
+ lex->safe_to_cache_query= 0;
error= mysql_open_cursor(thd, &result, &cursor);
+ }
else
{
/*
/* Store MYSQL_TIME (in binary format) */
bool Protocol_local::store(MYSQL_TIME *time,
- uint precision __attribute__((unused)))
+ uint precision MY_ATTRIBUTE((unused)))
{
return store_column(time, sizeof(MYSQL_TIME));
}
/** Store MYSQL_TIME (in binary format) */
bool Protocol_local::store_time(MYSQL_TIME *time,
- uint precision __attribute__((unused)))
+ uint precision MY_ATTRIBUTE((unused)))
{
return store_column(time, sizeof(MYSQL_TIME));
}
-/* Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2000, 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
*/
bool JOIN_TAB::and_with_condition(Item *add_cond, uint line)
{
- Item *old_cond __attribute__((unused))= m_condition;
+ Item *old_cond MY_ATTRIBUTE((unused))= m_condition;
if (and_conditions(&m_condition, add_cond))
return true;
DBUG_PRINT("info", ("JOIN_TAB::m_condition extended. Change %p -> %p "
-/* Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2000, 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
static uchar *servers_cache_get_key(FOREIGN_SERVER *server, size_t *length,
- my_bool not_used __attribute__((unused)))
+ my_bool not_used MY_ATTRIBUTE((unused)))
{
DBUG_ENTER("servers_cache_get_key");
DBUG_PRINT("info", ("server_name_length %d server_name %s",
-/* Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2000, 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
static uchar *
db_dirs_hash_get_key(const uchar *data, size_t *len_ret,
- my_bool __attribute__((unused)))
+ my_bool MY_ATTRIBUTE((unused)))
{
LEX_STRING *e= (LEX_STRING *) data;
{
return (void*) sql_alloc((uint) size);
}
- static void operator delete(void *ptr __attribute__((unused)),
- size_t size __attribute__((unused)))
+ static void operator delete(void *ptr MY_ATTRIBUTE((unused)),
+ size_t size MY_ATTRIBUTE((unused)))
{ TRASH(ptr, size); }
ulong thread_id;
-/* Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights
+/* Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights
* reserved.
This program is free software; you can redistribute it and/or modify
bool String::append(const String &s)
{
- DBUG_ASSERT(!this->uses_buffer_owned_by(&s));
- DBUG_ASSERT(!s.uses_buffer_owned_by(this));
if (s.length())
{
+ DBUG_ASSERT(!this->uses_buffer_owned_by(&s));
+ DBUG_ASSERT(!s.uses_buffer_owned_by(this));
+
if (realloc(str_length+s.length()))
return TRUE;
memcpy(Ptr+str_length,s.ptr(),s.length());
*/
create_info->used_fields|= HA_CREATE_USED_ENGINE;
- int result __attribute__((unused))=
+ int result MY_ATTRIBUTE((unused))=
store_create_info(thd, table, &query,
create_info, TRUE /* show_database */);
-/* Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2000, 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
@param OUT str String to conver to
@param dec Number of fractional digits.
*/
-void make_time(const DATE_TIME_FORMAT *format __attribute__((unused)),
+void make_time(const DATE_TIME_FORMAT *format MY_ATTRIBUTE((unused)),
const MYSQL_TIME *l_time, String *str, uint dec)
{
uint length= (uint) my_time_to_str(l_time, (char*) str->ptr(), dec);
@param l_time DATE value
@param OUT str String to conver to
*/
-void make_date(const DATE_TIME_FORMAT *format __attribute__((unused)),
+void make_date(const DATE_TIME_FORMAT *format MY_ATTRIBUTE((unused)),
const MYSQL_TIME *l_time, String *str)
{
uint length= (uint) my_date_to_str(l_time, (char*) str->ptr());
@param OUT str String to conver to
@param dec Number of fractional digits.
*/
-void make_datetime(const DATE_TIME_FORMAT *format __attribute__((unused)),
+void make_datetime(const DATE_TIME_FORMAT *format MY_ATTRIBUTE((unused)),
const MYSQL_TIME *l_time, String *str, uint dec)
{
uint length= (uint) my_datetime_to_str(l_time, (char*) str->ptr(), dec);
-/* Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2011, 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
case Item::REF_ITEM:
case Item::NULL_ITEM:
case Item::VARBIN_ITEM:
+ case Item::PARAM_ITEM:
if (make_copy_field)
{
DBUG_ASSERT(((Item_result_field*)item)->result_field);
-/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2000, 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
extern "C" uchar* get_hash_key(const uchar *buff, size_t *length,
- my_bool not_used __attribute__((unused)))
+ my_bool not_used MY_ATTRIBUTE((unused)))
{
udf_func *udf=(udf_func*) buff;
*length=(uint) udf->name.length;
/* Update the table->file->stats.records number */
table->file->info(HA_STATUS_VARIABLE | HA_STATUS_NO_LOCK);
- table->mark_columns_needed_for_update();
+ table->mark_columns_needed_for_update(false/*mark_binlog_columns=false*/);
select= make_select(table, 0, 0, conds, 0, &error);
{ // Enter scope for optimizer trace wrapper
#ifdef WITH_PARTITION_STORAGE_ENGINE
used_key_is_modified|= partition_key_modified(table, table->write_set);
#endif
-
+ table->mark_columns_per_binlog_row_image();
using_filesort= order && (need_sort||used_key_is_modified);
if (thd->lex->describe)
{
{
if (safe_update_on_fly(thd, join->join_tab, table_ref, all_tables))
{
- table->mark_columns_needed_for_update();
+ table->mark_columns_needed_for_update(true/*mark_binlog_columns=true*/);
table_to_update= table; // Update table on the fly
continue;
}
}
- table->mark_columns_needed_for_update();
+ table->mark_columns_needed_for_update(true/*mark_binlog_columns=true*/);
/*
enable uncacheable flag if we update a view with check option
<pre>
yyerrlab1:
#if defined (__GNUC_MINOR__) && 2093 <= (__GNUC__ * 1000 + __GNUC_MINOR__)
- __attribute__ ((__unused__))
+ MY_ATTRIBUTE ((__unused__))
#endif
</pre>
- This usage of __attribute__ is illegal, so we remove it.
+ This usage of MY_ATTRIBUTE is illegal, so we remove it.
See the following references for details:
http://lists.gnu.org/archive/html/bug-bison/2004-02/msg00014.html
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14273
*/
#if defined (__GNUC_MINOR__) && 2093 <= (__GNUC__ * 1000 + __GNUC_MINOR__)
-#undef __attribute__
-#define __attribute__(X)
+#undef MY_ATTRIBUTE
+#define MY_ATTRIBUTE(X)
#endif
ident_or_text
OPTIONS_SYM '(' server_options_list ')'
{
+ if ($2.length == 0)
+ {
+ my_error(ER_WRONG_VALUE, MYF(0), "server name", "");
+ MYSQL_YYABORT;
+ }
Lex->server_options.server_name= $2.str;
Lex->server_options.server_name_length= $2.length;
Lex->server_options.scheme= $6.str;
-/* Copyright (c) 2009, 2015, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2002, 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
if (!var->save_result.string_value.str)
return true;
+ if (!is_valid_log_name(var->save_result.string_value.str,
+ var->save_result.string_value.length))
+ {
+ my_error(ER_WRONG_VALUE_FOR_VAR, MYF(0),
+ self->name.str, var->save_result.string_value.str);
+ return true;
+ }
+
if (var->save_result.string_value.length > FN_REFLEN)
{ // path is too long
my_error(ER_PATH_LENGTH, MYF(0), self->name.str);
return false;
}
static bool fix_log(char** logname, const char* default_logname,
- const char*ext, bool enabled, void (*reopen)(char*))
+ const char*ext, bool enabled, bool (*reopen)(char*))
{
if (!*logname) // SET ... = DEFAULT
{
}
logger.lock_exclusive();
mysql_mutex_unlock(&LOCK_global_system_variables);
+ bool error= false;
if (enabled)
- reopen(*logname);
+ error= reopen(*logname);
logger.unlock();
mysql_mutex_lock(&LOCK_global_system_variables);
- return false;
+ return error;
}
-static void reopen_general_log(char* name)
+static bool reopen_general_log(char* name)
{
logger.get_log_file_handler()->close(0);
- logger.get_log_file_handler()->open_query_log(name);
+ return logger.get_log_file_handler()->open_query_log(name);
}
static bool fix_general_log_file(sys_var *self, THD *thd, enum_var_type type)
{
IN_FS_CHARSET, DEFAULT(0), NO_MUTEX_GUARD, NOT_IN_BINLOG,
ON_CHECK(check_log_path), ON_UPDATE(fix_general_log_file));
-static void reopen_slow_log(char* name)
+static bool reopen_slow_log(char* name)
{
logger.get_slow_log_file_handler()->close(0);
- logger.get_slow_log_file_handler()->open_slow_log(name);
+ return logger.get_slow_log_file_handler()->open_slow_log(name);
}
static bool fix_slow_log_file(sys_var *self, THD *thd, enum_var_type type)
{
static Sys_var_ulong Sys_wsrep_max_ws_size (
"wsrep_max_ws_size", "Max write set size (bytes)",
GLOBAL_VAR(wsrep_max_ws_size), CMD_LINE(REQUIRED_ARG),
- /* Upper limit is 65K short of 4G to avoid overlows on 32-bit systems */
- VALID_RANGE(1024, WSREP_MAX_WS_SIZE), DEFAULT(1073741824UL), BLOCK_SIZE(1));
+ VALID_RANGE(1024, WSREP_MAX_WS_SIZE), DEFAULT(WSREP_MAX_WS_SIZE),
+ BLOCK_SIZE(1), NO_MUTEX_GUARD, NOT_IN_BINLOG, ON_CHECK(0),
+ ON_UPDATE(wsrep_max_ws_size_update));
static Sys_var_ulong Sys_wsrep_max_ws_rows (
"wsrep_max_ws_rows", "Max number of rows in write set",
GLOBAL_VAR(wsrep_max_ws_rows), CMD_LINE(REQUIRED_ARG),
- VALID_RANGE(1, 1048576), DEFAULT(131072), BLOCK_SIZE(1));
+ VALID_RANGE(0, 1048576), DEFAULT(0), BLOCK_SIZE(1));
static Sys_var_charptr Sys_wsrep_notify_cmd(
"wsrep_notify_cmd", "",
/*
- Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
+ Copyright (c) 2000, 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
/* Get column name from column hash */
static uchar *get_field_name(Field **buff, size_t *length,
- my_bool not_used __attribute__((unused)))
+ my_bool not_used MY_ATTRIBUTE((unused)))
{
*length= (uint) strlen((*buff)->field_name);
return (uchar*) (*buff)->field_name;
@brief
Mark columns needed for doing an update of a row
+ @param mark_binlog_columns if true, mark columns as per binlog_row_image
+ requirements.
@details
Some engines needs to have all columns in an update (to be able to
build a complete row). If this is the case, we mark all not
updated columns to be read.
- If this is no the case, we do like in the delete case and mark
+ If this is not the case, we do like in the delete case and mark
if neeed, either the primary key column or all columns to be read.
(see mark_columns_needed_for_delete() for details)
mark all USED key columns as 'to-be-read'. This allows the engine to
loop over the given record to find all changed keys and doesn't have to
retrieve the row again.
-
+
Unlike other similar methods, it doesn't mark fields used by triggers,
that is the responsibility of the caller to do, by using
Table_triggers_list::mark_used_fields(TRG_EVENT_UPDATE)!
+
+ Note: Marking additional columns as per binlog_row_image requirements will
+ influence query execution plan. For example in the case of
+ binlog_row_image=FULL the entire read_set and write_set needs to be flagged.
+ This will influence update query to think that 'used key is being modified'
+ and query will create a temporary table to process the update operation.
+ Which will result in performance degradation. Hence callers who don't want
+ their query execution to be influenced as per binlog_row_image requirements
+ can skip marking binlog specific columns here and they should make an
+ explicit call to 'mark_columns_per_binlog_row_image()' function to mark
+ binlog_row_image specific columns.
*/
-void TABLE::mark_columns_needed_for_update()
+void TABLE::mark_columns_needed_for_update(bool mark_binlog_columns)
{
DBUG_ENTER("mark_columns_needed_for_update");
- mark_columns_per_binlog_row_image();
+
+ if (mark_binlog_columns)
+ mark_columns_per_binlog_row_image();
if (file->ha_table_flags() & HA_REQUIRES_KEY_COLUMNS_FOR_DELETE)
{
/* Mark all used key columns for read */
#ifndef TABLE_INCLUDED
#define TABLE_INCLUDED
-/* Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2000, 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
void mark_columns_used_by_index_no_reset(uint index, MY_BITMAP *map);
void mark_columns_used_by_index(uint index);
void mark_auto_increment_column(void);
- void mark_columns_needed_for_update(void);
+ void mark_columns_needed_for_update(bool mark_binlog_columns);
void mark_columns_needed_for_delete(void);
void mark_columns_needed_for_insert(void);
void mark_columns_per_binlog_row_image(void);
-/* Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2012, 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
extern "C" uchar *table_cache_key(const uchar *record,
size_t *length,
- my_bool not_used __attribute__((unused)))
+ my_bool not_used MY_ATTRIBUTE((unused)))
{
TABLE_SHARE *share= ((Table_cache_element*)record)->get_share();
*length= share->table_cache_key.length;
-/* Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2004, 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
extern "C" uchar *
my_tz_names_get_key(Tz_names_entry *entry, size_t *length,
- my_bool not_used __attribute__((unused)))
+ my_bool not_used MY_ATTRIBUTE((unused)))
{
*length= entry->name.length();
return (uchar*) entry->name.ptr();
extern "C" uchar *
my_offset_tzs_get_key(Time_zone_offset *entry,
size_t *length,
- my_bool not_used __attribute__((unused)))
+ my_bool not_used MY_ATTRIBUTE((unused)))
{
*length= sizeof(long);
return (uchar*) &entry->offset;
-/* Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2000, 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
****************************************************************************/
-void metaphon_deinit(UDF_INIT *initid __attribute__((unused)))
+void metaphon_deinit(UDF_INIT *initid MY_ATTRIBUTE((unused)))
{
}
#define NOGHTOF(x) (codes[(x) - 'A'] & 16) /* BDH */
-char *metaphon(UDF_INIT *initid __attribute__((unused)),
+char *metaphon(UDF_INIT *initid MY_ATTRIBUTE((unused)),
UDF_ARGS *args, char *result, unsigned long *length,
- char *is_null, char *error __attribute__((unused)))
+ char *is_null, char *error MY_ATTRIBUTE((unused)))
{
const char *word=args->args[0];
const char *w_end;
}
-double myfunc_double(UDF_INIT *initid __attribute__((unused)), UDF_ARGS *args,
- char *is_null, char *error __attribute__((unused)))
+double myfunc_double(UDF_INIT *initid MY_ATTRIBUTE((unused)), UDF_ARGS *args,
+ char *is_null, char *error MY_ATTRIBUTE((unused)))
{
unsigned long val = 0;
unsigned long v = 0;
/* This function returns the sum of all arguments */
-longlong myfunc_int(UDF_INIT *initid __attribute__((unused)), UDF_ARGS *args,
- char *is_null __attribute__((unused)),
- char *error __attribute__((unused)))
+longlong myfunc_int(UDF_INIT *initid MY_ATTRIBUTE((unused)), UDF_ARGS *args,
+ char *is_null MY_ATTRIBUTE((unused)),
+ char *error MY_ATTRIBUTE((unused)))
{
longlong val = 0;
uint i;
At least one of _init/_deinit is needed unless the server is started
with --allow_suspicious_udfs.
*/
-my_bool myfunc_int_init(UDF_INIT *initid __attribute__((unused)),
- UDF_ARGS *args __attribute__((unused)),
- char *message __attribute__((unused)))
+my_bool myfunc_int_init(UDF_INIT *initid MY_ATTRIBUTE((unused)),
+ UDF_ARGS *args MY_ATTRIBUTE((unused)),
+ char *message MY_ATTRIBUTE((unused)))
{
return 0;
}
free(initid->ptr);
}
-longlong sequence(UDF_INIT *initid __attribute__((unused)), UDF_ARGS *args,
- char *is_null __attribute__((unused)),
- char *error __attribute__((unused)))
+longlong sequence(UDF_INIT *initid MY_ATTRIBUTE((unused)), UDF_ARGS *args,
+ char *is_null MY_ATTRIBUTE((unused)),
+ char *error MY_ATTRIBUTE((unused)))
{
ulonglong val=0;
if (args->arg_count)
return 0;
}
-void lookup_deinit(UDF_INIT *initid __attribute__((unused)))
+void lookup_deinit(UDF_INIT *initid MY_ATTRIBUTE((unused)))
{
#if !defined(HAVE_GETHOSTBYADDR_R) || !defined(HAVE_SOLARIS_STYLE_GETHOST)
(void) pthread_mutex_destroy(&LOCK_hostname);
#endif
}
-char *lookup(UDF_INIT *initid __attribute__((unused)), UDF_ARGS *args,
+char *lookup(UDF_INIT *initid MY_ATTRIBUTE((unused)), UDF_ARGS *args,
char *result, unsigned long *res_length, char *null_value,
- char *error __attribute__((unused)))
+ char *error MY_ATTRIBUTE((unused)))
{
uint length;
char name_buff[256];
return 0;
}
-void reverse_lookup_deinit(UDF_INIT *initid __attribute__((unused)))
+void reverse_lookup_deinit(UDF_INIT *initid MY_ATTRIBUTE((unused)))
{
#if !defined(HAVE_GETHOSTBYADDR_R) || !defined(HAVE_SOLARIS_STYLE_GETHOST)
(void) pthread_mutex_destroy(&LOCK_hostname);
#endif
}
-char *reverse_lookup(UDF_INIT *initid __attribute__((unused)), UDF_ARGS *args,
+char *reverse_lookup(UDF_INIT *initid MY_ATTRIBUTE((unused)), UDF_ARGS *args,
char *result, unsigned long *res_length,
- char *null_value, char *error __attribute__((unused)))
+ char *null_value, char *error MY_ATTRIBUTE((unused)))
{
#if defined(HAVE_GETHOSTBYADDR_R) && defined(HAVE_SOLARIS_STYLE_GETHOST)
char name_buff[256];
/* This is needed to get things to work in MySQL 4.1.1 and above */
void
-avgcost_clear(UDF_INIT* initid, char* is_null __attribute__((unused)),
- char* message __attribute__((unused)))
+avgcost_clear(UDF_INIT* initid, char* is_null MY_ATTRIBUTE((unused)),
+ char* message MY_ATTRIBUTE((unused)))
{
struct avgcost_data* data = (struct avgcost_data*)initid->ptr;
data->totalprice= 0.0;
void
avgcost_add(UDF_INIT* initid, UDF_ARGS* args,
- char* is_null __attribute__((unused)),
- char* message __attribute__((unused)))
+ char* is_null MY_ATTRIBUTE((unused)),
+ char* message MY_ATTRIBUTE((unused)))
{
if (args->args[0] && args->args[1])
{
double
-avgcost( UDF_INIT* initid, UDF_ARGS* args __attribute__((unused)),
- char* is_null, char* error __attribute__((unused)))
+avgcost( UDF_INIT* initid, UDF_ARGS* args MY_ATTRIBUTE((unused)),
+ char* is_null, char* error MY_ATTRIBUTE((unused)))
{
struct avgcost_data* data = (struct avgcost_data*)initid->ptr;
if (!data->count || !data->totalquantity)
return 0;
}
-char *myfunc_argument_name(UDF_INIT *initid __attribute__((unused)),
+char *myfunc_argument_name(UDF_INIT *initid MY_ATTRIBUTE((unused)),
UDF_ARGS *args, char *result,
unsigned long *length, char *null_value,
- char *error __attribute__((unused)))
+ char *error MY_ATTRIBUTE((unused)))
{
if (!args->attributes[0])
{
return 0;
}
-char * is_const(UDF_INIT *initid, UDF_ARGS *args __attribute__((unused)),
+char * is_const(UDF_INIT *initid, UDF_ARGS *args MY_ATTRIBUTE((unused)),
char *result, unsigned long *length,
- char *is_null, char *error __attribute__((unused)))
+ char *is_null, char *error MY_ATTRIBUTE((unused)))
{
if (initid->ptr != 0) {
sprintf(result, "const");
}
extern "C"
-char * check_const_len(UDF_INIT *initid, UDF_ARGS *args __attribute__((unused)),
+char * check_const_len(UDF_INIT *initid, UDF_ARGS *args MY_ATTRIBUTE((unused)),
char *result, unsigned long *length,
- char *is_null, char *error __attribute__((unused)))
+ char *is_null, char *error MY_ATTRIBUTE((unused)))
{
strmov(result, initid->ptr);
*length= (uint) strlen(result);
}
void my_median_add(UDF_INIT* initid, UDF_ARGS* args,
- char* is_null __attribute__((unused)),
- char* message __attribute__((unused)))
+ char* is_null MY_ATTRIBUTE((unused)),
+ char* message MY_ATTRIBUTE((unused)))
{
My_median_data *data=
static_cast<My_median_data*>(static_cast<void*>(initid->ptr));
}
void my_median_clear(UDF_INIT* initid, UDF_ARGS* args,
- char* is_null __attribute__((unused)),
- char* message __attribute__((unused)))
+ char* is_null MY_ATTRIBUTE((unused)),
+ char* message MY_ATTRIBUTE((unused)))
{
My_median_data *data=
static_cast<My_median_data*>(static_cast<void*>(initid->ptr));
longlong my_median(UDF_INIT* initid, UDF_ARGS* args,
char* is_null,
- char* message __attribute__((unused)))
+ char* message MY_ATTRIBUTE((unused)))
{
My_median_data *data=
static_cast<My_median_data*>(static_cast<void*>(initid->ptr));
const char *error= 0;
Log_event *res= 0;
- if (data_len > wsrep_max_ws_size)
- {
- error = "Event too big";
- goto err;
- }
-
res= Log_event::read_log_event(buf, data_len, &error, description_event, 0);
-err:
if (!res)
{
DBUG_ASSERT(error != 0);
#include "sql_class.h" // THD, IO_CACHE
#define HEAP_PAGE_SIZE 65536 /* 64K */
-#define WSREP_MAX_WS_SIZE (0xFFFFFFFFUL - HEAP_PAGE_SIZE)
+#define WSREP_MAX_WS_SIZE 2147483647 /* 2GB */
/*
Write the contents of a cache to a memory buffer.
*/
void wsrep_cleanup_transaction(THD *thd)
{
+ if (!WSREP(thd)) return;
+
if (wsrep_emulate_bin_log) thd_binlog_trx_reset(thd);
thd->wsrep_ws_handle.trx_id= WSREP_UNDEFINED_TRX_ID;
thd->wsrep_trx_meta.gtid= WSREP_GTID_UNDEFINED;
thd->wsrep_trx_meta.depends_on= WSREP_SEQNO_UNDEFINED;
thd->wsrep_exec_mode= LOCAL_STATE;
+ thd->wsrep_affected_rows= 0;
return;
}
*/
void wsrep_post_commit(THD* thd, bool all)
{
+ if (!WSREP(thd)) return;
+
switch (thd->wsrep_exec_mode)
{
case LOCAL_COMMIT:
"wsrep status (%d %d %d)",
WSREP_QUERY(thd),
thd->get_stmt_da()->affected_rows(),
- stmt_has_updated_trans_table(thd), thd->variables.sql_log_bin,
+ stmt_has_updated_trans_table(thd->transaction.stmt.ha_list),
+ thd->variables.sql_log_bin,
thd->wsrep_exec_mode, thd->wsrep_query_state,
thd->wsrep_conflict_state);
}
* End configuration options
*/
-static const wsrep_uuid_t cluster_uuid = WSREP_UUID_UNDEFINED;
+static wsrep_uuid_t cluster_uuid = WSREP_UUID_UNDEFINED;
static char cluster_uuid_str[40]= { 0, };
static const char* cluster_status_str[WSREP_VIEW_MAX] =
{
if (memcmp(&cluster_uuid, &view->state_id.uuid, sizeof(wsrep_uuid_t)))
{
- memcpy((wsrep_uuid_t*)&cluster_uuid, &view->state_id.uuid,
- sizeof(cluster_uuid));
+ memcpy(&cluster_uuid, &view->state_id.uuid, sizeof(cluster_uuid));
wsrep_uuid_print (&cluster_uuid, cluster_uuid_str,
sizeof(cluster_uuid_str));
WSREP_ERROR("wsrep_load(%s) failed: %s (%d). Reverting to no provider.",
wsrep_provider, strerror(rcode), rcode);
strcpy((char*)wsrep_provider, WSREP_NONE); // damn it's a dirty hack
- (void) wsrep_init();
- return rcode;
+ return wsrep_init();
}
else /* this is for recursive call above */
{
wsrep_thr_lock_init(wsrep_thd_is_BF, wsrep_abort_thd,
wsrep_debug, wsrep_convert_LOCK_to_trx, wsrep_on);
+ /* Skip replication start if dummy wsrep provider is loaded */
+ if (!strcmp(wsrep_provider, WSREP_NONE)) return;
+
/* Skip replication start if no cluster address */
if (!wsrep_cluster_address || strlen(wsrep_cluster_address) == 0) return;
/* Other global variables */
extern wsrep_seqno_t wsrep_locked_seqno;
-#define WSREP_ON \
- (global_system_variables.wsrep_on)
+#define WSREP_ON \
+ ((global_system_variables.wsrep_on) && \
+ wsrep_provider && \
+ strcmp(wsrep_provider, WSREP_NONE))
#define WSREP(thd) \
(WSREP_ON && wsrep && (thd && thd->variables.wsrep_on))
shadow->db = thd->db;
shadow->db_length = thd->db_length;
thd->reset_db(NULL, 0);
+
+ shadow->user_time = thd->user_time;
}
static void wsrep_return_from_bf_mode(THD *thd, struct wsrep_thd_shadow* shadow)
thd->net.vio = shadow->vio;
thd->variables.tx_isolation = shadow->tx_isolation;
thd->reset_db(shadow->db, shadow->db_length);
+ thd->user_time = shadow->user_time;
}
void wsrep_replay_transaction(THD *thd)
wsrep_set_local_position (val, false);
}
+static int get_provider_option_value(const char* opts,
+ const char* opt_name,
+ ulong* opt_value)
+{
+ int ret= 1;
+ ulong opt_value_tmp;
+ char *opt_value_str, *s, *opts_copy= my_strdup(opts, MYF(MY_WME));
+
+ if ((opt_value_str= strstr(opts_copy, opt_name)) == NULL)
+ goto end;
+ opt_value_str= strtok_r(opt_value_str, "=", &s);
+ if (opt_value_str == NULL) goto end;
+ opt_value_str= strtok_r(NULL, ";", &s);
+ if (opt_value_str == NULL) goto end;
+
+ opt_value_tmp= strtoul(opt_value_str, NULL, 10);
+ if (errno == ERANGE) goto end;
+
+ *opt_value= opt_value_tmp;
+ ret= 0;
+
+end:
+ my_free(opts_copy);
+ return ret;
+}
+
static bool refresh_provider_options()
{
WSREP_DEBUG("refresh_provider_options: %s",
char* opts= wsrep->options_get(wsrep);
if (opts)
{
- if (wsrep_provider_options) my_free((void *)wsrep_provider_options);
- wsrep_provider_options = (char*)my_memdup(opts, strlen(opts) + 1,
- MYF(MY_WME));
+ wsrep_provider_options_init(opts);
+ get_provider_option_value(wsrep_provider_options,
+ (char*)"repl.max_ws_size",
+ &wsrep_max_ws_size);
+ free(opts);
}
else
{
return false;
}
+bool wsrep_max_ws_size_update (sys_var *self, THD *thd, enum_var_type)
+{
+ char max_ws_size_opt[128];
+ my_snprintf(max_ws_size_opt, sizeof(max_ws_size_opt),
+ "repl.max_ws_size=%d", wsrep_max_ws_size);
+ wsrep_status_t ret= wsrep->options_set(wsrep, max_ws_size_opt);
+ if (ret != WSREP_OK)
+ {
+ WSREP_ERROR("Set options returned %d", ret);
+ refresh_provider_options();
+ return true;
+ }
+ return refresh_provider_options();
+}
+
/*
* Status variables stuff below
*/
extern bool wsrep_desync_check CHECK_ARGS;
extern bool wsrep_desync_update UPDATE_ARGS;
+extern bool wsrep_max_ws_size_update UPDATE_ARGS;
+
extern bool wsrep_reject_queries_update UPDATE_ARGS;
#endif /* WSREP_VAR_H */
-/* Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2007, 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
#include <m_string.h>
#include <my_getopt.h>
#include <mysql_version.h>
+#include <welcome_copyright_notice.h> // ORACLE_WELCOME_COPYRIGHT_NOTICE
#define BUFFER_LEN 1024
#define ARCHIVE_ROW_HEADER_SIZE 4
static my_bool
get_one_option(int optid,
- const struct my_option *opt __attribute__((unused)),
+ const struct my_option *opt MY_ATTRIBUTE((unused)),
char *argument)
{
switch (optid) {
static void usage(void)
{
print_version();
- puts("Copyright 2007-2008 MySQL AB, 2008 Sun Microsystems, Inc.");
- puts("This software comes with ABSOLUTELY NO WARRANTY. This is free software,\nand you are welcome to modify and redistribute it under the GPL license\n");
+ puts(ORACLE_WELCOME_COPYRIGHT_NOTICE("2007"));
+
puts("Read and modify Archive files directly\n");
printf("Usage: %s [OPTIONS] file_to_be_looked_at [file_for_backup]\n", my_progname);
print_defaults("my", load_default_groups);
-/* Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2005, 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
}
static uchar* blackhole_get_key(st_blackhole_share *share, size_t *length,
- my_bool not_used __attribute__((unused)))
+ my_bool not_used MY_ATTRIBUTE((unused)))
{
*length= share->table_name_length;
return (uchar*) share->table_name;
-/* Copyright (c) 2004, 2011, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2004, 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
}
static uchar* tina_get_key(TINA_SHARE *share, size_t *length,
- my_bool not_used __attribute__((unused)))
+ my_bool not_used MY_ATTRIBUTE((unused)))
{
*length=share->table_name_length;
return (uchar*) share->table_name;
-/* Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2004, 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
*/
int ha_example::index_read_map(uchar *buf, const uchar *key,
- key_part_map keypart_map __attribute__((unused)),
+ key_part_map keypart_map MY_ATTRIBUTE((unused)),
enum ha_rkey_function find_flag
- __attribute__((unused)))
+ MY_ATTRIBUTE((unused)))
{
int rc;
DBUG_ENTER("ha_example::index_read");
/* Function we use in the creation of our hash to get key */
static uchar *federated_get_key(FEDERATED_SHARE *share, size_t *length,
- my_bool not_used __attribute__ ((unused)))
+ my_bool not_used MY_ATTRIBUTE ((unused)))
{
*length= share->share_key_length;
return (uchar*) share->share_key;
@param[in] record record data (unused)
*/
-void ha_federated::position(const uchar *record __attribute__ ((unused)))
+void ha_federated::position(const uchar *record MY_ATTRIBUTE ((unused)))
{
DBUG_ENTER("ha_federated::position");
-/* Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2000, 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
uint hp_rb_key_length(HP_KEYDEF *keydef,
- const uchar *key __attribute__((unused)))
+ const uchar *key MY_ATTRIBUTE((unused)))
{
return keydef->length;
}
-/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
reserved
This program is free software; you can redistribute it and/or modify
} /* rnd */
-static sig_handler endprog(int sig_number __attribute__((unused)))
+static sig_handler endprog(int sig_number MY_ATTRIBUTE((unused)))
{
{
hp_panic(HA_PANIC_CLOSE);
/*****************************************************************************
-Copyright (c) 1994, 2015, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1994, 2016, 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
@retval block, rw_lock_x_lock_count(&block->lock) == 1 if allocation succeeded
(init_mtr == mtr, or the page was not previously freed in mtr)
@retval block (not allocated or initialized) otherwise */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
buf_block_t*
btr_page_alloc_low(
/*===============*/
@retval true if the operation was successful
@retval false if it is a compressed page, and recompression failed */
-static __attribute__((nonnull))
+static MY_ATTRIBUTE((nonnull))
bool
btr_page_reorganize_block(
/*======================*/
{
ulint level;
- ut_ad(ptr && end_ptr);
+ ut_ad(ptr != NULL);
+ ut_ad(end_ptr != NULL);
/* If dealing with a compressed page the record has the
compression level used during original compression written in
Returns TRUE if the insert fits on the appropriate half-page with the
chosen split_rec.
@return true if fits */
-static __attribute__((nonnull(1,3,4,6), warn_unused_result))
+static MY_ATTRIBUTE((nonnull(1,3,4,6), warn_unused_result))
bool
btr_page_insert_fits(
/*=================*/
/**************************************************************//**
Attaches the halves of an index page on the appropriate level in an
index tree. */
-static __attribute__((nonnull))
+static MY_ATTRIBUTE((nonnull))
void
btr_attach_half_pages(
/*==================*/
/*************************************************************//**
Determine if a tuple is smaller than any record on the page.
@return TRUE if smaller */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
bool
btr_page_tuple_smaller(
/*===================*/
/*************************************************************//**
Removes a page from the level list of pages. */
-static __attribute__((nonnull))
+static MY_ATTRIBUTE((nonnull))
void
btr_level_list_remove_func(
/*=======================*/
ulint prev_page_no;
ulint next_page_no;
- ut_ad(page && mtr);
+ ut_ad(page != NULL);
+ ut_ad(mtr != NULL);
ut_ad(mtr_memo_contains_page(mtr, page, MTR_MEMO_PAGE_X_FIX));
ut_ad(space == page_get_space_id(page));
/* Get the previous and next page numbers of page */
/*****************************************************************************
-Copyright (c) 1994, 2015, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1994, 2016, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2008, Google Inc.
Copyright (c) 2012, Facebook Inc.
or by invoking ibuf_reset_free_bits() before mtr_commit().
@return pointer to inserted record if succeed, else NULL */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
rec_t*
btr_cur_insert_if_possible(
/*=======================*/
/*************************************************************//**
For an insert, checks the locks and does the undo logging if desired.
@return DB_SUCCESS, DB_WAIT_LOCK, DB_FAIL, or error number */
-UNIV_INLINE __attribute__((warn_unused_result, nonnull(2,3,5,6)))
+UNIV_INLINE MY_ATTRIBUTE((warn_unused_result, nonnull(2,3,5,6)))
dberr_t
btr_cur_ins_lock_and_undo(
/*======================*/
/*************************************************************//**
For an update, checks the locks and does the undo logging.
@return DB_SUCCESS, DB_WAIT_LOCK, or error number */
-UNIV_INLINE __attribute__((warn_unused_result, nonnull(2,3,6,7)))
+UNIV_INLINE MY_ATTRIBUTE((warn_unused_result, nonnull(2,3,6,7)))
dberr_t
btr_cur_upd_lock_and_undo(
/*======================*/
const rec_t* rec;
dberr_t err;
- ut_ad(thr || (flags & BTR_NO_LOCKING_FLAG));
+ ut_ad((thr != NULL) || (flags & BTR_NO_LOCKING_FLAG));
rec = btr_cur_get_rec(cursor);
index = cursor->index;
ut_ad(page_is_leaf(page_align(rec)));
#ifdef UNIV_DEBUG
- if (btr_cur_print_record_ops && thr) {
+ if (btr_cur_print_record_ops && (thr != NULL)) {
btr_cur_trx_report(thr_get_trx(thr)->id, index, "del mark ");
rec_print_new(stderr, rec, offsets);
}
rec = btr_cur_get_rec(cursor);
#ifdef UNIV_DEBUG
- if (btr_cur_print_record_ops && thr) {
+ if (btr_cur_print_record_ops && (thr != NULL)) {
btr_cur_trx_report(thr_get_trx(thr)->id, cursor->index,
"del mark ");
rec_print(stderr, rec, cursor->index);
ulint i, /*!< in: field number of field_ref;
ignored if rec == NULL */
enum trx_rb_ctx rb_ctx, /*!< in: rollback context */
- mtr_t* local_mtr __attribute__((unused))) /*!< in: mtr
+ mtr_t* local_mtr MY_ATTRIBUTE((unused))) /*!< in: mtr
containing the latch to data an an
X-latch to the index tree */
{
/*****************************************************************************
-Copyright (c) 1996, 2012, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1996, 2016, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2008, Google Inc.
Portions of this file contain modifications contributed and copyrighted by
/*==============================*/
btr_search_t* info, /*!< in: search info */
buf_block_t* block, /*!< in: buffer block */
- btr_cur_t* cursor __attribute__((unused)))
+ btr_cur_t* cursor MY_ATTRIBUTE((unused)))
/*!< in: cursor */
{
#ifdef UNIV_SYNC_DEBUG
/*****************************************************************************
-Copyright (c) 2006, 2013, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 2006, 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
/**********************************************************************//**
Check if a buddy is stamped free.
@return whether the buddy is free */
-UNIV_INLINE __attribute__((warn_unused_result))
+UNIV_INLINE MY_ATTRIBUTE((warn_unused_result))
bool
buf_buddy_stamp_is_free(
/*====================*/
@retval BUF_BUDDY_STATE_FREE if fully free
@retval BUF_BUDDY_STATE_USED if currently in use
@retval BUF_BUDDY_STATE_PARTIALLY_USED if partially in use. */
-static __attribute__((warn_unused_result))
+static MY_ATTRIBUTE((warn_unused_result))
buf_buddy_state_t
buf_buddy_is_free(
/*==============*/
/*****************************************************************************
-Copyright (c) 1995, 2015, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1995, 2016, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2008, Google Inc.
Portions of this file contain modifications contributed and copyrighted by
/********************************************************************//**
Inits a page to the buffer buf_pool. */
-static __attribute__((nonnull))
+static MY_ATTRIBUTE((nonnull))
void
buf_page_init(
/*==========*/
/*****************************************************************************
-Copyright (c) 2011, 2015, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 2011, 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
variable_name = 'INNODB_BUFFER_POOL_DUMP_STATUS';
or by:
SHOW STATUS LIKE 'innodb_buffer_pool_dump_status'; */
-static __attribute__((nonnull, format(printf, 2, 3)))
+static MY_ATTRIBUTE((nonnull, format(printf, 2, 3)))
void
buf_dump_status(
/*============*/
variable_name = 'INNODB_BUFFER_POOL_LOAD_STATUS';
or by:
SHOW STATUS LIKE 'innodb_buffer_pool_load_status'; */
-static __attribute__((nonnull, format(printf, 2, 3)))
+static MY_ATTRIBUTE((nonnull, format(printf, 2, 3)))
void
buf_load_status(
/*============*/
os_thread_ret_t
DECLARE_THREAD(buf_dump_thread)(
/*============================*/
- void* arg __attribute__((unused))) /*!< in: a dummy parameter
+ void* arg MY_ATTRIBUTE((unused))) /*!< in: a dummy parameter
required by os_thread_create */
{
ut_ad(!srv_read_only_mode);
/*****************************************************************************
-Copyright (c) 1995, 2015, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1995, 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
os_thread_ret_t
DECLARE_THREAD(buf_flush_page_cleaner_thread)(
/*==========================================*/
- void* arg __attribute__((unused)))
+ void* arg MY_ATTRIBUTE((unused)))
/*!< in: a dummy parameter required by
os_thread_create */
{
/*****************************************************************************
-Copyright (c) 1995, 2013, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1995, 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
caller needs to free the page to the free list
@retval false if BUF_BLOCK_ZIP_PAGE was removed from page_hash. In
this case the block is already returned to the buddy allocator. */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
bool
buf_LRU_block_remove_hashed(
/*========================*/
mutex and try to force a context switch. Then reacquire the same mutexes.
The current page is "fixed" before the release of the mutexes and then
"unfixed" again once we have reacquired the mutexes. */
-static __attribute__((nonnull))
+static MY_ATTRIBUTE((nonnull))
void
buf_flush_yield(
/*============*/
pool and flush list mutex and do a thread yield. Set the current page
to "sticky" so that it is not relocated during the yield.
@return true if yielded */
-static __attribute__((nonnull(1), warn_unused_result))
+static MY_ATTRIBUTE((nonnull(1), warn_unused_result))
bool
buf_flush_try_yield(
/*================*/
Removes a single page from a given tablespace inside a specific
buffer pool instance.
@return true if page was removed. */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
bool
buf_flush_or_remove_page(
/*=====================*/
@retval DB_SUCCESS if all freed
@retval DB_FAIL if not all freed
@retval DB_INTERRUPTED if the transaction was interrupted */
-static __attribute__((nonnull(1), warn_unused_result))
+static MY_ATTRIBUTE((nonnull(1), warn_unused_result))
dberr_t
buf_flush_or_remove_pages(
/*======================*/
inside a specific buffer pool instance. The pages will remain in the LRU
list and will be evicted from the LRU list as they age and move towards
the tail of the LRU list. */
-static __attribute__((nonnull(1)))
+static MY_ATTRIBUTE((nonnull(1)))
void
buf_flush_dirty_pages(
/*==================*/
/******************************************************************//**
Remove all pages that belong to a given tablespace inside a specific
buffer pool instance when we are DISCARDing the tablespace. */
-static __attribute__((nonnull))
+static MY_ATTRIBUTE((nonnull))
void
buf_LRU_remove_all_pages(
/*=====================*/
tablespace. The pages still remain a part of LRU and are evicted from
the list as they age towards the tail of the LRU only if buf_remove
is BUF_REMOVE_FLUSH_NO_WRITE. */
-static __attribute__((nonnull(1)))
+static MY_ATTRIBUTE((nonnull(1)))
void
buf_LRU_remove_pages(
/*=================*/
/*****************************************************************************
-Copyright (c) 1994, 2012, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1994, 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
ulint n_fields;
ulint i;
- ut_ad(tuple1 && tuple2);
+ ut_ad(tuple1 != NULL);
+ ut_ad(tuple2 != NULL);
ut_ad(tuple1->magic_n == DATA_TUPLE_MAGIC_N);
ut_ad(tuple2->magic_n == DATA_TUPLE_MAGIC_N);
ut_ad(dtuple_check_typed(tuple1));
void
dtuple_convert_back_big_rec(
/*========================*/
- dict_index_t* index __attribute__((unused)), /*!< in: index */
+ dict_index_t* index MY_ATTRIBUTE((unused)), /*!< in: index */
dtuple_t* entry, /*!< in: entry whose data was put to vector */
big_rec_t* vector) /*!< in, own: big rec vector; it is
freed in this function */
/*****************************************************************************
-Copyright (c) 1996, 2014, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1996, 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
/***************************************************************//**
Builds a table definition to insert.
@return DB_SUCCESS or error code */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
dberr_t
dict_build_table_def_step(
/*======================*/
/***************************************************************//**
Builds an index definition row to insert.
@return DB_SUCCESS or error code */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
dberr_t
dict_build_index_def_step(
/*======================*/
/***************************************************************//**
Creates an index tree for the index if it is not a member of a cluster.
@return DB_SUCCESS or DB_OUT_OF_FILE_SPACE */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
dberr_t
dict_create_index_tree_step(
/*========================*/
/****************************************************************//**
Evaluate the given foreign key SQL statement.
@return error code or DB_SUCCESS */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
dberr_t
dict_foreign_eval_sql(
/*==================*/
Add a single foreign key field definition to the data dictionary tables in
the database.
@return error code or DB_SUCCESS */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
dberr_t
dict_create_add_foreign_field_to_dictionary(
/*========================================*/
/*****************************************************************************
-Copyright (c) 1996, 2015, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1996, 2016, 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_index_t* index, /*!< in/out: index */
dict_table_t* table) /*!< in/out: table */
{
- ut_ad(index);
+ ut_ad(index != NULL);
ut_ad(mutex_own(&dict_sys->mutex));
ut_ad(!dict_table_is_comp(dict_sys->sys_tables));
ut_ad(!dict_table_is_comp(dict_sys->sys_indexes));
if (dict_index_is_clust(index)) {
dict_table_t* corrupt_table;
- corrupt_table = table ? table : index->table;
- ut_ad(!index->table || !table || index->table == table);
+ corrupt_table = (table != NULL) ? table : index->table;
+ ut_ad((index->table != NULL) || (table != NULL)
+ || index->table == table);
if (corrupt_table) {
corrupt_table->corrupted = TRUE;
{
dict_index_t* index;
- /* If name is NULL, just return */
- if (!name) {
- return(NULL);
- }
-
index = dict_table_get_first_index(table);
while (index != NULL) {
/*****************************************************************************
-Copyright (c) 1996, 2013, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1996, 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
goto err_len;
}
type = mach_read_from_4(field);
- if (type & (~0 << DICT_IT_BITS)) {
+ if (type & (~0U << DICT_IT_BITS)) {
return("unknown SYS_INDEXES.TYPE bits");
}
cache.
@return DB_SUCCESS if ok, DB_CORRUPTION if corruption of dictionary
table or DB_UNSUPPORTED if table has unknown index type */
-static __attribute__((nonnull))
+static MY_ATTRIBUTE((nonnull))
dberr_t
dict_load_indexes(
/*==============*/
/* the table->fts could be created in dict_load_column
when a user defined FTS_DOC_ID is present, but no
FTS */
+ fts_optimize_remove_table(table);
fts_free(table);
} else {
fts_optimize_add_table(table);
btr_pcur_open_on_user_rec(sys_table_ids, tuple, PAGE_CUR_GE,
BTR_SEARCH_LEAF, &pcur, &mtr);
-check_rec:
rec = btr_pcur_get_rec(&pcur);
if (page_rec_is_user_rec(rec)) {
/*---------------------------------------------------*/
/* Now we have the record in the secondary index
containing the table ID and NAME */
-
+check_rec:
field = rec_get_nth_field_old(
rec, DICT_FLD__SYS_TABLE_IDS__ID, &len);
ut_ad(len == 8);
if (rec_get_deleted_flag(rec, 0)) {
/* Until purge has completed, there
may be delete-marked duplicate records
- for the same SYS_TABLES.ID.
- Due to Bug #60049, some delete-marked
- records may survive the purge forever. */
- if (btr_pcur_move_to_next(&pcur, &mtr)) {
-
- goto check_rec;
+ for the same SYS_TABLES.ID, but different
+ SYS_TABLES.NAME. */
+ while (btr_pcur_move_to_next(&pcur, &mtr)) {
+ rec = btr_pcur_get_rec(&pcur);
+
+ if (page_rec_is_user_rec(rec)) {
+ goto check_rec;
+ }
}
} else {
/* Now we get the table name from the record */
/***********************************************************************//**
Loads a foreign key constraint to the dictionary cache.
@return DB_SUCCESS or error code */
-static __attribute__((nonnull(1), warn_unused_result))
+static MY_ATTRIBUTE((nonnull(1), warn_unused_result))
dberr_t
dict_load_foreign(
/*==============*/
/*****************************************************************************
-Copyright (c) 1996, 2015, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1996, 2016, 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
/**********************************************************************//**
Renames a column of a table in the data dictionary cache. */
-static __attribute__((nonnull))
+static MY_ATTRIBUTE((nonnull))
void
dict_mem_table_col_rename_low(
/*==========================*/
/*****************************************************************************
-Copyright (c) 2012, 2013, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 2012, 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
os_thread_ret_t
DECLARE_THREAD(dict_stats_thread)(
/*==============================*/
- void* arg __attribute__((unused))) /*!< in: a dummy parameter
+ void* arg MY_ATTRIBUTE((unused))) /*!< in: a dummy parameter
required by os_thread_create */
{
ut_a(!srv_read_only_mode);
Writes the flushed lsn and the latest archived log number to the page header
of the first page of a data file of the system tablespace (space 0),
which is uncompressed. */
-static __attribute__((warn_unused_result))
+static MY_ATTRIBUTE((warn_unused_result))
dberr_t
fil_write_lsn_and_arch_no_to_file(
/*==============================*/
ulint sum_of_sizes, /*!< in: combined size of previous files
in space, in database pages */
lsn_t lsn, /*!< in: lsn to write */
- ulint arch_log_no __attribute__((unused)))
+ ulint arch_log_no MY_ATTRIBUTE((unused)))
/*!< in: archived log number to write */
{
byte* buf1;
at database startup.
@retval NULL on success, or if innodb_force_recovery is set
@return pointer to an error message string */
-static __attribute__((warn_unused_result))
+static MY_ATTRIBUTE((warn_unused_result))
const char*
fil_check_first_page(
/*=================*/
/*****************************************************************************
-Copyright (c) 1995, 2015, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1995, 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
/********************************************************************//**
Marks a page used. The page must reside within the extents of the given
segment. */
-static __attribute__((nonnull))
+static MY_ATTRIBUTE((nonnull))
void
fseg_mark_page_used(
/*================*/
ulint space, /*!< in: space */
fsp_header_t* header, /*!< in/out: space header */
mtr_t* mtr) /*!< in/out: mini-transaction */
- UNIV_COLD __attribute__((nonnull));
+ UNIV_COLD MY_ATTRIBUTE((nonnull));
/**********************************************************************//**
Allocates a single free page from a segment. This function implements
the intelligent allocation strategy which tries to minimize file space
in which the page should be initialized.
If init_mtr!=mtr, but the page is already
latched in mtr, do not initialize the page. */
- __attribute__((warn_unused_result, nonnull));
+ MY_ATTRIBUTE((warn_unused_result, nonnull));
#endif /* !UNIV_HOTBACKUP */
/**********************************************************************//**
file.
@return pointer to the extent descriptor, NULL if the page does not
exist in the space or if the offset is >= the free limit */
-UNIV_INLINE __attribute__((nonnull, warn_unused_result))
+UNIV_INLINE MY_ATTRIBUTE((nonnull, warn_unused_result))
xdes_t*
xdes_get_descriptor_with_space_hdr(
/*===============================*/
above the free limit.
@return pointer to the extent descriptor, NULL if the page does not
exist in the space or if the offset exceeds the free limit */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
xdes_t*
xdes_get_descriptor(
/*================*/
fsp_parse_init_file_page(
/*=====================*/
byte* ptr, /*!< in: buffer */
- byte* end_ptr __attribute__((unused)), /*!< in: buffer end */
+ byte* end_ptr MY_ATTRIBUTE((unused)), /*!< in: buffer end */
buf_block_t* block) /*!< in: block or NULL */
{
ut_ad(ptr && end_ptr);
Tries to extend a single-table tablespace so that a page would fit in the
data file.
@return TRUE if success */
-static UNIV_COLD __attribute__((nonnull, warn_unused_result))
+static UNIV_COLD MY_ATTRIBUTE((nonnull, warn_unused_result))
ibool
fsp_try_extend_data_file_with_pages(
/*================================*/
/***********************************************************************//**
Tries to extend the last data file of a tablespace if it is auto-extending.
@return FALSE if not auto-extending */
-static UNIV_COLD __attribute__((nonnull))
+static UNIV_COLD MY_ATTRIBUTE((nonnull))
ibool
fsp_try_extend_data_file(
/*=====================*/
ulint i;
mtr_t ibuf_mtr;
- ut_ad(header && mtr);
+ ut_ad(header != NULL);
+ ut_ad(mtr != NULL);
ut_ad(page_offset(header) == FSP_HEADER_OFFSET);
/* Check if we can fill free list from above the free list limit */
/**********************************************************************//**
Allocates a single free page from a space. */
-static __attribute__((nonnull))
+static MY_ATTRIBUTE((nonnull))
void
fsp_alloc_from_free_frag(
/*=====================*/
@retval block, rw_lock_x_lock_count(&block->lock) == 1 if allocation succeeded
(init_mtr == mtr, or the page was not previously freed in mtr)
@retval block (not allocated or initialized) otherwise */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
buf_block_t*
fsp_alloc_free_page(
/*================*/
/*=============================*/
page_t* page, /*!< in: segment inode page */
ulint i, /*!< in: inode index on page */
- ulint zip_size __attribute__((unused)),
+ ulint zip_size MY_ATTRIBUTE((unused)),
/*!< in: compressed page size, or 0 */
- mtr_t* mtr __attribute__((unused)))
+ mtr_t* mtr MY_ATTRIBUTE((unused)))
/*!< in/out: mini-transaction */
{
ut_ad(i < FSP_SEG_INODES_PER_PAGE(zip_size));
/*======================*/
fseg_inode_t* inode, /*!< in: segment inode */
ulint n, /*!< in: slot index */
- mtr_t* mtr __attribute__((unused)))
+ mtr_t* mtr MY_ATTRIBUTE((unused)))
/*!< in/out: mini-transaction */
{
ut_ad(inode && mtr);
/********************************************************************//**
Marks a page used. The page must reside within the extents of the given
segment. */
-static __attribute__((nonnull))
+static MY_ATTRIBUTE((nonnull))
void
fseg_mark_page_used(
/*================*/
ib_id_t seg_id;
ulint i;
- ut_ad(seg_inode && mtr);
+ ut_ad(seg_inode != NULL);
+ ut_ad(mtr != NULL);
ut_ad(mach_read_from_4(seg_inode + FSEG_MAGIC_N)
== FSEG_MAGIC_N_VALUE);
ut_ad(!((page_offset(seg_inode) - FSEG_ARR_OFFSET) % FSEG_INODE_SIZE));
ulint descr_n_used;
ulint i;
- ut_ad(seg_inode && mtr);
+ ut_ad(seg_inode != NULL);
+ ut_ad(mtr != NULL);
descr = xdes_get_descriptor(space, zip_size, page, mtr);
YY_BUFFER_STATE fts0b_scan_string (yyconst char *yy_str ,yyscan_t yyscanner );
YY_BUFFER_STATE fts0b_scan_bytes (yyconst char *bytes,int len ,yyscan_t yyscanner );
-void *fts0balloc (yy_size_t , yyscan_t yyscanner __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) );
-void *fts0brealloc (void *,yy_size_t , yyscan_t yyscanner __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) );
-void fts0bfree (void * , yyscan_t yyscanner __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) );
+void *fts0balloc (yy_size_t , yyscan_t yyscanner MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) );
+void *fts0brealloc (void *,yy_size_t , yyscan_t yyscanner MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) );
+void fts0bfree (void * , yyscan_t yyscanner MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) );
#define yy_new_buffer fts0b_create_buffer
static yy_state_type yy_get_previous_state (yyscan_t yyscanner );
static yy_state_type yy_try_NUL_trans (yy_state_type current_state ,yyscan_t yyscanner);
static int yy_get_next_buffer (yyscan_t yyscanner );
-static void yy_fatal_error (yyconst char msg[] , yyscan_t yyscanner __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) );
+static void yy_fatal_error (yyconst char msg[] , yyscan_t yyscanner MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) );
/* Done after the current pattern has been matched and before the
* corresponding action - sets up yytext.
#line 1 "fts0blex.l"
/*****************************************************************************
-Copyright (c) 2007, 2014, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 2007, 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
#endif
#ifndef yytext_ptr
-static void yy_flex_strncpy (char *,yyconst char *,int , yyscan_t yyscanner __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)));
+static void yy_flex_strncpy (char *,yyconst char *,int , yyscan_t yyscanner MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)));
#endif
#ifdef YY_NEED_STRLEN
-static int yy_flex_strlen (yyconst char * , yyscan_t yyscanner __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)));
+static int yy_flex_strlen (yyconst char * , yyscan_t yyscanner MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)));
#endif
#ifndef YY_NO_INPUT
#define YY_EXIT_FAILURE 2
#endif
-static void yy_fatal_error (yyconst char* msg , yyscan_t yyscanner __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)))
+static void yy_fatal_error (yyconst char* msg , yyscan_t yyscanner MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)))
{
(void) fprintf( stderr, "%s\n", msg );
exit( YY_EXIT_FAILURE );
*/
#ifndef yytext_ptr
-static void yy_flex_strncpy (char* s1, yyconst char * s2, int n , yyscan_t yyscanner __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)))
+static void yy_flex_strncpy (char* s1, yyconst char * s2, int n , yyscan_t yyscanner MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)))
{
register int i;
for ( i = 0; i < n; ++i )
#endif
#ifdef YY_NEED_STRLEN
-static int yy_flex_strlen (yyconst char * s , yyscan_t yyscanner __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)))
+static int yy_flex_strlen (yyconst char * s , yyscan_t yyscanner MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)))
{
register int n;
for ( n = 0; s[n]; ++n )
}
#endif
-void *fts0balloc (yy_size_t size , yyscan_t yyscanner __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)))
+void *fts0balloc (yy_size_t size , yyscan_t yyscanner MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)))
{
return (void *) malloc( size );
}
-void *fts0brealloc (void * ptr, yy_size_t size , yyscan_t yyscanner __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)))
+void *fts0brealloc (void * ptr, yy_size_t size , yyscan_t yyscanner MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)))
{
/* The cast to (char *) in the following accommodates both
* implementations that use char* generic pointers, and those
return (void *) realloc( (char *) ptr, size );
}
-void fts0bfree (void * ptr , yyscan_t yyscanner __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)))
+void fts0bfree (void * ptr , yyscan_t yyscanner MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)))
{
free( (char *) ptr ); /* see fts0brealloc() for (char *) cast */
}
/** variable to record innodb_fts_internal_tbl_name for information
schema table INNODB_FTS_INSERTED etc. */
UNIV_INTERN char* fts_internal_tbl_name = NULL;
+UNIV_INTERN char* fts_internal_tbl_name2 = NULL;
/** InnoDB default stopword list:
There are different versions of stopwords, the stop words listed
@param[in,out] sync sync state
@param[in] unlock_cache whether unlock cache lock when write node
@param[in] wait whether wait when a sync is in progress
+@param[in] has_dict whether has dict operation lock
@return DB_SUCCESS if all OK */
static
dberr_t
fts_sync(
fts_sync_t* sync,
bool unlock_cache,
- bool wait);
+ bool wait,
+ bool has_dict);
/****************************************************************//**
Release all resources help by the words rb tree e.g., the node ilist. */
fts_words_free(
/*===========*/
ib_rbt_t* words) /*!< in: rb tree of words */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
#ifdef FTS_CACHE_SIZE_DEBUG
/****************************************************************//**
Read the max cache size parameter from the config table. */
/*==============*/
fts_trx_table_t*ftt, /*!< in: FTS trx table */
doc_id_t doc_id, /*!< in: doc id */
- ib_vector_t* fts_indexes __attribute__((unused)));
+ ib_vector_t* fts_indexes MY_ATTRIBUTE((unused)));
/*!< in: affected fts indexes */
#ifdef FTS_DOC_STATS_DEBUG
/****************************************************************//**
fts_table_t* fts_table, /*!< in: table instance */
const fts_string_t* word, /*!< in: the word to check */
ibool* found) /*!< out: TRUE if exists */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
#endif /* FTS_DOC_STATS_DEBUG */
/******************************************************************//**
const char* table_name, /*!< in: table name, or NULL */
doc_id_t doc_id, /*!< in: last document id */
trx_t* trx) /*!< in: update trx, or NULL */
- __attribute__((nonnull(1)));
+ MY_ATTRIBUTE((nonnull(1)));
/****************************************************************//**
This function loads the default InnoDB stopword list */
}
}
-/*********************************************************************//**
-Clear cache. */
+/** Clear cache.
+@param[in,out] cache fts cache */
UNIV_INTERN
void
fts_cache_clear(
-/*============*/
- fts_cache_t* cache) /*!< in: cache */
+ fts_cache_t* cache)
{
ulint i;
/****************************************************************//**
Drops a table. If the table can't be found we return a SUCCESS code.
@return DB_SUCCESS or error code */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
dberr_t
fts_drop_table(
/*===========*/
/****************************************************************//**
Rename a single auxiliary table due to database name change.
@return DB_SUCCESS or error code */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
dberr_t
fts_rename_one_aux_table(
/*=====================*/
on the given table. row_mysql_lock_data_dictionary must have been called
before this.
@return DB_SUCCESS or error code */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
dberr_t
fts_drop_common_tables(
/*===================*/
on the given table. row_mysql_lock_data_dictionary must have been called
before this.
@return DB_SUCCESS or error code */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
dberr_t
fts_drop_all_index_tables(
/*======================*/
This function fetch the Doc ID from CONFIG table, and compare with
the Doc ID supplied. And store the larger one to the CONFIG table.
@return DB_SUCCESS if OK */
-static __attribute__((nonnull))
+static MY_ATTRIBUTE((nonnull))
dberr_t
fts_cmp_set_sync_doc_id(
/*====================*/
/*********************************************************************//**
Do commit-phase steps necessary for the deletion of a row.
@return DB_SUCCESS or error code */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
dberr_t
fts_delete(
/*=======*/
/*********************************************************************//**
Do commit-phase steps necessary for the modification of a row.
@return DB_SUCCESS or error code */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
dberr_t
fts_modify(
/*=======*/
The given transaction is about to be committed; do whatever is necessary
from the FTS system's POV.
@return DB_SUCCESS or error code */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
dberr_t
fts_commit_table(
/*=============*/
/*==============*/
fts_trx_table_t*ftt, /*!< in: FTS trx table */
doc_id_t doc_id, /*!< in: doc id */
- ib_vector_t* fts_indexes __attribute__((unused)))
+ ib_vector_t* fts_indexes MY_ATTRIBUTE((unused)))
/*!< in: affected fts indexes */
{
mtr_t mtr;
get_doc, clust_index, doc_pcur, offsets, &doc);
if (doc.found) {
- ibool success __attribute__((unused));
+ ibool success MY_ATTRIBUTE((unused));
btr_pcur_store_position(doc_pcur, &mtr);
mtr_commit(&mtr);
DBUG_EXECUTE_IF(
"fts_instrument_sync_debug",
- fts_sync(cache->sync, true, true);
+ fts_sync(cache->sync, true, true, false);
);
DEBUG_SYNC_C("fts_instrument_sync_request");
dict_table_t* table) /*!< in: user table */
{
dict_index_t* index;
- dict_field_t* dfield __attribute__((unused)) = NULL;
+ dict_field_t* dfield MY_ATTRIBUTE((unused)) = NULL;
doc_id_t doc_id = 0;
mtr_t mtr;
btr_pcur_t pcur;
/*********************************************************************//**
Add rows to the DELETED_CACHE table.
@return DB_SUCCESS if all went well else error code*/
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
dberr_t
fts_sync_add_deleted_cache(
/*=======================*/
@param[in] index_cache index cache
@param[in] unlock_cache whether unlock cache when write node
@return DB_SUCCESS if all went well else error code */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
dberr_t
fts_sync_write_words(
trx_t* trx,
/*********************************************************************//**
Write a single documents statistics to disk.
@return DB_SUCCESS if all went well else error code */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
dberr_t
fts_sync_write_doc_stat(
/*====================*/
Run SYNC on the table, i.e., write out data from the index specific
cache to the FTS aux INDEX table and FTS aux doc id stats table.
@return DB_SUCCESS if all OK */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
dberr_t
fts_sync_index(
/*===========*/
}
/** Check if index cache has been synced completely
-@param[in,out] sync sync state
@param[in,out] index_cache index cache
@return true if index is synced, otherwise false. */
static
bool
fts_sync_index_check(
- fts_sync_t* sync,
fts_index_cache_t* index_cache)
{
const ib_rbt_node_t* rbt_node;
return(true);
}
-/*********************************************************************//**
-Commit the SYNC, change state of processed doc ids etc.
+/** Reset synced flag in index cache when rollback
+@param[in,out] index_cache index cache */
+static
+void
+fts_sync_index_reset(
+ fts_index_cache_t* index_cache)
+{
+ const ib_rbt_node_t* rbt_node;
+
+ for (rbt_node = rbt_first(index_cache->words);
+ rbt_node != NULL;
+ rbt_node = rbt_next(index_cache->words, rbt_node)) {
+
+ fts_tokenizer_word_t* word;
+ word = rbt_value(fts_tokenizer_word_t, rbt_node);
+
+ fts_node_t* fts_node;
+ fts_node = static_cast<fts_node_t*>(ib_vector_last(word->nodes));
+
+ fts_node->synced = false;
+ }
+}
+
+/** Commit the SYNC, change state of processed doc ids etc.
+@param[in,out] sync sync state
@return DB_SUCCESS if all OK */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
dberr_t
fts_sync_commit(
-/*============*/
- fts_sync_t* sync) /*!< in: sync state */
+ fts_sync_t* sync)
{
dberr_t error;
trx_t* trx = sync->trx;
(double) n_nodes/ (double) elapsed_time);
}
+ /* Avoid assertion in trx_free(). */
+ trx->dict_operation_lock_mode = 0;
trx_free_for_background(trx);
return(error);
}
-/*********************************************************************//**
-Rollback a sync operation */
+/** Rollback a sync operation
+@param[in,out] sync sync state */
static
void
fts_sync_rollback(
-/*==============*/
- fts_sync_t* sync) /*!< in: sync state */
+ fts_sync_t* sync)
{
trx_t* trx = sync->trx;
fts_cache_t* cache = sync->table->fts->cache;
index_cache = static_cast<fts_index_cache_t*>(
ib_vector_get(cache->indexes, i));
+ /* Reset synced flag so nodes will not be skipped
+ in the next sync, see fts_sync_write_words(). */
+ fts_sync_index_reset(index_cache);
+
for (j = 0; fts_index_selector[j].value; ++j) {
if (index_cache->ins_graph[j] != NULL) {
rw_lock_x_unlock(&cache->lock);
fts_sql_rollback(trx);
+
+ /* Avoid assertion in trx_free(). */
+ trx->dict_operation_lock_mode = 0;
trx_free_for_background(trx);
}
@param[in,out] sync sync state
@param[in] unlock_cache whether unlock cache lock when write node
@param[in] wait whether wait when a sync is in progress
+@param[in] has_dict whether has dict operation lock
@return DB_SUCCESS if all OK */
static
dberr_t
fts_sync(
fts_sync_t* sync,
bool unlock_cache,
- bool wait)
+ bool wait,
+ bool has_dict)
{
ulint i;
dberr_t error = DB_SUCCESS;
DEBUG_SYNC_C("fts_sync_begin");
fts_sync_begin(sync);
+ /* When sync in background, we hold dict operation lock
+ to prevent DDL like DROP INDEX, etc. */
+ if (has_dict) {
+ sync->trx->dict_operation_lock_mode = RW_S_LATCH;
+ }
+
begin_sync:
if (cache->total_size > fts_max_cache_size) {
/* Avoid the case: sync never finish when
ib_vector_get(cache->indexes, i));
if (index_cache->index->to_be_dropped
- || fts_sync_index_check(sync, index_cache)) {
+ || fts_sync_index_check(index_cache)) {
continue;
}
}
rw_lock_x_lock(&cache->lock);
+ sync->interrupted = false;
sync->in_progress = false;
os_event_set(sync->event);
rw_lock_x_unlock(&cache->lock);
@param[in,out] table fts table
@param[in] unlock_cache whether unlock cache when write node
@param[in] wait whether wait for existing sync to finish
+@param[in] has_dict whether has dict operation lock
@return DB_SUCCESS on success, error code on failure. */
UNIV_INTERN
dberr_t
fts_sync_table(
dict_table_t* table,
bool unlock_cache,
- bool wait)
+ bool wait,
+ bool has_dict)
{
dberr_t err = DB_SUCCESS;
ut_ad(table->fts);
if (!dict_table_is_discarded(table) && table->fts->cache) {
- err = fts_sync(table->fts->cache->sync, unlock_cache, wait);
+ err = fts_sync(table->fts->cache->sync,
+ unlock_cache, wait, has_dict);
}
return(err);
/*********************************************************************//**
Rename an aux table to HEX format. It's called when "%016llu" is used
to format an object id in table name, which only happens in Windows. */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
dberr_t
fts_rename_one_aux_table_to_hex_format(
/*===================================*/
This function should make sure that either all the parent table and aux tables
are set DICT_TF2_FTS_AUX_HEX_NAME with flags2 or none of them are set */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
dberr_t
fts_rename_aux_tables_to_hex_format_low(
/*====================================*/
{
ib_id_t dec_id = 0;
char tmp_id[FTS_AUX_MIN_TABLE_ID_LENGTH];
- int ret __attribute__((unused));
+ int ret MY_ATTRIBUTE((unused));
ret = sprintf(tmp_id, UINT64PFx, id);
ut_ad(ret == 16);
#ifdef _WIN32
ret = sscanf(tmp_id, "%016llu", &dec_id);
#else
- ret = sscanf(tmp_id, "%016"PRIu64, &dec_id);
+ ret = sscanf(tmp_id, "%016" PRIu64, &dec_id);
#endif /* _WIN32 */
ut_ad(ret == 1);
return(0);
}
+/* Get parent table name if it's a fts aux table
+@param[in] aux_table_name aux table name
+@param[in] aux_table_len aux table length
+@return parent table name, or NULL */
+char*
+fts_get_parent_table_name(
+ const char* aux_table_name,
+ ulint aux_table_len)
+{
+ fts_aux_table_t aux_table;
+ char* parent_table_name = NULL;
+
+ if (fts_is_aux_table_name(&aux_table, aux_table_name, aux_table_len)) {
+ dict_table_t* parent_table;
+
+ parent_table = dict_table_open_on_id(
+ aux_table.parent_id, TRUE, DICT_TABLE_OP_NORMAL);
+
+ if (parent_table != NULL) {
+ parent_table_name = mem_strdupl(
+ parent_table->name,
+ strlen(parent_table->name));
+
+ dict_table_close(parent_table, TRUE, FALSE);
+ }
+ }
+
+ return(parent_table_name);
+}
+
/** Check the validity of the parent table.
@param[in] aux_table auxiliary table
@return true if it is a valid table or false if it is not */
Check and drop all orphaned FTS auxiliary tables, those that don't have
a parent table or FTS index defined on them.
@return DB_SUCCESS or error code */
-static __attribute__((nonnull))
+static MY_ATTRIBUTE((nonnull))
void
fts_check_and_drop_orphaned_tables(
/*===============================*/
Read the words from the FTS INDEX.
@return DB_SUCCESS if all OK, DB_TABLE_NOT_FOUND if no more indexes
to search else error code */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
dberr_t
fts_index_fetch_words(
/*==================*/
/**********************************************************************//**
Encode the word pos list into the node
@return DB_SUCCESS or error code*/
-static __attribute__((nonnull))
+static MY_ATTRIBUTE((nonnull))
dberr_t
fts_optimize_encode_node(
/*=====================*/
/**********************************************************************//**
Optimize the data contained in a node.
@return DB_SUCCESS or error code*/
-static __attribute__((nonnull))
+static MY_ATTRIBUTE((nonnull))
dberr_t
fts_optimize_node(
/*==============*/
/**********************************************************************//**
Determine the starting pos within the deleted doc id vector for a word.
@return delete position */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
int
fts_optimize_deleted_pos(
/*=====================*/
/**********************************************************************//**
Update the FTS index table. This is a delete followed by an insert.
@return DB_SUCCESS or error code */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
dberr_t
fts_optimize_write_word(
/*====================*/
/**********************************************************************//**
Optimize the word ilist and rewrite data to the FTS index.
@return status one of RESTART, EXIT, ERROR */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
dberr_t
fts_optimize_compact(
/*=================*/
/**********************************************************************//**
Get optimize start time of an FTS index.
@return DB_SUCCESS if all OK else error code */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
dberr_t
fts_optimize_get_index_start_time(
/*==============================*/
/**********************************************************************//**
Set the optimize start time of an FTS index.
@return DB_SUCCESS if all OK else error code */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
dberr_t
fts_optimize_set_index_start_time(
/*==============================*/
/**********************************************************************//**
Get optimize end time of an FTS index.
@return DB_SUCCESS if all OK else error code */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
dberr_t
fts_optimize_get_index_end_time(
/*============================*/
/**********************************************************************//**
Set the optimize end time of an FTS index.
@return DB_SUCCESS if all OK else error code */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
dberr_t
fts_optimize_set_index_end_time(
/*============================*/
Optimize is complete. Set the completion time, and reset the optimize
start string for this FTS index to "".
@return DB_SUCCESS if all OK */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
dberr_t
fts_optimize_index_completed(
/*=========================*/
Read the list of words from the FTS auxiliary index that will be
optimized in this pass.
@return DB_SUCCESS if all OK */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
dberr_t
fts_optimize_index_read_words(
/*==========================*/
Run OPTIMIZE on the given FTS index. Note: this can take a very long
time (hours).
@return DB_SUCCESS if all OK */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
dberr_t
fts_optimize_index(
/*===============*/
/**********************************************************************//**
Delete the document ids in the delete, and delete cache tables.
@return DB_SUCCESS if all OK */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
dberr_t
fts_optimize_purge_deleted_doc_ids(
/*===============================*/
/**********************************************************************//**
Delete the document ids in the pending delete, and delete tables.
@return DB_SUCCESS if all OK */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
dberr_t
fts_optimize_purge_deleted_doc_id_snapshot(
/*=======================================*/
to the being deleted FTS auxiliary tables. The transaction is committed
upon successfull copy and rolled back on DB_DUPLICATE_KEY error.
@return DB_SUCCESS if all OK */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
dberr_t
fts_optimize_create_deleted_doc_id_snapshot(
/*========================================*/
Read in the document ids that are to be purged during optimize. The
transaction is committed upon successfully read.
@return DB_SUCCESS if all OK */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
dberr_t
fts_optimize_read_deleted_doc_id_snapshot(
/*======================================*/
optimized, since the FTS auxiliary indexes are not guaranteed to be
of the same cardinality.
@return DB_SUCCESS if all OK */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
dberr_t
fts_optimize_indexes(
/*=================*/
/*********************************************************************//**
Cleanup the snapshot tables and the master deleted table.
@return DB_SUCCESS if all OK */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
dberr_t
fts_optimize_purge_snapshot(
/*========================*/
/*********************************************************************//**
Reset the start time to 0 so that a new optimize can be started.
@return DB_SUCCESS if all OK */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
dberr_t
fts_optimize_reset_start_time(
/*==========================*/
/*********************************************************************//**
Run OPTIMIZE on the given table by a background thread.
@return DB_SUCCESS if all OK */
-static __attribute__((nonnull))
+static MY_ATTRIBUTE((nonnull))
dberr_t
fts_optimize_table_bk(
/*==================*/
empty_slot = i;
} else if (slot->table->id == table->id) {
/* Already exists in our optimize queue. */
+ ut_ad(slot->table_id = table->id);
return(FALSE);
}
}
{
dict_table_t* table = NULL;
+ /* Prevent DROP INDEX etc. from running when we are syncing
+ cache in background. */
+ if (!rw_lock_s_lock_nowait(&dict_operation_lock, __FILE__, __LINE__)) {
+ /* Exit when fail to get dict operation lock. */
+ return;
+ }
+
table = dict_table_open_on_id(table_id, FALSE, DICT_TABLE_OP_NORMAL);
if (table) {
if (dict_table_has_fts_index(table) && table->fts->cache) {
- fts_sync_table(table, true, false);
+ fts_sync_table(table, true, false, true);
}
dict_table_close(table, FALSE, FALSE);
}
+
+ rw_lock_s_unlock(&dict_operation_lock);
}
/**********************************************************************//**
/*****************************************************************************
-Copyright (c) 2007, 2015, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 2007, 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
dict_index_t* index, /*!< in: FTS index to search */
fts_query_t* query) /*!< in: query result, to be freed
by the client */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/*************************************************************//**
This function finds documents that contain all words in a
phrase or proximity search. And if proximity search, verify
/*****************************************************************//**
Set difference.
@return DB_SUCCESS if all go well */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
dberr_t
fts_query_difference(
/*=================*/
/*****************************************************************//**
Intersect the token doc ids with the current set.
@return DB_SUCCESS if all go well */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
dberr_t
fts_query_intersect(
/*================*/
/*****************************************************************//**
Set union.
@return DB_SUCCESS if all go well */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
dberr_t
fts_query_union(
/*============*/
Read the rows from the FTS index, that match word and where the
doc id is between first and last doc id.
@return DB_SUCCESS if all go well else error code */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
dberr_t
fts_query_find_term(
/*================*/
/********************************************************************
Calculate the total documents that contain a particular word (term).
@return DB_SUCCESS if all go well else error code */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
dberr_t
fts_query_total_docs_containing_term(
/*=================================*/
/********************************************************************
Get the total number of words in a documents.
@return DB_SUCCESS if all go well else error code */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
dberr_t
fts_query_terms_in_document(
/*========================*/
/*****************************************************************//**
Retrieve the document and match the phrase tokens.
@return DB_SUCCESS or error code */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
dberr_t
fts_query_match_document(
/*=====================*/
This function fetches the original documents and count the
words in between matching words to see that is in specified distance
@return DB_SUCCESS if all OK */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
bool
fts_query_is_in_proximity_range(
/*============================*/
Iterate over the matched document ids and search the for the
actual phrase in the text.
@return DB_SUCCESS if all OK */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
dberr_t
fts_query_search_phrase(
/*====================*/
/*****************************************************************//**
Text/Phrase search.
@return DB_SUCCESS or error code */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
dberr_t
fts_query_phrase_search(
/*====================*/
/*****************************************************************//**
Find the word and evaluate.
@return DB_SUCCESS if all go well */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
dberr_t
fts_query_execute(
/*==============*/
search arguments to search the document again, thus "expand"
the search result set.
@return DB_SUCCESS if success, otherwise the error code */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
dberr_t
fts_expand_query(
/*=============*/
YY_BUFFER_STATE fts0t_scan_string (yyconst char *yy_str ,yyscan_t yyscanner );
YY_BUFFER_STATE fts0t_scan_bytes (yyconst char *bytes,int len ,yyscan_t yyscanner );
-void *fts0talloc (yy_size_t , yyscan_t yyscanner __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) );
-void *fts0trealloc (void *,yy_size_t , yyscan_t yyscanner __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) );
-void fts0tfree (void * , yyscan_t yyscanner __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) );
+void *fts0talloc (yy_size_t , yyscan_t yyscanner MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) );
+void *fts0trealloc (void *,yy_size_t , yyscan_t yyscanner MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) );
+void fts0tfree (void * , yyscan_t yyscanner MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) );
#define yy_new_buffer fts0t_create_buffer
static yy_state_type yy_get_previous_state (yyscan_t yyscanner );
static yy_state_type yy_try_NUL_trans (yy_state_type current_state ,yyscan_t yyscanner);
static int yy_get_next_buffer (yyscan_t yyscanner );
-static void yy_fatal_error (yyconst char msg[] , yyscan_t yyscanner __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) );
+static void yy_fatal_error (yyconst char msg[] , yyscan_t yyscanner MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) );
/* Done after the current pattern has been matched and before the
* corresponding action - sets up yytext.
#line 1 "fts0tlex.l"
/*****************************************************************************
-Copyright (c) 2007, 2014, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 2007, 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
#endif
#ifndef yytext_ptr
-static void yy_flex_strncpy (char *,yyconst char *,int , yyscan_t yyscanner __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)));
+static void yy_flex_strncpy (char *,yyconst char *,int , yyscan_t yyscanner MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)));
#endif
#ifdef YY_NEED_STRLEN
-static int yy_flex_strlen (yyconst char * , yyscan_t yyscanner __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)));
+static int yy_flex_strlen (yyconst char * , yyscan_t yyscanner MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)));
#endif
#ifndef YY_NO_INPUT
#define YY_EXIT_FAILURE 2
#endif
-static void yy_fatal_error (yyconst char* msg , yyscan_t yyscanner __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)))
+static void yy_fatal_error (yyconst char* msg , yyscan_t yyscanner MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)))
{
(void) fprintf( stderr, "%s\n", msg );
exit( YY_EXIT_FAILURE );
*/
#ifndef yytext_ptr
-static void yy_flex_strncpy (char* s1, yyconst char * s2, int n , yyscan_t yyscanner __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)))
+static void yy_flex_strncpy (char* s1, yyconst char * s2, int n , yyscan_t yyscanner MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)))
{
register int i;
for ( i = 0; i < n; ++i )
#endif
#ifdef YY_NEED_STRLEN
-static int yy_flex_strlen (yyconst char * s , yyscan_t yyscanner __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)))
+static int yy_flex_strlen (yyconst char * s , yyscan_t yyscanner MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)))
{
register int n;
for ( n = 0; s[n]; ++n )
}
#endif
-void *fts0talloc (yy_size_t size , yyscan_t yyscanner __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)))
+void *fts0talloc (yy_size_t size , yyscan_t yyscanner MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)))
{
return (void *) malloc( size );
}
-void *fts0trealloc (void * ptr, yy_size_t size , yyscan_t yyscanner __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)))
+void *fts0trealloc (void * ptr, yy_size_t size , yyscan_t yyscanner MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)))
{
/* The cast to (char *) in the following accommodates both
* implementations that use char* generic pointers, and those
return (void *) realloc( (char *) ptr, size );
}
-void fts0tfree (void * ptr , yyscan_t yyscanner __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)))
+void fts0tfree (void * ptr , yyscan_t yyscanner MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)))
{
free( (char *) ptr ); /* see fts0trealloc() for (char *) cast */
}
#!/bin/sh
#
-# Copyright (c) 2007, 2011, Oracle and/or its affiliates. All Rights Reserved.
+# Copyright (c) 2007, 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
echo '#include "univ.i"' > $TMPF
# This is to avoid compiler warning about unused parameters.
-# FIXME: gcc extension "__attribute__" causing compilation errors on windows
+# FIXME: gcc extension "MY_ATTRIBUTE" causing compilation errors on windows
# platform. Quote them out for now.
sed -e '
-s/^\(static.*void.*yy_fatal_error.*msg.*,\)\(.*yyscanner\)/\1 \2 __attribute__((unused))/;
-s/^\(static.*void.*yy_flex_strncpy.*n.*,\)\(.*yyscanner\)/\1 \2 __attribute__((unused))/;
-s/^\(static.*int.*yy_flex_strlen.*s.*,\)\(.*yyscanner\)/\1 \2 __attribute__((unused))/;
-s/^\(\(static\|void\).*fts0[bt]alloc.*,\)\(.*yyscanner\)/\1 \3 __attribute__((unused))/;
-s/^\(\(static\|void\).*fts0[bt]realloc.*,\)\(.*yyscanner\)/\1 \3 __attribute__((unused))/;
-s/^\(\(static\|void\).*fts0[bt]free.*,\)\(.*yyscanner\)/\1 \3 __attribute__((unused))/;
+s/^\(static.*void.*yy_fatal_error.*msg.*,\)\(.*yyscanner\)/\1 \2 MY_ATTRIBUTE((unused))/;
+s/^\(static.*void.*yy_flex_strncpy.*n.*,\)\(.*yyscanner\)/\1 \2 MY_ATTRIBUTE((unused))/;
+s/^\(static.*int.*yy_flex_strlen.*s.*,\)\(.*yyscanner\)/\1 \2 MY_ATTRIBUTE((unused))/;
+s/^\(\(static\|void\).*fts0[bt]alloc.*,\)\(.*yyscanner\)/\1 \3 MY_ATTRIBUTE((unused))/;
+s/^\(\(static\|void\).*fts0[bt]realloc.*,\)\(.*yyscanner\)/\1 \3 MY_ATTRIBUTE((unused))/;
+s/^\(\(static\|void\).*fts0[bt]free.*,\)\(.*yyscanner\)/\1 \3 MY_ATTRIBUTE((unused))/;
' < fts0blex.cc >> $TMPF
mv $TMPF fts0blex.cc
echo '#include "univ.i"' > $TMPF
sed -e '
-s/^\(static.*void.*yy_fatal_error.*msg.*,\)\(.*yyscanner\)/\1 \2 __attribute__((unused))/;
-s/^\(static.*void.*yy_flex_strncpy.*n.*,\)\(.*yyscanner\)/\1 \2 __attribute__((unused))/;
-s/^\(static.*int.*yy_flex_strlen.*s.*,\)\(.*yyscanner\)/\1 \2 __attribute__((unused))/;
-s/^\(\(static\|void\).*fts0[bt]alloc.*,\)\(.*yyscanner\)/\1 \3 __attribute__((unused))/;
-s/^\(\(static\|void\).*fts0[bt]realloc.*,\)\(.*yyscanner\)/\1 \3 __attribute__((unused))/;
-s/^\(\(static\|void\).*fts0[bt]free.*,\)\(.*yyscanner\)/\1 \3 __attribute__((unused))/;
+s/^\(static.*void.*yy_fatal_error.*msg.*,\)\(.*yyscanner\)/\1 \2 MY_ATTRIBUTE((unused))/;
+s/^\(static.*void.*yy_flex_strncpy.*n.*,\)\(.*yyscanner\)/\1 \2 MY_ATTRIBUTE((unused))/;
+s/^\(static.*int.*yy_flex_strlen.*s.*,\)\(.*yyscanner\)/\1 \2 MY_ATTRIBUTE((unused))/;
+s/^\(\(static\|void\).*fts0[bt]alloc.*,\)\(.*yyscanner\)/\1 \3 MY_ATTRIBUTE((unused))/;
+s/^\(\(static\|void\).*fts0[bt]realloc.*,\)\(.*yyscanner\)/\1 \3 MY_ATTRIBUTE((unused))/;
+s/^\(\(static\|void\).*fts0[bt]free.*,\)\(.*yyscanner\)/\1 \3 MY_ATTRIBUTE((unused))/;
' < fts0tlex.cc >> $TMPF
mv $TMPF fts0tlex.cc
/********************************************************************//**
Obtain the InnoDB transaction of a MySQL thread.
@return reference to transaction pointer */
-__attribute__((warn_unused_result, nonnull))
+MY_ATTRIBUTE((warn_unused_result, nonnull))
static inline
trx_t*&
thd_to_trx(
innobase_end(
/*=========*/
handlerton* hton, /*!< in/out: InnoDB handlerton */
- ha_panic_function type __attribute__((unused)))
+ ha_panic_function type MY_ATTRIBUTE((unused)))
/*!< in: ha_panic() parameter */
{
int err= 0;
ha_innobase::innobase_lock_autoinc(void)
/*====================================*/
{
+ DBUG_ENTER("ha_innobase::innobase_lock_autoinc");
dberr_t error = DB_SUCCESS;
ut_ad(!srv_read_only_mode);
/* Fall through to old style locking. */
case AUTOINC_OLD_STYLE_LOCKING:
+ DBUG_EXECUTE_IF("die_if_autoinc_old_lock_style_used",
+ ut_ad(0););
error = row_lock_table_autoinc_for_mysql(prebuilt);
if (error == DB_SUCCESS) {
ut_error;
}
- return(error);
+ DBUG_RETURN(error);
}
/********************************************************************//**
/*****************************************************************//**
Creates a table definition to an InnoDB database. */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
int
create_table_def(
/*=============*/
/* Commit the transaction in order to release the table lock. */
trx_commit_for_mysql(prebuilt->trx);
+ if (err == DB_SUCCESS && !discard
+ && dict_stats_is_persistent_enabled(dict_table)) {
+ dberr_t ret;
+
+ /* Adjust the persistent statistics. */
+ ret = dict_stats_update(dict_table,
+ DICT_STATS_RECALC_PERSISTENT);
+
+ if (ret != DB_SUCCESS) {
+ push_warning_printf(
+ ha_thd(),
+ Sql_condition::WARN_LEVEL_WARN,
+ ER_ALTER_INFO,
+ "Error updating stats for table '%s'"
+ " after table rebuild: %s",
+ dict_table->name, ut_strerr(ret));
+ }
+ }
+
DBUG_RETURN(convert_error_code_to_mysql(err, dict_table->flags, NULL));
}
/*********************************************************************//**
Renames an InnoDB table.
@return DB_SUCCESS or error code */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
dberr_t
innobase_rename_table(
/*==================*/
if (innodb_optimize_fulltext_only) {
if (prebuilt->table->fts && prebuilt->table->fts->cache
&& !dict_table_is_discarded(prebuilt->table)) {
- fts_sync_table(prebuilt->table, false, true);
+ fts_sync_table(prebuilt->table, false, true, false);
fts_optimize_table(prebuilt->table);
}
return(HA_ADMIN_OK);
my_free(old);
}
- fts_internal_tbl_name = *(char**) var_ptr;
+ fts_internal_tbl_name2 = *(char**) var_ptr;
+ if (fts_internal_tbl_name2 == NULL) {
+ fts_internal_tbl_name = const_cast<char*>("default");
+ } else {
+ fts_internal_tbl_name = fts_internal_tbl_name2;
+ }
}
/****************************************************************//**
Evict all uncompressed pages of compressed tables from the buffer pool.
Keep the compressed pages in the buffer pool.
@return whether all uncompressed pages were evicted */
-static __attribute__((warn_unused_result))
+static MY_ATTRIBUTE((warn_unused_result))
bool
innodb_buffer_pool_evict_uncompressed(void)
/*=======================================*/
purge_run_now_set(
/*==============*/
THD* thd /*!< in: thread handle */
- __attribute__((unused)),
+ MY_ATTRIBUTE((unused)),
struct st_mysql_sys_var* var /*!< in: pointer to system
variable */
- __attribute__((unused)),
+ MY_ATTRIBUTE((unused)),
void* var_ptr /*!< out: where the formal
string goes */
- __attribute__((unused)),
+ MY_ATTRIBUTE((unused)),
const void* save) /*!< in: immediate result from
check function */
{
purge_stop_now_set(
/*===============*/
THD* thd /*!< in: thread handle */
- __attribute__((unused)),
+ MY_ATTRIBUTE((unused)),
struct st_mysql_sys_var* var /*!< in: pointer to system
variable */
- __attribute__((unused)),
+ MY_ATTRIBUTE((unused)),
void* var_ptr /*!< out: where the formal
string goes */
- __attribute__((unused)),
+ MY_ATTRIBUTE((unused)),
const void* save) /*!< in: immediate result from
check function */
{
checkpoint_now_set(
/*===============*/
THD* thd /*!< in: thread handle */
- __attribute__((unused)),
+ MY_ATTRIBUTE((unused)),
struct st_mysql_sys_var* var /*!< in: pointer to system
variable */
- __attribute__((unused)),
+ MY_ATTRIBUTE((unused)),
void* var_ptr /*!< out: where the formal
string goes */
- __attribute__((unused)),
+ MY_ATTRIBUTE((unused)),
const void* save) /*!< in: immediate result from
check function */
{
buf_flush_list_now_set(
/*===================*/
THD* thd /*!< in: thread handle */
- __attribute__((unused)),
+ MY_ATTRIBUTE((unused)),
struct st_mysql_sys_var* var /*!< in: pointer to system
variable */
- __attribute__((unused)),
+ MY_ATTRIBUTE((unused)),
void* var_ptr /*!< out: where the formal
string goes */
- __attribute__((unused)),
+ MY_ATTRIBUTE((unused)),
const void* save) /*!< in: immediate result from
check function */
{
buffer_pool_dump_now(
/*=================*/
THD* thd /*!< in: thread handle */
- __attribute__((unused)),
+ MY_ATTRIBUTE((unused)),
struct st_mysql_sys_var* var /*!< in: pointer to system
variable */
- __attribute__((unused)),
+ MY_ATTRIBUTE((unused)),
void* var_ptr /*!< out: where the formal
string goes */
- __attribute__((unused)),
+ MY_ATTRIBUTE((unused)),
const void* save) /*!< in: immediate result from
check function */
{
buffer_pool_load_now(
/*=================*/
THD* thd /*!< in: thread handle */
- __attribute__((unused)),
+ MY_ATTRIBUTE((unused)),
struct st_mysql_sys_var* var /*!< in: pointer to system
variable */
- __attribute__((unused)),
+ MY_ATTRIBUTE((unused)),
void* var_ptr /*!< out: where the formal
string goes */
- __attribute__((unused)),
+ MY_ATTRIBUTE((unused)),
const void* save) /*!< in: immediate result from
check function */
{
buffer_pool_load_abort(
/*===================*/
THD* thd /*!< in: thread handle */
- __attribute__((unused)),
+ MY_ATTRIBUTE((unused)),
struct st_mysql_sys_var* var /*!< in: pointer to system
variable */
- __attribute__((unused)),
+ MY_ATTRIBUTE((unused)),
void* var_ptr /*!< out: where the formal
string goes */
- __attribute__((unused)),
+ MY_ATTRIBUTE((unused)),
const void* save) /*!< in: immediate result from
check function */
{
static
void
innodb_status_output_update(
- THD* thd __attribute__((unused)),
- struct st_mysql_sys_var* var __attribute__((unused)),
- void* var_ptr __attribute__((unused)),
- const void* save __attribute__((unused)))
+ THD* thd MY_ATTRIBUTE((unused)),
+ struct st_mysql_sys_var* var MY_ATTRIBUTE((unused)),
+ void* var_ptr MY_ATTRIBUTE((unused)),
+ const void* save MY_ATTRIBUTE((unused)))
{
*static_cast<my_bool*>(var_ptr) = *static_cast<const my_bool*>(save);
/* The lock timeout monitor thread also takes care of this
"Whether to disable OS system file cache for sort I/O",
NULL, NULL, FALSE);
-static MYSQL_SYSVAR_STR(ft_aux_table, fts_internal_tbl_name,
+static MYSQL_SYSVAR_STR(ft_aux_table, fts_internal_tbl_name2,
PLUGIN_VAR_NOCMDARG,
"FTS internal auxiliary table to be checked",
innodb_internal_table_validate,
/*****************************************************************************
-Copyright (c) 2000, 2012, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 2000, 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
@param off auto_increment_offset
@param inc auto_increment_increment */
void thd_get_autoinc(const MYSQL_THD thd, ulong* off, ulong* inc)
-__attribute__((nonnull));
+MY_ATTRIBUTE((nonnull));
/** Is strict sql_mode set.
@param thd Thread object
@return True if sql_mode has strict mode (all or trans), false otherwise.
*/
bool thd_is_strict_mode(const MYSQL_THD thd)
-__attribute__((nonnull));
+MY_ATTRIBUTE((nonnull));
} /* extern "C" */
#ifdef WITH_WSREP
const KEY* key_info, /*!< in: Indexes to be created */
ulint num_of_keys) /*!< in: Number of indexes to
be created. */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/*****************************************************************//**
Determines InnoDB table flags.
outside system tablespace */
ulint* flags, /*!< out: DICT_TF flags */
ulint* flags2) /*!< out: DICT_TF2 flags */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/*****************************************************************//**
Validates the create options. We may build on this function
columns and indexes */
HA_CREATE_INFO* create_info, /*!< in: create info. */
bool use_tablespace) /*!< in: srv_file_per_table */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/*********************************************************************//**
Retrieve the FTS Relevance Ranking result for doc with doc_id
innobase_fts_close_ranking(
/*=======================*/
FT_INFO* fts_hdl) /*!< in: FTS handler */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/*****************************************************************//**
Initialize the table FTS stopword list
@return TRUE if success */
dict_table_t* table, /*!< in: Table has the FTS */
trx_t* trx, /*!< in: transaction */
THD* thd) /*!< in: current thread */
- __attribute__((nonnull(1,3), warn_unused_result));
+ MY_ATTRIBUTE((nonnull(1,3), warn_unused_result));
/** Some defines for innobase_fts_check_doc_id_index() return value */
enum fts_doc_id_index_enum {
that is being altered */
ulint* fts_doc_col_no) /*!< out: The column number for
Doc ID */
- __attribute__((warn_unused_result));
+ MY_ATTRIBUTE((warn_unused_result));
/*******************************************************************//**
Check whether the table has a unique index with FTS_DOC_ID_INDEX_NAME
/*===================================*/
ulint n_key, /*!< in: Number of keys */
const KEY* key_info) /*!< in: Key definitions */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/***********************************************************************
@return version of the extended FTS API */
/*****************************************************************************
-Copyright (c) 2005, 2015, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 2005, 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
| Alter_inplace_info::ALTER_COLUMN_NAME;
/* Report an InnoDB error to the client by invoking my_error(). */
-static UNIV_COLD __attribute__((nonnull))
+static UNIV_COLD MY_ATTRIBUTE((nonnull))
void
my_error_innodb(
/*============*/
Determine if ALTER TABLE needs to rebuild the table.
@param ha_alter_info the DDL operation
@return whether it is necessary to rebuild the table */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
bool
innobase_need_rebuild(
/*==================*/
const Alter_inplace_info* ha_alter_info)
{
- if (ha_alter_info->handler_flags
+ Alter_inplace_info::HA_ALTER_FLAGS alter_inplace_flags =
+ ha_alter_info->handler_flags & ~(INNOBASE_INPLACE_IGNORE);
+
+ if (alter_inplace_flags
== Alter_inplace_info::CHANGE_CREATE_OPTION
&& !(ha_alter_info->create_info->used_fields
& (HA_CREATE_USED_ROW_FORMAT
/*************************************************************//**
Initialize the dict_foreign_t structure with supplied info
@return true if added, false if duplicate foreign->id */
-static __attribute__((nonnull(1,3,5,7)))
+static MY_ATTRIBUTE((nonnull(1,3,5,7)))
bool
innobase_init_foreign(
/*==================*/
/*************************************************************//**
Check whether the foreign key options is legit
@return true if it is */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
bool
innobase_check_fk_option(
/*=====================*/
/*************************************************************//**
Set foreign key options
@return true if successfully set */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
bool
innobase_set_foreign_key_option(
/*============================*/
Check if a foreign key constraint can make use of an index
that is being created.
@return useable index, or NULL if none found */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
const KEY*
innobase_find_equiv_index(
/*======================*/
Find an index whose first fields are the columns in the array
in the same order and is not marked for deletion
@return matching index, NULL if not found */
-static __attribute__((nonnull(1,2,6), warn_unused_result))
+static MY_ATTRIBUTE((nonnull(1,2,6), warn_unused_result))
dict_index_t*
innobase_find_fk_index(
/*===================*/
Create InnoDB foreign key structure from MySQL alter_info
@retval true if successful
@retval false on error (will call my_error()) */
-static __attribute__((nonnull(1,2,3,7,8), warn_unused_result))
+static MY_ATTRIBUTE((nonnull(1,2,3,7,8), warn_unused_result))
bool
innobase_get_foreign_key_info(
/*==========================*/
/*******************************************************************//**
This function checks that index keys are sensible.
@return 0 or error number */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
int
innobase_check_index_keys(
/*======================*/
/*******************************************************************//**
Create index field definition for key part */
-static __attribute__((nonnull(2,3)))
+static MY_ATTRIBUTE((nonnull(2,3)))
void
innobase_create_index_field_def(
/*============================*/
/*******************************************************************//**
Create index definition for key */
-static __attribute__((nonnull))
+static MY_ATTRIBUTE((nonnull))
void
innobase_create_index_def(
/*======================*/
ENDIF
@return key definitions */
-static __attribute__((nonnull, warn_unused_result, malloc))
+static MY_ATTRIBUTE((nonnull, warn_unused_result, malloc))
index_def_t*
innobase_create_key_defs(
/*=====================*/
/*******************************************************************//**
Check each index column size, make sure they do not exceed the max limit
@return true if index column size exceeds limit */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
bool
innobase_check_column_length(
/*=========================*/
/********************************************************************//**
Drop any indexes that we were not able to free previously due to
open table handles. */
-static __attribute__((nonnull))
+static MY_ATTRIBUTE((nonnull))
void
online_retry_drop_indexes(
/*======================*/
/********************************************************************//**
Commit a dictionary transaction and drop any indexes that we were not
able to free previously due to open table handles. */
-static __attribute__((nonnull))
+static MY_ATTRIBUTE((nonnull))
void
online_retry_drop_indexes_with_trx(
/*===============================*/
@param drop_fk constraints being dropped
@param n_drop_fk number of constraints that are being dropped
@return whether the constraint is being dropped */
-inline __attribute__((pure, nonnull, warn_unused_result))
+inline MY_ATTRIBUTE((pure, nonnull, warn_unused_result))
bool
innobase_dropping_foreign(
/*======================*/
@retval true Not allowed (will call my_error())
@retval false Allowed
*/
-static __attribute__((pure, nonnull, warn_unused_result))
+static MY_ATTRIBUTE((pure, nonnull, warn_unused_result))
bool
innobase_check_foreigns_low(
/*========================*/
@retval true Not allowed (will call my_error())
@retval false Allowed
*/
-static __attribute__((pure, nonnull, warn_unused_result))
+static MY_ATTRIBUTE((pure, nonnull, warn_unused_result))
bool
innobase_check_foreigns(
/*====================*/
@param dfield InnoDB data field to copy to
@param field MySQL value for the column
@param comp nonzero if in compact format */
-static __attribute__((nonnull))
+static MY_ATTRIBUTE((nonnull))
void
innobase_build_col_map_add(
/*=======================*/
@param heap Memory heap where allocated
@return array of integers, mapping column numbers in the table
to column numbers in altered_table */
-static __attribute__((nonnull(1,2,3,4,5,7), warn_unused_result))
+static MY_ATTRIBUTE((nonnull(1,2,3,4,5,7), warn_unused_result))
const ulint*
innobase_build_col_map(
/*===================*/
@param user_table InnoDB table as it is before the ALTER operation
@param heap Memory heap for the allocation
@return array of new column names in rebuilt_table, or NULL if not renamed */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
const char**
innobase_get_col_names(
Alter_inplace_info* ha_alter_info,
@retval true Failure
@retval false Success
*/
-static __attribute__((warn_unused_result, nonnull(1,2,3,4)))
+static MY_ATTRIBUTE((warn_unused_result, nonnull(1,2,3,4)))
bool
prepare_inplace_alter_table_dict(
/*=============================*/
/* Check whether an index is needed for the foreign key constraint.
If so, if it is dropped, is there an equivalent index can play its role.
@return true if the index is needed and can't be dropped */
-static __attribute__((nonnull(1,2,3,5), warn_unused_result))
+static MY_ATTRIBUTE((nonnull(1,2,3,5), warn_unused_result))
bool
innobase_check_foreign_key_index(
/*=============================*/
}
if (!(ha_alter_info->handler_flags & INNOBASE_ALTER_DATA)
- || (ha_alter_info->handler_flags
+ || ((ha_alter_info->handler_flags & ~INNOBASE_INPLACE_IGNORE)
== Alter_inplace_info::CHANGE_CREATE_OPTION
&& !innobase_need_rebuild(ha_alter_info))) {
DBUG_RETURN(false);
}
- if (ha_alter_info->handler_flags
+ if ((ha_alter_info->handler_flags & ~INNOBASE_INPLACE_IGNORE)
== Alter_inplace_info::CHANGE_CREATE_OPTION
&& !innobase_need_rebuild(ha_alter_info)) {
goto ok_exit;
@param locked TRUE=table locked, FALSE=may need to do a lazy drop
@param trx the transaction
*/
-static __attribute__((nonnull))
+static MY_ATTRIBUTE((nonnull))
void
innobase_rollback_sec_index(
/*========================*/
@retval true Failure
@retval false Success
*/
-inline __attribute__((nonnull, warn_unused_result))
+inline MY_ATTRIBUTE((nonnull, warn_unused_result))
bool
rollback_inplace_alter_table(
/*=========================*/
@param foreign_id Foreign key constraint identifier
@retval true Failure
@retval false Success */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
bool
innobase_drop_foreign_try(
/*======================*/
@param new_clustered whether the table has been rebuilt
@retval true Failure
@retval false Success */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
bool
innobase_rename_column_try(
/*=======================*/
@param table_name Table name in MySQL
@retval true Failure
@retval false Success */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
bool
innobase_rename_columns_try(
/*========================*/
@param ha_alter_info Data used during in-place alter.
@param table the TABLE
@param user_table InnoDB table that was being altered */
-static __attribute__((nonnull))
+static MY_ATTRIBUTE((nonnull))
void
innobase_rename_columns_cache(
/*==========================*/
@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) */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
ulonglong
commit_get_autoinc(
/*===============*/
@retval true Failure
@retval false Success
*/
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
bool
innobase_update_foreign_try(
/*========================*/
@param ctx In-place ALTER TABLE context
@param user_thd MySQL connection
@return InnoDB error code (should always be DB_SUCCESS) */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
dberr_t
innobase_update_foreign_cache(
/*==========================*/
@retval true Failure
@retval false Success
*/
-inline __attribute__((nonnull, warn_unused_result))
+inline MY_ATTRIBUTE((nonnull, warn_unused_result))
bool
commit_try_rebuild(
/*===============*/
/** Apply the changes made during commit_try_rebuild(),
to the data dictionary cache and the file system.
@param ctx In-place ALTER TABLE context */
-inline __attribute__((nonnull))
+inline MY_ATTRIBUTE((nonnull))
void
commit_cache_rebuild(
/*=================*/
@retval true Failure
@retval false Success
*/
-inline __attribute__((nonnull, warn_unused_result))
+inline MY_ATTRIBUTE((nonnull, warn_unused_result))
bool
commit_try_norebuild(
/*=================*/
@param trx Data dictionary transaction object
(will be started and committed)
@return whether all replacements were found for dropped indexes */
-inline __attribute__((nonnull, warn_unused_result))
+inline MY_ATTRIBUTE((nonnull, warn_unused_result))
bool
commit_cache_norebuild(
/*===================*/
/*****************************************************************************
-Copyright (c) 2007, 2015, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 2007, 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
DBUG_RETURN(0);
}
- deleted = fts_doc_ids_create();
+ /* Prevent DDL to drop fts aux tables. */
+ rw_lock_s_lock(&dict_operation_lock);
user_table = dict_table_open_on_name(
fts_internal_tbl_name, FALSE, FALSE, DICT_ERR_IGNORE_NONE);
if (!user_table) {
+ rw_lock_s_unlock(&dict_operation_lock);
+
+ DBUG_RETURN(0);
+ } else if (!dict_table_has_fts_index(user_table)) {
+ dict_table_close(user_table, FALSE, FALSE);
+
+ rw_lock_s_unlock(&dict_operation_lock);
+
DBUG_RETURN(0);
}
+ deleted = fts_doc_ids_create();
+
trx = trx_allocate_for_background();
trx->op_info = "Select for FTS DELETE TABLE";
dict_table_close(user_table, FALSE, FALSE);
+ rw_lock_s_unlock(&dict_operation_lock);
+
DBUG_RETURN(0);
}
DBUG_RETURN(0);
}
+ if (user_table->fts == NULL || user_table->fts->cache == NULL) {
+ dict_table_close(user_table, FALSE, FALSE);
+
+ DBUG_RETURN(0);
+ }
+
cache = user_table->fts->cache;
ut_a(cache);
DBUG_RETURN(0);
}
+ /* Prevent DDL to drop fts aux tables. */
+ rw_lock_s_lock(&dict_operation_lock);
+
user_table = dict_table_open_on_name(
fts_internal_tbl_name, FALSE, FALSE, DICT_ERR_IGNORE_NONE);
if (!user_table) {
+ rw_lock_s_unlock(&dict_operation_lock);
+
DBUG_RETURN(0);
}
dict_table_close(user_table, FALSE, FALSE);
+ rw_lock_s_unlock(&dict_operation_lock);
+
DBUG_RETURN(0);
}
DBUG_RETURN(0);
}
+ DEBUG_SYNC_C("i_s_fts_config_fille_check");
+
fields = table->field;
+ /* Prevent DDL to drop fts aux tables. */
+ rw_lock_s_lock(&dict_operation_lock);
+
user_table = dict_table_open_on_name(
fts_internal_tbl_name, FALSE, FALSE, DICT_ERR_IGNORE_NONE);
if (!user_table) {
+ rw_lock_s_unlock(&dict_operation_lock);
+
DBUG_RETURN(0);
} else if (!dict_table_has_fts_index(user_table)) {
dict_table_close(user_table, FALSE, FALSE);
+ rw_lock_s_unlock(&dict_operation_lock);
+
DBUG_RETURN(0);
}
dict_table_close(user_table, FALSE, FALSE);
+ rw_lock_s_unlock(&dict_operation_lock);
+
DBUG_RETURN(0);
}
/*****************************************************************************
-Copyright (c) 1997, 2014, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1997, 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
ibuf_parse_bitmap_init(
/*===================*/
byte* ptr, /*!< in: buffer */
- byte* end_ptr __attribute__((unused)), /*!< in: buffer end */
+ byte* end_ptr MY_ATTRIBUTE((unused)), /*!< in: buffer end */
buf_block_t* block, /*!< in: block or NULL */
mtr_t* mtr) /*!< in: mtr or NULL */
{
/*******************************************************************//**
Get the matching records for space id.
@return current rec or NULL */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
const rec_t*
ibuf_get_user_rec(
/*===============*/
Reads page numbers for a space id from an ibuf tree.
@return a lower limit for the combined volume of records which will be
merged */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
ulint
ibuf_get_merge_pages(
/*=================*/
}
/*********************************************************************//**
-Get the table instance from the table id.
-@return table instance */
-static __attribute__((warn_unused_result))
-dict_table_t*
-ibuf_get_table(
-/*===========*/
- table_id_t table_id) /*!< in: valid table id */
-{
- rw_lock_s_lock_func(&dict_operation_lock, 0, __FILE__, __LINE__);
-
- dict_table_t* table = dict_table_open_on_id(
- table_id, FALSE, DICT_TABLE_OP_NORMAL);
-
- rw_lock_s_unlock_gen(&dict_operation_lock, 0);
-
- return(table);
-}
-
-/*********************************************************************//**
-Contracts insert buffer trees by reading pages to the buffer pool.
-@return a lower limit for the combined size in bytes of entries which
-will be merged from ibuf trees to the pages read, 0 if ibuf is
-empty */
-static
+Contracts insert buffer trees by reading pages referring to space_id
+to the buffer pool.
+@returns number of pages merged.*/
+UNIV_INTERN
ulint
ibuf_merge_space(
/*=============*/
- ulint space, /*!< in: tablespace id to merge */
- ulint* n_pages)/*!< out: number of pages to which merged */
+ ulint space) /*!< in: tablespace id to merge */
{
mtr_t mtr;
btr_pcur_t pcur;
mem_heap_t* heap = mem_heap_create(512);
dtuple_t* tuple = ibuf_search_tuple_build(space, 0, heap);
+ ulint n_pages = 0;
+
+ ut_ad(space < SRV_LOG_SPACE_FIRST_ID);
ibuf_mtr_start(&mtr);
} else {
sum_sizes = ibuf_get_merge_pages(
- &pcur, space, IBUF_MAX_N_PAGES_MERGED,
- &pages[0], &spaces[0], &versions[0], n_pages,
- &mtr);
+ &pcur, space, IBUF_MAX_N_PAGES_MERGED,
+ &pages[0], &spaces[0], &versions[0], &n_pages,
+ &mtr);
+ ib_logf(IB_LOG_LEVEL_INFO,"\n Size of pages merged %lu"
+ ,sum_sizes);
- ++sum_sizes;
}
ibuf_mtr_commit(&mtr);
btr_pcur_close(&pcur);
- if (sum_sizes > 0) {
-
- ut_a(*n_pages > 0 || sum_sizes == 1);
+ if (n_pages > 0) {
#ifdef UNIV_DEBUG
- ut_ad(*n_pages <= UT_ARR_SIZE(pages));
+ ut_ad(n_pages <= UT_ARR_SIZE(pages));
- for (ulint i = 0; i < *n_pages; ++i) {
+ for (ulint i = 0; i < n_pages; ++i) {
ut_ad(spaces[i] == space);
ut_ad(i == 0 || versions[i] == versions[i - 1]);
}
#endif /* UNIV_DEBUG */
buf_read_ibuf_merge_pages(
- true, spaces, versions, pages, *n_pages);
+ true, spaces, versions, pages, n_pages);
}
- return(sum_sizes);
+ return(n_pages);
}
-/*********************************************************************//**
-Contracts insert buffer trees by reading pages to the buffer pool.
+/** Contract the change buffer by reading pages to the buffer pool.
+@param[out] n_pages number of pages merged
+@param[in] sync whether the caller waits for
+the issued reads to complete
@return a lower limit for the combined size in bytes of entries which
will be merged from ibuf trees to the pages read, 0 if ibuf is
empty */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
ulint
ibuf_merge(
/*=======*/
- table_id_t table_id, /*!< in: if merge should be
- done only for a specific
- table, for all tables this
- should be 0 */
ulint* n_pages, /*!< out: number of pages to
which merged */
bool sync) /*!< in: TRUE if the caller
read with the highest
tablespace address to complete */
{
- dict_table_t* table;
-
*n_pages = 0;
/* We perform a dirty read of ibuf->empty, without latching
} else if (ibuf_debug) {
return(0);
#endif /* UNIV_DEBUG || UNIV_IBUF_DEBUG */
- } else if (table_id == 0) {
+ } else {
return(ibuf_merge_pages(n_pages, sync));
- } else if ((table = ibuf_get_table(table_id)) == 0) {
- /* Table has been dropped. */
- return(0);
}
-
- ulint volume = ibuf_merge_space(table->space, n_pages);
-
- dict_table_close(table, FALSE, FALSE);
-
- return(volume);
}
-/*********************************************************************//**
-Contracts insert buffer trees by reading pages to the buffer pool.
+/** Contract the change buffer by reading pages to the buffer pool.
+@param[in] sync whether the caller waits for
+the issued reads to complete
@return a lower limit for the combined size in bytes of entries which
-will be merged from ibuf trees to the pages read, 0 if ibuf is
-empty */
+will be merged from ibuf trees to the pages read, 0 if ibuf is empty */
static
ulint
ibuf_contract(
/*==========*/
- ibool sync) /*!< in: TRUE if the caller wants to wait for the
+ bool sync) /*!< in: TRUE if the caller wants to wait for the
issued read with the highest tablespace address
to complete */
{
ulint n_pages;
- return(ibuf_merge(0, &n_pages, sync));
+ return(ibuf_merge_pages(&n_pages, sync));
}
-/*********************************************************************//**
-Contracts insert buffer trees by reading pages to the buffer pool.
+/** Contract the change buffer by reading pages to the buffer pool.
+@param[in] full If true, do a full contraction based
+on PCT_IO(100). If false, the size of contract batch is determined
+based on the current size of the change buffer.
@return a lower limit for the combined size in bytes of entries which
will be merged from ibuf trees to the pages read, 0 if ibuf is
empty */
UNIV_INTERN
ulint
-ibuf_contract_in_background(
-/*========================*/
- table_id_t table_id, /*!< in: if merge should be done only
- for a specific table, for all tables
- this should be 0 */
- ibool full) /*!< in: TRUE if the caller wants to
- do a full contract based on PCT_IO(100).
- If FALSE then the size of contract
- batch is determined based on the
- current size of the ibuf tree. */
+ibuf_merge_in_background(
+/*=====================*/
+ bool full) /*!< in: TRUE if the caller wants to
+ do a full contract based on PCT_IO(100).
+ If FALSE then the size of contract
+ batch is determined based on the
+ current size of the ibuf tree. */
{
ulint sum_bytes = 0;
ulint sum_pages = 0;
ulint n_pages;
#if defined UNIV_DEBUG || defined UNIV_IBUF_DEBUG
- if (srv_ibuf_disable_background_merge && table_id == 0) {
+ if (srv_ibuf_disable_background_merge) {
return(0);
}
#endif /* UNIV_DEBUG || UNIV_IBUF_DEBUG */
while (sum_pages < n_pages) {
ulint n_bytes;
- n_bytes = ibuf_merge(table_id, &n_pag2, FALSE);
+ n_bytes = ibuf_merge(&n_pag2, false);
if (n_bytes == 0) {
return(sum_bytes);
Buffer an operation in the insert/delete buffer, instead of doing it
directly to the disk page, if this is possible.
@return DB_SUCCESS, DB_STRONG_FAIL or other error */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
dberr_t
ibuf_insert_low(
/*============*/
#ifdef UNIV_IBUF_DEBUG
fputs("Ibuf too big\n", stderr);
#endif
- /* Use synchronous contract (== TRUE) */
- ibuf_contract(TRUE);
+ ibuf_contract(true);
return(DB_STRONG_FAIL);
}
During merge, inserts to an index page a secondary index entry extracted
from the insert buffer.
@return newly inserted record */
-static __attribute__((nonnull))
+static MY_ATTRIBUTE((nonnull))
rec_t*
ibuf_insert_to_index_page_low(
/*==========================*/
/*********************************************************************//**
Restores insert buffer tree cursor position
@return TRUE if the position was restored; FALSE if not */
-static __attribute__((nonnull))
+static MY_ATTRIBUTE((nonnull))
ibool
ibuf_restore_pos(
/*=============*/
resort to a pessimistic delete, this function commits mtr and closes
the cursor.
@return TRUE if mtr was committed and pcur closed in this operation */
-static __attribute__((warn_unused_result))
+static MY_ATTRIBUTE((warn_unused_result))
ibool
ibuf_delete_rec(
/*============*/
/*****************************************************************************
-Copyright (c) 2011, 2015, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 2011, 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
#endif
#if defined(__GNUC__) && (__GNUC__ > 2) && ! defined(__INTEL_COMPILER)
-#define UNIV_NO_IGNORE __attribute__ ((warn_unused_result))
+#define UNIV_NO_IGNORE MY_ATTRIBUTE ((warn_unused_result))
#else
#define UNIV_NO_IGNORE
#endif /* __GNUC__ && __GNUC__ > 2 && !__INTEL_COMPILER */
/*****************************************************************************
-Copyright (c) 1994, 2013, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1994, 2016, 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
/*==================*/
const buf_block_t* block, /*!< in: corrupted block */
const dict_index_t* index) /*!< in: index tree */
- UNIV_COLD __attribute__((nonnull));
+ UNIV_COLD MY_ATTRIBUTE((nonnull));
/** Assert that a B-tree page is not corrupted.
@param block buffer block containing a B-tree page
ulint page_no, /*!< in: start page of the column */
dict_index_t* index, /*!< in/out: index tree */
const char* ctx) /*!< in: context (for logging) */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/**************************************************************//**
Display the references to off-page columns.
This function is to be called from a debugger,
btr_blob_dbg_print(
/*===============*/
const dict_index_t* index) /*!< in: index tree */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/**************************************************************//**
Check that there are no references to off-page columns from or to
the given page. Invoked when freeing or clearing a page.
/*==================*/
dict_index_t* index, /*!< in: index */
ulint page_no) /*!< in: page number */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/**************************************************************//**
Modify the 'deleted' flag of a record. */
dict_index_t* index, /*!< in/out: index */
const ulint* offsets,/*!< in: rec_get_offs(rec, index) */
ibool del) /*!< in: TRUE=deleted, FALSE=exists */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/**************************************************************//**
Change the ownership of an off-page column. */
UNIV_INTERN
const ulint* offsets,/*!< in: rec_get_offs(rec, index) */
ulint i, /*!< in: ith field in rec */
ibool own) /*!< in: TRUE=owned, FALSE=disowned */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/** Assert that there are no BLOB references to or from the given page. */
# define btr_blob_dbg_assert_empty(index, page_no) \
ut_a(btr_blob_dbg_is_empty(index, page_no))
/*=========*/
const dict_index_t* index, /*!< in: index tree */
mtr_t* mtr) /*!< in: mtr */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/**************************************************************//**
Checks and adjusts the root node of a tree during IMPORT TABLESPACE.
btr_root_adjust_on_import(
/*======================*/
const dict_index_t* index) /*!< in: index tree */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/**************************************************************//**
Gets the height of the B-tree (the level of the root, when the leaf
/*===========*/
dict_index_t* index, /*!< in: index tree */
mtr_t* mtr) /*!< in/out: mini-transaction */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/**************************************************************//**
Gets a buffer page and declares its latching order level. */
UNIV_INLINE
btr_page_get_index_id(
/*==================*/
const page_t* page) /*!< in: index page */
- __attribute__((nonnull, pure, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, pure, warn_unused_result));
#ifndef UNIV_HOTBACKUP
/********************************************************//**
Gets the node level field in an index page.
btr_page_get_level_low(
/*===================*/
const page_t* page) /*!< in: index page */
- __attribute__((nonnull, pure, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, pure, warn_unused_result));
#define btr_page_get_level(page, mtr) btr_page_get_level_low(page)
/********************************************************//**
Gets the next index page number.
/*==============*/
const page_t* page, /*!< in: index page */
mtr_t* mtr) /*!< in: mini-transaction handle */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/********************************************************//**
Gets the previous index page number.
@return prev page number */
/*==============*/
const page_t* page, /*!< in: index page */
mtr_t* mtr) /*!< in: mini-transaction handle */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/*************************************************************//**
Gets pointer to the previous user record in the tree. It is assumed
that the caller has appropriate latches on the page and its neighbor.
rec_t* rec, /*!< in: record on leaf level */
mtr_t* mtr) /*!< in: mtr holding a latch on the page, and if
needed, also to the previous page */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/*************************************************************//**
Gets pointer to the next user record in the tree. It is assumed
that the caller has appropriate latches on the page and its neighbor.
rec_t* rec, /*!< in: record on leaf level */
mtr_t* mtr) /*!< in: mtr holding a latch on the page, and if
needed, also to the next page */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/**************************************************************//**
Releases the latch on a leaf page and bufferunfixes it. */
UNIV_INLINE
ulint latch_mode, /*!< in: BTR_SEARCH_LEAF or
BTR_MODIFY_LEAF */
mtr_t* mtr) /*!< in: mtr */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/**************************************************************//**
Gets the child node file address in a node pointer.
NOTE: the offsets array must contain all offsets for the record since
/*===========================*/
const rec_t* rec, /*!< in: node pointer record */
const ulint* offsets)/*!< in: array returned by rec_get_offsets() */
- __attribute__((nonnull, pure, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, pure, warn_unused_result));
/************************************************************//**
Creates the root node for a new index tree.
@return page number of the created root, FIL_NULL if did not succeed */
index_id_t index_id,/*!< in: index id */
dict_index_t* index, /*!< in: index */
mtr_t* mtr) /*!< in: mini-transaction handle */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/************************************************************//**
Frees a B-tree except the root page, which MUST be freed after this
by calling btr_free_root. */
or 0 for uncompressed pages */
ulint root_page_no, /*!< in: root page number */
mtr_t* mtr) /*!< in/out: mini-transaction */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/*************************************************************//**
Makes tree one level higher by splitting the root, and inserts
the tuple. It is assumed that mtr contains an x-latch on the tree.
const dtuple_t* tuple, /*!< in: tuple to insert */
ulint n_ext, /*!< in: number of externally stored columns */
mtr_t* mtr) /*!< in: mtr */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/*************************************************************//**
Reorganizes an index page.
page_cur_t* cursor, /*!< in/out: page cursor */
dict_index_t* index, /*!< in: the index tree of the page */
mtr_t* mtr) /*!< in/out: mini-transaction */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/*************************************************************//**
Reorganizes an index page.
page_cur_t* cursor, /*!< in/out: page cursor */
dict_index_t* index, /*!< in: the index tree of the page */
mtr_t* mtr) /*!< in/out: mini-transaction */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/*************************************************************//**
Decides if the page should be split at the convergence point of
inserts converging to left.
rec_t** split_rec)/*!< out: if split recommended,
the first record on upper half page,
or NULL if tuple should be first */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/*************************************************************//**
Decides if the page should be split at the convergence point of
inserts converging to right.
rec_t** split_rec)/*!< out: if split recommended,
the first record on upper half page,
or NULL if tuple should be first */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/*************************************************************//**
Splits an index page to halves and inserts the tuple. It is assumed
that mtr holds an x-latch to the index tree. NOTE: the tree x-latch is
const dtuple_t* tuple, /*!< in: tuple to insert */
ulint n_ext, /*!< in: number of externally stored columns */
mtr_t* mtr) /*!< in: mtr */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/*******************************************************//**
Inserts a data tuple to a tree on a non-leaf level. It is assumed
that mtr holds an x-latch on the tree. */
const char* file, /*!< in: file name */
ulint line, /*!< in: line where called */
mtr_t* mtr) /*!< in: mtr */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
# define btr_insert_on_non_leaf_level(f,i,l,t,m) \
btr_insert_on_non_leaf_level_func(f,i,l,t,__FILE__,__LINE__,m)
#endif /* !UNIV_HOTBACKUP */
/*=================*/
rec_t* rec, /*!< in/out: record */
mtr_t* mtr) /*!< in: mtr */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
#ifndef UNIV_HOTBACKUP
/*************************************************************//**
Deletes on the upper level the node pointer to a page. */
dict_index_t* index, /*!< in: index tree */
buf_block_t* block, /*!< in: page whose node pointer is deleted */
mtr_t* mtr) /*!< in: mtr */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
#ifdef UNIV_DEBUG
/************************************************************//**
Checks that the node pointer to a page is appropriate.
dict_index_t* index, /*!< in: index tree */
buf_block_t* block, /*!< in: index page */
mtr_t* mtr) /*!< in: mtr */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
#endif /* UNIV_DEBUG */
/*************************************************************//**
Tries to merge the page first to the left immediate brother if such a
ibool adjust, /*!< in: TRUE if should adjust the
cursor position even if compression occurs */
mtr_t* mtr) /*!< in/out: mini-transaction */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/*************************************************************//**
Discards a page from a B-tree. This is used to remove the last record from
a B-tree page: the whole page must be removed at the same time. This cannot
btr_cur_t* cursor, /*!< in: cursor on the page to discard: not on
the root page */
mtr_t* mtr) /*!< in: mtr */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
#endif /* !UNIV_HOTBACKUP */
/****************************************************************//**
Parses the redo log record for setting an index record as the predefined
ulint comp, /*!< in: nonzero=compact page format */
page_t* page, /*!< in: page or NULL */
mtr_t* mtr) /*!< in: mtr or NULL */
- __attribute__((nonnull(1,2), warn_unused_result));
+ MY_ATTRIBUTE((nonnull(1,2), warn_unused_result));
/***********************************************************//**
Parses a redo log record of reorganizing a page.
@return end of log record or NULL */
bool compressed,/*!< in: true if compressed page */
buf_block_t* block, /*!< in: page to be reorganized, or NULL */
mtr_t* mtr) /*!< in: mtr or NULL */
- __attribute__((nonnull(1,2,3), warn_unused_result));
+ MY_ATTRIBUTE((nonnull(1,2,3), warn_unused_result));
#ifndef UNIV_HOTBACKUP
/**************************************************************//**
Gets the number of pages in a B-tree.
ulint flag, /*!< in: BTR_N_LEAF_PAGES or BTR_TOTAL_SIZE */
mtr_t* mtr) /*!< in/out: mini-transaction where index
is s-latched */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/**************************************************************//**
Allocates a new file page to be used in an index tree. NOTE: we assume
that the caller has made the reservation for free extents!
mtr_t* init_mtr) /*!< in/out: mini-transaction
for x-latching and initializing
the page */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/**************************************************************//**
Frees a file page used in an index tree. NOTE: cannot free field external
storage pages because the page must contain info on its level. */
dict_index_t* index, /*!< in: index tree */
buf_block_t* block, /*!< in: block to be freed, x-latched */
mtr_t* mtr) /*!< in: mtr */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/**************************************************************//**
Frees a file page used in an index tree. Can be used also to BLOB
external storage pages, because the page level 0 can be given as an
buf_block_t* block, /*!< in: block to be freed, x-latched */
ulint level, /*!< in: page level */
mtr_t* mtr) /*!< in: mtr */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
#ifdef UNIV_BTR_PRINT
/*************************************************************//**
Prints size info of a B-tree. */
btr_print_size(
/*===========*/
dict_index_t* index) /*!< in: index tree */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/**************************************************************//**
Prints directories and other info of all nodes in the index. */
UNIV_INTERN
dict_index_t* index, /*!< in: index */
ulint width) /*!< in: print this many entries from start
and end */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
#endif /* UNIV_BTR_PRINT */
/************************************************************//**
Checks the size and number of fields in a record based on the definition of
ibool dump_on_error) /*!< in: TRUE if the function
should print hex dump of record
and page on error */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/**************************************************************//**
Checks the consistency of an index tree.
@return TRUE if ok */
/*===============*/
dict_index_t* index, /*!< in: index */
const trx_t* trx) /*!< in: transaction or 0 */
- __attribute__((nonnull(1), warn_unused_result));
+ MY_ATTRIBUTE((nonnull(1), warn_unused_result));
#define BTR_N_LEAF_PAGES 1
#define BTR_TOTAL_SIZE 2
/*****************************************************************************
-Copyright (c) 1994, 2012, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1994, 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
btr_page_get_next(
/*==============*/
const page_t* page, /*!< in: index page */
- mtr_t* mtr __attribute__((unused)))
+ mtr_t* mtr MY_ATTRIBUTE((unused)))
/*!< in: mini-transaction handle */
{
- ut_ad(page && mtr);
+ ut_ad(page != NULL);
+ ut_ad(mtr != NULL);
ut_ad(mtr_memo_contains_page(mtr, page, MTR_MEMO_PAGE_X_FIX)
|| mtr_memo_contains_page(mtr, page, MTR_MEMO_PAGE_S_FIX));
ulint next, /*!< in: next page number */
mtr_t* mtr) /*!< in: mini-transaction handle */
{
- ut_ad(page && mtr);
+ ut_ad(page != NULL);
+ ut_ad(mtr != NULL);
if (page_zip) {
mach_write_to_4(page + FIL_PAGE_NEXT, next);
btr_page_get_prev(
/*==============*/
const page_t* page, /*!< in: index page */
- mtr_t* mtr __attribute__((unused))) /*!< in: mini-transaction handle */
+ mtr_t* mtr MY_ATTRIBUTE((unused))) /*!< in: mini-transaction handle */
{
- ut_ad(page && mtr);
+ ut_ad(page != NULL);
+ ut_ad(mtr != NULL);
return(mach_read_from_4(page + FIL_PAGE_PREV));
}
ulint prev, /*!< in: previous page number */
mtr_t* mtr) /*!< in: mini-transaction handle */
{
- ut_ad(page && mtr);
+ ut_ad(page != NULL);
+ ut_ad(mtr != NULL);
if (page_zip) {
mach_write_to_4(page + FIL_PAGE_PREV, prev);
/*****************************************************************************
-Copyright (c) 1994, 2014, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1994, 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
const char* file, /*!< in: file name */
ulint line, /*!< in: line where called */
mtr_t* mtr) /*!< in/out: mini-transaction */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
#define btr_cur_open_at_index_side(f,i,l,c,lv,m) \
btr_cur_open_at_index_side_func(f,i,l,c,lv,__FILE__,__LINE__,m)
/**********************************************************************//**
compressed tablespace, the caller must
mtr_commit(mtr) before latching
any further pages */
- __attribute__((nonnull(2,3,4,5,6,7,10), warn_unused_result));
+ MY_ATTRIBUTE((nonnull(2,3,4,5,6,7,10), warn_unused_result));
/*************************************************************//**
Performs an insert on a page of an index tree. It is assumed that mtr
holds an x-latch on the tree and on the cursor page. If the insert is
ulint n_ext, /*!< in: number of externally stored columns */
que_thr_t* thr, /*!< in: query thread or NULL */
mtr_t* mtr) /*!< in/out: mini-transaction */
- __attribute__((nonnull(2,3,4,5,6,7,10), warn_unused_result));
+ MY_ATTRIBUTE((nonnull(2,3,4,5,6,7,10), warn_unused_result));
/*************************************************************//**
See if there is enough place in the page modification log to log
an update-in-place.
bool create, /*!< in: true=delete-and-insert,
false=update-in-place */
mtr_t* mtr) /*!< in/out: mini-transaction */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
#ifdef UNIV_DEBUG
# define btr_cur_update_alloc_zip(page_zip,cursor,index,offsets,len,cr,mtr) \
btr_cur_update_alloc_zip_func(page_zip,cursor,index,offsets,len,cr,mtr)
is a secondary index, the caller must
mtr_commit(mtr) before latching any
further pages */
- __attribute__((warn_unused_result, nonnull));
+ MY_ATTRIBUTE((warn_unused_result, nonnull));
/***********************************************************//**
Writes a redo log record of updating a record in-place. */
UNIV_INTERN
trx_id_t trx_id, /*!< in: transaction id */
roll_ptr_t roll_ptr, /*!< in: roll ptr */
mtr_t* mtr) /*!< in: mtr */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/*************************************************************//**
Tries to update a record on a page in an index tree. It is assumed that mtr
holds an x-latch on the page. The operation does not succeed if there is too
is a secondary index, the caller must
mtr_commit(mtr) before latching any
further pages */
- __attribute__((warn_unused_result, nonnull));
+ MY_ATTRIBUTE((warn_unused_result, nonnull));
/*************************************************************//**
Performs an update of a record on a page of a tree. It is assumed
that mtr holds an x-latch on the tree and on the cursor page. If the
trx_id_t trx_id, /*!< in: transaction id */
mtr_t* mtr) /*!< in/out: mini-transaction; must be committed
before latching any further pages */
- __attribute__((warn_unused_result, nonnull));
+ MY_ATTRIBUTE((warn_unused_result, nonnull));
/***********************************************************//**
Marks a clustered index record deleted. Writes an undo log record to
undo log on this delete marking. Writes in the trx id field the id
const ulint* offsets,/*!< in: rec_get_offsets(rec) */
que_thr_t* thr, /*!< in: query thread */
mtr_t* mtr) /*!< in/out: mini-transaction */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/***********************************************************//**
Sets a secondary index record delete mark to TRUE or FALSE.
@return DB_SUCCESS, DB_LOCK_WAIT, or error number */
ibool val, /*!< in: value to set */
que_thr_t* thr, /*!< in: query thread */
mtr_t* mtr) /*!< in/out: mini-transaction */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/*************************************************************//**
Tries to compress a page of the tree if it seems useful. It is assumed
that mtr holds an x-latch on the tree and on the cursor page. To avoid
ibool adjust, /*!< in: TRUE if should adjust the
cursor position even if compression occurs */
mtr_t* mtr) /*!< in/out: mini-transaction */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/*******************************************************//**
Removes the record on which the tree cursor is positioned. It is assumed
that the mtr has an x-latch on the page where the cursor is positioned,
TRUE on a leaf page of a secondary
index, the mtr must be committed
before latching any further pages */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
# ifdef UNIV_DEBUG
# define btr_cur_optimistic_delete(cursor, flags, mtr) \
btr_cur_optimistic_delete_func(cursor, flags, mtr)
ulint flags, /*!< in: BTR_CREATE_FLAG or 0 */
enum trx_rb_ctx rb_ctx, /*!< in: rollback context */
mtr_t* mtr) /*!< in: mtr */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
#endif /* !UNIV_HOTBACKUP */
/***********************************************************//**
Parses a redo log record of updating a record in-place.
const ulint* offsets,/*!< in: array returned by rec_get_offsets() */
const upd_t* update, /*!< in: update vector */
mtr_t* mtr) /*!< in/out: mini-transaction */
- __attribute__((nonnull(2,3,4,5,6)));
+ MY_ATTRIBUTE((nonnull(2,3,4,5,6)));
/** Operation code for btr_store_big_rec_extern_fields(). */
enum blob_op {
btr_blob_op_is_update(
/*==================*/
enum blob_op op) /*!< in: operation */
- __attribute__((warn_unused_result));
+ MY_ATTRIBUTE((warn_unused_result));
/*******************************************************************//**
Stores the fields in big_rec_vec to the tablespace and puts pointers to
mtr_t* btr_mtr, /*!< in: mtr containing the
latches to the clustered index */
enum blob_op op) /*! in: operation code */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/*******************************************************************//**
Frees the space in an externally stored field to the file space
dtuple_t* tuple, /*!< in/out: data tuple */
const upd_t* update, /*!< in: update vector */
mem_heap_t* heap) /*!< in: memory heap */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/***********************************************************//**
Sets a secondary index record's delete mark to the given value. This
function is only used by the insert buffer merge mechanism. */
/*****************************************************************************
-Copyright (c) 1996, 2013, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1996, 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
ulint level, /*!< in: level to search for
(0=leaf) */
mtr_t* mtr) /*!< in/out: mini-transaction */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/**************************************************************//**
Gets the up_match value for a pcur after a search.
@return number of matched fields at the cursor or to the right if
/*****************************************************************************
-Copyright (c) 1996, 2011, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1996, 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
btr_search_get_info(
/*================*/
dict_index_t* index) /*!< in: index */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/*****************************************************************//**
Creates and initializes a search info struct.
@return own: search info struct */
/*****************************************************************************
-Copyright (c) 1996, 2011, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1996, 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
dict_index_t* index, /*!< in/out: index tree */
const btr_blob_dbg_t* b, /*!< in: the reference */
const char* ctx) /*!< in: context (for logging) */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/** Remove from index->blobs a reference to an off-page column.
@param index the index tree
dict_index_t* index, /*!< in/out: index tree */
const btr_blob_dbg_t* b, /*!< in: the reference */
const char* ctx) /*!< in: context (for logging) */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/**************************************************************//**
Add to index->blobs any references to off-page columns from a record.
dict_index_t* index, /*!< in/out: index */
const ulint* offsets,/*!< in: offsets */
const char* ctx) /*!< in: context (for logging) */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/**************************************************************//**
Remove from index->blobs any references to off-page columns from a record.
@return number of references removed */
dict_index_t* index, /*!< in/out: index */
const ulint* offsets,/*!< in: offsets */
const char* ctx) /*!< in: context (for logging) */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/**************************************************************//**
Count and add to index->blobs any references to off-page columns
from records on a page.
const page_t* page, /*!< in: rewritten page */
dict_index_t* index, /*!< in/out: index */
const char* ctx) /*!< in: context (for logging) */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/**************************************************************//**
Count and remove from index->blobs any references to off-page columns
from records on a page.
const page_t* page, /*!< in: b-tree page */
dict_index_t* index, /*!< in/out: index */
const char* ctx) /*!< in: context (for logging) */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/**************************************************************//**
Restore in index->blobs any references to off-page columns
Used when page reorganize fails due to compressed page overflow. */
const page_t* page, /*!< in: copy of original page */
dict_index_t* index, /*!< in/out: index */
const char* ctx) /*!< in: context (for logging) */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/** Operation that processes the BLOB references of an index record
@param[in] rec record on index page
dict_index_t* index, /*!< in/out: index */
const char* ctx, /*!< in: context (for logging) */
const btr_blob_dbg_op_f op) /*!< in: operation on records */
- __attribute__((nonnull(1,3,4,5)));
+ MY_ATTRIBUTE((nonnull(1,3,4,5)));
#else /* UNIV_BLOB_DEBUG */
# define btr_blob_dbg_add_rec(rec, index, offsets, ctx) ((void) 0)
# define btr_blob_dbg_add(page, index, ctx) ((void) 0)
/*****************************************************************************
-Copyright (c) 2006, 2011, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 2006, 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
storage was allocated from the
LRU list and buf_pool->mutex was
temporarily released */
- __attribute__((malloc, nonnull));
+ MY_ATTRIBUTE((malloc, nonnull));
/**********************************************************************//**
Deallocate a block. */
be pointed to by the buffer pool */
ulint size) /*!< in: block size,
up to UNIV_PAGE_SIZE */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
#ifndef UNIV_NONINL
# include "buf0buddy.ic"
/*****************************************************************************
-Copyright (c) 2006, 2011, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 2006, 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
allocated from the LRU list and
buf_pool->mutex was temporarily
released */
- __attribute__((malloc, nonnull));
+ MY_ATTRIBUTE((malloc, nonnull));
/**********************************************************************//**
Deallocate a block. */
pointed to by the buffer pool */
ulint i) /*!< in: index of buf_pool->zip_free[],
or BUF_BUDDY_SIZES */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/**********************************************************************//**
Get the index of buf_pool->zip_free[] for a given block size.
/*****************************************************************************
-Copyright (c) 1995, 2014, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1995, 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
buf_page_get_state(bpage) must be
BUF_BLOCK_ZIP_DIRTY or BUF_BLOCK_ZIP_PAGE */
buf_page_t* dpage) /*!< in/out: destination control block */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/*********************************************************************//**
Gets the current size of buffer buf_pool in bytes.
@return size in bytes */
buf_page_t*
buf_page_alloc_descriptor(void)
/*===========================*/
- __attribute__((malloc));
+ MY_ATTRIBUTE((malloc));
/********************************************************************//**
Free a buf_page_t descriptor. */
UNIV_INLINE
buf_page_free_descriptor(
/*=====================*/
buf_page_t* bpage) /*!< in: bpage descriptor to free. */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/********************************************************************//**
Allocates a buffer block.
buf_page_get_freed_page_clock(
/*==========================*/
const buf_page_t* bpage) /*!< in: block */
- __attribute__((pure));
+ MY_ATTRIBUTE((pure));
/********************************************************************//**
Reads the freed_page_clock of a buffer block.
@return freed_page_clock */
buf_block_get_freed_page_clock(
/*===========================*/
const buf_block_t* block) /*!< in: block */
- __attribute__((pure));
+ MY_ATTRIBUTE((pure));
/********************************************************************//**
Tells if a block is still close enough to the MRU end of the LRU list
ulint line, /*!< in: line */
# endif /* UNIV_SYNC_DEBUG */
buf_block_t* block) /*!< in/out: block to bufferfix */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/*******************************************************************//**
Increments the bufferfix count. */
const byte* read_buf, /*!< in: a database page */
ulint zip_size) /*!< in: size of compressed page;
0 for uncompressed pages */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/********************************************************************//**
Checks if a page is all zeroes.
@return TRUE if the page is all zeroes */
buf_block_get_lock_hash_val(
/*========================*/
const buf_block_t* block) /*!< in: block */
- __attribute__((pure));
+ MY_ATTRIBUTE((pure));
#ifdef UNIV_DEBUG
/*********************************************************************//**
Finds a block in the buffer pool that points to a
ulint flags) /*!< in: 0 or
BUF_PAGE_PRINT_NO_CRASH or
BUF_PAGE_PRINT_NO_FULL */
- UNIV_COLD __attribute__((nonnull));
+ UNIV_COLD MY_ATTRIBUTE((nonnull));
/********************************************************************//**
Decompress a block.
@return TRUE if successful */
buf_block_get_state(
/*================*/
const buf_block_t* block) /*!< in: pointer to the control block */
- __attribute__((pure));
+ MY_ATTRIBUTE((pure));
/*********************************************************************//**
Sets the state of a block. */
UNIV_INLINE
buf_page_in_file(
/*=============*/
const buf_page_t* bpage) /*!< in: pointer to control block */
- __attribute__((pure));
+ MY_ATTRIBUTE((pure));
#ifndef UNIV_HOTBACKUP
/*********************************************************************//**
Determines if a block should be on unzip_LRU list.
buf_page_belongs_to_unzip_LRU(
/*==========================*/
const buf_page_t* bpage) /*!< in: pointer to control block */
- __attribute__((pure));
+ MY_ATTRIBUTE((pure));
/*********************************************************************//**
Gets the mutex of a block.
buf_page_get_mutex(
/*===============*/
const buf_page_t* bpage) /*!< in: pointer to control block */
- __attribute__((pure));
+ MY_ATTRIBUTE((pure));
/*********************************************************************//**
Get the flush type of a page.
buf_page_get_flush_type(
/*====================*/
const buf_page_t* bpage) /*!< in: buffer page */
- __attribute__((pure));
+ MY_ATTRIBUTE((pure));
/*********************************************************************//**
Set the flush type of a page. */
UNIV_INLINE
buf_page_get_io_fix(
/*================*/
const buf_page_t* bpage) /*!< in: pointer to the control block */
- __attribute__((pure));
+ MY_ATTRIBUTE((pure));
/*********************************************************************//**
Gets the io_fix state of a block.
@return io_fix state */
buf_block_get_io_fix(
/*================*/
const buf_block_t* block) /*!< in: pointer to the control block */
- __attribute__((pure));
+ MY_ATTRIBUTE((pure));
/*********************************************************************//**
Sets the io_fix state of a block. */
UNIV_INLINE
buf_page_can_relocate(
/*==================*/
const buf_page_t* bpage) /*!< control block being relocated */
- __attribute__((pure));
+ MY_ATTRIBUTE((pure));
/*********************************************************************//**
Determine if a block has been flagged old.
buf_page_is_old(
/*============*/
const buf_page_t* bpage) /*!< in: control block */
- __attribute__((pure));
+ MY_ATTRIBUTE((pure));
/*********************************************************************//**
Flag a block old. */
UNIV_INLINE
buf_page_is_accessed(
/*=================*/
const buf_page_t* bpage) /*!< in: control block */
- __attribute__((nonnull, pure));
+ MY_ATTRIBUTE((nonnull, pure));
/*********************************************************************//**
Flag a block accessed. */
UNIV_INLINE
buf_page_set_accessed(
/*==================*/
buf_page_t* bpage) /*!< in/out: control block */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/*********************************************************************//**
Gets the buf_block_t handle of a buffered file block if an uncompressed
page frame exists, or NULL. Note: even though bpage is not declared a
buf_page_get_block(
/*===============*/
buf_page_t* bpage) /*!< in: control block, or NULL */
- __attribute__((pure));
+ MY_ATTRIBUTE((pure));
#endif /* !UNIV_HOTBACKUP */
#ifdef UNIV_DEBUG
/*********************************************************************//**
buf_block_get_frame(
/*================*/
const buf_block_t* block) /*!< in: pointer to the control block */
- __attribute__((pure));
+ MY_ATTRIBUTE((pure));
#else /* UNIV_DEBUG */
# define buf_block_get_frame(block) (block)->frame
#endif /* UNIV_DEBUG */
buf_page_get_space(
/*===============*/
const buf_page_t* bpage) /*!< in: pointer to the control block */
- __attribute__((pure));
+ MY_ATTRIBUTE((pure));
/*********************************************************************//**
Gets the space id of a block.
@return space id */
buf_block_get_space(
/*================*/
const buf_block_t* block) /*!< in: pointer to the control block */
- __attribute__((pure));
+ MY_ATTRIBUTE((pure));
/*********************************************************************//**
Gets the page number of a block.
@return page number */
buf_page_get_page_no(
/*=================*/
const buf_page_t* bpage) /*!< in: pointer to the control block */
- __attribute__((pure));
+ MY_ATTRIBUTE((pure));
/*********************************************************************//**
Gets the page number of a block.
@return page number */
buf_block_get_page_no(
/*==================*/
const buf_block_t* block) /*!< in: pointer to the control block */
- __attribute__((pure));
+ MY_ATTRIBUTE((pure));
/*********************************************************************//**
Gets the compressed page size of a block.
@return compressed page size, or 0 */
buf_page_get_zip_size(
/*==================*/
const buf_page_t* bpage) /*!< in: pointer to the control block */
- __attribute__((pure));
+ MY_ATTRIBUTE((pure));
/*********************************************************************//**
Gets the compressed page size of a block.
@return compressed page size, or 0 */
buf_block_get_zip_size(
/*===================*/
const buf_block_t* block) /*!< in: pointer to the control block */
- __attribute__((pure));
+ MY_ATTRIBUTE((pure));
/*********************************************************************//**
Gets the compressed page descriptor corresponding to an uncompressed page
if applicable. */
/*==================*/
ulint space, /*!< in: space id */
ulint offset) /*!< in: offset of the page within space */
- __attribute__((const));
+ MY_ATTRIBUTE((const));
/********************************************************************//**
Calculates the index of a buffer pool to the buf_pool[] array.
@return the position of the buffer pool in buf_pool[] */
buf_pool_index(
/*===========*/
const buf_pool_t* buf_pool) /*!< in: buffer pool */
- __attribute__((nonnull, const));
+ MY_ATTRIBUTE((nonnull, const));
/******************************************************************//**
Returns the buffer pool instance given a page instance
@return buf_pool */
/*=======================*/
buf_pool_t* buf_pool, /*!< buffer pool instance */
const buf_page_t* bpage) /*!< in: block */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/****************************************************************//**
Add watch for the given page to be read in. Caller must have the buffer pool
@return NULL if watch set, block if the page is in the buffer pool */
ulint space, /*!< in: space id */
ulint offset, /*!< in: page number */
ulint fold) /*!< in: buf_page_address_fold(space, offset) */
- __attribute__((warn_unused_result));
+ MY_ATTRIBUTE((warn_unused_result));
/****************************************************************//**
Stop watching if the page has been read in.
buf_pool_watch_set(space,offset) must have returned NULL before. */
/*====================*/
ulint space, /*!< in: space id */
ulint offset) /*!< in: page number */
- __attribute__((warn_unused_result));
+ MY_ATTRIBUTE((warn_unused_result));
/********************************************************************//**
Get total buffer pool statistics. */
UNIV_INTERN
/*****************************************************************************
-Copyright (c) 1995, 2013, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1995, 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
/*===============*/
buf_pool_t* buf_pool, /*!< in/out: buffer pool instance */
buf_block_t* block) /*!< in/out: buffer control block */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
# endif /* UNIV_DEBUG || UNIV_IBUF_DEBUG */
/*******************************************************************//**
This utility flushes dirty blocks from the end of the flush list of
buf_page_t* bpage, /*!< in: buffer control block, must be
buf_page_in_file(bpage) */
buf_flush_t flush_type)/*!< in: type of flush */
- __attribute__((warn_unused_result));
+ MY_ATTRIBUTE((warn_unused_result));
#ifdef UNIV_DEBUG
/******************************************************************//**
/*****************************************************************************
-Copyright (c) 1995, 2013, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1995, 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
buf_page_t* bpage, /*!< in: block to be freed */
bool zip) /*!< in: true if should remove also the
compressed page of an uncompressed page */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/******************************************************************//**
Try to free a replaceable block.
@return TRUE if found and freed */
ibool scan_all) /*!< in: scan whole LRU list
if TRUE, otherwise scan only
'old' blocks. */
- __attribute__((nonnull,warn_unused_result));
+ MY_ATTRIBUTE((nonnull,warn_unused_result));
/******************************************************************//**
Returns a free block from the buf_pool. The block is taken off the
free list. If it is empty, returns NULL.
buf_LRU_get_free_block(
/*===================*/
buf_pool_t* buf_pool) /*!< in/out: buffer pool instance */
- __attribute__((nonnull,warn_unused_result));
+ MY_ATTRIBUTE((nonnull,warn_unused_result));
/******************************************************************//**
Determines if the unzip_LRU list should be used for evicting a victim
instead of the general LRU list.
buf_page_t* bpage) /*!< in/out: block, must contain a file page and
be in a state where it can be freed; there
may or may not be a hash index to the page */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
#if defined UNIV_DEBUG || defined UNIV_BUF_DEBUG
/**********************************************************************//**
/*****************************************************************************
-Copyright (c) 1994, 2012, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1994, 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
dfield_get_type(
/*============*/
const dfield_t* field) /*!< in: SQL data field */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/*********************************************************************//**
Gets pointer to the data in a field.
@return pointer to data */
dfield_get_data(
/*============*/
const dfield_t* field) /*!< in: field */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
#else /* UNIV_DEBUG */
# define dfield_get_type(field) (&(field)->type)
# define dfield_get_data(field) ((field)->data)
/*============*/
dfield_t* field, /*!< in: SQL data field */
const dtype_t* type) /*!< in: pointer to data type struct */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/*********************************************************************//**
Gets length of field data.
@return length of data; UNIV_SQL_NULL if SQL null data */
dfield_get_len(
/*===========*/
const dfield_t* field) /*!< in: field */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/*********************************************************************//**
Sets length in a field. */
UNIV_INLINE
/*===========*/
dfield_t* field, /*!< in: field */
ulint len) /*!< in: length or UNIV_SQL_NULL */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/*********************************************************************//**
Determines if a field is SQL NULL
@return nonzero if SQL null data */
dfield_is_null(
/*===========*/
const dfield_t* field) /*!< in: field */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/*********************************************************************//**
Determines if a field is externally stored
@return nonzero if externally stored */
dfield_is_ext(
/*==========*/
const dfield_t* field) /*!< in: field */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/*********************************************************************//**
Sets the "external storage" flag */
UNIV_INLINE
dfield_set_ext(
/*===========*/
dfield_t* field) /*!< in/out: field */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/*********************************************************************//**
Sets pointer to the data and length in a field. */
UNIV_INLINE
dfield_t* field, /*!< in: field */
const void* data, /*!< in: data */
ulint len) /*!< in: length or UNIV_SQL_NULL */
- __attribute__((nonnull(1)));
+ MY_ATTRIBUTE((nonnull(1)));
/*********************************************************************//**
Sets a data field to SQL NULL. */
UNIV_INLINE
dfield_set_null(
/*============*/
dfield_t* field) /*!< in/out: field */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/**********************************************************************//**
Writes an SQL null field full of zeros. */
UNIV_INLINE
/*================*/
byte* data, /*!< in: pointer to a buffer of size len */
ulint len) /*!< in: SQL null size in bytes */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/*********************************************************************//**
Copies the data and len fields. */
UNIV_INLINE
/*=============*/
dfield_t* field1, /*!< out: field to copy to */
const dfield_t* field2) /*!< in: field to copy from */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/*********************************************************************//**
Copies a data field to another. */
UNIV_INLINE
/*========*/
dfield_t* field1, /*!< out: field to copy to */
const dfield_t* field2) /*!< in: field to copy from */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/*********************************************************************//**
Copies the data pointed to by a data field. */
UNIV_INLINE
/*=======*/
dfield_t* field, /*!< in/out: data field */
mem_heap_t* heap) /*!< in: memory heap where allocated */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
#ifndef UNIV_HOTBACKUP
/*********************************************************************//**
Tests if two data fields are equal.
const dfield_t* field2, /*!< in: field */
ulint len) /*!< in: maximum prefix to compare,
or 0 to compare the whole field length */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/*********************************************************************//**
Tests if dfield data length and content is equal to the given.
@return TRUE if equal */
const dfield_t* field, /*!< in: field */
ulint len, /*!< in: data length or UNIV_SQL_NULL */
const byte* data) /*!< in: data */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
#endif /* !UNIV_HOTBACKUP */
/*********************************************************************//**
Gets number of fields in a data tuple.
dtuple_get_n_fields(
/*================*/
const dtuple_t* tuple) /*!< in: tuple */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
#ifdef UNIV_DEBUG
/*********************************************************************//**
Gets nth field of a tuple.
dtuple_get_info_bits(
/*=================*/
const dtuple_t* tuple) /*!< in: tuple */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/*********************************************************************//**
Sets info bits in a data tuple. */
UNIV_INLINE
/*=================*/
dtuple_t* tuple, /*!< in: tuple */
ulint info_bits) /*!< in: info bits */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/*********************************************************************//**
Gets number of fields used in record comparisons.
@return number of fields used in comparisons in rem0cmp.* */
dtuple_get_n_fields_cmp(
/*====================*/
const dtuple_t* tuple) /*!< in: tuple */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/*********************************************************************//**
Gets number of fields used in record comparisons. */
UNIV_INLINE
dtuple_t* tuple, /*!< in: tuple */
ulint n_fields_cmp) /*!< in: number of fields used in
comparisons in rem0cmp.* */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/* Estimate the number of bytes that are going to be allocated when
creating a new dtuple_t object */
void* buf, /*!< in, out: buffer to use */
ulint buf_size, /*!< in: buffer size */
ulint n_fields) /*!< in: number of fields */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/**********************************************************//**
Creates a data tuple to a memory heap. The default value for number
is created, DTUPLE_EST_ALLOC(n_fields)
bytes will be allocated from this heap */
ulint n_fields)/*!< in: number of fields */
- __attribute__((nonnull, malloc));
+ MY_ATTRIBUTE((nonnull, malloc));
/*********************************************************************//**
Sets number of fields used in a tuple. Normally this is set in
/*================*/
dtuple_t* tuple, /*!< in: tuple */
ulint n_fields) /*!< in: number of fields */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/*********************************************************************//**
Copies a data tuple to another. This is a shallow copy; if a deep copy
is desired, dfield_dup() will have to be invoked on each field.
const dtuple_t* tuple, /*!< in: tuple to copy from */
mem_heap_t* heap) /*!< in: memory heap
where the tuple is created */
- __attribute__((nonnull, malloc));
+ MY_ATTRIBUTE((nonnull, malloc));
/**********************************************************//**
The following function returns the sum of data lengths of a tuple. The space
occupied by the field structs or the tuple struct is not counted.
/*=================*/
const dtuple_t* tuple, /*!< in: typed data tuple */
ulint comp) /*!< in: nonzero=ROW_FORMAT=COMPACT */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/*********************************************************************//**
Computes the number of externally stored fields in a data tuple.
@return number of fields */
dtuple_get_n_ext(
/*=============*/
const dtuple_t* tuple) /*!< in: tuple */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/************************************************************//**
Compare two data tuples, respecting the collation of character fields.
@return 1, 0 , -1 if tuple1 is greater, equal, less, respectively,
/*============*/
const dtuple_t* tuple1, /*!< in: tuple 1 */
const dtuple_t* tuple2) /*!< in: tuple 2 */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/************************************************************//**
Folds a prefix given as the number of fields of a tuple.
@return the folded value */
ulint n_bytes,/*!< in: number of bytes to fold in an
incomplete last field */
index_id_t tree_id)/*!< in: index tree id */
- __attribute__((nonnull, pure, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, pure, warn_unused_result));
/*******************************************************************//**
Sets types of fields binary in a tuple. */
UNIV_INLINE
/*====================*/
dtuple_t* tuple, /*!< in: data tuple */
ulint n) /*!< in: number of fields to set */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/**********************************************************************//**
Checks if a dtuple contains an SQL null value.
@return TRUE if some field is SQL null */
dtuple_contains_null(
/*=================*/
const dtuple_t* tuple) /*!< in: dtuple */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/**********************************************************//**
Checks that a data field is typed. Asserts an error if not.
@return TRUE if ok */
dfield_check_typed(
/*===============*/
const dfield_t* field) /*!< in: data field */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/**********************************************************//**
Checks that a data tuple is typed. Asserts an error if not.
@return TRUE if ok */
dtuple_check_typed(
/*===============*/
const dtuple_t* tuple) /*!< in: tuple */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/**********************************************************//**
Checks that a data tuple is typed.
@return TRUE if ok */
dtuple_check_typed_no_assert(
/*=========================*/
const dtuple_t* tuple) /*!< in: tuple */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
#ifdef UNIV_DEBUG
/**********************************************************//**
Validates the consistency of a tuple which must be complete, i.e,
dtuple_validate(
/*============*/
const dtuple_t* tuple) /*!< in: tuple */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
#endif /* UNIV_DEBUG */
/*************************************************************//**
Pretty prints a dfield value according to its data type. */
dfield_print(
/*=========*/
const dfield_t* dfield) /*!< in: dfield */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/*************************************************************//**
Pretty prints a dfield value according to its data type. Also the hex string
is printed if a string contains non-printable characters. */
dfield_print_also_hex(
/*==================*/
const dfield_t* dfield) /*!< in: dfield */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/**********************************************************//**
The following function prints the contents of a tuple. */
UNIV_INTERN
/*=========*/
FILE* f, /*!< in: output stream */
const dtuple_t* tuple) /*!< in: tuple */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/**************************************************************//**
Moves parts of long fields in entry to the big record vector so that
the size of tuple drops below the maximum record size allowed in the
dtuple_t* entry, /*!< in/out: index entry */
ulint* n_ext) /*!< in/out: number of
externally stored columns */
- __attribute__((nonnull, malloc, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, malloc, warn_unused_result));
/**************************************************************//**
Puts back to entry the data stored in vector. Note that to ensure the
fields in entry can accommodate the data, vector must have been created
dtuple_t* entry, /*!< in: entry whose data was put to vector */
big_rec_t* vector) /*!< in, own: big rec vector; it is
freed in this function */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/**************************************************************//**
Frees the memory in a big rec vector. */
UNIV_INLINE
/*================*/
big_rec_t* vector) /*!< in, own: big rec vector; it is
freed in this function */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/*######################################################################*/
/*****************************************************************************
-Copyright (c) 1994, 2012, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1994, 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
dfield_t* field, /*!< in: SQL data field */
const dtype_t* type) /*!< in: pointer to data type struct */
{
- ut_ad(field && type);
+ ut_ad(field != NULL);
+ ut_ad(type != NULL);
field->type = *type;
}
dfield_t* field1, /*!< out: field to copy to */
const dfield_t* field2) /*!< in: field to copy from */
{
- ut_ad(field1 && field2);
+ ut_ad(field1 != NULL);
+ ut_ad(field2 != NULL);
field1->data = field2->data;
field1->len = field2->len;
/*****************************************************************************
-Copyright (c) 1996, 2012, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1996, 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
dberr_t
dict_boot(void)
/*===========*/
- __attribute__((warn_unused_result));
+ MY_ATTRIBUTE((warn_unused_result));
/*****************************************************************//**
Creates and initializes the data dictionary at the server bootstrap.
dberr_t
dict_create(void)
/*=============*/
- __attribute__((warn_unused_result));
+ MY_ATTRIBUTE((warn_unused_result));
/*********************************************************************//**
Check if a table id belongs to system table.
dict_is_sys_table(
/*==============*/
table_id_t id) /*!< in: table id to check */
- __attribute__((warn_unused_result));
+ MY_ATTRIBUTE((warn_unused_result));
/* Space id and page no where the dictionary header resides */
#define DICT_HDR_SPACE 0 /* the SYSTEM tablespace */
/*****************************************************************************
-Copyright (c) 1996, 2014, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1996, 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
incremented if used */
const char* name, /*!< in: table name */
dict_foreign_t* foreign)/*!< in/out: foreign key */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/** Adds the given set of foreign key objects to the dictionary tables
in the database. This function does not modify the dictionary cache. The
const dict_foreign_set& local_fk_set,
const dict_table_t* table,
trx_t* trx)
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/****************************************************************//**
Creates the tablespaces and datafiles system tables inside InnoDB
at server bootstrap or server start if they are not found or are
const char* name, /*!< in: table name */
const dict_foreign_t* foreign,/*!< in: foreign key */
trx_t* trx) /*!< in/out: dictionary transaction */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/* Table create node structure */
struct tab_node_t{
/*****************************************************************************
-Copyright (c) 1996, 2012, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1996, 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
bool
row_is_mysql_tmp_table_name(
/*========================*/
- const char* name) __attribute__((warn_unused_result));
+ const char* name) MY_ATTRIBUTE((warn_unused_result));
/*!< in: table name in the form
'database/tablename' */
/*****************************************************************************
-Copyright (c) 1996, 2015, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1996, 2016, 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_casedn_str(
/*============*/
char* a) /*!< in/out: string to put in lower case */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/********************************************************************//**
Get the database name length in a table name.
@return database name length */
/*=================*/
const char* name) /*!< in: table name in the form
dbname '/' tablename */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/*********************************************************************//**
Open a table from its database and table name, this is currently used by
foreign constraint parser to get the referenced table.
/*================*/
const char* name) /*!< in: table name in the form
dbname '/' tablename */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/** Operation to perform when opening a table */
enum dict_table_op_t {
table_id_t table_id, /*!< in: table id */
ibool dict_locked, /*!< in: TRUE=data dictionary locked */
dict_table_op_t table_op) /*!< in: operation to perform */
- __attribute__((warn_unused_result));
+ MY_ATTRIBUTE((warn_unused_result));
/********************************************************************//**
Decrements the count of open handles to a table. */
UNIV_INTERN
ibool try_drop) /*!< in: TRUE=try to drop any orphan
indexes after an aborted online
index creation */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/**********************************************************************//**
Inits the data dictionary module. */
UNIV_INTERN
dict_col_get_mbminlen(
/*==================*/
const dict_col_t* col) /*!< in: column */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/*********************************************************************//**
Gets the maximum number of bytes per character.
@return maximum multi-byte char size, in bytes */
dict_col_get_mbmaxlen(
/*==================*/
const dict_col_t* col) /*!< in: column */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/*********************************************************************//**
Sets the minimum and maximum number of bytes per character. */
UNIV_INLINE
character size, in bytes */
ulint mbmaxlen) /*!< in: minimum multi-byte
character size, in bytes */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/*********************************************************************//**
Gets the column data type. */
UNIV_INLINE
/*===============*/
const dict_col_t* col, /*!< in: column */
dtype_t* type) /*!< out: data type */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/**********************************************************************//**
Determine bytes of column prefix to be stored in the undo log. Please
note if the table format is UNIV_FORMAT_A (< UNIV_FORMAT_B), no prefix
dict_table_t* table, /*!< in: table */
const dict_col_t* col) /*!< in: column which index prefix
is based on */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
#endif /* !UNIV_HOTBACKUP */
#ifdef UNIV_DEBUG
/*********************************************************************//**
/*=======================*/
const dict_col_t* col, /*!< in: column */
const dtype_t* type) /*!< in: data type */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
#endif /* UNIV_DEBUG */
#ifndef UNIV_HOTBACKUP
/***********************************************************************//**
dict_col_get_min_size(
/*==================*/
const dict_col_t* col) /*!< in: column */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/***********************************************************************//**
Returns the maximum size of the column.
@return maximum size */
dict_col_get_max_size(
/*==================*/
const dict_col_t* col) /*!< in: column */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/***********************************************************************//**
Returns the size of a fixed size column, 0 if not a fixed size column.
@return fixed size, or 0 */
/*====================*/
const dict_col_t* col, /*!< in: column */
ulint comp) /*!< in: nonzero=ROW_FORMAT=COMPACT */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/***********************************************************************//**
Returns the ROW_FORMAT=REDUNDANT stored SQL NULL size of a column.
For fixed length types it is the fixed length of the type, otherwise 0.
/*=======================*/
const dict_col_t* col, /*!< in: column */
ulint comp) /*!< in: nonzero=ROW_FORMAT=COMPACT */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/*********************************************************************//**
Gets the column number.
@return col->ind, table column position (starting from 0) */
dict_col_get_no(
/*============*/
const dict_col_t* col) /*!< in: column */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/*********************************************************************//**
Gets the column position in the clustered index. */
UNIV_INLINE
/*===================*/
const dict_col_t* col, /*!< in: table column */
const dict_index_t* clust_index) /*!< in: clustered index */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/****************************************************************//**
If the given column name is reserved for InnoDB system columns, return
TRUE.
dict_col_name_is_reserved(
/*======================*/
const char* name) /*!< in: column name */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/********************************************************************//**
Acquire the autoinc lock. */
UNIV_INTERN
dict_table_autoinc_lock(
/*====================*/
dict_table_t* table) /*!< in/out: table */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/********************************************************************//**
Unconditionally set the autoinc counter. */
UNIV_INTERN
/*==========================*/
dict_table_t* table, /*!< in/out: table */
ib_uint64_t value) /*!< in: next value to assign to a row */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/** Store autoinc value when the table is evicted.
@param[in] table table evicted */
dict_table_autoinc_read(
/*====================*/
const dict_table_t* table) /*!< in: table */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/********************************************************************//**
Updates the autoinc counter if the value supplied is greater than the
current value. */
dict_table_t* table, /*!< in/out: table */
ib_uint64_t value) /*!< in: value which was assigned to a row */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/********************************************************************//**
Release the autoinc lock. */
UNIV_INTERN
dict_table_autoinc_unlock(
/*======================*/
dict_table_t* table) /*!< in/out: table */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
#endif /* !UNIV_HOTBACKUP */
/**********************************************************************//**
Adds system columns to a table object. */
/*==========================*/
dict_table_t* table, /*!< in/out: table */
mem_heap_t* heap) /*!< in: temporary heap */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
#ifndef UNIV_HOTBACKUP
/**********************************************************************//**
Adds a table object to the dictionary cache. */
dict_table_t* table, /*!< in: table */
ibool can_be_evicted, /*!< in: TRUE if can be evicted*/
mem_heap_t* heap) /*!< in: temporary heap */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/**********************************************************************//**
Removes a table object from the dictionary cache. */
UNIV_INTERN
dict_table_remove_from_cache(
/*=========================*/
dict_table_t* table) /*!< in, own: table */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/**********************************************************************//**
Removes a table object from the dictionary cache. */
UNIV_INTERN
/*!< in: in ALTER TABLE we want
to preserve the original table name
in constraints which reference it */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/**********************************************************************//**
Removes an index from the dictionary cache. */
UNIV_INTERN
/*=========================*/
dict_table_t* table, /*!< in/out: table */
dict_index_t* index) /*!< in, own: index */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/**********************************************************************//**
Change the id of a table object in the dictionary cache. This is used in
DISCARD TABLESPACE. */
/*==========================*/
dict_table_t* table, /*!< in/out: table object already in cache */
table_id_t new_id) /*!< in: new id to set */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/**********************************************************************//**
Removes a foreign constraint struct from the dictionary cache. */
UNIV_INTERN
dict_foreign_remove_from_cache(
/*===========================*/
dict_foreign_t* foreign) /*!< in, own: foreign constraint */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/**********************************************************************//**
Adds a foreign key constraint object to the dictionary cache. May free
the object if there already is an object with the same identifier in.
compatibility */
dict_err_ignore_t ignore_err)
/*!< in: error to be ignored */
- __attribute__((nonnull(1), warn_unused_result));
+ MY_ATTRIBUTE((nonnull(1), warn_unused_result));
/*********************************************************************//**
Checks if a table is referenced by foreign keys.
@return TRUE if table is referenced by a foreign key */
dict_table_is_referenced_by_foreign_key(
/*====================================*/
const dict_table_t* table) /*!< in: InnoDB table */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/**********************************************************************//**
Replace the index passed in with another equivalent index in the
foreign key lists of the table.
/*!< in: column names, or NULL
to use table->col_names */
const dict_index_t* index) /*!< in: index to be replaced */
- __attribute__((nonnull(1,3), warn_unused_result));
+ MY_ATTRIBUTE((nonnull(1,3), warn_unused_result));
/**********************************************************************//**
Determines whether a string starts with the specified keyword.
@return TRUE if str starts with keyword */
THD* thd, /*!< in: MySQL thread handle */
const char* str, /*!< in: string to scan for keyword */
const char* keyword) /*!< in: keyword to look for */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/*********************************************************************//**
Scans a table create SQL string and adds to the data dictionary
the foreign key constraints declared in the string. This function
ibool reject_fks) /*!< in: if TRUE, fail with error
code DB_CANNOT_ADD_CONSTRAINT if
any foreign keys are found. */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/**********************************************************************//**
Parses the CONSTRAINT id's to be dropped in an ALTER TABLE statement.
@return DB_SUCCESS or DB_CANNOT_DROP_CONSTRAINT if syntax error or the
to drop */
const char*** constraints_to_drop) /*!< out: id's of the
constraints to drop */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/**********************************************************************//**
Returns a table object and increments its open handle count.
NOTE! This is a high-level function to be used mainly from outside the
dict_err_ignore_t
ignore_err) /*!< in: error to be ignored when
loading the table */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/*********************************************************************//**
Tries to find an index whose first fields are the columns in the array,
/*!< in: nonzero if none of
the columns must be declared
NOT NULL */
- __attribute__((nonnull(1,3), warn_unused_result));
+ MY_ATTRIBUTE((nonnull(1,3), warn_unused_result));
/**********************************************************************//**
Returns a column's name.
@return column name. NOTE: not guaranteed to stay valid if table is
/*====================*/
const dict_table_t* table, /*!< in: table */
ulint col_nr) /*!< in: column number */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/**********************************************************************//**
Prints a table data. */
UNIV_INTERN
dict_table_print(
/*=============*/
dict_table_t* table) /*!< in: table */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/**********************************************************************//**
Outputs info on foreign keys of a table. */
UNIV_INTERN
FILE* file, /*!< in: file where to print */
trx_t* trx, /*!< in: transaction */
dict_table_t* table) /*!< in: table */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/**********************************************************************//**
Outputs info on a foreign key of a table in a format suitable for
CREATE TABLE. */
trx_t* trx, /*!< in: transaction */
dict_foreign_t* foreign, /*!< in: foreign key constraint */
ibool add_newline) /*!< in: whether to add a newline */
- __attribute__((nonnull(1,3)));
+ MY_ATTRIBUTE((nonnull(1,3)));
/********************************************************************//**
Displays the names of the index and the table. */
UNIV_INTERN
FILE* file, /*!< in: output stream */
const trx_t* trx, /*!< in: transaction */
const dict_index_t* index) /*!< in: index to print */
- __attribute__((nonnull(1,3)));
+ MY_ATTRIBUTE((nonnull(1,3)));
/*********************************************************************//**
Tries to find an index whose first fields are the columns in the array,
in the same order and is not marked for deletion and is not the same
/*!< in: nonzero if none of
the columns must be declared
NOT NULL */
- __attribute__((nonnull(1,3), warn_unused_result));
+ MY_ATTRIBUTE((nonnull(1,3), warn_unused_result));
#ifdef UNIV_DEBUG
/********************************************************************//**
Gets the first index on the table (the clustered index).
dict_table_get_first_index(
/*=======================*/
const dict_table_t* table) /*!< in: table */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/********************************************************************//**
Gets the last index on the table.
@return index, NULL if none exists */
dict_table_get_last_index(
/*=======================*/
const dict_table_t* table) /*!< in: table */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/********************************************************************//**
Gets the next index on the table.
@return index, NULL if none left */
dict_table_get_next_index(
/*======================*/
const dict_index_t* index) /*!< in: index */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
#else /* UNIV_DEBUG */
# define dict_table_get_first_index(table) UT_LIST_GET_FIRST((table)->indexes)
# define dict_table_get_last_index(table) UT_LIST_GET_LAST((table)->indexes)
dict_index_is_clust(
/*================*/
const dict_index_t* index) /*!< in: index */
- __attribute__((nonnull, pure, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, pure, warn_unused_result));
/********************************************************************//**
Check whether the index is unique.
@return nonzero for unique index, zero for other indexes */
dict_index_is_unique(
/*=================*/
const dict_index_t* index) /*!< in: index */
- __attribute__((nonnull, pure, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, pure, warn_unused_result));
/********************************************************************//**
Check whether the index is the insert buffer tree.
@return nonzero for insert buffer, zero for other indexes */
dict_index_is_ibuf(
/*===============*/
const dict_index_t* index) /*!< in: index */
- __attribute__((nonnull, pure, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, pure, warn_unused_result));
/********************************************************************//**
Check whether the index is a secondary index or the insert buffer tree.
@return nonzero for insert buffer, zero for other indexes */
dict_index_is_sec_or_ibuf(
/*======================*/
const dict_index_t* index) /*!< in: index */
- __attribute__((nonnull, pure, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, pure, warn_unused_result));
/************************************************************************
Gets the all the FTS indexes for the table. NOTE: must not be called for
/* out: number of indexes collected */
dict_table_t* table, /* in: table */
ib_vector_t* indexes)/* out: vector for collecting FTS indexes */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/********************************************************************//**
Gets the number of user-defined columns in a table in the dictionary
cache.
dict_table_get_n_user_cols(
/*=======================*/
const dict_table_t* table) /*!< in: table */
- __attribute__((nonnull, pure, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, pure, warn_unused_result));
/********************************************************************//**
Gets the number of system columns in a table in the dictionary cache.
@return number of system (e.g., ROW_ID) columns of a table */
dict_table_get_n_sys_cols(
/*======================*/
const dict_table_t* table) /*!< in: table */
- __attribute__((nonnull, pure, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, pure, warn_unused_result));
/********************************************************************//**
Gets the number of all columns (also system) in a table in the dictionary
cache.
dict_table_get_n_cols(
/*==================*/
const dict_table_t* table) /*!< in: table */
- __attribute__((nonnull, pure, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, pure, warn_unused_result));
/********************************************************************//**
Gets the approximately estimated number of rows in the table.
@return estimated number of rows */
dict_table_get_n_rows(
/*==================*/
const dict_table_t* table) /*!< in: table */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/********************************************************************//**
Increment the number of rows in the table by one.
Notice that this operation is not protected by any latch, the number is
dict_table_n_rows_inc(
/*==================*/
dict_table_t* table) /*!< in/out: table */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/********************************************************************//**
Decrement the number of rows in the table by one.
Notice that this operation is not protected by any latch, the number is
dict_table_n_rows_dec(
/*==================*/
dict_table_t* table) /*!< in/out: table */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
#ifdef UNIV_DEBUG
/********************************************************************//**
Gets the nth column of a table.
/*===================*/
const dict_table_t* table, /*!< in: table */
ulint pos) /*!< in: position of column */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/********************************************************************//**
Gets the given system column of a table.
@return pointer to column object */
/*===================*/
const dict_table_t* table, /*!< in: table */
ulint sys) /*!< in: DATA_ROW_ID, ... */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
#else /* UNIV_DEBUG */
#define dict_table_get_nth_col(table, pos) \
((table)->cols + (pos))
/*======================*/
const dict_table_t* table, /*!< in: table */
ulint sys) /*!< in: DATA_ROW_ID, ... */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
#ifndef UNIV_HOTBACKUP
/********************************************************************//**
Returns the minimum data size of an index record.
dict_index_get_min_size(
/*====================*/
const dict_index_t* index) /*!< in: index */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
#endif /* !UNIV_HOTBACKUP */
/********************************************************************//**
Check whether the table uses the compact page format.
dict_table_is_comp(
/*===============*/
const dict_table_t* table) /*!< in: table */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/********************************************************************//**
Determine the file format of a table.
@return file format version */
dict_table_get_format(
/*==================*/
const dict_table_t* table) /*!< in: table */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/********************************************************************//**
Determine the file format from a dict_table_t::flags.
@return file format version */
dict_tf_get_format(
/*===============*/
ulint flags) /*!< in: dict_table_t::flags */
- __attribute__((warn_unused_result));
+ MY_ATTRIBUTE((warn_unused_result));
/********************************************************************//**
Set the various values in a dict_table_t::flags pointer. */
UNIV_INLINE
rec_format_t format, /*!< in: file format */
ulint zip_ssize, /*!< in: zip shift size */
bool remote_path) /*!< in: table uses DATA DIRECTORY */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/********************************************************************//**
Convert a 32 bit integer table flags to the 32 bit integer that is
written into the tablespace header at the offset FSP_SPACE_FLAGS and is
dict_tf_to_fsp_flags(
/*=================*/
ulint flags) /*!< in: dict_table_t::flags */
- __attribute__((const));
+ MY_ATTRIBUTE((const));
/********************************************************************//**
Extract the compressed page size from table flags.
@return compressed page size, or 0 if not compressed */
dict_tf_get_zip_size(
/*=================*/
ulint flags) /*!< in: flags */
- __attribute__((const));
+ MY_ATTRIBUTE((const));
/********************************************************************//**
Check whether the table uses the compressed compact page format.
@return compressed page size, or 0 if not compressed */
dict_table_zip_size(
/*================*/
const dict_table_t* table) /*!< in: table */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
#ifndef UNIV_HOTBACKUP
/*********************************************************************//**
Obtain exclusive locks on all index trees of the table. This is to prevent
dict_table_x_lock_indexes(
/*======================*/
dict_table_t* table) /*!< in: table */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/*********************************************************************//**
Release the exclusive locks on all index tree. */
UNIV_INLINE
dict_table_x_unlock_indexes(
/*========================*/
dict_table_t* table) /*!< in: table */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/********************************************************************//**
Checks if a column is in the ordering columns of the clustered index of a
table. Column prefixes are treated like whole columns.
/*============================*/
const dict_table_t* table, /*!< in: table */
ulint n) /*!< in: column number */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/*******************************************************************//**
Check if the table has an FTS index.
@return TRUE if table has an FTS index */
dict_table_has_fts_index(
/*=====================*/
dict_table_t* table) /*!< in: table */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/*******************************************************************//**
Copies types of columns contained in table to tuple and sets all
fields of the tuple to the SQL NULL value. This function should
/*==================*/
dtuple_t* tuple, /*!< in/out: data tuple */
const dict_table_t* table) /*!< in: table */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/********************************************************************
Wait until all the background threads of the given table have exited, i.e.,
bg_threads == 0. Note: bg_threads_mutex must be reserved when
dict_table_t* table, /* in: table */
ulint delay) /* in: time in microseconds to wait between
checks of bg_threads. */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/**********************************************************************//**
Looks for an index with the given id. NOTE that we do not reserve
the dictionary mutex: this function is for emergency purposes like
dict_index_find_on_id_low(
/*======================*/
index_id_t id) /*!< in: index id */
- __attribute__((warn_unused_result));
+ MY_ATTRIBUTE((warn_unused_result));
/**********************************************************************//**
Make room in the table cache by evicting an unused table. The unused table
should not be part of FK relationship and currently not used in any user
ibool strict) /*!< in: TRUE=refuse to create the index
if records could be too big to fit in
an B-tree page */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/**********************************************************************//**
Removes an index from the dictionary cache. */
UNIV_INTERN
/*=========================*/
dict_table_t* table, /*!< in/out: table */
dict_index_t* index) /*!< in, own: index */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
#endif /* !UNIV_HOTBACKUP */
/********************************************************************//**
Gets the number of fields in the internal representation of an index,
const dict_index_t* index) /*!< in: an internal
representation of index (in
the dictionary cache) */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/********************************************************************//**
Gets the number of fields in the internal representation of an index
that uniquely determine the position of an index entry in the index, if
/*====================*/
const dict_index_t* index) /*!< in: an internal representation
of index (in the dictionary cache) */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/********************************************************************//**
Gets the number of fields in the internal representation of an index
which uniquely determine the position of an index entry in the index, if
/*============================*/
const dict_index_t* index) /*!< in: an internal representation
of index (in the dictionary cache) */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/********************************************************************//**
Gets the number of user-defined ordering fields in the index. In the internal
representation we add the row id to the ordering fields to make all indexes
/*======================================*/
const dict_index_t* index) /*!< in: an internal representation
of index (in the dictionary cache) */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
#ifdef UNIV_DEBUG
/********************************************************************//**
Gets the nth field of an index.
/*=====================*/
const dict_index_t* index, /*!< in: index */
ulint pos) /*!< in: position of field */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
#else /* UNIV_DEBUG */
# define dict_index_get_nth_field(index, pos) ((index)->fields + (pos))
#endif /* UNIV_DEBUG */
/*===================*/
const dict_index_t* index, /*!< in: index */
ulint pos) /*!< in: position of the field */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/********************************************************************//**
Gets the column number of the nth field in an index.
@return column number */
/*======================*/
const dict_index_t* index, /*!< in: index */
ulint pos) /*!< in: position of the field */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/********************************************************************//**
Looks for column n in an index.
@return position in internal representation of the index;
/*=======================*/
const dict_index_t* index, /*!< in: index */
ulint n) /*!< in: column number */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/********************************************************************//**
Looks for column n in an index.
@return position in internal representation of the index;
ulint n, /*!< in: column number */
ibool inc_prefix) /*!< in: TRUE=consider
column prefixes too */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/********************************************************************//**
Returns TRUE if the index contains a column or a prefix of that column.
@return TRUE if contains the column or its prefix */
/*==============================*/
const dict_index_t* index, /*!< in: index */
ulint n) /*!< in: column number */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/********************************************************************//**
Looks for a matching field in an index. The column has to be the same. The
column in index must be complete, or must contain a prefix longer than the
const dict_index_t* index, /*!< in: index from which to search */
const dict_index_t* index2, /*!< in: index */
ulint n) /*!< in: field number in index2 */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/********************************************************************//**
Looks for column n position in the clustered index.
@return position in internal representation of the clustered index */
/*=======================*/
const dict_table_t* table, /*!< in: table */
ulint n) /*!< in: column number */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/********************************************************************//**
Returns the position of a system column in an index.
@return position, ULINT_UNDEFINED if not contained */
/*=======================*/
const dict_index_t* index, /*!< in: index */
ulint type) /*!< in: DATA_ROW_ID, ... */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/*******************************************************************//**
Adds a column to index. */
UNIV_INTERN
const dict_table_t* table, /*!< in: table */
dict_col_t* col, /*!< in: column */
ulint prefix_len) /*!< in: column prefix length */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
#ifndef UNIV_HOTBACKUP
/*******************************************************************//**
Copies types of fields contained in index to tuple. */
const dict_index_t* index, /*!< in: index */
ulint n_fields) /*!< in: number of
field types to copy */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
#endif /* !UNIV_HOTBACKUP */
/*********************************************************************//**
Gets the field column.
dict_field_get_col(
/*===============*/
const dict_field_t* field) /*!< in: index field */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
#ifndef UNIV_HOTBACKUP
/**********************************************************************//**
Returns an index object if it is found in the dictionary cache.
dict_index_get_if_in_cache_low(
/*===========================*/
index_id_t index_id) /*!< in: index id */
- __attribute__((warn_unused_result));
+ MY_ATTRIBUTE((warn_unused_result));
#if defined UNIV_DEBUG || defined UNIV_BUF_DEBUG
/**********************************************************************//**
Returns an index object if it is found in the dictionary cache.
dict_index_get_if_in_cache(
/*=======================*/
index_id_t index_id) /*!< in: index id */
- __attribute__((warn_unused_result));
+ MY_ATTRIBUTE((warn_unused_result));
#endif /* UNIV_DEBUG || UNIV_BUF_DEBUG */
#ifdef UNIV_DEBUG
/**********************************************************************//**
/*==========================*/
const dict_index_t* index, /*!< in: index tree */
const dtuple_t* tuple) /*!< in: tuple used in a search */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/** Whether and when to allow temporary index names */
enum check_name {
/** Require all indexes to be complete. */
in this table */
enum check_name check) /*!< in: whether and when to allow
temporary index names */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
#endif /* UNIV_DEBUG */
/**********************************************************************//**
Builds a node pointer out of a physical record and a page number.
created */
ulint level) /*!< in: level of rec in tree:
0 means leaf level */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/**********************************************************************//**
Copies an initial segment of a physical record, long enough to specify an
index entry uniquely.
byte** buf, /*!< in/out: memory buffer for the
copied prefix, or NULL */
ulint* buf_size)/*!< in/out: buffer size */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/**********************************************************************//**
Builds a typed data tuple out of a physical record.
@return own: data tuple */
rec_t* rec, /*!< in: record for which to build data tuple */
ulint n_fields,/*!< in: number of data fields */
mem_heap_t* heap) /*!< in: memory heap where tuple created */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/*********************************************************************//**
Gets the space id of the root of the index tree.
@return space id */
dict_index_get_space(
/*=================*/
const dict_index_t* index) /*!< in: index */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/*********************************************************************//**
Sets the space id of the root of the index tree. */
UNIV_INLINE
/*=================*/
dict_index_t* index, /*!< in/out: index */
ulint space) /*!< in: space id */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/*********************************************************************//**
Gets the page number of the root of the index tree.
@return page number */
dict_index_get_page(
/*================*/
const dict_index_t* tree) /*!< in: index */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/*********************************************************************//**
Gets the read-write lock of the index tree.
@return read-write lock */
dict_index_get_lock(
/*================*/
dict_index_t* index) /*!< in: index */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/********************************************************************//**
Returns free space reserved for future updates of records. This is
relevant only in the case of many consecutive inserts, as updates
dict_index_get_online_status(
/*=========================*/
const dict_index_t* index) /*!< in: secondary index */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/********************************************************************//**
Sets the status of online index creation. */
UNIV_INLINE
/*=========================*/
dict_index_t* index, /*!< in/out: index */
enum online_index_status status) /*!< in: status */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/********************************************************************//**
Determines if a secondary index is being or has been created online,
or if the table is being rebuilt online, allowing concurrent modifications
dict_index_is_online_ddl(
/*=====================*/
const dict_index_t* index) /*!< in: index */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/*********************************************************************//**
Calculates the minimum record length in an index. */
UNIV_INTERN
dict_index_calc_min_rec_len(
/*========================*/
const dict_index_t* index) /*!< in: index */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/********************************************************************//**
Reserves the dictionary system mutex for MySQL. */
UNIV_INTERN
dbname '/' tablename */
const char* name2) /*!< in: table name in the form
dbname '/' tablename */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/*********************************************************************//**
Removes an index from the cache */
UNIV_INTERN
/*=========================*/
dict_table_t* table, /*!< in/out: table */
dict_index_t* index) /*!< in, own: index */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/**********************************************************************//**
Get index by name
@return index, NULL if does not exist */
/*=========================*/
dict_table_t* table, /*!< in: table */
const char* name) /*!< in: name of the index to find */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/**********************************************************************//**
In case there is more than one index with the same name return the index
with the min(id).
/*====================================*/
dict_table_t* table, /*!< in: table */
const char* name) /*!< in: name of the index to find */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/***************************************************************
Check whether a column exists in an FTS index. */
UNIV_INLINE
the offset within the vector */
ib_vector_t* indexes,/* in: vector containing only FTS indexes */
ulint col_no) /* in: col number to search for */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/**********************************************************************//**
Move a table to the non LRU end of the LRU list. */
UNIV_INTERN
dict_table_move_from_lru_to_non_lru(
/*================================*/
dict_table_t* table) /*!< in: table to move from LRU to non-LRU */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/**********************************************************************//**
Move a table to the LRU list from the non-LRU list. */
UNIV_INTERN
dict_table_move_from_non_lru_to_lru(
/*================================*/
dict_table_t* table) /*!< in: table to move from non-LRU to LRU */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/**********************************************************************//**
Move to the most recently used segment of the LRU list. */
UNIV_INTERN
dict_move_to_mru(
/*=============*/
dict_table_t* table) /*!< in: table to move to MRU */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/** Maximum number of columns in a foreign key constraint. Please Note MySQL
has a much lower limit on the number of columns allowed in a foreign key
!= DB_TABLE_NOT_FOUND is
returned */
size_t errstr_sz) /*!< in: errstr size */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/* @} */
/*********************************************************************//**
size_t db_utf8_size, /*!< in: dbname_utf8 size */
char* table_utf8, /*!< out: table name, e.g. aюbØc */
size_t table_utf8_size)/*!< in: table_utf8 size */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/**********************************************************************//**
Closes the data dictionary module. */
dict_table_is_corrupted(
/*====================*/
const dict_table_t* table) /*!< in: table */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/**********************************************************************//**
Check whether the index is corrupted.
dict_index_is_corrupted(
/*====================*/
const dict_index_t* index) /*!< in: index */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
#endif /* !UNIV_HOTBACKUP */
/**********************************************************************//**
dict_index_t* index, /*!< in/out: index */
trx_t* trx, /*!< in/out: transaction */
const char* ctx) /*!< in: context */
- UNIV_COLD __attribute__((nonnull));
+ UNIV_COLD MY_ATTRIBUTE((nonnull));
/**********************************************************************//**
Flags an index corrupted in the data dictionary cache only. This
/*================================*/
dict_index_t* index, /*!< in/out: index */
dict_table_t* table) /*!< in/out: table */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/**********************************************************************//**
Flags a table with specified space_id corrupted in the table dictionary
dict_tf_is_valid(
/*=============*/
ulint flags) /*!< in: table flags */
- __attribute__((warn_unused_result));
+ MY_ATTRIBUTE((warn_unused_result));
/********************************************************************//**
Check if the tablespace for the table has been discarded.
dict_table_is_discarded(
/*====================*/
const dict_table_t* table) /*!< in: table to check */
- __attribute__((nonnull, pure, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, pure, warn_unused_result));
/********************************************************************//**
Check if it is a temporary table.
dict_table_is_temporary(
/*====================*/
const dict_table_t* table) /*!< in: table to check */
- __attribute__((nonnull, pure, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, pure, warn_unused_result));
#ifndef UNIV_HOTBACKUP
/*********************************************************************//**
dict_index_zip_success(
/*===================*/
dict_index_t* index) /*!< in/out: index to be updated. */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/*********************************************************************//**
This function should be called whenever a page compression attempt
fails. Updates the compression padding information. */
dict_index_zip_failure(
/*===================*/
dict_index_t* index) /*!< in/out: index to be updated. */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/*********************************************************************//**
Return the optimal page size, for which page will likely compress.
@return page size beyond which page may not compress*/
/*=================================*/
dict_index_t* index) /*!< in: index for which page size
is requested */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/*************************************************************//**
Convert table flag to row format string.
@return row format name */
/*****************************************************************************
-Copyright (c) 1996, 2015, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1996, 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
const dict_col_t* col, /*!< in: column */
dtype_t* type) /*!< out: data type */
{
- ut_ad(col && type);
+ ut_ad(col != NULL);
+ ut_ad(type != NULL);
type->mtype = col->mtype;
type->prtype = col->prtype;
ulint
dict_table_get_n_sys_cols(
/*======================*/
- const dict_table_t* table __attribute__((unused))) /*!< in: table */
+ const dict_table_t* table MY_ATTRIBUTE((unused))) /*!< in: table */
{
ut_ad(table);
ut_ad(table->magic_n == DICT_TABLE_MAGIC_N);
/*****************************************************************************
-Copyright (c) 1996, 2013, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1996, 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
bool check_charsets, /*!< in: whether to check
charset compatibility */
dict_err_ignore_t ignore_err) /*!< in: error to be ignored */
- __attribute__((nonnull(1), warn_unused_result));
+ MY_ATTRIBUTE((nonnull(1), warn_unused_result));
/********************************************************************//**
Prints to the standard output information on all tables found in the data
dictionary system table. */
/*****************************************************************************
-Copyright (c) 1996, 2015, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1996, 2016, 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
/** Bit mask of the COMPACT field */
#define DICT_TF_MASK_COMPACT \
- ((~(~0 << DICT_TF_WIDTH_COMPACT)) \
+ ((~(~0U << DICT_TF_WIDTH_COMPACT)) \
<< DICT_TF_POS_COMPACT)
/** Bit mask of the ZIP_SSIZE field */
#define DICT_TF_MASK_ZIP_SSIZE \
- ((~(~0 << DICT_TF_WIDTH_ZIP_SSIZE)) \
+ ((~(~0U << DICT_TF_WIDTH_ZIP_SSIZE)) \
<< DICT_TF_POS_ZIP_SSIZE)
/** Bit mask of the ATOMIC_BLOBS field */
#define DICT_TF_MASK_ATOMIC_BLOBS \
- ((~(~0 << DICT_TF_WIDTH_ATOMIC_BLOBS)) \
+ ((~(~0U << DICT_TF_WIDTH_ATOMIC_BLOBS)) \
<< DICT_TF_POS_ATOMIC_BLOBS)
/** Bit mask of the DATA_DIR field */
#define DICT_TF_MASK_DATA_DIR \
- ((~(~0 << DICT_TF_WIDTH_DATA_DIR)) \
+ ((~(~0U << DICT_TF_WIDTH_DATA_DIR)) \
<< DICT_TF_POS_DATA_DIR)
/** Return the value of the COMPACT field */
/* @{ */
/** Total number of bits in table->flags2. */
#define DICT_TF2_BITS 7
-#define DICT_TF2_BIT_MASK ~(~0 << DICT_TF2_BITS)
+#define DICT_TF2_BIT_MASK ~(~0U << DICT_TF2_BITS)
/** TEMPORARY; TRUE for tables from CREATE TEMPORARY TABLE. */
#define DICT_TF2_TEMPORARY 1
ulint mtype, /*!< in: main datatype */
ulint prtype, /*!< in: precise type */
ulint len) /*!< in: precision */
- __attribute__((nonnull(1)));
+ MY_ATTRIBUTE((nonnull(1)));
/**********************************************************************//**
Renames a column of a table in the data dictionary cache. */
UNIV_INTERN
unsigned nth_col,/*!< in: column index */
const char* from, /*!< in: old column name */
const char* to) /*!< in: new column name */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/**********************************************************************//**
This function populates a dict_col_t memory structure with
supplied information. */
/*****************************************************************************
-Copyright (c) 2009, 2012, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 2009, 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
dict_table_t* table, /*!< in/out: table */
ibool ps_on, /*!< in: persistent stats explicitly enabled */
ibool ps_off) /*!< in: persistent stats explicitly disabled */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/*********************************************************************//**
Check whether persistent statistics is enabled for a given table.
dict_stats_is_persistent_enabled(
/*=============================*/
const dict_table_t* table) /*!< in: table */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/*********************************************************************//**
Set the auto recalc flag for a given table (only honored for a persistent
dict_stats_deinit(
/*==============*/
dict_table_t* table) /*!< in/out: table */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/*********************************************************************//**
Calculates new estimates for table and index statistics. The statistics
dict_stats_update_for_index(
/*========================*/
dict_index_t* index) /*!< in/out: index */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/*********************************************************************//**
Renames a table in InnoDB persistent stats storage.
/*****************************************************************************
-Copyright (c) 2012, 2013, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 2012, 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
dict_stats_stop_bg(
/*===============*/
dict_table_t* table) /*!< in/out: table */
- __attribute__((warn_unused_result));
+ MY_ATTRIBUTE((warn_unused_result));
/*****************************************************************//**
Wait until background stats thread has stopped using the specified table.
/*****************************************************************************
-Copyright (c) 1996, 2013, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1996, 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
/*=============*/
dyn_array_t* arr) /*!< in/out memory buffer of
size sizeof(dyn_array_t) */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/************************************************************//**
Frees a dynamic array. */
UNIV_INLINE
dyn_array_free(
/*===========*/
dyn_array_t* arr) /*!< in,own: dyn array */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/*********************************************************************//**
Makes room on top of a dyn array and returns a pointer to a buffer in it.
After copying the elements, the caller must close the buffer using
dyn_array_t* arr, /*!< in: dynamic array */
ulint size) /*!< in: size in bytes of the buffer; MUST be
smaller than DYN_ARRAY_DATA_SIZE! */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/*********************************************************************//**
Closes the buffer returned by dyn_array_open. */
UNIV_INLINE
/*============*/
dyn_array_t* arr, /*!< in: dynamic array */
const byte* ptr) /*!< in: end of used space */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/*********************************************************************//**
Makes room on top of a dyn array and returns a pointer to
the added element. The caller must copy the element to
/*===========*/
dyn_array_t* arr, /*!< in/out: dynamic array */
ulint size) /*!< in: size in bytes of the element */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/************************************************************//**
Returns pointer to an element in dyn array.
@return pointer to element */
const dyn_array_t* arr, /*!< in: dyn array */
ulint pos) /*!< in: position of element
in bytes from array start */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/************************************************************//**
Returns the size of stored data in a dyn array.
@return data size in bytes */
dyn_array_get_data_size(
/*====================*/
const dyn_array_t* arr) /*!< in: dyn array */
- __attribute__((nonnull, warn_unused_result, pure));
+ MY_ATTRIBUTE((nonnull, warn_unused_result, pure));
/************************************************************//**
Gets the first block in a dyn array.
@param arr dyn array
dyn_block_get_used(
/*===============*/
const dyn_block_t* block) /*!< in: dyn array block */
- __attribute__((nonnull, warn_unused_result, pure));
+ MY_ATTRIBUTE((nonnull, warn_unused_result, pure));
/********************************************************************//**
Gets pointer to the start of data in a dyn array block.
@return pointer to data */
dyn_block_get_data(
/*===============*/
const dyn_block_t* block) /*!< in: dyn array block */
- __attribute__((nonnull, warn_unused_result, pure));
+ MY_ATTRIBUTE((nonnull, warn_unused_result, pure));
/********************************************************//**
Pushes n bytes to a dyn array. */
UNIV_INLINE
dyn_array_t* arr, /*!< in/out: dyn array */
const byte* str, /*!< in: string to write */
ulint len) /*!< in: string length */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/*#################################################################*/
/*****************************************************************************
-Copyright (c) 1996, 2013, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1996, 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
dyn_array_add_block(
/*================*/
dyn_array_t* arr) /*!< in/out: dyn array */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/********************************************************************//**
Gets the number of used bytes in a dyn array block.
/*****************************************************************************
-Copyright (c) 1995, 2015, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1995, 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
ulint id, /*!< in: space id where to append */
ibool is_raw) /*!< in: TRUE if a raw device or
a raw disk partition */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
#ifdef UNIV_LOG_ARCHIVE
/****************************************************************//**
Drops files from the start of a file space, so that its size is cut by
lsn values in data files */
lsn_t* max_flushed_lsn) /*!< out: max of flushed
lsn values in data files */
- __attribute__((warn_unused_result));
+ MY_ATTRIBUTE((warn_unused_result));
/*******************************************************************//**
Increments the count of pending operation, if space is not being deleted.
@return TRUE if being deleted, and operation should be skipped */
fil_discard_tablespace(
/*===================*/
ulint id) /*!< in: space id */
- __attribute__((warn_unused_result));
+ MY_ATTRIBUTE((warn_unused_result));
#endif /* !UNIV_HOTBACKUP */
/** Test if a tablespace file can be renamed to a new filepath by checking
ulint size) /*!< in: the initial size of the
tablespace file in pages,
must be >= FIL_IBD_FILE_INITIAL_SIZE */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
#ifndef UNIV_HOTBACKUP
/********************************************************************//**
Tries to open a single-table tablespace and optionally checks the space id is
const char* tablename, /*!< in: table name in the
databasename/tablename format */
const char* filepath) /*!< in: tablespace filepath */
- __attribute__((nonnull(5), warn_unused_result));
+ MY_ATTRIBUTE((nonnull(5), warn_unused_result));
#endif /* !UNIV_HOTBACKUP */
/********************************************************************//**
appropriately aligned */
void* message) /*!< in: message for aio handler if non-sync
aio used, else ignored */
- __attribute__((nonnull(8)));
+ MY_ATTRIBUTE((nonnull(8)));
/**********************************************************************//**
Waits for an aio operation to complete. This function is used to write the
handler for completed requests. The aio array of pending requests is divided
dict_table_t* table,
ulint n_io_buffers,
PageCallback& callback)
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/*******************************************************************//**
Checks if a single-table tablespace for a given table name exists in the
/*================*/
space_name_list_t& space_name_list)
/*!< in/out: Vector for collecting the names. */
- __attribute__((warn_unused_result));
+ MY_ATTRIBUTE((warn_unused_result));
/** Generate redo log for swapping two .ibd files
@param[in] old_table old table
const dict_table_t* new_table,
const char* tmp_name,
mtr_t* mtr)
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/*******************************************************************//**
Finds the given page_no of the given space id from the double write buffer,
/*****************************************************************************
-Copyright (c) 1995, 2012, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1995, 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
/** Bit mask of the POST_ANTELOPE field */
#define FSP_FLAGS_MASK_POST_ANTELOPE \
- ((~(~0 << FSP_FLAGS_WIDTH_POST_ANTELOPE)) \
+ ((~(~0U << FSP_FLAGS_WIDTH_POST_ANTELOPE)) \
<< FSP_FLAGS_POS_POST_ANTELOPE)
/** Bit mask of the ZIP_SSIZE field */
#define FSP_FLAGS_MASK_ZIP_SSIZE \
- ((~(~0 << FSP_FLAGS_WIDTH_ZIP_SSIZE)) \
+ ((~(~0U << FSP_FLAGS_WIDTH_ZIP_SSIZE)) \
<< FSP_FLAGS_POS_ZIP_SSIZE)
/** Bit mask of the ATOMIC_BLOBS field */
#define FSP_FLAGS_MASK_ATOMIC_BLOBS \
- ((~(~0 << FSP_FLAGS_WIDTH_ATOMIC_BLOBS)) \
+ ((~(~0U << FSP_FLAGS_WIDTH_ATOMIC_BLOBS)) \
<< FSP_FLAGS_POS_ATOMIC_BLOBS)
/** Bit mask of the PAGE_SSIZE field */
#define FSP_FLAGS_MASK_PAGE_SSIZE \
- ((~(~0 << FSP_FLAGS_WIDTH_PAGE_SSIZE)) \
+ ((~(~0U << FSP_FLAGS_WIDTH_PAGE_SSIZE)) \
<< FSP_FLAGS_POS_PAGE_SSIZE)
/** Bit mask of the DATA_DIR field */
#define FSP_FLAGS_MASK_DATA_DIR \
- ((~(~0 << FSP_FLAGS_WIDTH_DATA_DIR)) \
+ ((~(~0U << FSP_FLAGS_WIDTH_DATA_DIR)) \
<< FSP_FLAGS_POS_DATA_DIR)
/** Return the value of the POST_ANTELOPE field */
in which the page should be initialized.
If init_mtr!=mtr, but the page is already
latched in mtr, do not initialize the page. */
- __attribute__((warn_unused_result, nonnull));
+ MY_ATTRIBUTE((warn_unused_result, nonnull));
/**********************************************************************//**
Reserves free pages from a tablespace. All mini-transactions which may
use several pages from the tablespace should call this function beforehand
fseg_header_t* seg_header, /*!< in: segment header */
ulint space, /*!< in: space id */
ulint page) /*!< in: page offset */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/**********************************************************************//**
Frees part of a segment. This function can be used to free a segment
by repeatedly calling this function in different mini-transactions.
fsp_flags_is_valid(
/*===============*/
ulint flags) /*!< in: tablespace flags */
- __attribute__((warn_unused_result, const));
+ MY_ATTRIBUTE((warn_unused_result, const));
/********************************************************************//**
Determine if the tablespace is compressed from dict_table_t::flags.
@return TRUE if compressed, FALSE if not compressed */
/*****************************************************************************
-Copyright (c) 2007, 2014, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 2007, 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
and ignored processing an
operator, currently we only
ignore FTS_IGNORE operator */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/*****************************************************************//**
Process (nested) sub-expression, create a new result set to store the
sub-expression result by processing nodes under current sub-expression
fts_ast_node_t* node, /*!< in: instance to traverse*/
fts_ast_callback visitor, /*!< in: callback */
void* arg) /*!< in: callback arg */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/********************************************************************
Create a lex instance.*/
UNIV_INTERN
ibool boolean_mode, /*!< in: query type */
const byte* query, /*!< in: query string */
ulint query_len) /*!< in: query string len */
- __attribute__((nonnull, malloc, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, malloc, warn_unused_result));
/********************************************************************
Free an fts_lexer_t instance.*/
UNIV_INTERN
/*===========*/
fts_lexer_t* fts_lexer) /*!< in: lexer instance to
free */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/**
Create an ast string object, with NUL-terminator, so the string
/** Threshold where our optimize thread automatically kicks in */
#define FTS_OPTIMIZE_THRESHOLD 10000000
-#define FTS_DOC_ID_MAX_STEP 10000
+/** Threshold to avoid exhausting of doc ids. Consecutive doc id difference
+should not exceed FTS_DOC_ID_MAX_STEP */
+#define FTS_DOC_ID_MAX_STEP 65535
+
/** Variable specifying the FTS parallel sort degree */
extern ulong fts_sort_pll_degree;
/** Variable specifying the table that has Fulltext index to display its
content through information schema table */
extern char* fts_internal_tbl_name;
+extern char* fts_internal_tbl_name2;
#define fts_que_graph_free(graph) \
do { \
/*================*/
const dict_table_t* table, /*!< in: table */
doc_id_t* doc_id) /*!< out: new document id */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/*********************************************************************//**
Update the next and last Doc ID in the CONFIG table to be the input
"doc_id" value (+ 1). We would do so after each FTS index build or
const dict_table_t* table, /*!< in: table */
const char* table_name, /*!< in: table name, or NULL */
doc_id_t doc_id) /*!< in: DOC ID to set */
- __attribute__((nonnull(2)));
+ MY_ATTRIBUTE((nonnull(2)));
/******************************************************************//**
Create a new document id .
current row that is being
inserted. */
mem_heap_t* heap) /*!< in: heap */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/******************************************************************//**
Create a new fts_doc_ids_t.
@return new fts_doc_ids_t. */
fts_row_state state, /*!< in: state of the row */
ib_vector_t* fts_indexes) /*!< in: FTS indexes affected
(NULL=all) */
- __attribute__((nonnull(1,2)));
+ MY_ATTRIBUTE((nonnull(1,2)));
/******************************************************************//**
Free an FTS trx. */
index */
const char* name, /*!< in: table name */
bool skip_doc_id_index) /*!< in: Skip index on doc id */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/******************************************************************//**
Wrapper function of fts_create_index_tables_low(), create auxiliary
tables for an FTS index
trx_t* trx, /*!< in: transaction handle */
const dict_index_t* index) /*!< in: the FTS index
instance */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/******************************************************************//**
Creates the column specific ancillary tables needed for supporting an
FTS index on the given table. row_mysql_lock_data_dictionary must have
instance */
const char* table_name, /*!< in: the table name */
table_id_t table_id) /*!< in: the table id */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/******************************************************************//**
Add the FTS document id hidden column. */
UNIV_INTERN
/*==================*/
dict_table_t* table, /*!< in/out: Table with FTS index */
mem_heap_t* heap) /*!< in: temporary memory heap, or NULL */
- __attribute__((nonnull(1)));
+ MY_ATTRIBUTE((nonnull(1)));
/*********************************************************************//**
Drops the ancillary tables needed for supporting an FTS index on the
trx_t* trx, /*!< in: transaction */
dict_table_t* table) /*!< in: table has the FTS
index */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/******************************************************************//**
The given transaction is about to be committed; do whatever is necessary
from the FTS system's POV.
fts_commit(
/*=======*/
trx_t* trx) /*!< in: transaction */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/*******************************************************************//**
FTS Query entry point.
in bytes */
fts_result_t** result) /*!< out: query result, to be
freed by the caller.*/
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/******************************************************************//**
Retrieve the FTS Relevance Ranking result for doc with doc_id
fts_optimize_table(
/*===============*/
dict_table_t* table) /*!< in: table to optimiza */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/**********************************************************************//**
Startup the optimize thread and create the work queue. */
/*==================*/
trx_t* trx, /*!< in: transaction */
dict_index_t* index) /*!< in: Index to drop */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/******************************************************************//**
Remove the table from the OPTIMIZER's list. We do wait for
trx_t* trx, /*!< in: transaction */
fts_trx_t* fts_trx, /*!< in: fts transaction */
const char* name) /*!< in: savepoint name */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/**********************************************************************//**
Refresh last statement savepoint. */
UNIV_INTERN
fts_savepoint_laststmt_refresh(
/*===========================*/
trx_t* trx) /*!< in: transaction */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/**********************************************************************//**
Release the savepoint data identified by name. */
UNIV_INTERN
/*==============*/
fts_cache_t* cache); /*!< in: cache*/
-/*********************************************************************//**
-Clear cache. */
+/** Clear cache.
+@param[in,out] cache fts cache */
UNIV_INTERN
void
fts_cache_clear(
-/*============*/
- fts_cache_t* cache); /*!< in: cache */
+ fts_cache_t* cache);
/*********************************************************************//**
Initialize things in cache. */
fts_drop_orphaned_tables(void);
/*==========================*/
+/* Get parent table name if it's a fts aux table
+@param[in] aux_table_name aux table name
+@param[in] aux_table_len aux table length
+@return parent table name, or NULL */
+char*
+fts_get_parent_table_name(
+ const char* aux_table_name,
+ ulint aux_table_len);
+
/******************************************************************//**
Since we do a horizontal split on the index table, we need to drop
all the split tables.
/*========================*/
trx_t* trx, /*!< in: transaction */
dict_index_t* index) /*!< in: fts instance */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/** Run SYNC on the table, i.e., write out data from the cache to the
FTS auxiliary INDEX table and clear the cache at the end.
@param[in,out] table fts table
@param[in] unlock_cache whether unlock cache when write node
@param[in] wait whether wait for existing sync to finish
+@param[in] has_dict whether has dict operation lock
@return DB_SUCCESS on success, error code on failure. */
UNIV_INTERN
dberr_t
fts_sync_table(
dict_table_t* table,
bool unlock_cache,
- bool wait);
+ bool wait,
+ bool has_dict);
/****************************************************************//**
Free the query graph but check whether dict_sys->mutex is already
dict_table_t* table, /*!< in: Table where indexes are dropped */
dict_index_t* index, /*!< in: Index to be dropped */
trx_t* trx) /*!< in: Transaction for the drop */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/****************************************************************//**
Rename auxiliary tables for all fts index for a table
/*****************************************************************************
-Copyright (c) 2011, 2013, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 2011, 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
fts_table_t* fts_table, /*!< in: FTS aux table */
pars_info_t* info, /*!< in: info struct, or NULL */
const char* sql) /*!< in: SQL string to evaluate */
- __attribute__((nonnull(3), malloc, warn_unused_result));
+ MY_ATTRIBUTE((nonnull(3), malloc, warn_unused_result));
/******************************************************************//**
Evaluate a parsed SQL statement
@return DB_SUCCESS or error code */
/*=========*/
trx_t* trx, /*!< in: transaction */
que_t* graph) /*!< in: Parsed statement */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/******************************************************************//**
Construct the name of an ancillary FTS table for the given table.
@return own: table name, must be freed with mem_free() */
/*===============*/
const fts_table_t*
fts_table) /*!< in: FTS aux table info */
- __attribute__((nonnull, malloc, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, malloc, warn_unused_result));
/******************************************************************//**
Construct the column specification part of the SQL string for selecting the
indexed FTS columns for the given table. Adds the necessary bound
dict_index_t* index, /*!< in: FTS index */
pars_info_t* info, /*!< in/out: parser info */
mem_heap_t* heap) /*!< in: memory heap */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/** define for fts_doc_fetch_by_doc_id() "option" value, defines whether
we want to get Doc whose ID is equal to or greater or smaller than supplied
callback, /*!< in: callback to read
records */
void* arg) /*!< in: callback arg */
- __attribute__((nonnull(6)));
+ MY_ATTRIBUTE((nonnull(6)));
/*******************************************************************//**
Callback function for fetch that stores the text of an FTS document,
/*==========================*/
void* row, /*!< in: sel_node_t* */
void* user_arg) /*!< in: fts_doc_t* */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/********************************************************************
Write out a single word's data as new entry/entries in the INDEX table.
@return DB_SUCCESS if all OK. */
fts_table_t* fts_table, /*!< in: the FTS aux index */
fts_string_t* word, /*!< in: word in UTF-8 */
fts_node_t* node) /*!< in: node columns */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/*******************************************************************//**
Tokenize a document. */
UNIV_INTERN
tokenize */
fts_doc_t* result) /*!< out: if provided, save
result tokens here */
- __attribute__((nonnull(1)));
+ MY_ATTRIBUTE((nonnull(1)));
/*******************************************************************//**
Continue to tokenize a document. */
tokens from this tokenization */
fts_doc_t* result) /*!< out: if provided, save
result tokens here */
- __attribute__((nonnull(1)));
+ MY_ATTRIBUTE((nonnull(1)));
/******************************************************************//**
Initialize a document. */
UNIV_INTERN
fts_doc_init(
/*=========*/
fts_doc_t* doc) /*!< in: doc to initialize */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/******************************************************************//**
Do a binary search for a doc id in the array
int lower, /*!< in: lower bound of array*/
int upper, /*!< in: upper bound of array*/
doc_id_t doc_id) /*!< in: doc id to lookup */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/******************************************************************//**
Free document. */
UNIV_INTERN
fts_doc_free(
/*=========*/
fts_doc_t* doc) /*!< in: document */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/******************************************************************//**
Free fts_optimizer_word_t instanace.*/
UNIV_INTERN
fts_word_free(
/*==========*/
fts_word_t* word) /*!< in: instance to free.*/
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/******************************************************************//**
Read the rows from the FTS inde
@return DB_SUCCESS or error code */
const fts_string_t*
word, /*!< in: the word to fetch */
fts_fetch_t* fetch) /*!< in: fetch callback.*/
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/******************************************************************//**
Create a fts_optimizer_word_t instance.
@return new instance */
fts_word_t* word, /*!< in: word to initialize */
byte* utf8, /*!< in: UTF-8 string */
ulint len) /*!< in: length of string in bytes */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/******************************************************************//**
Compare two fts_trx_table_t instances, we actually compare the
table id's here.
/*==============*/
const void* v1, /*!< in: id1 */
const void* v2) /*!< in: id2 */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/******************************************************************//**
Compare a table id with a trx_table_t table id.
@return < 0 if n1 < n2, 0 if n1 == n2, > 0 if n1 > n2 */
/*=================*/
const void* p1, /*!< in: id1 */
const void* p2) /*!< in: id2 */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/******************************************************************//**
Commit a transaction.
@return DB_SUCCESS if all OK */
fts_sql_commit(
/*===========*/
trx_t* trx) /*!< in: transaction */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/******************************************************************//**
Rollback a transaction.
@return DB_SUCCESS if all OK */
fts_sql_rollback(
/*=============*/
trx_t* trx) /*!< in: transaction */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/******************************************************************//**
Parse an SQL string. %s is replaced with the table's id. Don't acquire
the dict mutex
fts_table_t* fts_table, /*!< in: table with FTS index */
pars_info_t* info, /*!< in: parser info */
const char* sql) /*!< in: SQL string to evaluate */
- __attribute__((nonnull(3), malloc, warn_unused_result));
+ MY_ATTRIBUTE((nonnull(3), malloc, warn_unused_result));
/******************************************************************//**
Get value from config table. The caller must ensure that enough
space is allocated for value to hold the column contents
this parameter name */
fts_string_t* value) /*!< out: value read from
config table */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/******************************************************************//**
Get value specific to an FTS index from the config table. The caller
must ensure that enough space is allocated for value to hold the
this parameter name */
fts_string_t* value) /*!< out: value read from
config table */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/******************************************************************//**
Set the value in the config table for name.
@return DB_SUCCESS or error code */
this parameter name */
const fts_string_t*
value) /*!< in: value to update */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/****************************************************************//**
Set an ulint value in the config table.
@return DB_SUCCESS if all OK else error code */
fts_table_t* fts_table, /*!< in: the indexed FTS table */
const char* name, /*!< in: param name */
ulint int_value) /*!< in: value */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/******************************************************************//**
Set the value specific to an FTS index in the config table.
@return DB_SUCCESS or error code */
this parameter name */
fts_string_t* value) /*!< out: value read from
config table */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/******************************************************************//**
Increment the value in the config table for column name.
@return DB_SUCCESS or error code */
const char* name, /*!< in: increment config value
for this parameter name */
ulint delta) /*!< in: increment by this much */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/******************************************************************//**
Increment the per index value in the config table for column name.
@return DB_SUCCESS or error code */
const char* name, /*!< in: increment config value
for this parameter name */
ulint delta) /*!< in: increment by this much */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/******************************************************************//**
Get an ulint value from the config table.
@return DB_SUCCESS or error code */
dict_index_t* index, /*!< in: FTS index */
const char* name, /*!< in: param name */
ulint* int_value) /*!< out: value */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/******************************************************************//**
Set an ulint value int the config table.
@return DB_SUCCESS or error code */
dict_index_t* index, /*!< in: FTS index */
const char* name, /*!< in: param name */
ulint int_value) /*!< in: value */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/******************************************************************//**
Get an ulint value from the config table.
@return DB_SUCCESS or error code */
fts_table_t* fts_table, /*!< in: the indexed FTS table */
const char* name, /*!< in: param name */
ulint* int_value) /*!< out: value */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/******************************************************************//**
Search cache for word.
@return the word node vector if found else NULL */
index_cache, /*!< in: cache to search */
const fts_string_t*
text) /*!< in: word to search for */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/******************************************************************//**
Check cache for deleted doc id.
@return TRUE if deleted */
const fts_cache_t*
cache, /*!< in: cache ito search */
doc_id_t doc_id) /*!< in: doc id to search for */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/******************************************************************//**
Append deleted doc ids to vector and sort the vector. */
UNIV_INTERN
trx_t* trx, /*!< in: transaction */
dict_index_t* index, /*!< in: for this index */
ulint* total) /*!< out: total words */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
#endif
/******************************************************************//**
Search the index specific cache for a particular FTS index.
cache, /*!< in: cache to search */
const dict_index_t*
index) /*!< in: index to search for */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/******************************************************************//**
Write the table id to the given buffer (including final NUL). Buffer must be
at least FTS_AUX_MIN_TABLE_ID_LENGTH bytes long.
/*================*/
ib_id_t id, /*!< in: a table/index id */
char* str, /*!< in: buffer to write the id to */
- bool hex_format __attribute__((unused)))
+ bool hex_format MY_ATTRIBUTE((unused)))
/*!< in: true for fixed hex format,
false for old ambiguous format */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/******************************************************************//**
Read the table id from the string generated by fts_write_object_id().
@return TRUE if parse successful */
/*===============*/
ib_id_t* id, /*!< out: a table id */
const char* str) /*!< in: buffer to read from */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/******************************************************************//**
Get the table id.
@return number of bytes written */
char* table_id) /*!< out: table id, must be at least
FTS_AUX_MIN_TABLE_ID_LENGTH bytes
long */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/******************************************************************//**
Add the table to add to the OPTIMIZER's list. */
UNIV_INTERN
fts_optimize_add_table(
/*===================*/
dict_table_t* table) /*!< in: table to add */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/******************************************************************//**
Optimize a table. */
UNIV_INTERN
fts_optimize_do_table(
/*==================*/
dict_table_t* table) /*!< in: table to optimize */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/******************************************************************//**
Construct the prefix name of an FTS table.
@return own: table name, must be freed with mem_free() */
/*======================*/
const fts_table_t*
fts_table) /*!< in: Auxiliary table type */
- __attribute__((nonnull, malloc, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, malloc, warn_unused_result));
/******************************************************************//**
Add node positions. */
UNIV_INTERN
fts_node_t* node, /*!< in: word node */
doc_id_t doc_id, /*!< in: doc id */
ib_vector_t* positions) /*!< in: fts_token_t::positions */
- __attribute__((nonnull(2,4)));
+ MY_ATTRIBUTE((nonnull(2,4)));
/******************************************************************//**
Create the config table name for retrieving index specific value.
/*===============================*/
const char* param, /*!< in: base name of param */
const dict_index_t* index) /*!< in: index for config */
- __attribute__((nonnull, malloc, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, malloc, warn_unused_result));
#ifndef UNIV_NONINL
#include "fts0priv.ic"
/*****************************************************************************
-Copyright (c) 2011, 2013, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 2011, 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
/*================*/
ib_id_t id, /* in: a table/index id */
char* str, /* in: buffer to write the id to */
- bool hex_format __attribute__((unused)))
+ bool hex_format MY_ATTRIBUTE((unused)))
/* in: true for fixed hex format,
false for old ambiguous format */
{
/* Use this to construct old(5.6.14 and 5.7.3) windows
ambiguous aux table names */
DBUG_EXECUTE_IF("innodb_test_wrong_windows_fts_aux_table_name",
- return(sprintf(str, "%016"PRIu64, id)););
+ return(sprintf(str, "%016" PRIu64, id)););
DBUG_EXECUTE_IF("innodb_test_wrong_fts_aux_table_name",
return(sprintf(str, UINT64PFx, id)););
// FIXME: Use ut_snprintf(), so does following one.
return(sprintf(str, "%016llu", id));
#else /* _WIN32 */
- return(sprintf(str, "%016"PRIu64, id));
+ return(sprintf(str, "%016" PRIu64, id));
#endif /* _WIN32 */
}
/*****************************************************************************
-Copyright (c) 2006, 2015, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 2006, 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
thd_requested_durability(
/*=====================*/
const THD* thd) /*!< in: thread handle */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/******************************************************************//**
Returns true if the transaction this thread is processing has edited
const unsigned char* b, /*!< in: data field */
unsigned int b_length) /*!< in: data field length,
not UNIV_SQL_NULL */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/**************************************************************//**
Converts a MySQL type to an InnoDB type. Note that this function returns
the 'mtype' of InnoDB. InnoDB differentiates between MySQL's old <= 4.1
and unsigned integer
types are 'unsigned types' */
const void* field) /*!< in: MySQL Field */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/******************************************************************//**
Get the variable length bounds of the given character set. */
/*==============*/
THD* thd, /*!< in: MySQL thread handle */
size_t* length) /*!< out: length of the SQL statement */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/******************************************************************//**
This function is used to find the storage length in bytes of the first n
characters for prefix indexes using a multibyte character set. The function
innobase_index_cond(
/*================*/
void* file) /*!< in/out: pointer to ha_innobase */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/******************************************************************//**
Returns true if the thread supports XA,
global value of innodb_supports_xa if thd is NULL.
const char* name, /*!< in: index or table name
to format */
ibool is_index_name) /*!< in: index name */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/** Corresponds to Sql_condition:enum_warning_level. */
enum ib_log_level_t {
ib_uint32_t code, /*!< MySQL error code */
const char* format, /*!< printf format */
...) /*!< Args */
- __attribute__((format(printf, 4, 5)));
+ MY_ATTRIBUTE((format(printf, 4, 5)));
/******************************************************************//**
Use this when the args are passed to the format string from
ib_log_level_t level, /*!< in: warning level */
const char* format, /*!< printf format */
...) /*!< Args */
- __attribute__((format(printf, 2, 3)));
+ MY_ATTRIBUTE((format(printf, 2, 3)));
/******************************************************************//**
Returns the NUL terminated value of glob_hostname.
ulonglong step, /*!< in: AUTOINC increment step */
ulonglong offset, /*!< in: AUTOINC offset */
ulonglong max_value) /*!< in: max value for type */
- __attribute__((pure, warn_unused_result));
+ MY_ATTRIBUTE((pure, warn_unused_result));
/********************************************************************//**
Get the upper limit of the MySQL integral and floating-point type.
innobase_get_int_col_max_value(
/*===========================*/
const Field* field) /*!< in: MySQL field */
- __attribute__((nonnull, pure, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, pure, warn_unused_result));
/**********************************************************************
Check if the length of the identifier exceeds the maximum allowed.
/*****************************************************************************
-Copyright (c) 2005, 2013, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 2005, 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
const dict_index_t* index, /*!< in: index */
const ulint* offsets)/*!< in: rec_get_offsets(
rec, index, ...) */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/*************************************************************//**
Copies an InnoDB index entry to table->record[0]. */
struct TABLE* table, /*!< in/out: MySQL table */
const dict_index_t* index, /*!< in: InnoDB index */
const dfield_t* fields) /*!< in: InnoDB index fields */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/*************************************************************//**
Copies an InnoDB row to table->record[0]. */
struct TABLE* table, /*!< in/out: MySQL table */
const dict_table_t* itab, /*!< in: InnoDB table */
const dtuple_t* row) /*!< in: InnoDB row */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/*************************************************************//**
Resets table->record[0]. */
innobase_rec_reset(
/*===============*/
struct TABLE* table) /*!< in/out: MySQL table */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/** Generate the next autoinc based on a snapshot of the session
auto_increment_increment and auto_increment_offset variables. */
/*****************************************************************************
-Copyright (c) 1997, 2013, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1997, 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
ibuf_mtr_start(
/*===========*/
mtr_t* mtr) /*!< out: mini-transaction */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/***************************************************************//**
Commits an insert buffer mini-transaction. */
UNIV_INLINE
ibuf_mtr_commit(
/*============*/
mtr_t* mtr) /*!< in/out: mini-transaction */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/*********************************************************************//**
Initializes an ibuf bitmap page. */
UNIV_INTERN
ibuf_inside(
/*========*/
const mtr_t* mtr) /*!< in: mini-transaction */
- __attribute__((nonnull, pure));
+ MY_ATTRIBUTE((nonnull, pure));
/***********************************************************************//**
Checks if a page address is an ibuf bitmap page (level 3 page) address.
@return TRUE if a bitmap page */
is not one of the fixed address ibuf
pages, or NULL, in which case a new
transaction is created. */
- __attribute__((warn_unused_result));
+ MY_ATTRIBUTE((warn_unused_result));
#ifdef UNIV_DEBUG
/** Checks if a page is a level 2 or 3 page in the ibuf hierarchy of
pages. Must not be called when recv_no_ibuf_operations==TRUE.
ibuf_delete_for_discarded_space(
/*============================*/
ulint space); /*!< in: space id */
-/*********************************************************************//**
-Contracts insert buffer trees by reading pages to the buffer pool.
+/** Contract the change buffer by reading pages to the buffer pool.
+@param[in] full If true, do a full contraction based
+on PCT_IO(100). If false, the size of contract batch is determined
+based on the current size of the change buffer.
@return a lower limit for the combined size in bytes of entries which
will be merged from ibuf trees to the pages read, 0 if ibuf is
empty */
UNIV_INTERN
ulint
-ibuf_contract_in_background(
-/*========================*/
- table_id_t table_id, /*!< in: if merge should be done only
- for a specific table, for all tables
- this should be 0 */
- ibool full); /*!< in: TRUE if the caller wants to
- do a full contract based on PCT_IO(100).
- If FALSE then the size of contract
- batch is determined based on the
- current size of the ibuf tree. */
+ibuf_merge_in_background(
+ bool full); /*!< in: TRUE if the caller wants to
+ do a full contract based on PCT_IO(100).
+ If FALSE then the size of contract
+ batch is determined based on the
+ current size of the ibuf tree. */
+
+/** Contracts insert buffer trees by reading pages referring to space_id
+to the buffer pool.
+@returns number of pages merged.*/
+UNIV_INTERN
+ulint
+ibuf_merge_space(
+/*=============*/
+ ulint space); /*!< in: space id */
+
#endif /* !UNIV_HOTBACKUP */
/*********************************************************************//**
Parses a redo log record of an ibuf bitmap page init.
/*========================*/
const trx_t* trx, /*!< in: transaction */
ulint space_id) /*!< in: tablespace identifier */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
#define IBUF_HEADER_PAGE_NO FSP_IBUF_HEADER_PAGE_NO
#define IBUF_TREE_ROOT_PAGE_NO FSP_IBUF_TREE_ROOT_PAGE_NO
/*****************************************************************************
-Copyright (c) 1996, 2014, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1996, 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
/*========================*/
ulint space, /*!< in: space id */
ulint page_no)/*!< in: page number */
- __attribute__((warn_unused_result));
+ MY_ATTRIBUTE((warn_unused_result));
/*********************************************************************//**
Checks if locks of other transactions prevent an immediate insert of
a record. If they do, first tests if the query thread should anyway
inserted record maybe should inherit
LOCK_GAP type locks from the successor
record */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/*********************************************************************//**
Checks if locks of other transactions prevent an immediate modify (update,
delete mark, or delete unmark) of a clustered index record. If they do,
dict_index_t* index, /*!< in: clustered index */
const ulint* offsets,/*!< in: rec_get_offsets(rec, index) */
que_thr_t* thr) /*!< in: query thread */
- __attribute__((warn_unused_result, nonnull));
+ MY_ATTRIBUTE((warn_unused_result, nonnull));
/*********************************************************************//**
Checks if locks of other transactions prevent an immediate modify
(delete mark or delete unmark) of a secondary index record.
que_thr_t* thr, /*!< in: query thread
(can be NULL if BTR_NO_LOCKING_FLAG) */
mtr_t* mtr) /*!< in/out: mini-transaction */
- __attribute__((warn_unused_result, nonnull(2,3,4,6)));
+ MY_ATTRIBUTE((warn_unused_result, nonnull(2,3,4,6)));
/*********************************************************************//**
Like lock_clust_rec_read_check_and_lock(), but reads a
secondary index record.
ulint gap_mode,/*!< in: LOCK_ORDINARY, LOCK_GAP, or
LOCK_REC_NOT_GAP */
que_thr_t* thr) /*!< in: query thread */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/*********************************************************************//**
Checks that a record is seen in a consistent read.
@return true if sees, or false if an earlier version of the record
should be read or passed over
by a read cursor */
const read_view_t* view) /*!< in: consistent read view */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/*********************************************************************//**
Locks the specified database table in the mode given. If the lock cannot
be granted immediately, the query thread is put to wait.
in dictionary cache */
enum lock_mode mode, /*!< in: lock mode */
que_thr_t* thr) /*!< in: query thread */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/*********************************************************************//**
Creates a table IX lock object for a resurrected transaction. */
UNIV_INTERN
/*==========*/
ulint space, /*!< in: space */
ulint page_no)/*!< in: page number */
- __attribute__((const));
+ MY_ATTRIBUTE((const));
/*********************************************************************//**
Calculates the hash value of a page file address: used in inserting or
searching for a lock in the hash table.
/*====================*/
const dict_table_t* table, /*!< in: table */
const trx_t* trx) /*!< in: transaction */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/*********************************************************************//**
Checks if a lock request lock1 has to wait for request lock2.
@return TRUE if lock1 has to wait for lock2 to be removed */
dict_index_t* index, /*!< in: index */
const ulint* offsets, /*!< in: rec_get_offsets(rec, index) */
trx_id_t max_trx_id) /*!< in: trx_sys_get_max_trx_id() */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/*********************************************************************//**
Prints info of a table lock. */
UNIV_INTERN
/*====================*/
FILE* file, /*!< in: file where to print */
ibool nowait) /*!< in: whether to wait for the lock mutex */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/*********************************************************************//**
Prints info of locks for each transaction. This function assumes that the
caller holds the lock mutex and more importantly it will release the lock
lock_number_of_rows_locked(
/*=======================*/
const trx_lock_t* trx_lock) /*!< in: transaction locks */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/*******************************************************************//**
Gets the type of a lock. Non-inline version for using outside of the
lock_trx_handle_wait(
/*=================*/
trx_t* trx) /*!< in/out: trx lock state */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/*********************************************************************//**
Get the number of locks on a table.
@return number of locks */
lock_table_get_n_locks(
/*===================*/
const dict_table_t* table) /*!< in: table */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
#ifdef UNIV_DEBUG
/*********************************************************************//**
Checks that a transaction id is sensible, i.e., not in the future.
const rec_t* rec, /*!< in: user record */
dict_index_t* index, /*!< in: index */
const ulint* offsets) /*!< in: rec_get_offsets(rec, index) */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/*******************************************************************//**
Check if the transaction holds any locks on the sys tables
or its records.
lock_trx_has_sys_table_locks(
/*=========================*/
const trx_t* trx) /*!< in: transaction to check */
- __attribute__((warn_unused_result));
+ MY_ATTRIBUTE((warn_unused_result));
/*******************************************************************//**
Check if the transaction holds an exclusive lock on a record.
const dict_table_t* table, /*!< in: table to check */
const buf_block_t* block, /*!< in: buffer block of the record */
ulint heap_no)/*!< in: record heap number */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
#endif /* UNIV_DEBUG */
/** Lock modes and types */
/*****************************************************************************
-Copyright (c) 2007, 2011, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 2007, 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
const rec_t* rec, /*!< in: user record */
const dict_index_t* index, /*!< in: clustered index */
const ulint* offsets)/*!< in: rec_get_offsets(rec, index) */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
#ifndef UNIV_NONINL
#include "lock0priv.ic"
/*****************************************************************************
-Copyright (c) 1997, 2014, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1997, 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
lsn_t* first_header_lsn)
/*!< out: lsn of of the start of the
first log file */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/*******************************************************************//**
Scans the log segment and n_bytes_scanned is set to the length of valid
log scanned. */
/*****************************************************************************
-Copyright (c) 1995, 2009, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1995, 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
mach_read_from_1(
/*=============*/
const byte* b) /*!< in: pointer to byte */
- __attribute__((nonnull, pure));
+ MY_ATTRIBUTE((nonnull, pure));
/*******************************************************//**
The following function is used to store data in two consecutive
bytes. We store the most significant byte to the lower address. */
mach_read_from_2(
/*=============*/
const byte* b) /*!< in: pointer to two bytes */
- __attribute__((nonnull, pure));
+ MY_ATTRIBUTE((nonnull, pure));
/********************************************************//**
The following function is used to convert a 16-bit data item
mach_encode_2(
/*==========*/
ulint n) /*!< in: integer in machine-dependent format */
- __attribute__((const));
+ MY_ATTRIBUTE((const));
/********************************************************//**
The following function is used to convert a 16-bit data item
from the canonical format, for fast bytewise equality test
mach_decode_2(
/*==========*/
uint16 n) /*!< in: 16-bit integer in canonical format */
- __attribute__((const));
+ MY_ATTRIBUTE((const));
/*******************************************************//**
The following function is used to store data in 3 consecutive
bytes. We store the most significant byte to the lowest address. */
mach_read_from_3(
/*=============*/
const byte* b) /*!< in: pointer to 3 bytes */
- __attribute__((nonnull, pure));
+ MY_ATTRIBUTE((nonnull, pure));
/*******************************************************//**
The following function is used to store data in four consecutive
bytes. We store the most significant byte to the lowest address. */
mach_read_from_4(
/*=============*/
const byte* b) /*!< in: pointer to four bytes */
- __attribute__((nonnull, pure));
+ MY_ATTRIBUTE((nonnull, pure));
/*********************************************************//**
Writes a ulint in a compressed form (1..5 bytes).
@return stored size in bytes */
mach_get_compressed_size(
/*=====================*/
ulint n) /*!< in: ulint integer to be stored */
- __attribute__((const));
+ MY_ATTRIBUTE((const));
/*********************************************************//**
Reads a ulint in a compressed form.
@return read integer */
mach_read_compressed(
/*=================*/
const byte* b) /*!< in: pointer to memory from where to read */
- __attribute__((nonnull, pure));
+ MY_ATTRIBUTE((nonnull, pure));
/*******************************************************//**
The following function is used to store data in 6 consecutive
bytes. We store the most significant byte to the lowest address. */
mach_read_from_6(
/*=============*/
const byte* b) /*!< in: pointer to 6 bytes */
- __attribute__((nonnull, pure));
+ MY_ATTRIBUTE((nonnull, pure));
/*******************************************************//**
The following function is used to store data in 7 consecutive
bytes. We store the most significant byte to the lowest address. */
mach_read_from_7(
/*=============*/
const byte* b) /*!< in: pointer to 7 bytes */
- __attribute__((nonnull, pure));
+ MY_ATTRIBUTE((nonnull, pure));
/*******************************************************//**
The following function is used to store data in 8 consecutive
bytes. We store the most significant byte to the lowest address. */
mach_read_from_8(
/*=============*/
const byte* b) /*!< in: pointer to 8 bytes */
- __attribute__((nonnull, pure));
+ MY_ATTRIBUTE((nonnull, pure));
/*********************************************************//**
Writes a 64-bit integer in a compressed form (5..9 bytes).
@return size in bytes */
mach_ull_read_compressed(
/*=====================*/
const byte* b) /*!< in: pointer to memory from where to read */
- __attribute__((nonnull, pure));
+ MY_ATTRIBUTE((nonnull, pure));
/*********************************************************//**
Writes a 64-bit integer in a compressed form (1..11 bytes).
@return size in bytes */
mach_ull_get_much_compressed_size(
/*==============================*/
ib_uint64_t n) /*!< in: 64-bit integer to be stored */
- __attribute__((const));
+ MY_ATTRIBUTE((const));
/*********************************************************//**
Reads a 64-bit integer in a compressed form.
@return the value read */
mach_ull_read_much_compressed(
/*==========================*/
const byte* b) /*!< in: pointer to memory from where to read */
- __attribute__((nonnull, pure));
+ MY_ATTRIBUTE((nonnull, pure));
/*********************************************************//**
Reads a ulint in a compressed form if the log record fully contains it.
@return pointer to end of the stored field, NULL if not complete */
mach_double_read(
/*=============*/
const byte* b) /*!< in: pointer to memory from where to read */
- __attribute__((nonnull, pure));
+ MY_ATTRIBUTE((nonnull, pure));
/*********************************************************//**
Writes a double. It is stored in a little-endian format. */
UNIV_INLINE
mach_float_read(
/*============*/
const byte* b) /*!< in: pointer to memory from where to read */
- __attribute__((nonnull, pure));
+ MY_ATTRIBUTE((nonnull, pure));
/*********************************************************//**
Writes a float. It is stored in a little-endian format. */
UNIV_INLINE
/*===========================*/
const byte* buf, /*!< in: from where to read */
ulint buf_size) /*!< in: from how many bytes to read */
- __attribute__((nonnull, pure));
+ MY_ATTRIBUTE((nonnull, pure));
/*********************************************************//**
Writes a ulint in the little-endian format. */
UNIV_INLINE
mach_read_from_2_little_endian(
/*===========================*/
const byte* buf) /*!< in: from where to read */
- __attribute__((nonnull, pure));
+ MY_ATTRIBUTE((nonnull, pure));
/*********************************************************//**
Writes a ulint in the little-endian format. */
UNIV_INLINE
/*****************************************************************************
-Copyright (c) 1994, 2010, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1994, 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
/*============*/
mem_heap_t* heap, /*!< in: memory heap */
const char* format, /*!< in: format string */
- ...) __attribute__ ((format (printf, 2, 3)));
+ ...) MY_ATTRIBUTE ((format (printf, 2, 3)));
#ifdef MEM_PERIODIC_CHECK
/******************************************************************//**
/*****************************************************************************
-Copyright (c) 1994, 2010, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1994, 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
mem_heap_free_func(
/*===============*/
mem_heap_t* heap, /*!< in, own: heap to be freed */
- const char* file_name __attribute__((unused)),
+ const char* file_name MY_ATTRIBUTE((unused)),
/*!< in: file name where freed */
- ulint line __attribute__((unused)))
+ ulint line MY_ATTRIBUTE((unused)))
{
mem_block_t* block;
mem_block_t* prev_block;
/*****************************************************************************
-Copyright (c) 1995, 2013, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1995, 2016, 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
mtr_start(
/*======*/
mtr_t* mtr) /*!< out: mini-transaction */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/***************************************************************//**
Commits a mini-transaction. */
UNIV_INTERN
mtr_commit(
/*=======*/
mtr_t* mtr) /*!< in/out: mini-transaction */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/**********************************************************//**
Sets and returns a savepoint in mtr.
@return savepoint */
mtr_t* mtr, /*!< in/out: mini-transaction */
void* object, /*!< in: object */
ulint type) /*!< in: object type: MTR_MEMO_S_LOCK, ... */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
#ifdef UNIV_DEBUG
# ifndef UNIV_HOTBACKUP
/**********************************************************//**
mtr_t* mtr, /*!< in: mtr */
const void* object, /*!< in: object to search */
ulint type) /*!< in: type of object */
- __attribute__((warn_unused_result, nonnull));
+ MY_ATTRIBUTE((warn_unused_result, nonnull));
/**********************************************************//**
Checks if memo contains the given page.
/*****************************************************************************
-Copyright (c) 1995, 2013, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1995, 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
mtr_block_dirtied(
/*==============*/
const buf_block_t* block) /*!< in: block being x-fixed */
- __attribute__((nonnull,warn_unused_result));
+ MY_ATTRIBUTE((nonnull,warn_unused_result));
/***************************************************************//**
Starts a mini-transaction. */
/***********************************************************************
-Copyright (c) 1995, 2015, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1995, 2016, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2009, Percona Inc.
Portions of this file contain modifications contributed and copyrighted
OS_FILE_READ_ALLOW_DELETE; the last option is
used by a backup program reading the file */
ibool* success)/*!< out: TRUE if succeed, FALSE if error */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/****************************************************************//**
Tries to disable OS caching on an opened file descriptor. */
UNIV_INTERN
function source code for the exact rules */
ulint type, /*!< in: OS_DATA_FILE or OS_LOG_FILE */
ibool* success)/*!< out: TRUE if succeed, FALSE if error */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/***********************************************************************//**
Deletes a file. The file has to be closed before calling this.
@return TRUE if success */
ibool* success,/*!< out: TRUE if succeed, FALSE if error */
const char* src_file,/*!< in: file name where func invoked */
ulint src_line)/*!< in: line where the func invoked */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/****************************************************************//**
NOTE! Please use the corresponding macro
ibool* success,/*!< out: TRUE if succeed, FALSE if error */
const char* src_file,/*!< in: file name where func invoked */
ulint src_line)/*!< in: line where the func invoked */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/****************************************************************//**
NOTE! Please use the corresponding macro os_file_create(), not directly
ibool* success,/*!< out: TRUE if succeed, FALSE if error */
const char* src_file,/*!< in: file name where func invoked */
ulint src_line)/*!< in: line where the func invoked */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/***********************************************************************//**
NOTE! Please use the corresponding macro os_file_close(), not directly
os_file_get_size(
/*=============*/
os_file_t file) /*!< in: handle to a file */
- __attribute__((warn_unused_result));
+ MY_ATTRIBUTE((warn_unused_result));
/***********************************************************************//**
Write the specified number of zeros to a newly created file.
@return TRUE if success */
null-terminated string */
os_file_t file, /*!< in: handle to a file */
os_offset_t size) /*!< in: file size */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/***********************************************************************//**
Truncates a file at its current position.
@return TRUE if success */
/*****************************************************************************
-Copyright (c) 1995, 2011, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1995, 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
/*===========*/
void* exit_value) /*!< in: exit value; in Windows this void*
is cast as a DWORD */
- UNIV_COLD __attribute__((noreturn));
+ UNIV_COLD MY_ATTRIBUTE((noreturn));
/*****************************************************************//**
Returns the thread identifier of current thread.
@return current thread identifier */
/*****************************************************************************
-Copyright (c) 1994, 2013, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1994, 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
mem_heap_t** heap, /*!< in/out: pointer to memory heap, or NULL */
ulint n_ext, /*!< in: number of externally stored columns */
mtr_t* mtr) /*!< in: mini-transaction handle, or NULL */
- __attribute__((nonnull(1,2,3,4,5), warn_unused_result));
+ MY_ATTRIBUTE((nonnull(1,2,3,4,5), warn_unused_result));
#endif /* !UNIV_HOTBACKUP */
/***********************************************************//**
Inserts a record next to page cursor. Returns pointer to inserted record if
const rec_t* rec, /*!< in: pointer to a physical record */
ulint* offsets,/*!< in/out: rec_get_offsets(rec, index) */
mtr_t* mtr) /*!< in: mini-transaction handle, or NULL */
- __attribute__((nonnull(1,2,3,4), warn_unused_result));
+ MY_ATTRIBUTE((nonnull(1,2,3,4), warn_unused_result));
/***********************************************************//**
Inserts a record next to page cursor on a compressed and uncompressed
page. Returns pointer to inserted record if succeed, i.e.,
const rec_t* rec, /*!< in: pointer to a physical record */
ulint* offsets,/*!< in/out: rec_get_offsets(rec, index) */
mtr_t* mtr) /*!< in: mini-transaction handle, or NULL */
- __attribute__((nonnull(1,2,3,4), warn_unused_result));
+ MY_ATTRIBUTE((nonnull(1,2,3,4), warn_unused_result));
/*************************************************************//**
Copies records from page to a newly created page, from a given record onward,
including that record. Infimum and supremum records are not copied.
/*****************************************************************************
-Copyright (c) 1994, 2015, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1994, 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
page_align(
/*=======*/
const void* ptr) /*!< in: pointer to page frame */
- __attribute__((const));
+ MY_ATTRIBUTE((const));
/************************************************************//**
Gets the offset within a page.
@return offset from the start of the page */
page_offset(
/*========*/
const void* ptr) /*!< in: pointer to page frame */
- __attribute__((const));
+ MY_ATTRIBUTE((const));
/*************************************************************//**
Returns the max trx id field value. */
UNIV_INLINE
/*=================*/
const page_t* page, /*!< in: page */
ulint field) /*!< in: PAGE_FREE, ... */
- __attribute__((nonnull, pure));
+ MY_ATTRIBUTE((nonnull, pure));
/*************************************************************//**
Returns the pointer stored in the given header field, or NULL. */
/*===================*/
const page_t* page, /*!< in: page */
ulint nth) /*!< in: nth record */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/************************************************************//**
Returns the nth record of the record list.
This is the inverse function of page_rec_get_n_recs_before().
/*=============*/
page_t* page, /*< in: page */
ulint nth) /*!< in: nth record */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
#ifndef UNIV_HOTBACKUP
/************************************************************//**
page_get_middle_rec(
/*================*/
page_t* page) /*!< in: page */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/*************************************************************//**
Compares a data tuple to a physical record. Differs from the function
cmp_dtuple_rec_with_match in the way that the record must reside on an
page_is_leaf(
/*=========*/
const page_t* page) /*!< in: page */
- __attribute__((nonnull, pure));
+ MY_ATTRIBUTE((nonnull, pure));
/************************************************************//**
Determine whether the page is empty.
@return true if the page is empty (PAGE_N_RECS = 0) */
page_is_empty(
/*==========*/
const page_t* page) /*!< in: page */
- __attribute__((nonnull, pure));
+ MY_ATTRIBUTE((nonnull, pure));
/************************************************************//**
Determine whether the page contains garbage.
@return true if the page contains garbage (PAGE_GARBAGE is not 0) */
page_has_garbage(
/*=============*/
const page_t* page) /*!< in: page */
- __attribute__((nonnull, pure));
+ MY_ATTRIBUTE((nonnull, pure));
/************************************************************//**
Gets the pointer to the next record on the page.
@return pointer to next record */
page_rec_is_user_rec_low(
/*=====================*/
ulint offset) /*!< in: record offset on page */
- __attribute__((const));
+ MY_ATTRIBUTE((const));
/************************************************************//**
TRUE if the record is the supremum record on a page.
@return TRUE if the supremum record */
page_rec_is_supremum_low(
/*=====================*/
ulint offset) /*!< in: record offset on page */
- __attribute__((const));
+ MY_ATTRIBUTE((const));
/************************************************************//**
TRUE if the record is the infimum record on a page.
@return TRUE if the infimum record */
page_rec_is_infimum_low(
/*====================*/
ulint offset) /*!< in: record offset on page */
- __attribute__((const));
+ MY_ATTRIBUTE((const));
/************************************************************//**
TRUE if the record is a user record on the page.
page_rec_is_user_rec(
/*=================*/
const rec_t* rec) /*!< in: record */
- __attribute__((const));
+ MY_ATTRIBUTE((const));
/************************************************************//**
TRUE if the record is the supremum record on a page.
@return TRUE if the supremum record */
page_rec_is_supremum(
/*=================*/
const rec_t* rec) /*!< in: record */
- __attribute__((const));
+ MY_ATTRIBUTE((const));
/************************************************************//**
TRUE if the record is the infimum record on a page.
page_rec_is_infimum(
/*================*/
const rec_t* rec) /*!< in: record */
- __attribute__((const));
+ MY_ATTRIBUTE((const));
/***************************************************************//**
Looks for the record which owns the given record.
@return the owner record */
ulint i, /*!< in: index of the field to update */
ulint val, /*!< in: value to write */
mtr_t* mtr) /*!< in/out: mini-transaction */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
#endif /* !UNIV_HOTBACKUP */
/************************************************************//**
Returns the maximum combined size of records which can be inserted on top
page_get_free_space_of_empty(
/*=========================*/
ulint comp) /*!< in: nonzero=compact page format */
- __attribute__((const));
+ MY_ATTRIBUTE((const));
/**********************************************************//**
Returns the base extra size of a physical record. This is the
size of the fixed header, independent of the record size.
ulint level, /*!< in: the B-tree level of the page */
trx_id_t max_trx_id, /*!< in: PAGE_MAX_TRX_ID */
mtr_t* mtr) /*!< in/out: mini-transaction */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/**********************************************************//**
Empty a previously created B-tree index page. */
UNIV_INTERN
buf_block_t* block, /*!< in/out: B-tree block */
dict_index_t* index, /*!< in: the index of the page */
mtr_t* mtr) /*!< in/out: mini-transaction */
- __attribute__((nonnull(1,2)));
+ MY_ATTRIBUTE((nonnull(1,2)));
/*************************************************************//**
Differs from page_copy_rec_list_end, because this function does not
touch the lock table and max trx id on page or compress the page.
rec_t* rec, /*!< in: record on page */
dict_index_t* index, /*!< in: record descriptor */
mtr_t* mtr) /*!< in: mtr */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/*************************************************************//**
Copies records from page to new_page, up to the given record, NOT
including that record. Infimum and supremum records are not copied.
rec_t* rec, /*!< in: record on page */
dict_index_t* index, /*!< in: record descriptor */
mtr_t* mtr) /*!< in: mtr */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/*************************************************************//**
Deletes records from a page from a given record onward, including that record.
The infimum and supremum records are not deleted. */
records in the end of the chain to
delete, or ULINT_UNDEFINED if not known */
mtr_t* mtr) /*!< in: mtr */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/*************************************************************//**
Deletes records from page, up to the given record, NOT including
that record. Infimum and supremum records are not deleted. */
buf_block_t* block, /*!< in: buffer block of the page */
dict_index_t* index, /*!< in: record descriptor */
mtr_t* mtr) /*!< in: mtr */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/*************************************************************//**
Moves record list end to another page. Moved records include
split_rec.
rec_t* split_rec, /*!< in: first record to move */
dict_index_t* index, /*!< in: record descriptor */
mtr_t* mtr) /*!< in: mtr */
- __attribute__((nonnull(1, 2, 4, 5)));
+ MY_ATTRIBUTE((nonnull(1, 2, 4, 5)));
/*************************************************************//**
Moves record list start to another page. Moved records do not include
split_rec.
rec_t* split_rec, /*!< in: first record not to move */
dict_index_t* index, /*!< in: record descriptor */
mtr_t* mtr) /*!< in: mtr */
- __attribute__((nonnull(1, 2, 4, 5)));
+ MY_ATTRIBUTE((nonnull(1, 2, 4, 5)));
/****************************************************************//**
Splits a directory slot which owns too many records. */
UNIV_INTERN
page_zip_des_t* page_zip,/*!< in/out: compressed page whose
uncompressed part will be written, or NULL */
ulint slot_no)/*!< in: the directory slot */
- __attribute__((nonnull(1)));
+ MY_ATTRIBUTE((nonnull(1)));
/*************************************************************//**
Tries to balance the given directory slot with too few records
with the upper neighbor, so that there are at least the minimum number
page_t* page, /*!< in/out: index page */
page_zip_des_t* page_zip,/*!< in/out: compressed page, or NULL */
ulint slot_no)/*!< in: the directory slot */
- __attribute__((nonnull(1)));
+ MY_ATTRIBUTE((nonnull(1)));
/**********************************************************//**
Parses a log record of a record list end or start deletion.
@return end of log record or NULL */
/*****************************************************************************
-Copyright (c) 1994, 2013, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1994, 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
page_zip_des_t* page_zip,/*!< in/out: compressed page */
const byte* rec, /*!< in: record on the uncompressed page */
ulint flag) /*!< in: the deleted flag (nonzero=TRUE) */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/**********************************************************************//**
Write the "owned" flag of a record on a compressed page. The n_owned field
page_zip_des_t* page_zip,/*!< in/out: compressed page */
const byte* rec, /*!< in: record on the uncompressed page */
ulint flag) /*!< in: the owned flag (nonzero=TRUE) */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/**********************************************************************//**
Shift the dense page directory when a record is deleted. */
dict_index_t* index, /*!< in: index of rec */
const ulint* offsets,/*!< in: rec_get_offsets(rec) */
const byte* free) /*!< in: previous start of the free list */
- __attribute__((nonnull(1,2,3,4)));
+ MY_ATTRIBUTE((nonnull(1,2,3,4)));
/**********************************************************************//**
Add a slot to the dense page directory. */
page_zip_des_t* page_zip, /*!< in/out: compressed page */
ulint is_clustered) /*!< in: nonzero for clustered index,
zero for others */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
#endif
/*****************************************************************************
-Copyright (c) 2005, 2013, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 2005, 2016, 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
page_zip_get_size(
/*==============*/
const page_zip_des_t* page_zip) /*!< in: compressed page */
- __attribute__((nonnull, pure));
+ MY_ATTRIBUTE((nonnull, pure));
/**********************************************************************//**
Set the size of a compressed page in bytes. */
UNIV_INLINE
ulint n_fields, /*!< in: number of fields in the record;
ignored if zip_size == 0 */
ulint zip_size) /*!< in: compressed page size in bytes, or 0 */
- __attribute__((const));
+ MY_ATTRIBUTE((const));
/**********************************************************************//**
Determine the guaranteed free space on an empty page.
/*================*/
ulint n_fields, /*!< in: number of columns in the index */
ulint zip_size) /*!< in: compressed page size in bytes */
- __attribute__((const));
+ MY_ATTRIBUTE((const));
#endif /* !UNIV_HOTBACKUP */
/**********************************************************************//**
dict_index_t* index, /*!< in: index of the B-tree node */
ulint level, /*!< in: compression level */
mtr_t* mtr) /*!< in: mini-transaction, or NULL */
- __attribute__((nonnull(1,2,3)));
+ MY_ATTRIBUTE((nonnull(1,2,3)));
/**********************************************************************//**
Decompress a page. This function should tolerate errors on the compressed
FALSE=verify but do not copy some
page header fields that should not change
after page creation */
- __attribute__((nonnull(1,2)));
+ MY_ATTRIBUTE((nonnull(1,2)));
#ifdef UNIV_DEBUG
/**********************************************************************//**
const dict_index_t* index, /*!< in: index of the page, if known */
ibool sloppy) /*!< in: FALSE=strict,
TRUE=ignore the MIN_REC_FLAG */
- __attribute__((nonnull(1,2)));
+ MY_ATTRIBUTE((nonnull(1,2)));
/**********************************************************************//**
Check that the compressed and decompressed pages match. */
UNIV_INTERN
const page_zip_des_t* page_zip,/*!< in: compressed page */
const page_t* page, /*!< in: uncompressed page */
const dict_index_t* index) /*!< in: index of the page, if known */
- __attribute__((nonnull(1,2)));
+ MY_ATTRIBUTE((nonnull(1,2)));
#endif /* UNIV_ZIP_DEBUG */
/**********************************************************************//**
/*==================*/
const page_zip_des_t* page_zip,/*!< in: compressed page */
ibool is_clust)/*!< in: TRUE if clustered index */
- __attribute__((nonnull, pure));
+ MY_ATTRIBUTE((nonnull, pure));
/**********************************************************************//**
Determine if enough space is available in the modification log.
ulint length, /*!< in: combined size of the record */
ulint create) /*!< in: nonzero=add the record to
the heap */
- __attribute__((nonnull, pure));
+ MY_ATTRIBUTE((nonnull, pure));
/**********************************************************************//**
Write data to the uncompressed header portion of a page. The data must
const byte* str, /*!< in: address on the uncompressed page */
ulint length, /*!< in: length of the data */
mtr_t* mtr) /*!< in: mini-transaction, or NULL */
- __attribute__((nonnull(1,2)));
+ MY_ATTRIBUTE((nonnull(1,2)));
/**********************************************************************//**
Write an entire record on the compressed page. The data must already
dict_index_t* index, /*!< in: the index the record belongs to */
const ulint* offsets,/*!< in: rec_get_offsets(rec, index) */
ulint create) /*!< in: nonzero=insert, zero=update */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/***********************************************************//**
Parses a log record of writing a BLOB pointer of a record.
ulint n, /*!< in: column index */
mtr_t* mtr) /*!< in: mini-transaction handle,
or NULL if no logging is needed */
- __attribute__((nonnull(1,2,3,4)));
+ MY_ATTRIBUTE((nonnull(1,2,3,4)));
/***********************************************************//**
Parses a log record of writing the node pointer of a record.
ulint size, /*!< in: data size of rec */
ulint ptr, /*!< in: node pointer */
mtr_t* mtr) /*!< in: mini-transaction, or NULL */
- __attribute__((nonnull(1,2)));
+ MY_ATTRIBUTE((nonnull(1,2)));
/**********************************************************************//**
Write the trx_id and roll_ptr of a record on a B-tree leaf node page. */
ulint trx_id_col,/*!< in: column number of TRX_ID in rec */
trx_id_t trx_id, /*!< in: transaction identifier */
roll_ptr_t roll_ptr)/*!< in: roll_ptr */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/**********************************************************************//**
Write the "deleted" flag of a record on a compressed page. The flag must
page_zip_des_t* page_zip,/*!< in/out: compressed page */
const byte* rec, /*!< in: record on the uncompressed page */
ulint flag) /*!< in: the deleted flag (nonzero=TRUE) */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/**********************************************************************//**
Write the "owned" flag of a record on a compressed page. The n_owned field
page_zip_des_t* page_zip,/*!< in/out: compressed page */
const byte* rec, /*!< in: record on the uncompressed page */
ulint flag) /*!< in: the owned flag (nonzero=TRUE) */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/**********************************************************************//**
Insert a record to the dense page directory. */
const ulint* offsets, /*!< in: rec_get_offsets(rec) */
const byte* free) /*!< in: previous start of
the free list */
- __attribute__((nonnull(1,2,3,4)));
+ MY_ATTRIBUTE((nonnull(1,2,3,4)));
/**********************************************************************//**
Add a slot to the dense page directory. */
page_zip_des_t* page_zip, /*!< in/out: compressed page */
ulint is_clustered) /*!< in: nonzero for clustered index,
zero for others */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/***********************************************************//**
Parses a log record of writing to the header of a page.
const byte* str, /*!< in: address on the uncompressed page */
ulint length, /*!< in: length of the data */
mtr_t* mtr) /*!< in: mini-transaction, or NULL */
- __attribute__((nonnull(1,2)));
+ MY_ATTRIBUTE((nonnull(1,2)));
/**********************************************************************//**
Reorganize and compress a page. This is a low-level operation for
m_start, m_end, m_nonempty */
dict_index_t* index, /*!< in: index of the B-tree node */
mtr_t* mtr) /*!< in: mini-transaction */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
#ifndef UNIV_HOTBACKUP
/**********************************************************************//**
Copy the records of a page byte for byte. Do not copy the page header
const page_t* src, /*!< in: page */
dict_index_t* index, /*!< in: index of the B-tree */
mtr_t* mtr) /*!< in: mini-transaction */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
#endif /* !UNIV_HOTBACKUP */
/**********************************************************************//**
byte* end_ptr,/*!< in: buffer end */
page_t* page, /*!< out: uncompressed page */
page_zip_des_t* page_zip)/*!< out: compressed page */
- __attribute__((nonnull(1,2)));
+ MY_ATTRIBUTE((nonnull(1,2)));
/**********************************************************************//**
Calculate the compressed page checksum.
const void* data, /*!< in: compressed page */
ulint size, /*!< in: size of compressed page */
srv_checksum_algorithm_t algo) /*!< in: algorithm to use */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/**********************************************************************//**
Verify a compressed page's checksum.
page_t* page, /*!< in: uncompressed page */
page_zip_des_t* page_zip, /*!< out: compressed page */
dict_index_t* index) /*!< in: index */
- __attribute__((nonnull(1,2)));
+ MY_ATTRIBUTE((nonnull(1,2)));
/**********************************************************************//**
Reset the counters used for filling
/*****************************************************************************
-Copyright (c) 1996, 2012, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1996, 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
query graph, or NULL for dummy graph */
trx_t* trx, /*!< in: transaction handle */
mem_heap_t* heap) /*!< in: memory heap from which allocated */
- __attribute__((nonnull(2,3), warn_unused_result));
+ MY_ATTRIBUTE((nonnull(2,3), warn_unused_result));
/****************************************************************//**
Create parser info struct.
pars_info_t* info, /*!< in: info struct */
const char* name, /*!< in: name */
const ib_uint64_t* val) /*!< in: value */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/****************************************************************//**
Add bound id. */
/*****************************************************************************
-Copyright (c) 1997, 2012, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1997, 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
/*==================*/
const read_view_t* view, /*!< in: read view */
trx_id_t trx_id) /*!< in: trx id */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/*********************************************************************//**
Prints a read view to stderr. */
UNIV_INTERN
/*****************************************************************************
-Copyright (c) 1994, 2012, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1994, 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
bytes within the first field not completely
matched; when function returns, contains the
value for current comparison */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
#define cmp_dtuple_rec_with_match(tuple,rec,offsets,fields,bytes) \
cmp_dtuple_rec_with_match_low( \
tuple,rec,offsets,dtuple_get_n_fields_cmp(tuple),fields,bytes)
struct TABLE* table) /*!< in: MySQL table, for reporting
duplicate key value if applicable,
or NULL */
- __attribute__((nonnull(1,2,3,4), warn_unused_result));
+ MY_ATTRIBUTE((nonnull(1,2,3,4), warn_unused_result));
/*************************************************************//**
This function is used to compare two physical records. Only the common
first fields are compared, and if an externally stored field is
/*****************************************************************************
-Copyright (c) 1994, 2012, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1994, 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
/*===================*/
const rec_t* rec, /*!< in: physical record */
ulint comp) /*!< in: nonzero=compact page format */
- __attribute__((nonnull, pure, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, pure, warn_unused_result));
/******************************************************//**
The following function is used to get the pointer of the next chained record
on the same page.
/*=============*/
rec_t* rec, /*!< in: physical record */
ulint comp) /*!< in: nonzero=compact page format */
- __attribute__((nonnull, pure, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, pure, warn_unused_result));
/******************************************************//**
The following function is used to get the offset of the
next chained record on the same page.
/*==============*/
const rec_t* rec, /*!< in: physical record */
ulint comp) /*!< in: nonzero=compact page format */
- __attribute__((nonnull, pure, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, pure, warn_unused_result));
/******************************************************//**
The following function is used to set the next record offset field
of an old-style record. */
/*==================*/
rec_t* rec, /*!< in: old-style physical record */
ulint next) /*!< in: offset of the next record */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/******************************************************//**
The following function is used to set the next record offset field
of a new-style record. */
/*==================*/
rec_t* rec, /*!< in/out: new-style physical record */
ulint next) /*!< in: offset of the next record */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/******************************************************//**
The following function is used to get the number of fields
in an old-style record.
rec_get_n_fields_old(
/*=================*/
const rec_t* rec) /*!< in: physical record */
- __attribute__((nonnull, pure, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, pure, warn_unused_result));
/******************************************************//**
The following function is used to get the number of fields
in a record.
/*=============*/
const rec_t* rec, /*!< in: physical record */
const dict_index_t* index) /*!< in: record descriptor */
- __attribute__((nonnull, pure, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, pure, warn_unused_result));
/******************************************************//**
The following function is used to get the number of records owned by the
previous directory record.
rec_get_n_owned_old(
/*================*/
const rec_t* rec) /*!< in: old-style physical record */
- __attribute__((nonnull, pure, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, pure, warn_unused_result));
/******************************************************//**
The following function is used to set the number of owned records. */
UNIV_INLINE
/*================*/
rec_t* rec, /*!< in: old-style physical record */
ulint n_owned) /*!< in: the number of owned */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/******************************************************//**
The following function is used to get the number of records owned by the
previous directory record.
rec_get_n_owned_new(
/*================*/
const rec_t* rec) /*!< in: new-style physical record */
- __attribute__((nonnull, pure, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, pure, warn_unused_result));
/******************************************************//**
The following function is used to set the number of owned records. */
UNIV_INLINE
rec_t* rec, /*!< in/out: new-style physical record */
page_zip_des_t* page_zip,/*!< in/out: compressed page, or NULL */
ulint n_owned)/*!< in: the number of owned */
- __attribute__((nonnull(1)));
+ MY_ATTRIBUTE((nonnull(1)));
/******************************************************//**
The following function is used to retrieve the info bits of
a record.
/*==============*/
const rec_t* rec, /*!< in: physical record */
ulint comp) /*!< in: nonzero=compact page format */
- __attribute__((nonnull, pure, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, pure, warn_unused_result));
/******************************************************//**
The following function is used to set the info bits of a record. */
UNIV_INLINE
/*==================*/
rec_t* rec, /*!< in: old-style physical record */
ulint bits) /*!< in: info bits */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/******************************************************//**
The following function is used to set the info bits of a record. */
UNIV_INLINE
/*==================*/
rec_t* rec, /*!< in/out: new-style physical record */
ulint bits) /*!< in: info bits */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/******************************************************//**
The following function retrieves the status bits of a new-style record.
@return status bits */
rec_get_status(
/*===========*/
const rec_t* rec) /*!< in: physical record */
- __attribute__((nonnull, pure, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, pure, warn_unused_result));
/******************************************************//**
The following function is used to set the status bits of a new-style record. */
/*===========*/
rec_t* rec, /*!< in/out: physical record */
ulint bits) /*!< in: info bits */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/******************************************************//**
The following function is used to retrieve the info and status
/*=========================*/
const rec_t* rec, /*!< in: physical record */
ulint comp) /*!< in: nonzero=compact page format */
- __attribute__((nonnull, pure, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, pure, warn_unused_result));
/******************************************************//**
The following function is used to set the info and status
bits of a record. (Only compact records have status bits.) */
/*=========================*/
rec_t* rec, /*!< in/out: compact physical record */
ulint bits) /*!< in: info bits */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/******************************************************//**
The following function tells if record is delete marked.
/*=================*/
const rec_t* rec, /*!< in: physical record */
ulint comp) /*!< in: nonzero=compact page format */
- __attribute__((nonnull, pure, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, pure, warn_unused_result));
/******************************************************//**
The following function is used to set the deleted bit. */
UNIV_INLINE
/*=====================*/
rec_t* rec, /*!< in: old-style physical record */
ulint flag) /*!< in: nonzero if delete marked */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/******************************************************//**
The following function is used to set the deleted bit. */
UNIV_INLINE
rec_t* rec, /*!< in/out: new-style physical record */
page_zip_des_t* page_zip,/*!< in/out: compressed page, or NULL */
ulint flag) /*!< in: nonzero if delete marked */
- __attribute__((nonnull(1)));
+ MY_ATTRIBUTE((nonnull(1)));
/******************************************************//**
The following function tells if a new-style record is a node pointer.
@return TRUE if node pointer */
rec_get_node_ptr_flag(
/*==================*/
const rec_t* rec) /*!< in: physical record */
- __attribute__((nonnull, pure, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, pure, warn_unused_result));
/******************************************************//**
The following function is used to get the order number
of an old-style record in the heap of the index page.
rec_get_heap_no_old(
/*================*/
const rec_t* rec) /*!< in: physical record */
- __attribute__((nonnull, pure, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, pure, warn_unused_result));
/******************************************************//**
The following function is used to set the heap number
field in an old-style record. */
/*================*/
rec_t* rec, /*!< in: physical record */
ulint heap_no)/*!< in: the heap number */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/******************************************************//**
The following function is used to get the order number
of a new-style record in the heap of the index page.
rec_get_heap_no_new(
/*================*/
const rec_t* rec) /*!< in: physical record */
- __attribute__((nonnull, pure, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, pure, warn_unused_result));
/******************************************************//**
The following function is used to set the heap number
field in a new-style record. */
/*================*/
rec_t* rec, /*!< in/out: physical record */
ulint heap_no)/*!< in: the heap number */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/******************************************************//**
The following function is used to test whether the data offsets
in the record are stored in one-byte or two-byte format.
rec_get_1byte_offs_flag(
/*====================*/
const rec_t* rec) /*!< in: physical record */
- __attribute__((nonnull, pure, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, pure, warn_unused_result));
/******************************************************//**
The following function is used to set the 1-byte offsets flag. */
/*====================*/
rec_t* rec, /*!< in: physical record */
ibool flag) /*!< in: TRUE if 1byte form */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/******************************************************//**
Returns the offset of nth field end if the record is stored in the 1-byte
/*=====================*/
const rec_t* rec, /*!< in: record */
ulint n) /*!< in: field index */
- __attribute__((nonnull, pure, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, pure, warn_unused_result));
/******************************************************//**
Returns the offset of nth field end if the record is stored in the 2-byte
/*=====================*/
const rec_t* rec, /*!< in: record */
ulint n) /*!< in: field index */
- __attribute__((nonnull, pure, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, pure, warn_unused_result));
/******************************************************//**
Returns nonzero if the field is stored off-page.
/*==================*/
const rec_t* rec, /*!< in: record */
ulint n) /*!< in: field index */
- __attribute__((nonnull, pure, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, pure, warn_unused_result));
/******************************************************//**
Determine how many of the first n columns in a compact
const rec_t* rec, /*!< in: compact physical record */
const dict_index_t* index, /*!< in: record descriptor */
ulint n) /*!< in: number of columns to scan */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/******************************************************//**
The following function determines the offsets to each field
#endif /* UNIV_DEBUG */
mem_heap_t** heap) /*!< in/out: memory heap */
#ifdef UNIV_DEBUG
- __attribute__((nonnull(1,2,5,7),warn_unused_result));
+ MY_ATTRIBUTE((nonnull(1,2,5,7),warn_unused_result));
#else /* UNIV_DEBUG */
- __attribute__((nonnull(1,2,5),warn_unused_result));
+ MY_ATTRIBUTE((nonnull(1,2,5),warn_unused_result));
#endif /* UNIV_DEBUG */
#ifdef UNIV_DEBUG
0=leaf node */
ulint* offsets)/*!< in/out: array consisting of
offsets[0] allocated elements */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
#ifdef UNIV_DEBUG
/************************************************************//**
Validates offsets returned by rec_get_offsets().
const dict_index_t* index, /*!< in: record descriptor or NULL */
const ulint* offsets)/*!< in: array returned by
rec_get_offsets() */
- __attribute__((nonnull(3), warn_unused_result));
+ MY_ATTRIBUTE((nonnull(3), warn_unused_result));
/************************************************************//**
Updates debug data in offsets, in order to avoid bogus
rec_offs_validate() failures. */
const dict_index_t* index, /*!< in: record descriptor */
ulint* offsets)/*!< in: array returned by
rec_get_offsets() */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
#else
# define rec_offs_make_valid(rec, index, offsets) ((void) 0)
#endif /* UNIV_DEBUG */
ulint n, /*!< in: index of the field */
ulint* len) /*!< out: length of the field; UNIV_SQL_NULL
if SQL null */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
#define rec_get_nth_field_old(rec, n, len) \
((rec) + rec_get_nth_field_offs_old(rec, n, len))
/************************************************************//**
/*===================*/
const rec_t* rec, /*!< in: record */
ulint n) /*!< in: index of the field */
- __attribute__((nonnull, pure, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, pure, warn_unused_result));
/************************************************************//**
The following function is used to get an offset to the nth
data field in a record.
ulint n, /*!< in: index of the field */
ulint* len) /*!< out: length of the field; UNIV_SQL_NULL
if SQL null */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
#define rec_get_nth_field(rec, offsets, n, len) \
((rec) + rec_get_nth_field_offs(offsets, n, len))
/******************************************************//**
rec_offs_comp(
/*==========*/
const ulint* offsets)/*!< in: array returned by rec_get_offsets() */
- __attribute__((nonnull, pure, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, pure, warn_unused_result));
/******************************************************//**
Determine if the offsets are for a record containing
externally stored columns.
rec_offs_any_extern(
/*================*/
const ulint* offsets)/*!< in: array returned by rec_get_offsets() */
- __attribute__((nonnull, pure, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, pure, warn_unused_result));
/******************************************************//**
Determine if the offsets are for a record containing null BLOB pointers.
@return first field containing a null BLOB pointer, or NULL if none found */
/*=====================*/
const rec_t* rec, /*!< in: record */
const ulint* offsets) /*!< in: rec_get_offsets(rec) */
- __attribute__((nonnull, pure, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, pure, warn_unused_result));
/******************************************************//**
Returns nonzero if the extern bit is set in nth field of rec.
@return nonzero if externally stored */
/*================*/
const ulint* offsets,/*!< in: array returned by rec_get_offsets() */
ulint n) /*!< in: nth field */
- __attribute__((nonnull, pure, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, pure, warn_unused_result));
/******************************************************//**
Returns nonzero if the SQL NULL bit is set in nth field of rec.
@return nonzero if SQL NULL */
/*==================*/
const ulint* offsets,/*!< in: array returned by rec_get_offsets() */
ulint n) /*!< in: nth field */
- __attribute__((nonnull, pure, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, pure, warn_unused_result));
/******************************************************//**
Gets the physical size of a field.
@return length of field */
/*==============*/
const ulint* offsets,/*!< in: array returned by rec_get_offsets() */
ulint n) /*!< in: nth field */
- __attribute__((nonnull, pure, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, pure, warn_unused_result));
/******************************************************//**
Returns the number of extern bits set in a record.
rec_offs_n_extern(
/*==============*/
const ulint* offsets)/*!< in: array returned by rec_get_offsets() */
- __attribute__((nonnull, pure, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, pure, warn_unused_result));
/***********************************************************//**
This is used to modify the value of an already existing field in a record.
The previous value must have exactly the same size as the new value. If len
length as the previous value.
If SQL null, previous value must be
SQL null. */
- __attribute__((nonnull(1,2)));
+ MY_ATTRIBUTE((nonnull(1,2)));
/**********************************************************//**
The following function returns the data size of an old-style physical
record, that is the sum of field lengths. SQL null fields
rec_get_data_size_old(
/*==================*/
const rec_t* rec) /*!< in: physical record */
- __attribute__((nonnull, pure, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, pure, warn_unused_result));
/**********************************************************//**
The following function returns the number of allocated elements
for an array of offsets.
rec_offs_get_n_alloc(
/*=================*/
const ulint* offsets)/*!< in: array for rec_get_offsets() */
- __attribute__((nonnull, pure, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, pure, warn_unused_result));
/**********************************************************//**
The following function sets the number of allocated elements
for an array of offsets. */
ulint* offsets, /*!< out: array for rec_get_offsets(),
must be allocated */
ulint n_alloc) /*!< in: number of elements */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
#define rec_offs_init(offsets) \
rec_offs_set_n_alloc(offsets, (sizeof offsets) / sizeof *offsets)
/**********************************************************//**
rec_offs_n_fields(
/*==============*/
const ulint* offsets)/*!< in: array returned by rec_get_offsets() */
- __attribute__((nonnull, pure, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, pure, warn_unused_result));
/**********************************************************//**
The following function returns the data size of a physical
record, that is the sum of field lengths. SQL null fields
rec_offs_data_size(
/*===============*/
const ulint* offsets)/*!< in: array returned by rec_get_offsets() */
- __attribute__((nonnull, pure, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, pure, warn_unused_result));
/**********************************************************//**
Returns the total size of record minus data size of record.
The value returned by the function is the distance from record
rec_offs_extra_size(
/*================*/
const ulint* offsets)/*!< in: array returned by rec_get_offsets() */
- __attribute__((nonnull, pure, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, pure, warn_unused_result));
/**********************************************************//**
Returns the total size of a physical record.
@return size */
rec_offs_size(
/*==========*/
const ulint* offsets)/*!< in: array returned by rec_get_offsets() */
- __attribute__((nonnull, pure, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, pure, warn_unused_result));
#ifdef UNIV_DEBUG
/**********************************************************//**
Returns a pointer to the start of the record.
/*==========*/
const rec_t* rec, /*!< in: pointer to record */
const ulint* offsets)/*!< in: array returned by rec_get_offsets() */
- __attribute__((nonnull, pure, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, pure, warn_unused_result));
/**********************************************************//**
Returns a pointer to the end of the record.
@return pointer to end */
/*========*/
const rec_t* rec, /*!< in: pointer to record */
const ulint* offsets)/*!< in: array returned by rec_get_offsets() */
- __attribute__((nonnull, pure, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, pure, warn_unused_result));
#else /* UNIV_DEBUG */
# define rec_get_start(rec, offsets) ((rec) - rec_offs_extra_size(offsets))
# define rec_get_end(rec, offsets) ((rec) + rec_offs_data_size(offsets))
void* buf, /*!< in: buffer */
const rec_t* rec, /*!< in: physical record */
const ulint* offsets)/*!< in: array returned by rec_get_offsets() */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
#ifndef UNIV_HOTBACKUP
/**********************************************************//**
Determines the size of a data tuple prefix in a temporary file.
const dfield_t* fields, /*!< in: array of data fields */
ulint n_fields,/*!< in: number of data fields */
ulint* extra) /*!< out: extra size */
- __attribute__((warn_unused_result, nonnull));
+ MY_ATTRIBUTE((warn_unused_result, nonnull));
/******************************************************//**
Determine the offset to each field in temporary file.
const dict_index_t* index, /*!< in: record descriptor */
ulint* offsets)/*!< in/out: array of offsets;
in: n=rec_offs_n_fields(offsets) */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/*********************************************************//**
Builds a temporary file record out of a data tuple.
const dict_index_t* index, /*!< in: record descriptor */
const dfield_t* fields, /*!< in: array of data fields */
ulint n_fields) /*!< in: number of fields */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/**************************************************************//**
Copies the first n fields of a physical record to a new physical record in
for the copied prefix,
or NULL */
ulint* buf_size) /*!< in/out: buffer size */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/************************************************************//**
Folds a prefix of a physical record to a ulint.
@return the folded value */
ulint n_bytes, /*!< in: number of bytes to fold
in an incomplete last field */
index_id_t tree_id) /*!< in: index tree id */
- __attribute__((nonnull, pure, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, pure, warn_unused_result));
#endif /* !UNIV_HOTBACKUP */
/*********************************************************//**
Builds a physical record out of a data tuple and
const dtuple_t* dtuple, /*!< in: data tuple */
ulint n_ext) /*!< in: number of
externally stored columns */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/**********************************************************//**
Returns the extra size of an old-style physical record if we know its
data size and number of fields.
ulint data_size, /*!< in: data size */
ulint n_fields, /*!< in: number of fields */
ulint n_ext) /*!< in: number of externally stored columns */
- __attribute__((const));
+ MY_ATTRIBUTE((const));
/**********************************************************//**
Determines the size of a data tuple prefix in ROW_FORMAT=COMPACT.
@return total size */
const dfield_t* fields, /*!< in: array of data fields */
ulint n_fields,/*!< in: number of data fields */
ulint* extra) /*!< out: extra size */
- __attribute__((warn_unused_result, nonnull(1,2)));
+ MY_ATTRIBUTE((warn_unused_result, nonnull(1,2)));
/**********************************************************//**
Determines the size of a data tuple in ROW_FORMAT=COMPACT.
@return total size */
const dfield_t* fields, /*!< in: array of data fields */
ulint n_fields,/*!< in: number of data fields */
ulint* extra) /*!< out: extra size */
- __attribute__((nonnull(1,3)));
+ MY_ATTRIBUTE((nonnull(1,3)));
/**********************************************************//**
The following function returns the size of a data tuple when converted to
a physical record.
dict_index_t* index, /*!< in: record descriptor */
const dtuple_t* dtuple, /*!< in: data tuple */
ulint n_ext) /*!< in: number of externally stored columns */
- __attribute__((warn_unused_result, nonnull));
+ MY_ATTRIBUTE((warn_unused_result, nonnull));
#ifndef UNIV_HOTBACKUP
/**************************************************************//**
Copies the first n fields of a physical record to a data tuple.
ulint n_fields, /*!< in: number of fields
to copy */
mem_heap_t* heap) /*!< in: memory heap */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
#endif /* !UNIV_HOTBACKUP */
/***************************************************************//**
Validates the consistency of a physical record.
/*=========*/
const rec_t* rec, /*!< in: physical record */
const ulint* offsets)/*!< in: array returned by rec_get_offsets() */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/***************************************************************//**
Prints an old-style physical record. */
UNIV_INTERN
/*==========*/
FILE* file, /*!< in: file where to print */
const rec_t* rec) /*!< in: physical record */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
#ifndef UNIV_HOTBACKUP
/***************************************************************//**
Prints a physical record in ROW_FORMAT=COMPACT. Ignores the
FILE* file, /*!< in: file where to print */
const rec_t* rec, /*!< in: physical record */
const ulint* offsets)/*!< in: array returned by rec_get_offsets() */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/***************************************************************//**
Prints a physical record. */
UNIV_INTERN
FILE* file, /*!< in: file where to print */
const rec_t* rec, /*!< in: physical record */
const ulint* offsets)/*!< in: array returned by rec_get_offsets() */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/***************************************************************//**
Prints a physical record. */
UNIV_INTERN
FILE* file, /*!< in: file where to print */
const rec_t* rec, /*!< in: physical record */
const dict_index_t* index) /*!< in: record descriptor */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
# ifdef UNIV_DEBUG
/************************************************************//**
/*===========*/
const rec_t* rec, /*!< in: record */
const dict_index_t* index) /*!< in: clustered index */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
# endif /* UNIV_DEBUG */
#endif /* UNIV_HOTBACKUP */
/*****************************************************************************
-Copyright (c) 1994, 2013, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1994, 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
ulint extra_len;
ulint data_len;
- ut_ad(rec && buf);
+ ut_ad(rec != NULL);
+ ut_ad(buf != NULL);
ut_ad(rec_offs_validate(rec, NULL, offsets));
ut_ad(rec_validate(rec, offsets));
/*****************************************************************************
-Copyright (c) 2010, 2012, Oracle and/or its affiliates. All Rights Reserved.
+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
instantiated */
fts_psort_t** merge) /*!< out: parallel merge info
to be instantiated */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/********************************************************************//**
Clean up and deallocate FTS parallel sort structures, and close
temparary merge sort files */
fts_psort_t* psort_info, /*!< parallel sort info */
ulint id) /* !< in: which auxiliary table's data
to insert to */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
#endif /* row0ftsort_h */
/*****************************************************************************
-Copyright (c) 2012, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 2012, 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
dict_table_t* table, /*!< in/out: table */
row_prebuilt_t* prebuilt) /*!< in: prebuilt struct
in MySQL */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/*****************************************************************//**
Update the DICT_TF2_DISCARDED flag in SYS_TABLES.
bool dict_locked) /*!< in: Set to true if the
caller already owns the
dict_sys_t:: mutex. */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/*****************************************************************//**
Update the (space, root page) of a table's indexes from the values
bool dict_locked) /*!< in: Set to true if the
caller already owns the
dict_sys_t:: mutex. */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
#ifndef UNIV_NONINL
#include "row0import.ic"
#endif
/*****************************************************************************
-Copyright (c) 1996, 2012, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1996, 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
table, else the referenced table */
dtuple_t* entry, /*!< in: index entry for index */
que_thr_t* thr) /*!< in: query thread */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/*********************************************************************//**
Creates an insert node struct.
@return own: insert node struct */
dtuple_t* entry, /*!< in/out: index entry to insert */
ulint n_ext, /*!< in: number of externally stored columns */
que_thr_t* thr) /*!< in: query thread or NULL */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/***************************************************************//**
Tries to insert an entry into a secondary index. If a record with exactly the
same fields is found, the other record is necessarily marked deleted.
trx_id_t trx_id, /*!< in: PAGE_MAX_TRX_ID during
row_log_table_apply(), or 0 */
que_thr_t* thr) /*!< in: query thread */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/***************************************************************//**
Tries to insert the externally stored fields (off-page columns)
of a clustered index entry.
const void* thd, /*!< in: connection, or NULL */
#endif /* DBUG_OFF */
ulint line) /*!< in: line number of caller */
- __attribute__((nonnull(1,2,3,4,5,6), warn_unused_result));
+ MY_ATTRIBUTE((nonnull(1,2,3,4,5,6), warn_unused_result));
#ifdef DBUG_OFF
# define row_ins_index_entry_big_rec(e,big,ofs,heap,index,thd,file,line) \
row_ins_index_entry_big_rec_func(e,big,ofs,heap,index,file,line)
dtuple_t* entry, /*!< in/out: index entry to insert */
que_thr_t* thr, /*!< in: query thread */
ulint n_ext) /*!< in: number of externally stored columns */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/***************************************************************//**
Inserts an entry into a secondary index. Tries first optimistic,
then pessimistic descent down the tree. If the entry matches enough
dict_index_t* index, /*!< in: secondary index */
dtuple_t* entry, /*!< in/out: index entry to insert */
que_thr_t* thr) /*!< in: query thread */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/***********************************************************//**
Inserts a row to a table. This is a high-level function used in
SQL execution graphs.
/*****************************************************************************
-Copyright (c) 2011, 2015, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 2011, 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
const ulint* col_map,/*!< in: mapping of old column
numbers to new ones, or NULL if !table */
const char* path) /*!< in: where to create temporary file */
- __attribute__((nonnull(1), warn_unused_result));
+ MY_ATTRIBUTE((nonnull(1), warn_unused_result));
/******************************************************//**
Free the row log for an index that was being created online. */
row_log_free(
/*=========*/
row_log_t*& log) /*!< in,own: row log */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/******************************************************//**
Free the row log for an index on which online creation was aborted. */
row_log_abort_sec(
/*==============*/
dict_index_t* index) /*!< in/out: index (x-latched) */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/******************************************************//**
Try to log an operation to a secondary index that is
const dtuple_t* tuple, /*!< in: index tuple */
trx_id_t trx_id) /*!< in: transaction ID for insert,
or 0 for delete */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/******************************************************//**
Logs an operation to a secondary index that is (or was) being created. */
UNIV_INTERN
const dtuple_t* tuple, /*!< in: index tuple */
trx_id_t trx_id) /*!< in: transaction ID for insert,
or 0 for delete */
- UNIV_COLD __attribute__((nonnull));
+ UNIV_COLD MY_ATTRIBUTE((nonnull));
/******************************************************//**
Gets the error status of the online index rebuild log.
/*====================*/
const dict_index_t* index) /*!< in: clustered index of a table
that is being rebuilt online */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/******************************************************//**
Logs a delete operation to a table that is being rebuilt.
const ulint* offsets,/*!< in: rec_get_offsets(rec,index) */
const byte* sys) /*!< in: DB_TRX_ID,DB_ROLL_PTR that should
be logged, or NULL to use those in rec */
- UNIV_COLD __attribute__((nonnull(1,2,3)));
+ UNIV_COLD MY_ATTRIBUTE((nonnull(1,2,3)));
/******************************************************//**
Logs an update operation to a table that is being rebuilt.
const ulint* offsets,/*!< in: rec_get_offsets(rec,index) */
const dtuple_t* old_pk) /*!< in: row_log_table_get_pk()
before the update */
- UNIV_COLD __attribute__((nonnull(1,2,3)));
+ UNIV_COLD MY_ATTRIBUTE((nonnull(1,2,3)));
/******************************************************//**
Constructs the old PRIMARY KEY and DB_TRX_ID,DB_ROLL_PTR
byte* sys, /*!< out: DB_TRX_ID,DB_ROLL_PTR for
row_log_table_delete(), or NULL */
mem_heap_t** heap) /*!< in/out: memory heap where allocated */
- UNIV_COLD __attribute__((nonnull(1,2,5), warn_unused_result));
+ UNIV_COLD MY_ATTRIBUTE((nonnull(1,2,5), warn_unused_result));
/******************************************************//**
Logs an insert to a table that is being rebuilt.
dict_index_t* index, /*!< in/out: clustered index, S-latched
or X-latched */
const ulint* offsets)/*!< in: rec_get_offsets(rec,index) */
- UNIV_COLD __attribute__((nonnull));
+ UNIV_COLD MY_ATTRIBUTE((nonnull));
/******************************************************//**
Notes that a BLOB is being freed during online ALTER TABLE. */
UNIV_INTERN
/*====================*/
dict_index_t* index, /*!< in/out: clustered index, X-latched */
ulint page_no)/*!< in: starting page number of the BLOB */
- UNIV_COLD __attribute__((nonnull));
+ UNIV_COLD MY_ATTRIBUTE((nonnull));
/******************************************************//**
Notes that a BLOB is being allocated during online ALTER TABLE. */
UNIV_INTERN
/*=====================*/
dict_index_t* index, /*!< in/out: clustered index, X-latched */
ulint page_no)/*!< in: starting page number of the BLOB */
- UNIV_COLD __attribute__((nonnull));
+ UNIV_COLD MY_ATTRIBUTE((nonnull));
/******************************************************//**
Apply the row_log_table log to a table upon completing rebuild.
@return DB_SUCCESS, or error code on failure */
/*!< in: old table */
struct TABLE* table) /*!< in/out: MySQL table
(for reporting duplicates) */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/******************************************************//**
Get the latest transaction ID that has invoked row_log_online_op()
row_log_get_max_trx(
/*================*/
dict_index_t* index) /*!< in: index, must be locked */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/******************************************************//**
Merge the row log to the index upon completing index creation.
dict_index_t* index, /*!< in/out: secondary index */
struct TABLE* table) /*!< in/out: MySQL table
(for reporting duplicates) */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
#ifndef UNIV_NONINL
#include "row0log.ic"
/*****************************************************************************
-Copyright (c) 2005, 2015, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 2005, 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
/*=================*/
row_merge_dup_t* dup, /*!< in/out: for reporting duplicates */
const dfield_t* entry) /*!< in: duplicate index entry */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/*********************************************************************//**
Sets an exclusive lock on a table, for the duration of creating indexes.
@return error code or DB_SUCCESS */
trx_t* trx, /*!< in/out: transaction */
dict_table_t* table, /*!< in: table to lock */
enum lock_mode mode) /*!< in: LOCK_X or LOCK_S */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/*********************************************************************//**
Drop indexes that were created before an error occurred.
The data dictionary must have been locked exclusively by the caller,
/*========================*/
trx_t* trx, /*!< in/out: dictionary transaction */
table_id_t table_id)/*!< in: table identifier */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/*********************************************************************//**
Drop those indexes which were created before an error occurred.
The data dictionary must have been locked exclusively by the caller,
dict_table_t* table, /*!< in/out: table containing the indexes */
ibool locked) /*!< in: TRUE=table locked,
FALSE=may need to do a lazy drop */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/*********************************************************************//**
Drop all partially created indexes during crash recovery. */
UNIV_INTERN
int
row_merge_file_create_low(
const char* path)
- __attribute__((warn_unused_result));
+ MY_ATTRIBUTE((warn_unused_result));
/*********************************************************************//**
Destroy a merge file. And de-register the file from Performance Schema
if UNIV_PFS_IO is defined. */
old_table->name */
const char* tmp_name, /*!< in: new name for old_table */
trx_t* trx) /*!< in/out: dictionary transaction */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/*********************************************************************//**
Rename an index in the dictionary that was created. The data
trx_t* trx, /*!< in/out: transaction */
table_id_t table_id, /*!< in: table identifier */
index_id_t index_id) /*!< in: index identifier */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/*********************************************************************//**
Rename an index in the dictionary that is to be dropped. The data
dictionary must have been locked exclusively by the caller, because
trx_t* trx, /*!< in/out: transaction */
table_id_t table_id, /*!< in: table identifier */
index_id_t index_id) /*!< in: index identifier */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/*********************************************************************//**
Create the index and load in to the dictionary.
@return index, or NULL on error */
/*=================*/
trx_t* trx, /*!< in: transaction */
dict_table_t* table) /*!< in: table instance to drop */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/*********************************************************************//**
Build indexes on a table by reading a clustered index,
creating a temporary file containing index entries, merge sorting
AUTO_INCREMENT column, or
ULINT_UNDEFINED if none is added */
ib_sequence_t& sequence) /*!< in/out: autoinc sequence */
- __attribute__((nonnull(1,2,3,5,6,8), warn_unused_result));
+ MY_ATTRIBUTE((nonnull(1,2,3,5,6,8), warn_unused_result));
/********************************************************************//**
Write a buffer to a block. */
UNIV_INTERN
const row_merge_buf_t* buf, /*!< in: sorted buffer */
const merge_file_t* of, /*!< in: output file */
row_merge_block_t* block) /*!< out: buffer for writing to file */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/********************************************************************//**
Sort a buffer. */
UNIV_INTERN
row_merge_buf_t* buf, /*!< in/out: sort buffer */
row_merge_dup_t* dup) /*!< in/out: reporter of duplicates
(NULL if non-unique index) */
- __attribute__((nonnull(1)));
+ MY_ATTRIBUTE((nonnull(1)));
/********************************************************************//**
Write a merge block to the file system.
@return TRUE if request was successful, FALSE if fail */
row_merge_buf_empty(
/*================*/
row_merge_buf_t* buf) /*!< in,own: sort buffer */
- __attribute__((warn_unused_result, nonnull));
+ MY_ATTRIBUTE((warn_unused_result, nonnull));
/** Create a merge file in the given location.
@param[out] merge_file merge file structure
index entries */
row_merge_block_t* block, /*!< in/out: 3 buffers */
int* tmpfd) /*!< in/out: temporary file handle */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/*********************************************************************//**
Allocate a sort buffer.
@return own: sort buffer */
row_merge_buf_create(
/*=================*/
dict_index_t* index) /*!< in: secondary index */
- __attribute__((warn_unused_result, nonnull, malloc));
+ MY_ATTRIBUTE((warn_unused_result, nonnull, malloc));
/*********************************************************************//**
Deallocate a sort buffer. */
UNIV_INTERN
row_merge_buf_free(
/*===============*/
row_merge_buf_t* buf) /*!< in,own: sort buffer to be freed */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/*********************************************************************//**
Destroy a merge file. */
UNIV_INTERN
row_merge_file_destroy(
/*===================*/
merge_file_t* merge_file) /*!< in/out: merge file structure */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/********************************************************************//**
Read a merge block from the file system.
@return TRUE if request was successful, FALSE if fail */
or NULL on end of list
(non-NULL on I/O error) */
ulint* offsets)/*!< out: offsets of mrec */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
#endif /* row0merge.h */
/*****************************************************************************
-Copyright (c) 2000, 2012, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 2000, 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
trx_t* trx, /*!< in: transaction */
que_thr_t* thr, /*!< in: query thread, or NULL */
trx_savept_t* savept) /*!< in: savepoint, or NULL */
- __attribute__((nonnull(1,2)));
+ MY_ATTRIBUTE((nonnull(1,2)));
/********************************************************************//**
Create a prebuilt struct for a MySQL table handle.
@return own: a prebuilt struct */
/*=============================*/
row_prebuilt_t* prebuilt) /*!< in: prebuilt struct in the MySQL
table handle */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/*********************************************************************//**
Sets a table lock on the table mentioned in prebuilt.
@return error code or DB_SUCCESS */
prebuilt->select_lock_type */
ulint mode) /*!< in: lock mode of table
(ignored if table==NULL) */
- __attribute__((nonnull(1)));
+ MY_ATTRIBUTE((nonnull(1)));
/*********************************************************************//**
Does an insert for MySQL.
@return error code or DB_SUCCESS */
byte* mysql_rec, /*!< in: row in the MySQL format */
row_prebuilt_t* prebuilt) /*!< in: prebuilt struct in MySQL
handle */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/*********************************************************************//**
Builds a dummy query graph used in selects. */
UNIV_INTERN
the MySQL format */
row_prebuilt_t* prebuilt) /*!< in: prebuilt struct in MySQL
handle */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/*********************************************************************//**
This can only be used when srv_locks_unsafe_for_binlog is TRUE or this
session is using a READ COMMITTED or READ UNCOMMITTED isolation level.
the records under pcur and
clust_pcur, and we do not need
to reposition the cursors. */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/*********************************************************************//**
Checks if a table name contains the string "/#sql" which denotes temporary
tables in MySQL.
bool
row_is_mysql_tmp_table_name(
/*========================*/
- const char* name) __attribute__((warn_unused_result));
+ const char* name) MY_ATTRIBUTE((warn_unused_result));
/*!< in: table name in the form
'database/tablename' */
upd_node_t* node, /*!< in: update node used in the cascade
or set null operation */
dict_table_t* table) /*!< in: table where we do the operation */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/*********************************************************************//**
Locks the data dictionary exclusively for performing a table create or other
data dictionary modification operation. */
added to the data dictionary cache) */
trx_t* trx, /*!< in/out: transaction */
bool commit) /*!< in: if true, commit the transaction */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/*********************************************************************//**
Does an index creation operation for MySQL. TODO: currently failure
to create an index results in dropping the whole table! This is no problem
index columns, which are
then checked for not being too
large. */
- __attribute__((nonnull(1,2), warn_unused_result));
+ MY_ATTRIBUTE((nonnull(1,2), warn_unused_result));
/*********************************************************************//**
Scans a table create SQL string and adds to the data dictionary
the foreign key constraints declared in the string. This function
ibool reject_fks) /*!< in: if TRUE, fail with error
code DB_CANNOT_ADD_CONSTRAINT if
any foreign keys are found. */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/*********************************************************************//**
The master thread in srv0srv.cc calls this regularly to drop tables which
we must drop in background after queries to them have ended. Such lazy
dict_table_t* table, /*!< in: table to lock */
enum lock_mode mode, /*!< in: LOCK_X or LOCK_S */
const char* op_info) /*!< in: string for trx->op_info */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/*********************************************************************//**
Truncates a table for MySQL.
/*=========================*/
dict_table_t* table, /*!< in: table handle */
trx_t* trx) /*!< in: transaction handle */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/*********************************************************************//**
Drops a table for MySQL. If the name of the dropped table ends in
one of "innodb_monitor", "innodb_lock_monitor", "innodb_tablespace_monitor",
bool nonatomic = true)
/*!< in: whether it is permitted
to release and reacquire dict_operation_lock */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/*********************************************************************//**
Drop all temporary tables during crash recovery. */
UNIV_INTERN
/*=============================*/
const char* name, /*!< in: table name */
trx_t* trx) /*!< in: transaction handle */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/*****************************************************************//**
Imports a tablespace. The space id in the .ibd file must match the space id
of the table in the data dictionary.
/*============================*/
dict_table_t* table, /*!< in/out: table */
row_prebuilt_t* prebuilt) /*!< in: prebuilt struct in MySQL */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/*********************************************************************//**
Drops a database for MySQL.
@return error code or DB_SUCCESS */
/*========================*/
const char* name, /*!< in: database name which ends to '/' */
trx_t* trx) /*!< in: transaction handle */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/*********************************************************************//**
Renames a table for MySQL.
@return error code or DB_SUCCESS */
const char* new_name, /*!< in: new table name */
trx_t* trx, /*!< in/out: transaction */
bool commit) /*!< in: whether to commit trx */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/*********************************************************************//**
Checks that the index contains entries in an ascending order, unique
constraint is not broken, and calculates the number of index entries
const dict_index_t* index, /*!< in: index */
ulint* n_rows) /*!< out: number of entries
seen in the consistent read */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/*********************************************************************//**
Determines if a table is a magic monitor table.
@return true if monitor table */
/*=======================*/
const char* table_name) /*!< in: name of the table, in the
form database/table_name */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/*********************************************************************//**
Initialize this module */
UNIV_INTERN
dict_table_t* table, /*!< in/out: table */
trx_t* trx, /*!< in/out: transaction */
table_id_t* new_id) /*!< out: new table id */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/* A struct describing a place for an individual column in the MySQL
row format which is presented to the table handler in ha_innobase.
/*****************************************************************************
-Copyright (c) 1997, 2015, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1997, 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
que_thr_t* parent, /*!< in: parent node, i.e., a
thr node */
mem_heap_t* heap) /*!< in: memory heap where created */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/***********************************************************//**
Determines if it is possible to remove a secondary index entry.
Removal is possible if the secondary index entry does not refer to any
purge_node_t* node, /*!< in/out: row purge node */
dict_index_t* index, /*!< in: secondary index */
const dtuple_t* entry) /*!< in: secondary index entry */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/***************************************************************
Does the purge operation for a single undo log record. This is a high-level
function used in an SQL execution graph.
row_purge_step(
/*===========*/
que_thr_t* thr) /*!< in: query thread */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/* Purge node structure */
/*****************************************************************************
-Copyright (c) 2012, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 2012, 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
/*====================*/
dict_table_t* table, /*!< in: quiesce this table */
trx_t* trx) /*!< in/out: transaction/session */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/*********************************************************************//**
Set a table's quiesce state.
dict_table_t* table, /*!< in: quiesce this table */
ib_quiesce_t state, /*!< in: quiesce state to set */
trx_t* trx) /*!< in/out: transaction */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/*********************************************************************//**
Cleanup after table quiesce. */
/*=======================*/
dict_table_t* table, /*!< in: quiesce this table */
trx_t* trx) /*!< in/out: transaction/session */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
#ifndef UNIV_NONINL
#include "row0quiesce.ic"
/*****************************************************************************
-Copyright (c) 1996, 2012, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1996, 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
/*==================*/
const dict_index_t* index, /*!< in: clustered index */
const ulint* offsets)/*!< in: record offsets */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/*********************************************************************//**
Reads the trx id field from a clustered index record.
@return value of the field */
const rec_t* rec, /*!< in: record */
const dict_index_t* index, /*!< in: clustered index */
const ulint* offsets)/*!< in: rec_get_offsets(rec, index) */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/*********************************************************************//**
Reads the roll pointer field from a clustered index record.
@return value of the field */
const rec_t* rec, /*!< in: record */
const dict_index_t* index, /*!< in: clustered index */
const ulint* offsets)/*!< in: rec_get_offsets(rec, index) */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/*****************************************************************//**
When an insert or purge to a table is performed, this function builds
the entry to be inserted into or purged from an index on the table.
mem_heap_t* heap) /*!< in: memory heap from which
the memory for the index entry
is allocated */
- __attribute__((warn_unused_result, nonnull(1,3,4)));
+ MY_ATTRIBUTE((warn_unused_result, nonnull(1,3,4)));
/*****************************************************************//**
When an insert or purge to a table is performed, this function builds
the entry to be inserted into or purged from an index on the table.
mem_heap_t* heap) /*!< in: memory heap from which
the memory for the index entry
is allocated */
- __attribute__((warn_unused_result, nonnull(1,3,4)));
+ MY_ATTRIBUTE((warn_unused_result, nonnull(1,3,4)));
/*******************************************************************//**
An inverse function to row_build_index_entry. Builds a row from a
record in a clustered index.
prefixes, or NULL */
mem_heap_t* heap) /*!< in: memory heap from which
the memory needed is allocated */
- __attribute__((nonnull(2,3,9)));
+ MY_ATTRIBUTE((nonnull(2,3,9)));
/*******************************************************************//**
Converts an index record to a typed data tuple.
@return index entry built; does not set info_bits, and the data fields
stored columns */
mem_heap_t* heap) /*!< in: memory heap from which
the memory needed is allocated */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/*******************************************************************//**
Converts an index record to a typed data tuple. NOTE that externally
stored (often big) fields are NOT copied to heap.
stored columns */
mem_heap_t* heap) /*!< in: memory heap from which
the memory needed is allocated */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/*******************************************************************//**
Builds from a secondary index record a row reference with which we can
search the clustered index record.
as long as the row reference is used! */
mem_heap_t* heap) /*!< in: memory heap from which the memory
needed is allocated */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/*******************************************************************//**
Builds from a secondary index record a row reference with which we can
search the clustered index record. */
ulint* offsets,/*!< in: rec_get_offsets(rec, index)
or NULL */
trx_t* trx) /*!< in: transaction or NULL */
- __attribute__((nonnull(1,2,3)));
+ MY_ATTRIBUTE((nonnull(1,2,3)));
/*******************************************************************//**
Builds from a secondary index record a row reference with which we can
search the clustered index record. */
const dict_table_t* table, /*!< in: table */
const dtuple_t* ref, /*!< in: row reference */
mtr_t* mtr) /*!< in/out: mtr */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/*********************************************************************//**
Fetches the clustered index record for a secondary index record. The latches
on the secondary index record are preserved.
dict_index_t* index, /*!< in: secondary index */
dict_index_t** clust_index,/*!< out: clustered index */
mtr_t* mtr) /*!< in: mtr */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/** Result of row_search_index_entry */
enum row_search_result {
btr_pcur_t* pcur, /*!< in/out: persistent cursor, which must
be closed by the caller */
mtr_t* mtr) /*!< in: mtr */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
#define ROW_COPY_DATA 1
#define ROW_COPY_POINTERS 2
char* buf, /*!< out: output buffer */
ulint buf_size) /*!< in: output buffer size
in bytes */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
#ifndef UNIV_NONINL
#include "row0row.ic"
/*****************************************************************************
-Copyright (c) 1997, 2012, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1997, 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
then prebuilt must have a pcur
with stored position! In opening of a
cursor 'direction' should be 0. */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/*******************************************************************//**
Checks if MySQL at the moment is allowed for this table to retrieve a
consistent read result, or store it to the query cache.
dict_index_t* index, /*!< in: index to search */
const char* col_name, /*!< in: autoinc column name */
ib_uint64_t* value) /*!< out: AUTOINC value read */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/** A structure for caching column values for prefetched rows */
struct sel_buf_t{
/*****************************************************************************
-Copyright (c) 1997, 2012, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1997, 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
row_undo_ins(
/*=========*/
undo_node_t* node) /*!< in: row undo node */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
#ifndef UNIV_NONINL
#include "row0uins.ic"
#endif
/*****************************************************************************
-Copyright (c) 1997, 2012, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1997, 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
/*=========*/
undo_node_t* node, /*!< in: row undo node */
que_thr_t* thr) /*!< in: query thread */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
#ifndef UNIV_NONINL
#include "row0umod.ic"
/*****************************************************************************
-Copyright (c) 1996, 2012, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1996, 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
/*======================*/
const upd_t* update, /*!< in: update vector */
ulint no) /*!< in: field_no */
- __attribute__((nonnull, pure));
+ MY_ATTRIBUTE((nonnull, pure));
/*********************************************************************//**
Writes into the redo log the values of trx id and roll ptr and enough info
to determine their positions within a clustered index record.
row_upd_changes_disowned_external(
/*==============================*/
const upd_t* update) /*!< in: update vector */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
#endif /* !UNIV_HOTBACKUP */
/***********************************************************//**
Replaces the new column values stored in the update vector to the
const ulint* offsets,/*!< in: rec_get_offsets(rec, index) */
const dtuple_t* entry, /*!< in: entry to insert */
mem_heap_t* heap) /*!< in: memory heap from which allocated */
- __attribute__((warn_unused_result, nonnull));
+ MY_ATTRIBUTE((warn_unused_result, nonnull));
/***************************************************************//**
Builds an update vector from those fields, excluding the roll ptr and
trx id fields, which in an index entry differ from a record that has
trx_t* trx, /*!< in: transaction (for diagnostics),
or NULL */
mem_heap_t* heap) /*!< in: memory heap from which allocated */
- __attribute__((nonnull(1,2,3,7), warn_unused_result));
+ MY_ATTRIBUTE((nonnull(1,2,3,7), warn_unused_result));
/***********************************************************//**
Replaces the new column values stored in the update vector to the index entry
given. */
does not work for non-clustered indexes. */
mem_heap_t* heap) /*!< in: memory heap for allocating and
copying the new values */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/***********************************************************//**
Replaces the new column values stored in the update vector to the index entry
given. */
an upd_field is the clustered index position */
mem_heap_t* heap) /*!< in: memory heap for allocating and
copying the new values */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/***********************************************************//**
Replaces the new column values stored in the update vector. */
UNIV_INTERN
compile time */
const row_ext_t*ext) /*!< NULL, or prefixes of the externally
stored columns in the old row */
- __attribute__((nonnull(1,2), warn_unused_result));
+ MY_ATTRIBUTE((nonnull(1,2), warn_unused_result));
#ifdef UNIV_DEBUG
# define row_upd_changes_ord_field_binary(index,update,thr,row,ext) \
row_upd_changes_ord_field_binary_func(index,update,thr,row,ext)
/*===================*/
dict_table_t* table, /*!< in: table */
upd_field_t* upd_field) /*!< in: field to check */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/***********************************************************//**
Checks if an update vector changes an ordering field of an index record.
This function is fast if the update vector is short or the number of ordering
/*****************************************************************************
-Copyright (c) 1997, 2012, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1997, 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
if the history is missing or the record
does not exist in the view, that is,
it was freshly inserted afterwards */
- __attribute__((nonnull(1,2,3,4,5,6,7)));
+ MY_ATTRIBUTE((nonnull(1,2,3,4,5,6,7)));
/*****************************************************************//**
Constructs the last committed version of a clustered index record,
const rec_t** old_vers)/*!< out: rec, old version, or NULL if the
record does not exist in the view, that is,
it was freshly inserted afterwards */
- __attribute__((nonnull(1,2,3,4,5)));
+ MY_ATTRIBUTE((nonnull(1,2,3,4,5)));
#ifndef UNIV_NONINL
/*****************************************************************************
-Copyright (c) 1995, 2015, Oracle and/or its affiliates. All rights reserved.
+Copyright (c) 1995, 2016, Oracle and/or its affiliates. All rights reserved.
Copyright (c) 2008, 2009, Google Inc.
Copyright (c) 2009, Percona Inc.
os_thread_ret_t
DECLARE_THREAD(srv_purge_coordinator_thread)(
/*=========================================*/
- void* arg __attribute__((unused))); /*!< in: a dummy parameter
+ void* arg MY_ATTRIBUTE((unused))); /*!< in: a dummy parameter
required by os_thread_create */
/*********************************************************************//**
os_thread_ret_t
DECLARE_THREAD(srv_worker_thread)(
/*==============================*/
- void* arg __attribute__((unused))); /*!< in: a dummy parameter
+ void* arg MY_ATTRIBUTE((unused))); /*!< in: a dummy parameter
required by os_thread_create */
} /* extern "C" */
/*****************************************************************************
-Copyright (c) 1995, 2012, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1995, 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
ulint dest_len, /*!< in: max bytes to copy */
const char* basedir, /*!< in: base directory */
const char* table_name) /*!< in: source table name */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/*****************************************************************//**
Get the meta-data filename from the table name. */
dict_table_t* table, /*!< in: table */
char* filename, /*!< out: filename */
ulint max_len) /*!< in: filename max length */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/** Log sequence number at shutdown */
extern lsn_t srv_shutdown_lsn;
/*****************************************************************************
-Copyright (c) 1995, 2013, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1995, 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
/*========================*/
os_thread_id_t* waiter, /*!< out: longest waiting thread */
const void** sema) /*!< out: longest-waited-for semaphore */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/********************************************************************//**
Validates the integrity of the wait array. Checks
that the number of reserved cells equals the count variable. */
/*****************************************************************************
-Copyright (c) 1995, 2014, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1995, 2016, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2008, Google Inc.
Portions of this file contain modifications contributed and copyrighted by
rw_lock_s_lock_low(
/*===============*/
rw_lock_t* lock, /*!< in: pointer to rw-lock */
- ulint pass __attribute__((unused)),
+ ulint pass MY_ATTRIBUTE((unused)),
/*!< in: pass value; != 0, if the lock will be
passed to another thread to unlock */
const char* file_name, /*!< in: file name where lock requested */
rw_lock_t* lock, /*!< in: rw-lock */
ulint lock_type) /*!< in: lock type: RW_LOCK_SHARED,
RW_LOCK_EX */
- __attribute__((warn_unused_result));
+ MY_ATTRIBUTE((warn_unused_result));
#endif /* UNIV_SYNC_DEBUG */
/******************************************************************//**
Checks if somebody has locked the rw-lock in the specified mode. */
/*****************************************************************************
-Copyright (c) 1995, 2011, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1995, 2016, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2008, Google Inc.
Portions of this file contain modifications contributed and copyrighted by
rw_lock_s_lock_low(
/*===============*/
rw_lock_t* lock, /*!< in: pointer to rw-lock */
- ulint pass __attribute__((unused)),
+ ulint pass MY_ATTRIBUTE((unused)),
/*!< in: pass value; != 0, if the lock will be
passed to another thread to unlock */
const char* file_name, /*!< in: file name where lock requested */
/*****************************************************************************
-Copyright (c) 1995, 2015, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1995, 2016, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2008, Google Inc.
Copyright (c) 2012, Facebook Inc.
mutex_own(
/*======*/
const ib_mutex_t* mutex) /*!< in: mutex */
- __attribute__((warn_unused_result));
+ MY_ATTRIBUTE((warn_unused_result));
#endif /* UNIV_DEBUG */
#ifdef UNIV_SYNC_DEBUG
/******************************************************************//**
ulint level, /*!< in: level in the latching order; if
SYNC_LEVEL_VARYING, nothing is done */
ibool relock) /*!< in: TRUE if re-entering an x-lock */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/******************************************************************//**
Removes a latch from the thread level array if it is found there.
@return TRUE if found in the array; it is no error if the latch is
/*============================*/
ibool dict_mutex_allowed) /*!< in: TRUE if dictionary mutex is
allowed to be owned by the thread */
- __attribute__((warn_unused_result));
+ MY_ATTRIBUTE((warn_unused_result));
/******************************************************************//**
Checks if the level array for the current thread is empty,
except for data dictionary latches. */
ibool has_search_latch)
/*!< in: TRUE if and only if the thread
is supposed to hold btr_search_latch */
- __attribute__((warn_unused_result));
+ MY_ATTRIBUTE((warn_unused_result));
/******************************************************************//**
Gets the debug information for a reserved mutex. */
/*****************************************************************************
-Copyright (c) 1996, 2013, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1996, 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
trx_undo_rec_get_offset(
/*====================*/
undo_no_t undo_no) /*!< in: undo no read from node */
- __attribute__((const));
+ MY_ATTRIBUTE((const));
/**********************************************************************//**
Returns the start of the undo record data area. */
externally stored fild */
undo_no_t* undo_no, /*!< out: undo log record number */
table_id_t* table_id) /*!< out: table id */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/*******************************************************************//**
Builds a row reference from an undo log record.
@return pointer to remaining part of undo record */
only in the assertion. */
mem_heap_t* heap) /*!< in: memory heap from which the memory
needed is allocated */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/***********************************************************************//**
Writes information to an undo log about an insert, update, or a delete marking
of a clustered index record. This information is used in a rollback of the
inserted undo log record,
0 if BTR_NO_UNDO_LOG
flag was specified */
- __attribute__((nonnull(3,4,10), warn_unused_result));
+ MY_ATTRIBUTE((nonnull(3,4,10), warn_unused_result));
/******************************************************************//**
Copies an undo record to heap. This function can be called if we know that
the undo log record exists.
/*======================*/
roll_ptr_t roll_ptr, /*!< in: roll pointer to record */
mem_heap_t* heap) /*!< in: memory heap where copied */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/*******************************************************************//**
Build a previous version of a clustered index record. The caller must
hold a latch on the index page of the clustered index record.
rec_t** old_vers)/*!< out, own: previous version, or NULL if
rec is the first inserted version, or if
history data has been deleted */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
#endif /* !UNIV_HOTBACKUP */
/***********************************************************//**
Parses a redo log record of adding an undo log record.
/*****************************************************************************
-Copyright (c) 1996, 2014, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1996, 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
os_thread_ret_t
DECLARE_THREAD(trx_rollback_or_clean_all_recovered)(
/*================================================*/
- void* arg __attribute__((unused)));
+ void* arg MY_ATTRIBUTE((unused)));
/*!< in: a dummy parameter required by
os_thread_create */
/*********************************************************************//**
trx_rollback_for_mysql(
/*===================*/
trx_t* trx) /*!< in/out: transaction */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/*******************************************************************//**
Rollback the latest SQL statement for MySQL.
@return error code or DB_SUCCESS */
trx_rollback_last_sql_stat_for_mysql(
/*=================================*/
trx_t* trx) /*!< in/out: transaction */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/*******************************************************************//**
Rollback a transaction to a given savepoint or do a complete rollback.
@return error code or DB_SUCCESS */
trx_savept_t* savept) /*!< in: pointer to savepoint undo number, if
partial rollback requested, or NULL for
complete rollback */
- __attribute__((nonnull(1)));
+ MY_ATTRIBUTE((nonnull(1)));
/*******************************************************************//**
Rolls back a transaction back to a named savepoint. Modifications after the
savepoint are undone but InnoDB does NOT release the corresponding locks
information to remove the
binlog entries of the queries
executed after the savepoint */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/*******************************************************************//**
Creates a named savepoint. If the transaction is not yet started, starts it.
If there is already a savepoint of the same name, this call erases that old
position corresponding to this
connection at the time of the
savepoint */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/*******************************************************************//**
Releases a named savepoint. Savepoints which
were set after this savepoint are deleted.
/*============================*/
trx_t* trx, /*!< in: transaction handle */
const char* savepoint_name) /*!< in: savepoint name */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/*******************************************************************//**
Frees savepoint structs starting from savep. */
UNIV_INTERN
/*****************************************************************************
-Copyright (c) 1996, 2012, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1996, 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
trx_in_trx_list(
/*============*/
const trx_t* in_trx) /*!< in: transaction */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
#endif /* UNIV_DEBUG */
#if defined UNIV_DEBUG || defined UNIV_BLOB_LIGHT_DEBUG
/***********************************************************//**
trx_assert_recovered(
/*=================*/
trx_id_t trx_id) /*!< in: transaction identifier */
- __attribute__((warn_unused_result));
+ MY_ATTRIBUTE((warn_unused_result));
#endif /* UNIV_DEBUG || UNIV_BLOB_LIGHT_DEBUG */
/*****************************************************************//**
Updates the offset information about the end of the MySQL binlog entry
/*****************************************************************************
-Copyright (c) 1996, 2013, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1996, 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
trx_free_prepared(
/*==============*/
trx_t* trx) /*!< in, own: trx object */
- UNIV_COLD __attribute__((nonnull));
+ UNIV_COLD MY_ATTRIBUTE((nonnull));
/********************************************************************//**
Frees a transaction object for MySQL. */
UNIV_INTERN
/*==================*/
trx_t* trx, /*!< in/out: transaction */
trx_dict_op_t op) /*!< in: dictionary operation type */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
#ifdef UNIV_DEBUG
#define trx_start_for_ddl(t, o) \
trx_commit(
/*=======*/
trx_t* trx) /*!< in/out: transaction */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/****************************************************************//**
Commits a transaction and a mini-transaction. */
UNIV_INTERN
trx_t* trx, /*!< in/out: transaction */
mtr_t* mtr) /*!< in/out: mini-transaction (will be committed),
or NULL if trx made no modifications */
- __attribute__((nonnull(1)));
+ MY_ATTRIBUTE((nonnull(1)));
/****************************************************************//**
Cleans up a transaction at database startup. The cleanup is needed if
the transaction already got to the middle of a commit when the database
trx_commit_complete_for_mysql(
/*==========================*/
trx_t* trx) /*!< in/out: transaction */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/**********************************************************************//**
Marks the latest SQL statement ended. */
UNIV_INTERN
/*!< in: length of trx->lock.trx_locks */
ulint heap_size)
/*!< in: mem_heap_get_size(trx->lock.lock_heap) */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/**********************************************************************//**
Prints info about a transaction.
const trx_t* trx, /*!< in: transaction */
ulint max_query_len) /*!< in: max query length to print,
or 0 to use the default max length */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/**********************************************************************//**
Prints info about a transaction.
const trx_t* trx, /*!< in: transaction */
ulint max_query_len) /*!< in: max query length to print,
or 0 to use the default max length */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/**********************************************************************//**
Determine if a transaction is a dictionary operation.
trx_get_dict_operation(
/*===================*/
const trx_t* trx) /*!< in: transaction */
- __attribute__((pure));
+ MY_ATTRIBUTE((pure));
/**********************************************************************//**
Flag a transaction a dictionary operation. */
UNIV_INLINE
if state != TRX_STATE_NOT_STARTED
asserts that
trx->state != TRX_STATE_NOT_STARTED */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
# ifdef UNIV_DEBUG
/**********************************************************************//**
Asserts that a transaction has been started.
trx_assert_started(
/*===============*/
const trx_t* trx) /*!< in: transaction */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
# endif /* UNIV_DEBUG */
/**********************************************************************//**
/*****************************************************************************
-Copyright (c) 1996, 2013, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1996, 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
trx_undo_trx_id_is_insert(
/*======================*/
const byte* trx_id) /*!< in: DB_TRX_ID, followed by DB_ROLL_PTR */
- __attribute__((nonnull, pure, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, pure, warn_unused_result));
#endif /* !UNIV_HOTBACKUP */
/*****************************************************************//**
Writes a roll ptr to an index page. In case that the size changes in
mtr_t* mtr) /*!< in: mtr which does not have a latch to any
undo log page; the caller must have reserved
the rollback segment mutex */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/********************************************************************//**
Frees the last undo log page.
The caller must hold the rollback segment mutex. */
mtr_t* mtr) /*!< in/out: mini-transaction which does not
have a latch to any undo log page or which
has allocated the undo log page */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
#ifdef UNIV_DEBUG
# define trx_undo_free_last_page(trx,undo,mtr) \
trx_undo_free_last_page_func(trx,undo,mtr)
trx_undo_t* undo, /*!< in/out: undo log */
undo_no_t limit) /*!< in: all undo records with undo number
>= this value should be truncated */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
#ifdef UNIV_DEBUG
# define trx_undo_truncate_end(trx,undo,limit) \
trx_undo_truncate_end_func(trx,undo,limit)
/*=================*/
trx_t* trx, /*!< in: transaction */
ulint type) /*!< in: TRX_UNDO_INSERT or TRX_UNDO_UPDATE */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/******************************************************************//**
Sets the state of the undo log segment at a transaction finish.
@return undo log segment header page, x-latched */
trx_undo_free_prepared(
/*===================*/
trx_t* trx) /*!< in/out: PREPARED transaction */
- UNIV_COLD __attribute__((nonnull));
+ UNIV_COLD MY_ATTRIBUTE((nonnull));
#endif /* !UNIV_HOTBACKUP */
/***********************************************************//**
Parses the redo log entry of an undo log page initialization.
/*****************************************************************************
-Copyright (c) 1994, 2013, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1994, 2016, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2008, Google Inc.
Portions of this file contain modifications contributed and copyrighted by
GCC visibility directive on all Sun operating systems because there is no
easy way to get it to work. See http://bugs.mysql.com/bug.php?id=52263. */
#if defined(__GNUC__) && (__GNUC__ >= 4) && !defined(sun) || defined(__INTEL_COMPILER)
-# define UNIV_INTERN __attribute__((visibility ("hidden")))
+# define UNIV_INTERN MY_ATTRIBUTE((visibility ("hidden")))
#else
# define UNIV_INTERN
#endif
program. The paths leading to call of cold functions within code are
marked as unlikely by the branch prediction mechanism. optimize a
rarely invoked function for size instead for speed. */
-# define UNIV_COLD __attribute__((cold))
+# define UNIV_COLD MY_ATTRIBUTE((cold))
#else
# define UNIV_COLD /* empty */
#endif
#if defined(__GNUC__) && (__GNUC__ > 2) && ! defined(__INTEL_COMPILER)
#define HAVE_GCC_GT_2
/* Tell the compiler that variable/function is unused. */
-# define UNIV_UNUSED __attribute__ ((unused))
+# define UNIV_UNUSED MY_ATTRIBUTE ((unused))
#else
# define UNIV_UNUSED
#endif /* CHECK FOR GCC VER_GT_2 */
/*****************************************************************************
-Copyright (c) 1994, 2009, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1994, 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
/*==========*/
ulint high, /*!< in: high-order 32 bits */
ulint low) /*!< in: low-order 32 bits */
- __attribute__((const));
+ MY_ATTRIBUTE((const));
/********************************************************//**
Rounds a 64-bit integer downward to a multiple of a power of 2.
/*==========*/
const void* ptr, /*!< in: pointer */
ulint align_no) /*!< in: align by this number */
- __attribute__((const));
+ MY_ATTRIBUTE((const));
/*********************************************************//**
The following function computes the offset of a pointer from the nearest
aligned address.
/*============*/
const void* ptr, /*!< in: pointer */
ulint align_no) /*!< in: align by this number */
- __attribute__((const));
+ MY_ATTRIBUTE((const));
/*****************************************************************//**
Gets the nth bit of a ulint.
@return TRUE if nth bit is 1; 0th bit is defined to be the least significant */
/*****************************************************************************
-Copyright (c) 1994, 2009, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1994, 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
const char* expr, /*!< in: the failed assertion */
const char* file, /*!< in: source file containing the assertion */
ulint line) /*!< in: line number of the assertion */
- UNIV_COLD __attribute__((nonnull(2)));
+ UNIV_COLD MY_ATTRIBUTE((nonnull(2)));
/** Abort the execution. */
# define UT_DBG_PANIC abort()
/*****************************************************************************
-Copyright (c) 1994, 2011, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1994, 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
ulint n, /*!< in: number of bytes to allocate */
ibool assert_on_error) /*!< in: if TRUE, we crash mysqld if
the memory cannot be allocated */
- __attribute__((malloc));
+ MY_ATTRIBUTE((malloc));
/**********************************************************************//**
Allocates memory. */
#define ut_malloc(n) ut_malloc_low(n, TRUE)
/*****************************************************************************
-Copyright (c) 1994, 2009, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1994, 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
ut_fold_ull(
/*========*/
ib_uint64_t d) /*!< in: 64-bit integer */
- __attribute__((const));
+ MY_ATTRIBUTE((const));
/*************************************************************//**
Folds a character string ending in the null character.
@return folded value */
ut_fold_string(
/*===========*/
const char* str) /*!< in: null-terminated string */
- __attribute__((pure));
+ MY_ATTRIBUTE((pure));
/***********************************************************//**
Looks for a prime number slightly greater than the given argument.
The prime is chosen so that it is not near any power of 2.
ut_find_prime(
/*==========*/
ulint n) /*!< in: positive number > 100 */
- __attribute__((const));
+ MY_ATTRIBUTE((const));
#endif /* !UNIV_INNOCHECKSUM */
/*===============*/
ulint n1, /*!< in: ulint */
ulint n2) /*!< in: ulint */
- __attribute__((const));
+ MY_ATTRIBUTE((const));
/*************************************************************//**
Folds a binary string.
@return folded value */
/*===========*/
const byte* str, /*!< in: string of bytes */
ulint len) /*!< in: length */
- __attribute__((pure));
+ MY_ATTRIBUTE((pure));
#ifndef UNIV_NONINL
/*****************************************************************************
-Copyright (c) 1994, 2014, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1994, 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
ut_2_power_up(
/*==========*/
ulint n) /*!< in: number != 0 */
- __attribute__((const));
+ MY_ATTRIBUTE((const));
/** Determine how many bytes (groups of 8 bits) are needed to
store the given number of bits.
ut_print_timestamp(
/*===============*/
FILE* file) /*!< in: file where to print */
- UNIV_COLD __attribute__((nonnull));
+ UNIV_COLD MY_ATTRIBUTE((nonnull));
#ifndef UNIV_INNOCHECKSUM
ulint* aux_arr, /*!< in/out: aux array to use in sort */
ulint low, /*!< in: lower bound */
ulint high) /*!< in: upper bound */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
#ifndef UNIV_NONINL
#include "ut0ut.ic"
/*****************************************************************************
-Copyright (c) 1996, 2015, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1996, 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
lock_rec_validate_page(
/*===================*/
const buf_block_t* block) /*!< in: buffer block */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
#endif /* UNIV_DEBUG */
/* The lock system */
#ifdef UNIV_DEBUG
UNIV_INTERN
#else
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
#endif
bool
lock_check_trx_id_sanity(
wsrep_kill_victim(const trx_t * const trx, const lock_t *lock) {
ut_ad(lock_mutex_own());
ut_ad(trx_mutex_own(lock->trx));
+
+ /* quit for native mysql */
+ if (!wsrep_on(trx->mysql_thd)) return;
+
my_bool bf_this = wsrep_thd_is_BF(trx->mysql_thd, FALSE);
my_bool bf_other = wsrep_thd_is_BF(lock->trx->mysql_thd, TRUE);
#ifdef WITH_WSREP
if (lock_rec_has_to_wait(TRUE, trx, mode, lock, is_supremum)) {
- trx_mutex_enter(lock->trx);
- wsrep_kill_victim(trx, lock);
- trx_mutex_exit(lock->trx);
+ if (wsrep_on(trx->mysql_thd)) {
+ trx_mutex_enter(lock->trx);
+ wsrep_kill_victim(trx, lock);
+ trx_mutex_exit(lock->trx);
+ }
#else
if (lock_rec_has_to_wait(trx, mode, lock, is_supremum)) {
#endif /* WITH_WSREP */
#ifdef WITH_WSREP
- if (c_lock && wsrep_thd_is_BF(trx->mysql_thd, FALSE)) {
+ if (c_lock &&
+ wsrep_on(trx->mysql_thd) &&
+ wsrep_thd_is_BF(trx->mysql_thd, FALSE)) {
lock_t *hash = (lock_t *)c_lock->hash;
lock_t *prev = NULL;
ut_ad(heap_no == ULINT_UNDEFINED);
ut_ad(lock_get_type_low(lock) == LOCK_TABLE);
- lock = UT_LIST_GET_PREV(un_member.tab_lock.locks, lock);
+ lock = UT_LIST_GET_NEXT(un_member.tab_lock.locks, lock);
}
} while (lock != NULL
&& lock->trx->lock.deadlock_mark > ctx->mark_start);
} else {
*heap_no = ULINT_UNDEFINED;
ut_ad(lock_get_type_low(lock) == LOCK_TABLE);
- lock = UT_LIST_GET_PREV(un_member.tab_lock.locks, lock);
+ dict_table_t* table = lock->un_member.tab_lock.table;
+ lock = UT_LIST_GET_FIRST(table->locks);
}
ut_a(lock != NULL);
UT_LIST_ADD_LAST(trx_locks, trx->lock.trx_locks, lock);
#ifdef WITH_WSREP
- if (c_lock && wsrep_thd_is_BF(trx->mysql_thd, FALSE)) {
- UT_LIST_INSERT_AFTER(
- un_member.tab_lock.locks, table->locks, c_lock, lock);
- } else {
- UT_LIST_ADD_LAST(un_member.tab_lock.locks, table->locks, lock);
- }
+ if(wsrep_on(trx->mysql_thd)) {
+ if (c_lock && wsrep_thd_is_BF(trx->mysql_thd, FALSE)) {
+ UT_LIST_INSERT_AFTER(
+ un_member.tab_lock.locks, table->locks, c_lock, lock);
+ } else {
+ UT_LIST_ADD_LAST(
+ un_member.tab_lock.locks, table->locks, lock);
+ }
- if (c_lock) trx_mutex_enter(c_lock->trx);
- if (c_lock && c_lock->trx->lock.que_state == TRX_QUE_LOCK_WAIT) {
+ if (c_lock) trx_mutex_enter(c_lock->trx);
+ if (c_lock && c_lock->trx->lock.que_state == TRX_QUE_LOCK_WAIT) {
- c_lock->trx->lock.was_chosen_as_deadlock_victim = TRUE;
+ c_lock->trx->lock.was_chosen_as_deadlock_victim = TRUE;
- if (wsrep_debug) wsrep_print_wait_locks(c_lock);
+ if (wsrep_debug) wsrep_print_wait_locks(c_lock);
- /* have to release trx mutex for the duration of
- victim lock release. This will eventually call
- lock_grant, which wants to grant trx mutex again
- */
- /* caller has trx_mutex, have to release for lock cancel */
- trx_mutex_exit(trx);
- lock_cancel_waiting_and_release(c_lock->trx->lock.wait_lock);
- trx_mutex_enter(trx);
+ /* have to release trx mutex for the duration of
+ victim lock release. This will eventually call
+ lock_grant, which wants to grant trx mutex again
+ */
+ /* caller has trx_mutex, have to release for lock cancel */
+ trx_mutex_exit(trx);
+ lock_cancel_waiting_and_release(
+ c_lock->trx->lock.wait_lock);
+ trx_mutex_enter(trx);
- /* trx might not wait for c_lock, but some other lock
- does not matter if wait_lock was released above
- */
- if (c_lock->trx->lock.wait_lock == c_lock) {
- lock_reset_lock_and_trx_wait(lock);
- }
+ /* trx might not wait for c_lock, but some other lock
+ does not matter if wait_lock was released above
+ */
+ if (c_lock->trx->lock.wait_lock == c_lock) {
+ lock_reset_lock_and_trx_wait(lock);
+ }
- if (wsrep_debug) {
- fprintf(stderr, "WSREP: c_lock canceled %llu\n",
- (ulonglong) c_lock->trx->id);
+ if (wsrep_debug) {
+ fprintf(stderr, "WSREP: c_lock canceled %llu\n",
+ (ulonglong) c_lock->trx->id);
+ }
}
- }
- if (c_lock) trx_mutex_exit(c_lock->trx);
-#else
+ if (c_lock) trx_mutex_exit(c_lock->trx);
+ } else {
+#endif /* WITH_WSREP */
UT_LIST_ADD_LAST(un_member.tab_lock.locks, table->locks, lock);
+#ifdef WITH_WSREP
+ }
#endif /* WITH_WSREP */
if (UNIV_UNLIKELY(type_mode & LOCK_WAIT)) {
&& (wait || !lock_get_wait(lock))) {
#ifdef WITH_WSREP
- if (wsrep_debug)
- fprintf(stderr, "WSREP: table lock abort");
- trx_mutex_enter(lock->trx);
- wsrep_kill_victim((trx_t *)trx, (lock_t *)lock);
- trx_mutex_exit(lock->trx);
+ if (wsrep_on(trx->mysql_thd)) {
+ if (wsrep_debug)
+ fprintf(stderr,
+ "WSREP: table lock abort");
+ trx_mutex_enter(lock->trx);
+ wsrep_kill_victim((trx_t *)trx, (lock_t *)lock);
+ trx_mutex_exit(lock->trx);
+ }
#endif
return(lock);
}
dberr_t err;
const lock_t* wait_for;
- ut_ad(table && thr);
+ ut_ad(table != NULL);
+ ut_ad(thr != NULL);
if (flags & BTR_NO_LOCKING_FLAG) {
/*********************************************************************//**
Validate record locks up to a limit.
@return lock at limit or NULL if no more locks in the hash bucket */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
const lock_t*
lock_rec_validate(
/*==============*/
/*****************************************************************************
-Copyright (c) 1996, 2013, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1996, 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
os_thread_ret_t
DECLARE_THREAD(lock_wait_timeout_thread)(
/*=====================================*/
- void* arg __attribute__((unused)))
+ void* arg MY_ATTRIBUTE((unused)))
/* in: a dummy parameter required by
os_thread_create */
{
/*****************************************************************************
-Copyright (c) 1995, 2015, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1995, 2016, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2009, Google Inc.
Portions of this file contain modifications contributed and copyrighted by
ulint space_id, /*!< in: space id of the file space
which contains the log files of this
group */
- ulint archive_space_id __attribute__((unused)))
+ ulint archive_space_id MY_ATTRIBUTE((unused)))
/*!< in: space id of the file space
which contains some archived log
files for this group; currently, only
log_archived_file_name_gen(
/*=======================*/
char* buf, /*!< in: buffer where to write */
- ulint id __attribute__((unused)),
+ ulint id MY_ATTRIBUTE((unused)),
/*!< in: group id;
currently we only archive the first group */
ulint file_no)/*!< in: file number */
/*****************************************************************************
-Copyright (c) 1997, 2015, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1997, 2016, 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
os_thread_ret_t
DECLARE_THREAD(recv_writer_thread)(
/*===============================*/
- void* arg __attribute__((unused)))
+ void* arg MY_ATTRIBUTE((unused)))
/*!< in: a dummy parameter required by
os_thread_create */
{
/********************************************************//**
Looks for the maximum consistent checkpoint from the log groups.
@return error code or DB_SUCCESS */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
dberr_t
recv_find_max_checkpoint(
/*=====================*/
/*****************************************************************************
-Copyright (c) 1994, 2011, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1994, 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
mem_field_erase(
/*============*/
byte* buf, /*!< in: memory field */
- ulint n __attribute__((unused)))
+ ulint n MY_ATTRIBUTE((unused)))
/*!< in: how many bytes the user requested */
{
byte* usr_buf;
mem_heap_validate_or_print(
/*=======================*/
mem_heap_t* heap, /*!< in: memory heap */
- byte* top __attribute__((unused)),
+ byte* top MY_ATTRIBUTE((unused)),
/*!< in: calculate and validate only until
this top pointer in the heap is reached,
if this pointer is NULL, ignored */
/*****************************************************************************
-Copyright (c) 1995, 2013, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1995, 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
/*****************************************************************//**
Releases the item in the slot given. */
-static __attribute__((nonnull))
+static MY_ATTRIBUTE((nonnull))
void
mtr_memo_slot_release_func(
/*=======================*/
Releases the mlocks and other objects stored in an mtr memo.
They are released in the order opposite to which they were pushed
to the memo. */
-static __attribute__((nonnull))
+static MY_ATTRIBUTE((nonnull))
void
mtr_memo_pop_all(
/*=============*/
/*===========*/
const byte* ptr, /*!< in: pointer from where to read */
ulint type, /*!< in: MLOG_1BYTE, MLOG_2BYTES, MLOG_4BYTES */
- mtr_t* mtr __attribute__((unused)))
+ mtr_t* mtr MY_ATTRIBUTE((unused)))
/*!< in: mini-transaction handle */
{
ut_ad(mtr->state == MTR_ACTIVE);
/***********************************************************************
-Copyright (c) 1995, 2015, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1995, 2016, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2009, Percona Inc.
Portions of this file contain modifications contributed and copyrighted
os_file_set_nocache(
/*================*/
int fd /*!< in: file descriptor to alter */
- __attribute__((unused)),
+ MY_ATTRIBUTE((unused)),
const char* file_name /*!< in: used in the diagnostic
message */
- __attribute__((unused)),
- const char* operation_name __attribute__((unused)))
+ MY_ATTRIBUTE((unused)),
+ const char* operation_name MY_ATTRIBUTE((unused)))
/*!< in: "open" or "create"; used
in the diagnostic message */
{
/*******************************************************************//**
Does a synchronous read operation in Posix.
@return number of bytes read, -1 if error */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
ssize_t
os_file_pread(
/*==========*/
/*******************************************************************//**
Does a synchronous write operation in Posix.
@return number of bytes written, -1 if error */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
ssize_t
os_file_pwrite(
/*===========*/
/*****************************************************************************
-Copyright (c) 1994, 2015, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1994, 2016, 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
page_parse_create(
/*==============*/
byte* ptr, /*!< in: buffer */
- byte* end_ptr __attribute__((unused)), /*!< in: buffer end */
+ byte* end_ptr MY_ATTRIBUTE((unused)), /*!< in: buffer end */
ulint comp, /*!< in: nonzero=compact page format */
buf_block_t* block, /*!< in: block or NULL */
mtr_t* mtr) /*!< in: mtr or NULL */
/*****************************************************************************
-Copyright (c) 2005, 2015, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 2005, 2016, 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
independently of any UNIV_ debugging conditions. */
#if defined UNIV_DEBUG || defined UNIV_ZIP_DEBUG
# include <stdarg.h>
-__attribute__((format (printf, 1, 2)))
+MY_ATTRIBUTE((format (printf, 1, 2)))
/**********************************************************************//**
Report a failure to decompress or compress.
@return number of characters printed */
void
page_zip_free(
/*==========*/
- void* opaque __attribute__((unused)), /*!< in: memory heap */
- void* address __attribute__((unused)))/*!< in: object to free */
+ void* opaque MY_ATTRIBUTE((unused)), /*!< in: memory heap */
+ void* address MY_ATTRIBUTE((unused)))/*!< in: object to free */
{
}
ulint size;
ulint trailer_size;
- ut_ad(ptr && end_ptr);
+ ut_ad(ptr != NULL);
+ ut_ad(end_ptr != NULL);
ut_ad(!page == !page_zip);
if (UNIV_UNLIKELY(ptr + (2 + 2) > end_ptr)) {
static int yy_did_buffer_switch_on_eof;
void yyrestart (FILE *input_file );
-__attribute__((unused)) static void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer );
+MY_ATTRIBUTE((unused)) static void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer );
static YY_BUFFER_STATE yy_create_buffer (FILE *file,int size );
void yy_delete_buffer (YY_BUFFER_STATE b );
void yy_flush_buffer (YY_BUFFER_STATE b );
#line 1 "pars0lex.l"
/*****************************************************************************
-Copyright (c) 1997, 2011, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1997, 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
/* Accessor methods to globals.
These are made visible to non-reentrant scanners for convenience. */
-__attribute__((unused)) static int yylex_destroy (void );
+MY_ATTRIBUTE((unused)) static int yylex_destroy (void );
int yyget_debug (void );
* @param new_buffer The new input buffer.
*
*/
- __attribute__((unused)) static void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer )
+ MY_ATTRIBUTE((unused)) static void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer )
{
/* TODO. We should be able to replace this entire function body
}
/* yylex_destroy is for both reentrant and non-reentrant scanners. */
-__attribute__((unused)) static int yylex_destroy (void)
+MY_ATTRIBUTE((unused)) static int yylex_destroy (void)
{
/* Pop the buffer stack, destroying each element. */
#!/bin/bash
#
-# Copyright (c) 1994, 2011, Oracle and/or its affiliates. All Rights Reserved.
+# Copyright (c) 1994, 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
s/'"$TMPFILE"'/'"$OUTFILE"'/;
s/\(int offset = \)\((yy_c_buf_p) - (yytext_ptr)\);/\1(int)(\2);/;
s/\(void yy\(restart\|_\(delete\|flush\)_buffer\)\)/static \1/;
-s/\(void yy_switch_to_buffer\)/__attribute__((unused)) static \1/;
-s/\(void yy\(push\|pop\)_buffer_state\)/__attribute__((unused)) static \1/;
+s/\(void yy_switch_to_buffer\)/MY_ATTRIBUTE((unused)) static \1/;
+s/\(void yy\(push\|pop\)_buffer_state\)/MY_ATTRIBUTE((unused)) static \1/;
s/\(YY_BUFFER_STATE yy_create_buffer\)/static \1/;
-s/\(\(int\|void\) yy[gs]et_\)/__attribute__((unused)) static \1/;
+s/\(\(int\|void\) yy[gs]et_\)/MY_ATTRIBUTE((unused)) static \1/;
s/\(void \*\?yy\(\(re\)\?alloc\|free\)\)/static \1/;
s/\(extern \)\?\(int yy\(leng\|lineno\|_flex_debug\)\)/static \2/;
-s/\(int yylex_destroy\)/__attribute__((unused)) static \1/;
+s/\(int yylex_destroy\)/MY_ATTRIBUTE((unused)) static \1/;
s/\(extern \)\?\(int yylex \)/UNIV_INTERN \2/;
-s/^\(\(FILE\|char\) *\* *yyget\)/__attribute__((unused)) static \1/;
+s/^\(\(FILE\|char\) *\* *yyget\)/MY_ATTRIBUTE((unused)) static \1/;
s/^\(extern \)\?\(\(FILE\|char\) *\* *yy\)/static \2/;
' < $TMPFILE >> $OUTFILE
/*****************************************************************************
-Copyright (c) 1996, 2013, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1996, 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
sym_node_t* column_defs, /*!< in: list of column names */
sym_node_t* compact, /* in: non-NULL if COMPACT table. */
sym_node_t* block_size, /* in: block size (can be NULL) */
- void* not_fit_in_memory __attribute__((unused)))
+ void* not_fit_in_memory MY_ATTRIBUTE((unused)))
/*!< in: a non-NULL pointer means that
this is a table which in simulations
should be simulated as not fitting
que_fork_t*
pars_stored_procedure_call(
/*=======================*/
- sym_node_t* sym_node __attribute__((unused)))
+ sym_node_t* sym_node MY_ATTRIBUTE((unused)))
/*!< in: stored procedure name */
{
ut_error;
void
yyerror(
/*====*/
- const char* s __attribute__((unused)))
+ const char* s MY_ATTRIBUTE((unused)))
/*!< in: error message string */
{
ut_ad(s);
/*****************************************************************************
-Copyright (c) 1994, 2012, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1994, 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
completely matched fields; when function
returns, contains the value for current
comparison */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
#endif /* UNIV_DEBUG */
/*************************************************************//**
This function is used to compare two data fields for which the data type
in current field */
int ret; /* return value */
- ut_ad(dtuple && rec && matched_fields && matched_bytes);
+ ut_ad(dtuple != NULL);
+ ut_ad(rec != NULL);
+ ut_ad(matched_fields != NULL);
+ ut_ad(matched_bytes != NULL);
ut_ad(dtuple_check_typed(dtuple));
ut_ad(rec_offs_validate(rec, NULL, offsets));
@retval 1 if rec1 field is greater than rec2
@retval -1 if rec1 field is less than rec2
@retval 0 if rec1 field equals to rec2 */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
int
cmp_rec_rec_simple_field(
/*=====================*/
int ret = 0; /* return value */
ulint comp;
- ut_ad(rec1 && rec2 && index);
+ ut_ad(rec1 != NULL);
+ ut_ad(rec2 != NULL);
+ ut_ad(index != NULL);
ut_ad(rec_offs_validate(rec1, index, offsets1));
ut_ad(rec_offs_validate(rec2, index, offsets2));
ut_ad(rec_offs_comp(offsets1) == rec_offs_comp(offsets2));
int ret; /* return value */
ulint cur_field; /* current field number */
- ut_ad(dtuple && rec && matched_fields);
+ ut_ad(dtuple != NULL);
+ ut_ad(rec != NULL);
+ ut_ad(matched_fields != NULL);
ut_ad(dtuple_check_typed(dtuple));
ut_ad(rec_offs_validate(rec, NULL, offsets));
/*****************************************************************************
-Copyright (c) 1994, 2013, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1994, 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
Determine the offset to each field in a leaf-page record
in ROW_FORMAT=COMPACT. This is a special case of
rec_init_offsets() and rec_get_offsets_func(). */
-UNIV_INLINE __attribute__((nonnull))
+UNIV_INLINE MY_ATTRIBUTE((nonnull))
void
rec_init_offsets_comp_ordinary(
/*===========================*/
/**********************************************************//**
Determines the size of a data tuple prefix in ROW_FORMAT=COMPACT.
@return total size */
-UNIV_INLINE __attribute__((warn_unused_result, nonnull(1,2)))
+UNIV_INLINE MY_ATTRIBUTE((warn_unused_result, nonnull(1,2)))
ulint
rec_get_converted_size_comp_prefix_low(
/*===================================*/
/*********************************************************//**
Builds a ROW_FORMAT=COMPACT record out of a data tuple. */
-UNIV_INLINE __attribute__((nonnull))
+UNIV_INLINE MY_ATTRIBUTE((nonnull))
void
rec_convert_dtuple_to_rec_comp(
/*===========================*/
{
rec_t* rec;
- ut_ad(buf && index && dtuple);
+ ut_ad(buf != NULL);
+ ut_ad(index != NULL);
+ ut_ad(dtuple != NULL);
ut_ad(dtuple_validate(dtuple));
ut_ad(dtuple_check_typed(dtuple));
/*****************************************************************************
-Copyright (c) 2010, 2015, Oracle and/or its affiliates. All Rights Reserved.
+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
dfield_dup(field, buf->heap);
/* One variable length column, word with its lenght less than
- fts_max_token_size, add one extra size and one extra byte */
- cur_len += 2;
+ fts_max_token_size, add one extra size and one extra byte.
+
+ Since the max length for FTS token now is larger than 255,
+ so we will need to signify length byte itself, so only 1 to 128
+ bytes can be used for 1 bytes, larger than that 2 bytes. */
+ if (t_str.f_len < 128) {
+ /* Extra size is one byte. */
+ cur_len += 2;
+ } else {
+ /* Extra size is two bytes. */
+ cur_len += 3;
+ }
/* Reserve one byte for the end marker of row_merge_block_t. */
if (buf->total_size + data_size[idx] + cur_len
/********************************************************************//**
Insert processed FTS data to auxillary index tables.
@return DB_SUCCESS if insertion runs fine */
-static __attribute__((nonnull))
+static MY_ATTRIBUTE((nonnull))
dberr_t
row_merge_write_fts_word(
/*=====================*/
/*****************************************************************************
-Copyright (c) 2012, 2015, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 2012, 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
Clean up after import tablespace failure, this function will acquire
the dictionary latches on behalf of the transaction if the transaction
hasn't already acquired them. */
-static __attribute__((nonnull))
+static MY_ATTRIBUTE((nonnull))
void
row_import_discard_changes(
/*=======================*/
/*****************************************************************//**
Clean up after import tablespace. */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
dberr_t
row_import_cleanup(
/*===============*/
/*****************************************************************//**
Report error during tablespace import. */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
dberr_t
row_import_error(
/*=============*/
Adjust the root page index node and leaf node segment headers, update
with the new space id. For all the table's secondary indexes.
@return error code */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
dberr_t
row_import_adjust_root_pages_of_secondary_indexes(
/*==============================================*/
/*****************************************************************//**
Ensure that dict_sys->row_id exceeds SELECT MAX(DB_ROW_ID).
@return error code */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
dberr_t
row_import_set_sys_max_row_id(
/*==========================*/
/*********************************************************************//**
Write the meta data (index user fields) config file.
@return DB_SUCCESS or error code. */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
dberr_t
row_import_cfg_read_index_fields(
/*=============================*/
Read the index names and root page numbers of the indexes and set the values.
Row format [root_page_no, len of str, str ... ]
@return DB_SUCCESS or error code. */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
dberr_t
row_import_read_index_data(
/*=======================*/
/*********************************************************************//**
Read the meta data (table columns) config file. Deserialise the contents of
dict_col_t structure, along with the column name. */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
dberr_t
row_import_read_columns(
/*====================*/
/*****************************************************************//**
Read the contents of the <tablespace>.cfg file.
@return DB_SUCCESS or error code. */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
dberr_t
row_import_read_v1(
/*===============*/
/**
Read the contents of the <tablespace>.cfg file.
@return DB_SUCCESS or error code. */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
dberr_t
row_import_read_meta_data(
/*======================*/
/**
Read the contents of the <tablename>.cfg file.
@return DB_SUCCESS or error code. */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
dberr_t
row_import_read_cfg(
/*================*/
/*****************************************************************************
-Copyright (c) 1996, 2015, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1996, 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
in the index. This situation can occur if the delete-marked record is
kept in the index for consistent reads.
@return DB_SUCCESS or error code */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
dberr_t
row_ins_sec_index_entry_by_modify(
/*==============================*/
existing record in the index. This situation can occur if the delete marked
record is kept in the index for consistent reads.
@return DB_SUCCESS, DB_FAIL, or error code */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
dberr_t
row_ins_clust_index_entry_by_modify(
/*================================*/
Returns the number of ancestor UPDATE or DELETE nodes of a
cascaded update/delete node.
@return number of ancestors */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
ulint
row_ins_cascade_n_ancestors(
/*========================*/
can also be 0 if no foreign key fields changed; the returned value is
ULINT_UNDEFINED if the column type in the child table is too short to
fit the new value in the parent table: that means the update fails */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
ulint
row_ins_cascade_calc_update_vec(
/*============================*/
and the constraint had an ON DELETE or ON UPDATE condition which was not
RESTRICT.
@return DB_SUCCESS, DB_LOCK_WAIT, or error code */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
dberr_t
row_ins_foreign_check_on_constraint(
/*================================*/
sets shared locks which lock either the success or the failure of
a constraint.
@return DB_SUCCESS or error code */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
dberr_t
row_ins_check_foreign_constraints(
/*==============================*/
whether a uniqueness violation has occurred for the key value of the entry.
Set shared locks on possible duplicate records.
@return DB_SUCCESS, DB_DUPLICATE_KEY, or DB_LOCK_WAIT */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
dberr_t
row_ins_scan_sec_index_for_duplicate(
/*=================================*/
@retval DB_SUCCESS_LOCKED_REC when rec is an exact match of entry or
a newer version of entry (the entry should not be inserted)
@retval DB_DUPLICATE_KEY when entry is a duplicate of rec */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
dberr_t
row_ins_duplicate_online(
/*=====================*/
@retval DB_SUCCESS_LOCKED_REC when rec is an exact match of entry or
a newer version of entry (the entry should not be inserted)
@retval DB_DUPLICATE_KEY when entry is a duplicate of rec */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
dberr_t
row_ins_duplicate_error_in_clust_online(
/*====================================*/
record
@retval DB_SUCCESS_LOCKED_REC if an exact match of the record was found
in online table rebuild (flags & (BTR_KEEP_SYS_FLAG | BTR_NO_LOCKING_FLAG)) */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
dberr_t
row_ins_duplicate_error_in_clust(
/*=============================*/
/***************************************************************//**
Starts a mini-transaction and checks if the index will be dropped.
@return true if the index is to be dropped */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
bool
row_ins_sec_mtr_start_and_check_if_aborted(
/*=======================================*/
/***********************************************************//**
Sets the values of the dtuple fields in entry from the values of appropriate
columns in row. */
-static __attribute__((nonnull))
+static MY_ATTRIBUTE((nonnull))
void
row_ins_index_entry_set_vals(
/*=========================*/
Inserts a single index entry to the table.
@return DB_SUCCESS if operation successfully completed, else error
code or DB_LOCK_WAIT */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
dberr_t
row_ins_index_entry_step(
/*=====================*/
Inserts a row to a table.
@return DB_SUCCESS if operation successfully completed, else error
code or DB_LOCK_WAIT */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
dberr_t
row_ins(
/*====*/
/*****************************************************************************
-Copyright (c) 2011, 2015, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 2011, 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
/** Create the file or online log if it does not exist.
@param[in,out] log online rebuild log
@return file descriptor. */
-static __attribute__((warn_unused_result))
+static MY_ATTRIBUTE((warn_unused_result))
int
row_log_tmpfile(
row_log_t* log)
/** Allocate the memory for the log buffer.
@param[in,out] log_buf Buffer used for log operation
@return TRUE if success, false if not */
-static __attribute__((warn_unused_result))
+static MY_ATTRIBUTE((warn_unused_result))
bool
row_log_block_allocate(
row_log_buf_t& log_buf)
/******************************************************//**
Starts logging an operation to a table that is being rebuilt.
@return pointer to log, or NULL if no logging is necessary */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
byte*
row_log_table_open(
/*===============*/
/******************************************************//**
Stops logging an operation to a table that is being rebuilt. */
-static __attribute__((nonnull))
+static MY_ATTRIBUTE((nonnull))
void
row_log_table_close_func(
/*=====================*/
&old_pk_extra_size);
ut_ad(old_pk_extra_size < 0x100);
- mrec_size = 4 + old_pk_size;
+ mrec_size = 6 + old_pk_size;
/* Log enough prefix of the BLOB unless both the
old and new table are in COMPACT or REDUNDANT format,
*b++ = static_cast<byte>(old_pk_extra_size);
/* Log the size of external prefix we saved */
- mach_write_to_2(b, ext_size);
- b += 2;
+ mach_write_to_4(b, ext_size);
+ b += 4;
rec_convert_dtuple_to_temp(
b + old_pk_extra_size, new_index,
/******************************************************//**
Logs an insert or update to a table that is being rebuilt. */
-static __attribute__((nonnull(1,2,3)))
+static MY_ATTRIBUTE((nonnull(1,2,3)))
void
row_log_table_low(
/*==============*/
/******************************************************//**
Converts a log record to a table row.
@return converted row, or NULL if the conversion fails */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
const dtuple_t*
row_log_table_apply_convert_mrec(
/*=============================*/
/******************************************************//**
Replays an insert operation on a table that was rebuilt.
@return DB_SUCCESS or error code */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
dberr_t
row_log_table_apply_insert_low(
/*===========================*/
/******************************************************//**
Replays an insert operation on a table that was rebuilt.
@return DB_SUCCESS or error code */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
dberr_t
row_log_table_apply_insert(
/*=======================*/
/******************************************************//**
Deletes a record from a table that is being rebuilt.
@return DB_SUCCESS or error code */
-static __attribute__((nonnull(1, 2, 4, 5), warn_unused_result))
+static MY_ATTRIBUTE((nonnull(1, 2, 4, 5), warn_unused_result))
dberr_t
row_log_table_apply_delete_low(
/*===========================*/
/******************************************************//**
Replays a delete operation on a table that was rebuilt.
@return DB_SUCCESS or error code */
-static __attribute__((nonnull(1, 3, 4, 5, 6, 7), warn_unused_result))
+static MY_ATTRIBUTE((nonnull(1, 3, 4, 5, 6, 7), warn_unused_result))
dberr_t
row_log_table_apply_delete(
/*=======================*/
/******************************************************//**
Replays an update operation on a table that was rebuilt.
@return DB_SUCCESS or error code */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
dberr_t
row_log_table_apply_update(
/*=======================*/
Applies an operation to a table that was rebuilt.
@return NULL on failure (mrec corruption) or when out of data;
pointer to next record on success */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
const mrec_t*
row_log_table_apply_op(
/*===================*/
break;
case ROW_T_DELETE:
- /* 1 (extra_size) + 2 (ext_size) + at least 1 (payload) */
- if (mrec + 4 >= mrec_end) {
+ /* 1 (extra_size) + 4 (ext_size) + at least 1 (payload) */
+ if (mrec + 6 >= mrec_end) {
return(NULL);
}
extra_size = *mrec++;
- ext_size = mach_read_from_2(mrec);
- mrec += 2;
+ ext_size = mach_read_from_4(mrec);
+ mrec += 4;
ut_ad(mrec < mrec_end);
/* We assume extra_size < 0x100 for the PRIMARY KEY prefix.
/******************************************************//**
Applies operations to a table was rebuilt.
@return DB_SUCCESS, or error code on failure */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
dberr_t
row_log_table_apply_ops(
/*====================*/
/******************************************************//**
Applies an operation to a secondary index that was being created. */
-static __attribute__((nonnull))
+static MY_ATTRIBUTE((nonnull))
void
row_log_apply_op_low(
/*=================*/
Applies an operation to a secondary index that was being created.
@return NULL on failure (mrec corruption) or when out of data;
pointer to next record on success */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
const mrec_t*
row_log_apply_op(
/*=============*/
/******************************************************//**
Applies operations to a secondary index that was being created.
@return DB_SUCCESS, or error code on failure */
-static __attribute__((nonnull))
+static MY_ATTRIBUTE((nonnull))
dberr_t
row_log_apply_ops(
/*==============*/
#ifdef UNIV_DEBUG
/******************************************************//**
Display a merge tuple. */
-static __attribute__((nonnull))
+static MY_ATTRIBUTE((nonnull))
void
row_merge_tuple_print(
/*==================*/
/******************************************************//**
Encode an index record. */
-static __attribute__((nonnull))
+static MY_ATTRIBUTE((nonnull))
void
row_merge_buf_encode(
/*=================*/
/******************************************************//**
Allocate a sort buffer.
@return own: sort buffer */
-static __attribute__((malloc, nonnull))
+static MY_ATTRIBUTE((malloc, nonnull))
row_merge_buf_t*
row_merge_buf_create_low(
/*=====================*/
/*************************************************************//**
Compare two tuples.
@return 1, 0, -1 if a is greater, equal, less, respectively, than b */
-static __attribute__((warn_unused_result))
+static MY_ATTRIBUTE((warn_unused_result))
int
row_merge_tuple_cmp(
/*================*/
/**********************************************************************//**
Merge sort the tuple buffer in main memory. */
-static __attribute__((nonnull(4,5)))
+static MY_ATTRIBUTE((nonnull(4,5)))
void
row_merge_tuple_sort(
/*=================*/
@param[in,out] tmpfd temporary file handle
@param[in] path path to create temporary file
@return file descriptor, or -1 on failure */
-static __attribute__((warn_unused_result))
+static MY_ATTRIBUTE((warn_unused_result))
int
row_merge_tmpfile_if_needed(
int* tmpfd,
@param[in] nrec number of records in the file
@param[in] path path to create temporary files
@return file descriptor, or -1 on failure */
-static __attribute__((warn_unused_result))
+static MY_ATTRIBUTE((warn_unused_result))
int
row_merge_file_create_if_needed(
merge_file_t* file,
@param[in,out] block file buffer
@param[in,out] tmpfd temporary file handle
return DB_SUCCESS or error */
-static __attribute__((nonnull(1,2,3,4,6,9,10,16), warn_unused_result))
+static MY_ATTRIBUTE((nonnull(1,2,3,4,6,9,10,16), warn_unused_result))
dberr_t
row_merge_read_clustered_index(
trx_t* trx,
/* Sync fts cache for other fts indexes to keep all
fts indexes consistent in sync_doc_id. */
err = fts_sync_table(const_cast<dict_table_t*>(new_table),
- false, true);
+ false, true, false);
if (err == DB_SUCCESS) {
fts_update_next_doc_id(
/*************************************************************//**
Merge two blocks of records on disk and write a bigger block.
@return DB_SUCCESS or error code */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
dberr_t
row_merge_blocks(
/*=============*/
/*************************************************************//**
Copy a block of index entries.
@return TRUE on success, FALSE on failure */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
ibool
row_merge_blocks_copy(
/*==================*/
/*************************************************************//**
Merge disk files.
@return DB_SUCCESS or error code */
-static __attribute__((nonnull))
+static MY_ATTRIBUTE((nonnull))
dberr_t
row_merge(
/*======*/
/*************************************************************//**
Copy externally stored columns to the data tuple. */
-static __attribute__((nonnull))
+static MY_ATTRIBUTE((nonnull))
void
row_merge_copy_blobs(
/*=================*/
Read sorted file containing index data tuples and insert these data
tuples to the index
@return DB_SUCCESS or error number */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
dberr_t
row_merge_insert_index_tuples(
/*==========================*/
/*********************************************************************//**
Create and execute a query graph for creating an index.
@return DB_SUCCESS or error code */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
dberr_t
row_merge_create_index_graph(
/*=========================*/
/*****************************************************************************
-Copyright (c) 2000, 2015, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 2000, 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
}
/* Difference between Doc IDs are restricted within
- 4 bytes integer. See fts_get_encoded_len() */
+ 4 bytes integer. See fts_get_encoded_len(). Consecutive
+ doc_ids difference should not exceed
+ FTS_DOC_ID_MAX_STEP value. */
- if (doc_id - next_doc_id >= FTS_DOC_ID_MAX_STEP) {
+ if (next_doc_id > 1
+ && doc_id - next_doc_id >= FTS_DOC_ID_MAX_STEP) {
fprintf(stderr,
"InnoDB: Doc ID " UINT64PF " is too"
" big. Its difference with largest"
trx_t* trx = prebuilt->trx;
ulint fk_depth = 0;
- ut_ad(prebuilt && trx);
+ ut_ad(prebuilt != NULL);
+ ut_ad(trx != NULL);
UT_NOT_USED(mysql_rec);
if (prebuilt->table->ibd_file_missing) {
btr_pcur_t* clust_pcur = &prebuilt->clust_pcur;
trx_t* trx = prebuilt->trx;
- ut_ad(prebuilt && trx);
+ ut_ad(prebuilt != NULL);
+ ut_ad(trx != NULL);
if (UNIV_UNLIKELY
(!srv_locks_unsafe_for_binlog
return(n_tables + n_tables_dropped);
}
+ DBUG_EXECUTE_IF("row_drop_tables_in_background_sleep",
+ os_thread_sleep(5000000);
+ );
+
table = dict_table_open_on_name(drop->table_name, FALSE, FALSE,
DICT_ERR_IGNORE_NONE);
goto already_dropped;
}
+ if (!table->to_be_dropped) {
+ /* There is a scenario: the old table is dropped
+ just after it's added into drop list, and new
+ table with the same name is created, then we try
+ to drop the new table in background. */
+ dict_table_close(table, FALSE, FALSE);
+
+ goto already_dropped;
+ }
+
ut_a(!table->can_be_evicted);
dict_table_close(table, FALSE, FALSE);
}
}
+
+ DBUG_EXECUTE_IF("row_drop_table_add_to_background",
+ row_add_table_to_background_drop_list(table->name);
+ err = DB_SUCCESS;
+ goto funct_exit;
+ );
+
/* TODO: could we replace the counter n_foreign_key_checks_running
with lock checks on the table? Acquire here an exclusive lock on the
table, and rewrite lock0lock.cc and the lock wait in srv0srv.cc so that
Drop all foreign keys in a database, see Bug#18942.
Called at the end of row_drop_database_for_mysql().
@return error code or DB_SUCCESS */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
dberr_t
drop_all_foreign_keys_in_db(
/*========================*/
row_mysql_lock_data_dictionary(trx);
while ((table_name = dict_get_first_table_name_in_db(name))) {
+ /* Drop parent table if it is a fts aux table, to
+ avoid accessing dropped fts aux tables in information
+ scheam when parent table still exists.
+ Note: Drop parent table will drop fts aux tables. */
+ char* parent_table_name;
+ parent_table_name = fts_get_parent_table_name(
+ table_name, strlen(table_name));
+
+ if (parent_table_name != NULL) {
+ mem_free(table_name);
+ table_name = parent_table_name;
+ }
+
ut_a(memcmp(table_name, name, namelen) == 0);
table = dict_table_open_on_name(
Checks if a table name contains the string "/#sql" which denotes temporary
tables in MySQL.
@return true if temporary table */
-UNIV_INTERN __attribute__((warn_unused_result))
+UNIV_INTERN MY_ATTRIBUTE((warn_unused_result))
bool
row_is_mysql_tmp_table_name(
/*========================*/
/****************************************************************//**
Delete a single constraint.
@return error code or DB_SUCCESS */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
dberr_t
row_delete_constraint_low(
/*======================*/
/****************************************************************//**
Delete a single constraint.
@return error code or DB_SUCCESS */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
dberr_t
row_delete_constraint(
/*==================*/
/*****************************************************************************
-Copyright (c) 1997, 2015, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1997, 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
{
purge_node_t* node;
- ut_ad(parent && heap);
+ ut_ad(parent != NULL);
+ ut_ad(heap != NULL);
node = static_cast<purge_node_t*>(
mem_heap_zalloc(heap, sizeof(*node)));
Removes a delete marked clustered index record if possible.
@retval true if the row was not found, or it was successfully removed
@retval false if the row was modified after the delete marking */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
bool
row_purge_remove_clust_if_poss_low(
/*===============================*/
@retval true if the row was not found, or it was successfully removed
@retval false the purge needs to be suspended because of running out
of file space. */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
bool
row_purge_remove_clust_if_poss(
/*===========================*/
Removes a secondary index entry if possible, by modifying the
index tree. Does not try to buffer the delete.
@return TRUE if success or if not found */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
ibool
row_purge_remove_sec_if_poss_tree(
/*==============================*/
if possible.
@retval true if success or if not found
@retval false if row_purge_remove_sec_if_poss_tree() should be invoked */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
bool
row_purge_remove_sec_if_poss_leaf(
/*==============================*/
/***********************************************************//**
Removes a secondary index entry if possible. */
-UNIV_INLINE __attribute__((nonnull(1,2)))
+UNIV_INLINE MY_ATTRIBUTE((nonnull(1,2)))
void
row_purge_remove_sec_if_poss(
/*=========================*/
@retval true if the row was not found, or it was successfully removed
@retval false the purge needs to be suspended because of
running out of file space */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
bool
row_purge_del_mark(
/*===============*/
ulint info_bits;
ulint type;
- ut_ad(node && thr);
+ ut_ad(node != NULL);
+ ut_ad(thr != NULL);
ptr = trx_undo_rec_get_pars(
undo_rec, &type, &node->cmpl_info,
/***********************************************************//**
Purges the parsed record.
@return true if purged, false if skipped */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
bool
row_purge_record_func(
/*==================*/
Fetches an undo log record and does the purge for the recorded operation.
If none left, or the current purge completed, returns the control to the
parent node, which is always a query thread node. */
-static __attribute__((nonnull))
+static MY_ATTRIBUTE((nonnull))
void
row_purge(
/*======*/
/*****************************************************************************
-Copyright (c) 2012, 2014, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 2012, 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
/*********************************************************************//**
Write the meta data (index user fields) config file.
@return DB_SUCCESS or error code. */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
dberr_t
row_quiesce_write_index_fields(
/*===========================*/
/*********************************************************************//**
Write the meta data config file index information.
@return DB_SUCCESS or error code. */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
dberr_t
row_quiesce_write_indexes(
/*======================*/
dict_col_t structure, along with the column name. All fields are serialized
as ib_uint32_t.
@return DB_SUCCESS or error code. */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
dberr_t
row_quiesce_write_table(
/*====================*/
/*********************************************************************//**
Write the meta data config file header.
@return DB_SUCCESS or error code. */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
dberr_t
row_quiesce_write_header(
/*=====================*/
/*********************************************************************//**
Write the table meta data after quiesce.
@return DB_SUCCESS or error code */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
dberr_t
row_quiesce_write_cfg(
/*==================*/
trx_purge_stop();
}
- ut_a(table->id > 0);
-
for (ulint count = 0;
- ibuf_contract_in_background(table->id, TRUE) != 0
+ ibuf_merge_space(table->space) != 0
&& !trx_is_interrupted(trx);
++count) {
if (!(count % 20)) {
/*****************************************************************************
-Copyright (c) 1996, 2012, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1996, 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
ulint offsets_[REC_OFFS_NORMAL_SIZE];
rec_offs_init(offsets_);
- ut_ad(index && rec && heap);
+ ut_ad(index != NULL);
+ ut_ad(rec != NULL);
+ ut_ad(heap != NULL);
ut_ad(dict_index_is_clust(index));
ut_ad(!mutex_own(&trx_sys->mutex));
ut_ad(!col_map || col_table);
ulint len;
ulint rec_len;
- ut_ad(rec && heap && index);
+ ut_ad(rec != NULL);
+ ut_ad(heap != NULL);
+ ut_ad(index != NULL);
/* Because this function may be invoked by row0merge.cc
on a record whose header is in different format, the check
rec_offs_validate(rec, index, offsets) must be avoided here. */
byte* buf;
const rec_t* copy_rec;
- ut_ad(rec && heap && index);
+ ut_ad(rec != NULL);
+ ut_ad(heap != NULL);
+ ut_ad(index != NULL);
ut_ad(rec_offs_validate(rec, index, offsets));
/* Take a copy of rec to heap */
ulint* offsets = offsets_;
rec_offs_init(offsets_);
- ut_ad(index && rec && heap);
+ ut_ad(index != NULL);
+ ut_ad(rec != NULL);
+ ut_ad(heap != NULL);
ut_ad(!dict_index_is_clust(index));
offsets = rec_get_offsets(rec, index, offsets,
/*****************************************************************************
-Copyright (c) 1997, 2015, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1997, 2016, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2008, Google Inc.
Portions of this file contain modifications contributed and copyrighted by
/*********************************************************************//**
Builds a previous version of a clustered index record for a consistent read
@return DB_SUCCESS or error code */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
dberr_t
row_sel_build_prev_vers(
/*====================*/
/*********************************************************************//**
Builds the last committed version of a clustered index record for a
semi-consistent read. */
-static __attribute__((nonnull))
+static MY_ATTRIBUTE((nonnull))
void
row_sel_build_committed_vers_for_mysql(
/*===================================*/
Retrieves the clustered index record corresponding to a record in a
non-clustered index. Does the necessary locking.
@return DB_SUCCESS or error code */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
dberr_t
row_sel_get_clust_rec(
/*==================*/
/*********************************************************************//**
Performs a select step.
@return DB_SUCCESS or error code */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
dberr_t
row_sel(
/*====*/
/**************************************************************//**
Stores a non-SQL-NULL field in the MySQL format. The counterpart of this
function is row_mysql_store_col_in_innobase_format() in row0mysql.cc. */
-static __attribute__((nonnull))
+static MY_ATTRIBUTE((nonnull))
void
row_sel_field_store_in_mysql_format_func(
/*=====================================*/
#endif /* UNIV_DEBUG */
/**************************************************************//**
Convert a field in the Innobase format to a field in the MySQL format. */
-static __attribute__((warn_unused_result))
+static MY_ATTRIBUTE((warn_unused_result))
ibool
row_sel_store_mysql_field_func(
/*===========================*/
columns to mysql_rec, other columns are left blank. All columns may not
be needed in the query.
@return TRUE on success, FALSE if not all columns could be retrieved */
-static __attribute__((warn_unused_result))
+static MY_ATTRIBUTE((warn_unused_result))
ibool
row_sel_store_mysql_rec(
/*====================*/
/*********************************************************************//**
Builds a previous version of a clustered index record for a consistent read
@return DB_SUCCESS or error code */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
dberr_t
row_sel_build_prev_vers_for_mysql(
/*==============================*/
non-clustered index. Does the necessary locking. Used in the MySQL
interface.
@return DB_SUCCESS, DB_SUCCESS_LOCKED_REC, or error code */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
dberr_t
row_sel_get_clust_rec_for_mysql(
/*============================*/
/*****************************************************************************
-Copyright (c) 1997, 2014, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1997, 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
Removes a clustered index record. The pcur in node was positioned on the
record, now it is detached.
@return DB_SUCCESS or DB_OUT_OF_FILE_SPACE */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
dberr_t
row_undo_ins_remove_clust_rec(
/*==========================*/
/***************************************************************//**
Removes a secondary index entry if found.
@return DB_SUCCESS, DB_FAIL, or DB_OUT_OF_FILE_SPACE */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
dberr_t
row_undo_ins_remove_sec_low(
/*========================*/
Removes a secondary index entry from the index if found. Tries first
optimistic, then pessimistic descent down the tree.
@return DB_SUCCESS or DB_OUT_OF_FILE_SPACE */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
dberr_t
row_undo_ins_remove_sec(
/*====================*/
/***************************************************************//**
Removes secondary index records.
@return DB_SUCCESS or DB_OUT_OF_FILE_SPACE */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
dberr_t
row_undo_ins_remove_sec_rec(
/*========================*/
/*****************************************************************************
-Copyright (c) 1997, 2014, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1997, 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
/***********************************************************//**
Undoes a modify in a clustered index record.
@return DB_SUCCESS, DB_FAIL, or error code: we may run out of file space */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
dberr_t
row_undo_mod_clust_low(
/*===================*/
delete-marked record and there no longer exist transactions
that would see the delete-marked record.
@return DB_SUCCESS, DB_FAIL, or error code: we may run out of file space */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
dberr_t
row_undo_mod_remove_clust_low(
/*==========================*/
Undoes a modify in a clustered index record. Sets also the node state for the
next round of undo.
@return DB_SUCCESS or error code: we may run out of file space */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
dberr_t
row_undo_mod_clust(
/*===============*/
/***********************************************************//**
Delete marks or removes a secondary index entry if found.
@return DB_SUCCESS, DB_FAIL, or DB_OUT_OF_FILE_SPACE */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
dberr_t
row_undo_mod_del_mark_or_remove_sec_low(
/*====================================*/
clustered index record or an earlier version of it, if the secondary index
record through which we do the search is delete-marked.
@return DB_SUCCESS or DB_OUT_OF_FILE_SPACE */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
dberr_t
row_undo_mod_del_mark_or_remove_sec(
/*================================*/
@retval DB_OUT_OF_FILE_SPACE when running out of tablespace
@retval DB_DUPLICATE_KEY if the value was missing
and an insert would lead to a duplicate exists */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
dberr_t
row_undo_mod_del_unmark_sec_and_undo_update(
/*========================================*/
/***********************************************************//**
Flags a secondary index corrupted. */
-static __attribute__((nonnull))
+static MY_ATTRIBUTE((nonnull))
void
row_undo_mod_sec_flag_corrupted(
/*============================*/
/***********************************************************//**
Undoes a modify in secondary indexes when undo record type is UPD_DEL.
@return DB_SUCCESS or DB_OUT_OF_FILE_SPACE */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
dberr_t
row_undo_mod_upd_del_sec(
/*=====================*/
/***********************************************************//**
Undoes a modify in secondary indexes when undo record type is DEL_MARK.
@return DB_SUCCESS or DB_OUT_OF_FILE_SPACE */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
dberr_t
row_undo_mod_del_mark_sec(
/*======================*/
/***********************************************************//**
Undoes a modify in secondary indexes when undo record type is UPD_EXIST.
@return DB_SUCCESS or DB_OUT_OF_FILE_SPACE */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
dberr_t
row_undo_mod_upd_exist_sec(
/*=======================*/
/***********************************************************//**
Parses the row reference and other info in a modify undo log record. */
-static __attribute__((nonnull))
+static MY_ATTRIBUTE((nonnull))
void
row_undo_mod_parse_undo_rec(
/*========================*/
dberr_t err;
ibool dict_locked;
- ut_ad(node && thr);
+ ut_ad(node != NULL);
+ ut_ad(thr != NULL);
ut_ad(node->state == UNDO_NODE_MODIFY);
dict_locked = thr_get_trx(thr)->dict_operation_lock_mode == RW_X_LATCH;
/*****************************************************************************
-Copyright (c) 1997, 2012, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1997, 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
If none left, or a partial rollback completed, returns control to the
parent node, which is always a query thread node.
@return DB_SUCCESS if operation successfully completed, else error code */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
dberr_t
row_undo(
/*=====*/
roll_ptr_t roll_ptr;
ibool locked_data_dict;
- ut_ad(node && thr);
+ ut_ad(node != NULL);
+ ut_ad(thr != NULL);
trx = node->trx;
/*****************************************************************************
-Copyright (c) 1996, 2014, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1996, 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
pcur position!
@return DB_SUCCESS or an error code */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
dberr_t
row_upd_check_references_constraints(
/*=================================*/
dict_table_open_on_name(
foreign->referenced_table_name_lookup,
FALSE, FALSE, DICT_ERR_IGNORE_NONE);
- opened = TRUE;
+ opened = (foreign->referenced_table) ? TRUE : FALSE;
}
if (foreign->referenced_table) {
->n_foreign_key_checks_running);
if (opened == TRUE) {
- dict_table_close(foreign->referenced_table, TRUE, FALSE);
+ dict_table_close(foreign->referenced_table, FALSE, FALSE);
opened = FALSE;
}
}
roll_ptr_t roll_ptr,/*!< in: roll ptr of the undo log record */
byte* log_ptr,/*!< pointer to a buffer of size > 20 opened
in mlog */
- mtr_t* mtr __attribute__((unused))) /*!< in: mtr */
+ mtr_t* mtr MY_ATTRIBUTE((unused))) /*!< in: mtr */
{
ut_ad(dict_index_is_clust(index));
ut_ad(mtr);
Updates a secondary index entry of a row.
@return DB_SUCCESS if operation successfully completed, else error
code or DB_LOCK_WAIT */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
dberr_t
row_upd_sec_index_entry(
/*====================*/
deletes it if this is a delete.
@return DB_SUCCESS if operation successfully completed, else error
code or DB_LOCK_WAIT */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
dberr_t
row_upd_sec_step(
/*=============*/
freed in a rollback. A limited version of this function used to be
called btr_cur_mark_dtuple_inherited_extern().
@return TRUE if any columns were inherited */
-static __attribute__((warn_unused_result))
+static MY_ATTRIBUTE((warn_unused_result))
ibool
row_upd_clust_rec_by_insert_inherit_func(
/*=====================================*/
database applications.
@return DB_SUCCESS if operation successfully completed, else error
code or DB_LOCK_WAIT */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
dberr_t
row_upd_clust_rec_by_insert(
/*========================*/
not change.
@return DB_SUCCESS if operation successfully completed, else error
code or DB_LOCK_WAIT */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
dberr_t
row_upd_clust_rec(
/*==============*/
/***********************************************************//**
Delete marks a clustered index record.
@return DB_SUCCESS if operation successfully completed, else error code */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
dberr_t
row_upd_del_mark_clust_rec(
/*=======================*/
Updates the clustered index record.
@return DB_SUCCESS if operation successfully completed, DB_LOCK_WAIT
in case of a lock wait, else error code */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
dberr_t
row_upd_clust_step(
/*===============*/
record, and the position of the cursor is stored in the cursor.
@return DB_SUCCESS if operation successfully completed, else error
code or DB_LOCK_WAIT */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
dberr_t
row_upd(
/*====*/
{
dberr_t err = DB_SUCCESS;
- ut_ad(node && thr);
+ ut_ad(node != NULL);
+ ut_ad(thr != NULL);
if (UNIV_LIKELY(node->in_mysql_interface)) {
/*****************************************************************************
-Copyright (c) 2010, 2014, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 2010, 2016, 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
module */
set_current_module = FALSE;
} else if (module_id == MONITOR_ALL_COUNTER) {
- continue;
+ if (!(innodb_counter_info[ix].monitor_type
+ & MONITOR_GROUP_MODULE)) {
+ continue;
+ }
} else {
/* Hitting the next module, stop */
break;
os_thread_ret_t
DECLARE_THREAD(srv_monitor_thread)(
/*===============================*/
- void* arg __attribute__((unused)))
+ void* arg MY_ATTRIBUTE((unused)))
/*!< in: a dummy parameter required by
os_thread_create */
{
os_thread_ret_t
DECLARE_THREAD(srv_error_monitor_thread)(
/*=====================================*/
- void* arg __attribute__((unused)))
+ void* arg MY_ATTRIBUTE((unused)))
/*!< in: a dummy parameter required by
os_thread_create */
{
/* Do an ibuf merge */
srv_main_thread_op_info = "doing insert buffer merge";
counter_time = ut_time_us(NULL);
- ibuf_contract_in_background(0, FALSE);
+ ibuf_merge_in_background(false);
MONITOR_INC_TIME_IN_MICRO_SECS(
MONITOR_SRV_IBUF_MERGE_MICROSECOND, counter_time);
/* Do an ibuf merge */
counter_time = ut_time_us(NULL);
srv_main_thread_op_info = "doing insert buffer merge";
- ibuf_contract_in_background(0, TRUE);
+ ibuf_merge_in_background(true);
MONITOR_INC_TIME_IN_MICRO_SECS(
MONITOR_SRV_IBUF_MERGE_MICROSECOND, counter_time);
/* Do an ibuf merge */
srv_main_thread_op_info = "doing insert buffer merge";
- n_bytes_merged = ibuf_contract_in_background(0, TRUE);
+ n_bytes_merged = ibuf_merge_in_background(true);
/* Flush logs if needed */
srv_sync_log_buffer_in_background();
os_thread_ret_t
DECLARE_THREAD(srv_master_thread)(
/*==============================*/
- void* arg __attribute__((unused)))
+ void* arg MY_ATTRIBUTE((unused)))
/*!< in: a dummy parameter required by
os_thread_create */
{
os_thread_ret_t
DECLARE_THREAD(srv_worker_thread)(
/*==============================*/
- void* arg __attribute__((unused))) /*!< in: a dummy parameter
+ void* arg MY_ATTRIBUTE((unused))) /*!< in: a dummy parameter
required by os_thread_create */
{
srv_slot_t* slot;
os_thread_ret_t
DECLARE_THREAD(srv_purge_coordinator_thread)(
/*=========================================*/
- void* arg __attribute__((unused))) /*!< in: a dummy parameter
+ void* arg MY_ATTRIBUTE((unused))) /*!< in: a dummy parameter
required by os_thread_create */
{
srv_slot_t* slot;
/*****************************************************************************
-Copyright (c) 1996, 2015, Oracle and/or its affiliates. All rights reserved.
+Copyright (c) 1996, 2016, Oracle and/or its affiliates. All rights reserved.
Copyright (c) 2008, Google Inc.
Copyright (c) 2009, Percona Inc.
void
srv_normalize_path_for_win(
/*=======================*/
- char* str __attribute__((unused))) /*!< in/out: null-terminated
+ char* str MY_ATTRIBUTE((unused))) /*!< in/out: null-terminated
character string */
{
#ifdef __WIN__
/*********************************************************************//**
Creates a log file.
@return DB_SUCCESS or error code */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
dberr_t
create_log_file(
/*============*/
/*********************************************************************//**
Opens a log file.
@return DB_SUCCESS or error code */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
dberr_t
open_log_file(
/*==========*/
/*********************************************************************//**
Creates or opens database data files and closes them.
@return DB_SUCCESS or error code */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
dberr_t
open_or_create_data_files(
/*======================*/
/*****************************************************************************
-Copyright (c) 1995, 2015, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1995, 2016, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2008, Google Inc.
Portions of this file contain modifications contributed and copyrighted by
mutex_enter_nowait_func(
/*====================*/
ib_mutex_t* mutex, /*!< in: pointer to mutex */
- const char* file_name __attribute__((unused)),
+ const char* file_name MY_ATTRIBUTE((unused)),
/*!< in: file name where mutex
requested */
- ulint line __attribute__((unused)))
+ ulint line MY_ATTRIBUTE((unused)))
/*!< in: line where requested */
{
ut_ad(mutex_validate(mutex));
/*****************************************************************************
-Copyright (c) 1996, 2012, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1996, 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
released with the corresponding release function.
@return copy of an undo log record or pointer to trx_purge_dummy_rec,
if the whole undo log can skipped in purge; NULL if none left */
-static __attribute__((warn_unused_result, nonnull))
+static MY_ATTRIBUTE((warn_unused_result, nonnull))
trx_undo_rec_t*
trx_purge_fetch_next_rec(
/*=====================*/
/*****************************************************************************
-Copyright (c) 1996, 2012, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1996, 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
/***********************************************************************//**
Erases the unused undo log page end.
@return TRUE if the page contained something, FALSE if it was empty */
-static __attribute__((nonnull))
+static MY_ATTRIBUTE((nonnull))
ibool
trx_undo_erase_page_end(
/*====================*/
trx_undo_parse_erase_page_end(
/*==========================*/
byte* ptr, /*!< in: buffer */
- byte* end_ptr __attribute__((unused)), /*!< in: buffer end */
+ byte* end_ptr MY_ATTRIBUTE((unused)), /*!< in: buffer end */
page_t* page, /*!< in: page or NULL */
mtr_t* mtr) /*!< in: mtr or NULL */
{
@retval true if the undo log has been
truncated and we cannot fetch the old version
@retval false if the undo log record is available */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
bool
trx_undo_get_undo_rec(
/*==================*/
#ifdef UNIV_DEBUG
#define ATTRIB_USED_ONLY_IN_DEBUG
#else /* UNIV_DEBUG */
-#define ATTRIB_USED_ONLY_IN_DEBUG __attribute__((unused))
+#define ATTRIB_USED_ONLY_IN_DEBUG MY_ATTRIBUTE((unused))
#endif /* UNIV_DEBUG */
/*******************************************************************//**
/*****************************************************************************
-Copyright (c) 1996, 2014, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1996, 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
were set after this savepoint are deleted.
@return if no savepoint of the name found then DB_NO_SAVEPOINT,
otherwise DB_SUCCESS */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
dberr_t
trx_rollback_to_savepoint_for_mysql_low(
/*====================================*/
os_thread_ret_t
DECLARE_THREAD(trx_rollback_or_clean_all_recovered)(
/*================================================*/
- void* arg __attribute__((unused)))
+ void* arg MY_ATTRIBUTE((unused)))
/*!< in: a dummy parameter required by
os_thread_create */
{
/*****************************************************************************
-Copyright (c) 1996, 2015, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1996, 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
/****************************************************************//**
Assign the transaction its history serialisation number and write the
update UNDO log record to the assigned rollback segment. */
-static __attribute__((nonnull))
+static MY_ATTRIBUTE((nonnull))
void
trx_write_serialisation_history(
/*============================*/
/********************************************************************
Finalize a transaction containing updates for a FTS table. */
-static __attribute__((nonnull))
+static MY_ATTRIBUTE((nonnull))
void
trx_finalize_for_fts_table(
/*=======================*/
/******************************************************************//**
Finalize a transaction containing updates to FTS tables. */
-static __attribute__((nonnull))
+static MY_ATTRIBUTE((nonnull))
void
trx_finalize_for_fts(
/*=================*/
/**********************************************************************//**
If required, flushes the log to disk based on the value of
innodb_flush_log_at_trx_commit. */
-static __attribute__((nonnull))
+static MY_ATTRIBUTE((nonnull))
void
trx_flush_log_if_needed(
/*====================*/
/****************************************************************//**
Commits a transaction in memory. */
-static __attribute__((nonnull))
+static MY_ATTRIBUTE((nonnull))
void
trx_commit_in_memory(
/*=================*/
@return trx on match, the trx->xid will be invalidated;
note that the trx may have been committed, unless the caller is
holding lock_sys->mutex */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
trx_t*
trx_get_trx_by_xid_low(
/*===================*/
/*****************************************************************************
-Copyright (c) 1996, 2013, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1996, 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
Creates a new undo log segment in file.
@return DB_SUCCESS if page creation OK possible error codes are:
DB_TOO_MANY_CONCURRENT_TRXS DB_OUT_OF_FILE_SPACE */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
dberr_t
trx_undo_seg_create(
/*================*/
- trx_rseg_t* rseg __attribute__((unused)),/*!< in: rollback segment */
+ trx_rseg_t* rseg MY_ATTRIBUTE((unused)),/*!< in: rollback segment */
trx_rsegf_t* rseg_hdr,/*!< in: rollback segment header, page
x-latched */
ulint type, /*!< in: type of the segment: TRX_UNDO_INSERT or
ibool success;
dberr_t err = DB_SUCCESS;
- ut_ad(mtr && id && rseg_hdr);
+ ut_ad(mtr != NULL);
+ ut_ad(id != NULL);
+ ut_ad(rseg_hdr != NULL);
ut_ad(mutex_own(&(rseg->mutex)));
/* fputs(type == TRX_UNDO_INSERT
trx_undo_parse_discard_latest(
/*==========================*/
byte* ptr, /*!< in: buffer */
- byte* end_ptr __attribute__((unused)), /*!< in: buffer end */
+ byte* end_ptr MY_ATTRIBUTE((unused)), /*!< in: buffer end */
page_t* page, /*!< in: page or NULL */
mtr_t* mtr) /*!< in: mtr or NULL */
{
@return DB_SUCCESS if successful in creating the new undo lob object,
possible error codes are: DB_TOO_MANY_CONCURRENT_TRXS
DB_OUT_OF_FILE_SPACE DB_OUT_OF_MEMORY */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
dberr_t
trx_undo_create(
/*============*/
}
-static int _ftb_no_dupes_cmp(const void* not_used __attribute__((unused)),
+static int _ftb_no_dupes_cmp(const void* not_used MY_ATTRIBUTE((unused)),
const void *a,const void *b)
{
return CMP_NUM((*((my_off_t*)a)), (*((my_off_t*)b)));
static int ftb_phrase_add_word(MYSQL_FTPARSER_PARAM *param,
char *word, int word_len,
- MYSQL_FTPARSER_BOOLEAN_INFO *boolean_info __attribute__((unused)))
+ MYSQL_FTPARSER_BOOLEAN_INFO *boolean_info MY_ATTRIBUTE((unused)))
{
MY_FTB_PHRASE_PARAM *phrase_param= param->mysql_ftparam;
FT_WORD *w= (FT_WORD *)phrase_param->document->data;
static int ftb_find_relevance_add_word(MYSQL_FTPARSER_PARAM *param,
char *word, int len,
- MYSQL_FTPARSER_BOOLEAN_INFO *boolean_info __attribute__((unused)))
+ MYSQL_FTPARSER_BOOLEAN_INFO *boolean_info MY_ATTRIBUTE((unused)))
{
MY_FTB_FIND_PARAM *ftb_param= param->mysql_ftparam;
FT_INFO *ftb= ftb_param->ftb;
-/* Copyright (c) 2001, 2011, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2001, 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
double tmp_weight;
} FT_SUPERDOC;
-static int FT_SUPERDOC_cmp(void* cmp_arg __attribute__((unused)),
+static int FT_SUPERDOC_cmp(void* cmp_arg MY_ATTRIBUTE((unused)),
FT_SUPERDOC *p1, FT_SUPERDOC *p2)
{
if (p1->doc.dpos < p2->doc.dpos)
static int walk_and_copy(FT_SUPERDOC *from,
- uint32 count __attribute__((unused)), FT_DOC **to)
+ uint32 count MY_ATTRIBUTE((unused)), FT_DOC **to)
{
DBUG_ENTER("walk_and_copy");
from->doc.weight+=from->tmp_weight*from->word_ptr->weight;
}
static int walk_and_push(FT_SUPERDOC *from,
- uint32 count __attribute__((unused)), QUEUE *best)
+ uint32 count MY_ATTRIBUTE((unused)), QUEUE *best)
{
DBUG_ENTER("walk_and_copy");
from->doc.weight+=from->tmp_weight*from->word_ptr->weight;
}
-static int FT_DOC_cmp(void *unused __attribute__((unused)),
+static int FT_DOC_cmp(void *unused MY_ATTRIBUTE((unused)),
FT_DOC *a, FT_DOC *b)
{
double c= b->weight - a->weight;
float ft_nlq_find_relevance(FT_INFO *handler,
- uchar *record __attribute__((unused)),
- uint length __attribute__((unused)))
+ uchar *record MY_ATTRIBUTE((unused)),
+ uint length MY_ATTRIBUTE((unused)))
{
int a,b,c;
FT_DOC *docs=handler->doc;
-/* Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights
+/* Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights
reserved.
This program is free software; you can redistribute it and/or modify
static int ft_add_word(MYSQL_FTPARSER_PARAM *param,
char *word, int word_len,
- MYSQL_FTPARSER_BOOLEAN_INFO *boolean_info __attribute__((unused)))
+ MYSQL_FTPARSER_BOOLEAN_INFO *boolean_info MY_ATTRIBUTE((unused)))
{
TREE *wtree;
FT_WORD w;
-/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2000, 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
static TREE *stopwords3=NULL;
-static int FT_STOPWORD_cmp(void* cmp_arg __attribute__((unused)),
+static int FT_STOPWORD_cmp(void* cmp_arg MY_ATTRIBUTE((unused)),
FT_STOPWORD *w1, FT_STOPWORD *w2)
{
return ha_compare_text(ft_stopword_cs,
}
static void FT_STOPWORD_free(FT_STOPWORD *w, TREE_FREE action,
- void *arg __attribute__((unused)))
+ void *arg MY_ATTRIBUTE((unused)))
{
if (action == free_free)
my_free((void*)w->pos);
/*
- Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
+ Copyright (c) 2000, 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
/* TODO: respect myisam_repair_threads variable */
my_snprintf(buf, 40, "Repair with %d threads", my_count_bits(key_map));
thd_proc_info(thd, buf);
+ /*
+ The new file is created with the right stats, so we can skip
+ copying file stats from old to new.
+ */
error = mi_repair_parallel(¶m, file, fixed_name,
- param.testflag & T_QUICK);
+ param.testflag & T_QUICK, TRUE);
thd_proc_info(thd, "Repair done"); // to reset proc_info, as
// it was pointing to local buffer
}
else
{
thd_proc_info(thd, "Repair by sorting");
+ /*
+ The new file is created with the right stats, so we can skip
+ copying file stats from old to new.
+ */
error = mi_repair_by_sort(¶m, file, fixed_name,
- param.testflag & T_QUICK);
+ param.testflag & T_QUICK, TRUE);
}
}
else
{
thd_proc_info(thd, "Repair with keycache");
param.testflag &= ~T_REP_BY_SORT;
+ /*
+ The new file is created with the right stats, so we can skip
+ copying file stats from old to new.
+ */
error= mi_repair(¶m, file, fixed_name,
- param.testflag & T_QUICK);
+ param.testflag & T_QUICK, TRUE);
}
#ifdef HAVE_MMAP
if (remap)
{
optimize_done=1;
thd_proc_info(thd, "Sorting index");
- error=mi_sort_index(¶m,file,fixed_name);
+ /*
+ The new file is created with the right stats, so we can skip
+ copying file stats from old to new.
+ */
+ error=mi_sort_index(¶m,file,fixed_name, TRUE);
}
if (!statistics_done && (local_testflag & T_STATISTICS))
{
}
int ha_myisam::index_next_same(uchar *buf,
- const uchar *key __attribute__((unused)),
- uint length __attribute__((unused)))
+ const uchar *key MY_ATTRIBUTE((unused)),
+ uint length MY_ATTRIBUTE((unused)))
{
int error;
DBUG_ASSERT(inited==INDEX);
/*
- Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
+ Copyright (c) 2000, 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
/* Save new datafile-name in temp_filename */
int mi_repair(MI_CHECK *param, register MI_INFO *info,
- char * name, int rep_quick)
+ char * name, int rep_quick, my_bool no_copy_stat)
{
int error,got_error;
ha_rows start_records,new_header_length;
/* Replace the actual file with the temporary file */
if (new_file >= 0)
{
+ myf flags= 0;
+ if (param->testflag & T_BACKUP_DATA)
+ flags |= MY_REDEL_MAKE_BACKUP;
+ if (no_copy_stat)
+ flags |= MY_REDEL_NO_COPY_STAT;
mysql_file_close(new_file, MYF(0));
info->dfile=new_file= -1;
/*
info->s->file_map= NULL;
}
if (change_to_newfile(share->data_file_name, MI_NAME_DEXT, DATA_TMP_EXT,
- (param->testflag & T_BACKUP_DATA ?
- MYF(MY_REDEL_MAKE_BACKUP): MYF(0))) ||
+ flags) ||
mi_open_datafile(info,share,name,-1))
got_error=1;
/* Tell system that we want all memory for our cache */
-void lock_memory(MI_CHECK *param __attribute__((unused)))
+void lock_memory(MI_CHECK *param MY_ATTRIBUTE((unused)))
{
#ifdef SUN_OS /* Key-cacheing thrases on sun 4.1 */
if (param->opt_lock_memory)
/* Sort index for more efficent reads */
-int mi_sort_index(MI_CHECK *param, register MI_INFO *info, char * name)
+int mi_sort_index(MI_CHECK *param, register MI_INFO *info, char * name,
+ my_bool no_copy_stat)
{
reg2 uint key;
reg1 MI_KEYDEF *keyinfo;
share->kfile = -1;
(void) mysql_file_close(new_file, MYF(MY_WME));
if (change_to_newfile(share->index_file_name, MI_NAME_IEXT, INDEX_TMP_EXT,
- MYF(0)) ||
+ no_copy_stat ? MYF(MY_REDEL_NO_COPY_STAT) : MYF(0)) ||
mi_open_keyfile(share))
goto err2;
info->lock_type= F_UNLCK; /* Force mi_readinfo to lock */
info MyISAM handler to repair
name Name of table (for warnings)
rep_quick set to <> 0 if we should not change data file
+ no_copy_stat Don't copy file stats from old to new file,
+ assume that new file was created with correct stats
RESULT
0 ok
*/
int mi_repair_by_sort(MI_CHECK *param, register MI_INFO *info,
- const char * name, int rep_quick)
+ const char * name, int rep_quick, my_bool no_copy_stat)
{
int got_error;
uint i;
/* Replace the actual file with the temporary file */
if (new_file >= 0)
{
+ myf flags= 0;
+ if (param->testflag & T_BACKUP_DATA)
+ flags |= MY_REDEL_MAKE_BACKUP;
+ if (no_copy_stat)
+ flags |= MY_REDEL_NO_COPY_STAT;
mysql_file_close(new_file, MYF(0));
info->dfile=new_file= -1;
if (change_to_newfile(share->data_file_name,MI_NAME_DEXT, DATA_TMP_EXT,
- (param->testflag & T_BACKUP_DATA ?
- MYF(MY_REDEL_MAKE_BACKUP): MYF(0))) ||
+ flags) ||
mi_open_datafile(info,share,name,-1))
got_error=1;
}
info MyISAM handler to repair
name Name of table (for warnings)
rep_quick set to <> 0 if we should not change data file
+ no_copy_stat Don't copy file stats from old to new file,
+ assume that new file was created with correct stats
DESCRIPTION
Same as mi_repair_by_sort but do it multithreaded
*/
int mi_repair_parallel(MI_CHECK *param, register MI_INFO *info,
- const char * name, int rep_quick)
+ const char * name, int rep_quick, my_bool no_copy_stat)
{
int got_error;
uint i,key, total_key_length, istep;
/* Replace the actual file with the temporary file */
if (new_file >= 0)
{
+ myf flags= 0;
+ if (param->testflag & T_BACKUP_DATA)
+ flags |= MY_REDEL_MAKE_BACKUP;
+ if (no_copy_stat)
+ flags |= MY_REDEL_NO_COPY_STAT;
mysql_file_close(new_file, MYF(0));
info->dfile=new_file= -1;
if (change_to_newfile(share->data_file_name, MI_NAME_DEXT, DATA_TMP_EXT,
- (param->testflag & T_BACKUP_DATA ?
- MYF(MY_REDEL_MAKE_BACKUP): MYF(0))) ||
+ flags) ||
mi_open_datafile(info,share,name,-1))
got_error=1;
}
-/* Copyright (c) 2000-2006 MySQL AB, 2009 Sun Microsystems, Inc.
- Use is subject to license terms.
+/* Copyright (c) 2000, 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
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
-void _mi_report_crashed(MI_INFO *file __attribute__((unused)),
- const char *message __attribute__((unused)),
- const char *sfile __attribute__((unused)),
- uint sline __attribute__((unused)))
+void _mi_report_crashed(MI_INFO *file MY_ATTRIBUTE((unused)),
+ const char *message MY_ATTRIBUTE((unused)),
+ const char *sfile MY_ATTRIBUTE((unused)),
+ uint sline MY_ATTRIBUTE((unused)))
{
}
-/* Copyright (c) 2003-2008 MySQL AB, 2009 Sun Microsystems, Inc.
- Use is subject to license terms.
+/* Copyright (c) 2003, 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
*/
int mi_assign_to_key_cache(MI_INFO *info,
- ulonglong key_map __attribute__((unused)),
+ ulonglong key_map MY_ATTRIBUTE((unused)),
KEY_CACHE *key_cache)
{
int error= 0;
-/* Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2000, 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
*************************************************************************/
int mi_open_datafile(MI_INFO *info, MYISAM_SHARE *share, const char *org_name,
- File file_to_dup __attribute__((unused)))
+ File file_to_dup MY_ATTRIBUTE((unused)))
{
char *data_name= share->data_file_name;
char real_data_name[FN_REFLEN];
-/* Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2000, 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
}
static void uf_constant(MI_COLUMNDEF *rec,
- MI_BIT_BUFF *bit_buff __attribute__((unused)),
+ MI_BIT_BUFF *bit_buff MY_ATTRIBUTE((unused)),
uchar *to,
uchar *end)
{
/*ARGSUSED*/
-static void uf_zero(MI_COLUMNDEF *rec __attribute__((unused)),
- MI_BIT_BUFF *bit_buff __attribute__((unused)),
+static void uf_zero(MI_COLUMNDEF *rec MY_ATTRIBUTE((unused)),
+ MI_BIT_BUFF *bit_buff MY_ATTRIBUTE((unused)),
uchar *to, uchar *end)
{
memset(to, 0, (end-to));
static void uf_varchar1(MI_COLUMNDEF *rec, MI_BIT_BUFF *bit_buff,
- uchar *to, uchar *end __attribute__((unused)))
+ uchar *to, uchar *end MY_ATTRIBUTE((unused)))
{
if (get_bit(bit_buff))
to[0]= 0; /* Zero lengths */
static void uf_varchar2(MI_COLUMNDEF *rec, MI_BIT_BUFF *bit_buff,
- uchar *to, uchar *end __attribute__((unused)))
+ uchar *to, uchar *end MY_ATTRIBUTE((unused)))
{
if (get_bit(bit_buff))
to[0]=to[1]=0; /* Zero lengths */
static int _mi_read_rnd_mempack_record(MI_INFO *info, uchar *buf,
register my_off_t filepos,
my_bool skip_deleted_blocks
- __attribute__((unused)))
+ MY_ATTRIBUTE((unused)))
{
MI_BLOCK_INFO block_info;
MYISAM_SHARE *share=info->s;
-/* Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2000, 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
int _mi_bin_search(MI_INFO *info, register MI_KEYDEF *keyinfo, uchar *page,
uchar *key, uint key_len, uint comp_flag, uchar **ret_pos,
- uchar *buff __attribute__((unused)), my_bool *last_key)
+ uchar *buff MY_ATTRIBUTE((unused)), my_bool *last_key)
{
reg4 int start,mid,end,save_end;
int flag;
int
_mi_calc_static_key_length(MI_KEYDEF *keyinfo,uint nod_flag,
- uchar *next_pos __attribute__((unused)),
- uchar *org_key __attribute__((unused)),
- uchar *prev_key __attribute__((unused)),
+ uchar *next_pos MY_ATTRIBUTE((unused)),
+ uchar *org_key MY_ATTRIBUTE((unused)),
+ uchar *prev_key MY_ATTRIBUTE((unused)),
uchar *key, MI_KEY_PARAM *s_temp)
{
s_temp->key=key;
int
_mi_calc_var_key_length(MI_KEYDEF *keyinfo,uint nod_flag,
- uchar *next_pos __attribute__((unused)),
- uchar *org_key __attribute__((unused)),
- uchar *prev_key __attribute__((unused)),
+ uchar *next_pos MY_ATTRIBUTE((unused)),
+ uchar *org_key MY_ATTRIBUTE((unused)),
+ uchar *prev_key MY_ATTRIBUTE((unused)),
uchar *key, MI_KEY_PARAM *s_temp)
{
s_temp->key=key;
/* store key without compression */
-void _mi_store_static_key(MI_KEYDEF *keyinfo __attribute__((unused)),
+void _mi_store_static_key(MI_KEYDEF *keyinfo MY_ATTRIBUTE((unused)),
register uchar *key_pos,
register MI_KEY_PARAM *s_temp)
{
{ *((pos)++) = (uchar) ((length) >> 8); *((pos)++) = (uchar) (length); } }
-void _mi_store_var_pack_key(MI_KEYDEF *keyinfo __attribute__((unused)),
+void _mi_store_var_pack_key(MI_KEYDEF *keyinfo MY_ATTRIBUTE((unused)),
register uchar *key_pos,
register MI_KEY_PARAM *s_temp)
{
/* variable length key with prefix compression */
-void _mi_store_bin_pack_key(MI_KEYDEF *keyinfo __attribute__((unused)),
+void _mi_store_bin_pack_key(MI_KEYDEF *keyinfo MY_ATTRIBUTE((unused)),
register uchar *key_pos,
register MI_KEY_PARAM *s_temp)
{
-/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2000, 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
ulong myisam_data_pointer_size=4;
ulonglong myisam_mmap_size= SIZE_T_MAX, myisam_mmap_used= 0;
-static int always_valid(const char *filename __attribute__((unused)))
+static int always_valid(const char *filename MY_ATTRIBUTE((unused)))
{
return 0;
}
/*
- Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
+ Copyright (c) 2000, 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
static my_bool
-get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
- char *argument __attribute__((unused)))
+get_one_option(int optid, const struct my_option *opt MY_ATTRIBUTE((unused)),
+ char *argument MY_ATTRIBUTE((unused)))
{
switch(optid) {
case 'a':
-/* Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2001, 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
static my_bool
-get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
- char *argument __attribute__((unused)))
+get_one_option(int optid, const struct my_option *opt MY_ATTRIBUTE((unused)),
+ char *argument MY_ATTRIBUTE((unused)))
{
switch(optid) {
case 'd':
-/* Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2000, 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
static my_bool
get_one_option(int optid,
- const struct my_option *opt __attribute__((unused)),
+ const struct my_option *opt MY_ATTRIBUTE((unused)),
char *argument)
{
switch (optid) {
info->s->state.key_map,
param->force_sort))
{
+ /*
+ The new file might not be created with the right stats depending
+ on how myisamchk is run, so we must copy file stats from old to new.
+ */
if (param->testflag & T_REP_BY_SORT)
- error=mi_repair_by_sort(param,info,filename,rep_quick);
+ error= mi_repair_by_sort(param, info, filename, rep_quick, FALSE);
else
- error=mi_repair_parallel(param,info,filename,rep_quick);
+ error= mi_repair_parallel(param, info, filename, rep_quick, FALSE);
state_updated=1;
}
else if (param->testflag & T_REP_ANY)
- error=mi_repair(param, info,filename,rep_quick);
+ error= mi_repair(param, info, filename, rep_quick, FALSE);
}
if (!error && param->testflag & T_SORT_RECORDS)
{
{
if (param->verbose)
puts("Table had a compressed index; We must now recreate the index");
- error=mi_repair_by_sort(param,info,filename,1);
+ error= mi_repair_by_sort(param, info, filename, 1, FALSE);
}
}
}
if (!error && param->testflag & T_SORT_INDEX)
- error=mi_sort_index(param,info,filename);
+ error= mi_sort_index(param, info, filename, FALSE);
if (!error)
share->state.changed&= ~(STATE_CHANGED | STATE_CRASHED |
STATE_CRASHED_ON_REPAIR);
static int not_killed= 0;
-volatile int *killed_ptr(MI_CHECK *param __attribute__((unused)))
+volatile int *killed_ptr(MI_CHECK *param MY_ATTRIBUTE((unused)))
{
return ¬_killed; /* always NULL */
}
/* print warnings and errors */
/* VARARGS */
-void mi_check_print_info(MI_CHECK *param __attribute__((unused)),
+void mi_check_print_info(MI_CHECK *param MY_ATTRIBUTE((unused)),
const char *fmt,...)
{
va_list args;
-/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2000, 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
} /* read_string */
-static int file_info_compare(void* cmp_arg __attribute__((unused)),
+static int file_info_compare(void* cmp_arg MY_ATTRIBUTE((unused)),
void *a, void *b)
{
long lint;
/* ARGSUSED */
static int test_if_open (struct file_info *key,
- element_count count __attribute__((unused)),
+ element_count count MY_ATTRIBUTE((unused)),
struct test_if_open_param *param)
{
if (!strcmp(key->name,param->name) && key->id > param->max_id)
/* ARGSUSED */
static int test_when_accessed (struct file_info *key,
- element_count count __attribute__((unused)),
+ element_count count MY_ATTRIBUTE((unused)),
struct st_access_param *access_param)
{
if (key->accessed < access_param->min_accessed && ! key->closed)
-/* Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2000, 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
#endif
#include <my_getopt.h>
#include <assert.h>
+#include <welcome_copyright_notice.h> // ORACLE_WELCOME_COPYRIGHT_NOTICE
#if SIZEOF_LONG_LONG > 4
#define BITS_SAVED 64
uint trees,
HUFF_COUNTS *huff_counts,
uint fields);
-static int compare_tree(void* cmp_arg __attribute__((unused)),
+static int compare_tree(void* cmp_arg MY_ATTRIBUTE((unused)),
const uchar *s,const uchar *t);
static int get_statistic(PACK_MRG_INFO *mrg,HUFF_COUNTS *huff_counts);
static void check_counts(HUFF_COUNTS *huff_counts,uint trees,
static void usage(void)
{
print_version();
- puts("Copyright 2002-2008 MySQL AB, 2008 Sun Microsystems, Inc.");
- puts("This software comes with ABSOLUTELY NO WARRANTY. This is free software,");
- puts("and you are welcome to modify and redistribute it under the GPL license\n");
+ puts(ORACLE_WELCOME_COPYRIGHT_NOTICE("2002"));
puts("Pack a MyISAM-table to take much less space.");
puts("Keys are not updated, you must run myisamchk -rq on the datafile");
static my_bool
-get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
+get_one_option(int optid, const struct my_option *opt MY_ATTRIBUTE((unused)),
char *argument)
{
uint length;
DBUG_RETURN(error != HA_ERR_END_OF_FILE);
}
-static int compare_huff_elements(void *not_used __attribute__((unused)),
+static int compare_huff_elements(void *not_used MY_ATTRIBUTE((unused)),
uchar *a, uchar *b)
{
return *((my_off_t*) a) < *((my_off_t*) b) ? -1 :
return 0;
}
-static int compare_tree(void* cmp_arg __attribute__((unused)),
+static int compare_tree(void* cmp_arg MY_ATTRIBUTE((unused)),
register const uchar *s, register const uchar *t)
{
uint length;
-/* Copyright (c) 2002, 2011, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2002, 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
-1
};
-int main(int argc __attribute__((unused)),char *argv[] __attribute__((unused)))
+int main(int argc MY_ATTRIBUTE((unused)),char *argv[] MY_ATTRIBUTE((unused)))
{
MY_INIT(argv[0]);
exit(run_test("rt_test"));
static void print_record(uchar * record,
- my_off_t offs __attribute__((unused)),
+ my_off_t offs MY_ATTRIBUTE((unused)),
const char * tail)
{
int i;
}
#else
-int main(int argc __attribute__((unused)),char *argv[] __attribute__((unused)))
+int main(int argc MY_ATTRIBUTE((unused)),char *argv[] MY_ATTRIBUTE((unused)))
{
exit(0);
}
-/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2000, 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
}
-static int write_merge_key(MI_SORT_PARAM *info __attribute__((unused)),
+static int write_merge_key(MI_SORT_PARAM *info MY_ATTRIBUTE((unused)),
IO_CACHE *to_file, uchar *key,
uint sort_length, uint count)
{
-/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2000, 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
*/
static int sp_add_point_to_mbr(uchar *(*wkb), uchar *end, uint n_dims,
- uchar byte_order __attribute__((unused)),
+ uchar byte_order MY_ATTRIBUTE((unused)),
double *mbr)
{
double ord;
-/* Copyright (c) 2002, 2011, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2002, 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
static char blob_key[MAX_REC_LENGTH];
-int main(int argc __attribute__((unused)),char *argv[])
+int main(int argc MY_ATTRIBUTE((unused)),char *argv[])
{
MY_INIT(argv[0]);
exit(run_test("sp_test"));
}
#else
-int main(int argc __attribute__((unused)),char *argv[] __attribute__((unused)))
+int main(int argc MY_ATTRIBUTE((unused)),char *argv[] MY_ATTRIBUTE((unused)))
{
exit(0);
}
-/* Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2000, 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
and adds a child list of TABLE_LIST to the parent handler.
*/
-int ha_myisammrg::open(const char *name, int mode __attribute__((unused)),
+int ha_myisammrg::open(const char *name, int mode MY_ATTRIBUTE((unused)),
uint test_if_locked_arg)
{
DBUG_ENTER("ha_myisammrg::open");
}
int ha_myisammrg::index_next_same(uchar * buf,
- const uchar *key __attribute__((unused)),
- uint length __attribute__((unused)))
+ const uchar *key MY_ATTRIBUTE((unused)),
+ uint length MY_ATTRIBUTE((unused)))
{
int error;
DBUG_ASSERT(this->file->children_attached);
/*
- Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved.
+ Copyright (c) 2004, 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
#endif
/**
- * __attribute__((noreturn)) was introduce in gcc 2.5
+ * MY_ATTRIBUTE((noreturn)) was introduce in gcc 2.5
*/
#if (GCC_VERSION >= 2005)
-#define ATTRIBUTE_NORETURN __attribute__((noreturn))
+#define ATTRIBUTE_NORETURN MY_ATTRIBUTE((noreturn))
#else
#define ATTRIBUTE_NORETURN
#endif
/**
- * __attribute__((noinline)) was introduce in gcc 3.1
+ * MY_ATTRIBUTE((noinline)) was introduce in gcc 3.1
*/
#if (GCC_VERSION >= 3001)
-#define ATTRIBUTE_NOINLINE __attribute__((noinline))
+#define ATTRIBUTE_NOINLINE MY_ATTRIBUTE((noinline))
#else
#define ATTRIBUTE_NOINLINE
#endif
/*
- Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved.
+ Copyright (c) 2004, 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
void (*usage)(void));
my_bool
ndb_std_get_one_option(int optid,
- const struct my_option *opt __attribute__((unused)),
+ const struct my_option *opt MY_ATTRIBUTE((unused)),
char *argument);
void ndb_usage(void (*usagefunc)(void), const char *load_default_groups[],
/*
- Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
+ Copyright (c) 2008, 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
my_bool
ndb_std_get_one_option(int optid,
- const struct my_option *opt __attribute__((unused)),
- char *argument __attribute__((unused)))
+ const struct my_option *opt MY_ATTRIBUTE((unused)),
+ char *argument MY_ATTRIBUTE((unused)))
{
switch (optid) {
#ifndef DBUG_OFF
/*
- Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
+ Copyright (c) 2003, 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
};
static my_bool
-get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
+get_one_option(int optid, const struct my_option *opt MY_ATTRIBUTE((unused)),
char *argument)
{
return 0;
/*
- Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
+ Copyright (c) 2003, 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
}
static my_bool
-get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
+get_one_option(int optid, const struct my_option *opt MY_ATTRIBUTE((unused)),
char *argument)
{
#ifndef DBUG_OFF
-/* Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved.
+/* 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
CHARSET_INFO *cs= get_charset(statement->m_sqltext_cs_number, MYF(0));
size_t valid_length= statement->m_sqltext_length;
- if (cs->mbmaxlen > 1)
+ if (cs != NULL)
{
- int well_formed_error;
- valid_length= cs->cset->well_formed_len(cs, statement->m_sqltext, statement->m_sqltext + valid_length,
- valid_length, &well_formed_error);
+ if (cs->mbmaxlen > 1)
+ {
+ int well_formed_error;
+ valid_length= cs->cset->well_formed_len(cs,
+ statement->m_sqltext,
+ statement->m_sqltext + valid_length,
+ valid_length,
+ &well_formed_error);
+ }
}
m_row.m_sqltext.set_charset(cs);
-/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2000, 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
static void
-default_reporter(enum loglevel level __attribute__ ((unused)),
- const char *format __attribute__ ((unused)),
+default_reporter(enum loglevel level MY_ATTRIBUTE ((unused)),
+ const char *format MY_ATTRIBUTE ((unused)),
...)
{
}
fprint_copyright(FILE *file)
{
fprintf(file,
-"/* Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved.\n"
+"/* Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved.\n"
"\n"
" This program is free software; you can redistribute it and/or modify\n"
" it under the terms of the GNU General Public License as published by\n"
int
-main(int argc, char **argv __attribute__((unused)))
+main(int argc, char **argv MY_ATTRIBUTE((unused)))
{
CHARSET_INFO ncs;
CHARSET_INFO *cs;
-/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2000, 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
/* Compare strings */
-static int my_strnncoll_big5(const CHARSET_INFO *cs __attribute__((unused)),
+static int my_strnncoll_big5(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)),
const uchar *a, size_t a_length,
const uchar *b, size_t b_length,
my_bool b_is_prefix)
/* compare strings, ignore end space */
-static int my_strnncollsp_big5(const CHARSET_INFO* cs __attribute__((unused)),
+static int my_strnncollsp_big5(const CHARSET_INFO* cs MY_ATTRIBUTE((unused)),
const uchar *a, size_t a_length,
const uchar *b, size_t b_length,
my_bool diff_if_only_endspace_difference)
}
-static uint ismbchar_big5(const CHARSET_INFO *cs __attribute__((unused)),
+static uint ismbchar_big5(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)),
const char* p, const char *e)
{
return (isbig5head(*(p)) && (e)-(p)>1 && isbig5tail(*((p)+1))? 2: 0);
}
-static uint mbcharlen_big5(const CHARSET_INFO *cs __attribute__((unused)),
+static uint mbcharlen_big5(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)),
uint c)
{
return (isbig5head(c)? 2 : 1);
static int
-my_wc_mb_big5(const CHARSET_INFO *cs __attribute__((unused)),
+my_wc_mb_big5(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)),
my_wc_t wc, uchar *s, uchar *e)
{
static int
-my_mb_wc_big5(const CHARSET_INFO *cs __attribute__((unused)),
+my_mb_wc_big5(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)),
my_wc_t *pwc,const uchar *s,const uchar *e)
{
CP950 and HKSCS additional characters are also accepted.
*/
static
-size_t my_well_formed_len_big5(const CHARSET_INFO *cs __attribute__((unused)),
+size_t my_well_formed_len_big5(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)),
const char *b, const char *e,
size_t pos, int *error)
{
/* Copyright (c) 2002 MySQL AB & tommy@valley.ne.jp
- Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved.
+ Copyright (c) 2002, 2016, Oracle and/or its affiliates. All rights reserved.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
static my_bool
my_coll_init_8bit_bin(CHARSET_INFO *cs,
- MY_CHARSET_LOADER *loader __attribute__((unused)))
+ MY_CHARSET_LOADER *loader MY_ATTRIBUTE((unused)))
{
cs->max_sort_char=255;
return FALSE;
}
-static int my_strnncoll_binary(const CHARSET_INFO *cs __attribute__((unused)),
+static int my_strnncoll_binary(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)),
const uchar *s, size_t slen,
const uchar *t, size_t tlen,
my_bool t_is_prefix)
}
-size_t my_lengthsp_binary(const CHARSET_INFO *cs __attribute__((unused)),
- const char *ptr __attribute__((unused)),
+size_t my_lengthsp_binary(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)),
+ const char *ptr MY_ATTRIBUTE((unused)),
size_t length)
{
return length;
*/
static int my_strnncollsp_binary(const CHARSET_INFO *cs
- __attribute__((unused)),
+ MY_ATTRIBUTE((unused)),
const uchar *s, size_t slen,
const uchar *t, size_t tlen,
my_bool diff_if_only_endspace_difference
- __attribute__((unused)))
+ MY_ATTRIBUTE((unused)))
{
return my_strnncoll_binary(cs,s,slen,t,tlen,0);
}
static int my_strnncoll_8bit_bin(const CHARSET_INFO *cs
- __attribute__((unused)),
+ MY_ATTRIBUTE((unused)),
const uchar *s, size_t slen,
const uchar *t, size_t tlen,
my_bool t_is_prefix)
*/
static int my_strnncollsp_8bit_bin(const CHARSET_INFO *cs
- __attribute__((unused)),
+ MY_ATTRIBUTE((unused)),
const uchar *a, size_t a_length,
const uchar *b, size_t b_length,
my_bool diff_if_only_endspace_difference)
/* This function is used for all conversion functions */
-static size_t my_case_str_bin(const CHARSET_INFO *cs __attribute__((unused)),
- char *str __attribute__((unused)))
+static size_t my_case_str_bin(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)),
+ char *str MY_ATTRIBUTE((unused)))
{
return 0;
}
-static size_t my_case_bin(const CHARSET_INFO *cs __attribute__((unused)),
- char *src __attribute__((unused)),
+static size_t my_case_bin(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)),
+ char *src MY_ATTRIBUTE((unused)),
size_t srclen,
- char *dst __attribute__((unused)),
- size_t dstlen __attribute__((unused)))
+ char *dst MY_ATTRIBUTE((unused)),
+ size_t dstlen MY_ATTRIBUTE((unused)))
{
return srclen;
}
-static int my_strcasecmp_bin(const CHARSET_INFO *cs __attribute__((unused)),
+static int my_strcasecmp_bin(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)),
const char *s, const char *t)
{
return strcmp(s,t);
}
-uint my_mbcharlen_8bit(const CHARSET_INFO *cs __attribute__((unused)),
- uint c __attribute__((unused)))
+uint my_mbcharlen_8bit(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)),
+ uint c MY_ATTRIBUTE((unused)))
{
return 1;
}
-static int my_mb_wc_bin(const CHARSET_INFO *cs __attribute__((unused)),
+static int my_mb_wc_bin(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)),
my_wc_t *wc,
const uchar *str,
- const uchar *end __attribute__((unused)))
+ const uchar *end MY_ATTRIBUTE((unused)))
{
if (str >= end)
return MY_CS_TOOSMALL;
}
-static int my_wc_mb_bin(const CHARSET_INFO *cs __attribute__((unused)),
+static int my_wc_mb_bin(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)),
my_wc_t wc,
uchar *s,
- uchar *e __attribute__((unused)))
+ uchar *e MY_ATTRIBUTE((unused)))
{
if (s >= e)
return MY_CS_TOOSMALL;
}
-void my_hash_sort_8bit_bin(const CHARSET_INFO *cs __attribute__((unused)),
+void my_hash_sort_8bit_bin(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)),
const uchar *key, size_t len,
ulong *nr1, ulong *nr2)
{
}
-void my_hash_sort_bin(const CHARSET_INFO *cs __attribute__((unused)),
+void my_hash_sort_bin(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)),
const uchar *key, size_t len,ulong *nr1, ulong *nr2)
{
const uchar *pos = key;
static
-uint my_instr_bin(const CHARSET_INFO *cs __attribute__((unused)),
+uint my_instr_bin(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)),
const char *b, size_t b_length,
const char *s, size_t s_length,
my_match_t *match, uint nmatch)
-/* Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2005, 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
(0x80<=(c) && (c)<=0xfc))
-static uint ismbchar_cp932(const CHARSET_INFO *cs __attribute__((unused)),
+static uint ismbchar_cp932(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)),
const char* p, const char *e)
{
return (iscp932head((uchar) *p) && (e-p)>1 && iscp932tail((uchar)p[1]) ? 2: 0);
}
-static uint mbcharlen_cp932(const CHARSET_INFO *cs __attribute__((unused)),
+static uint mbcharlen_cp932(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)),
uint c)
{
return (iscp932head((uchar) c) ? 2 : 1);
}
-static int my_strnncoll_cp932(const CHARSET_INFO *cs __attribute__((unused)),
+static int my_strnncoll_cp932(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)),
const uchar *a, size_t a_length,
const uchar *b, size_t b_length,
my_bool b_is_prefix)
static int my_strnncollsp_cp932(const CHARSET_INFO *cs
- __attribute__((unused)),
+ MY_ATTRIBUTE((unused)),
const uchar *a, size_t a_length,
const uchar *b, size_t b_length,
my_bool diff_if_only_endspace_difference
- __attribute__((unused)))
+ MY_ATTRIBUTE((unused)))
{
const uchar *a_end= a + a_length;
const uchar *b_end= b + b_length;
*/
static int
-my_mb_wc_cp932(const CHARSET_INFO *cs __attribute__((unused)),
+my_mb_wc_cp932(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)),
my_wc_t *pwc, const uchar *s, const uchar *e){
int hi;
@retval MY_CS_ILUNI If the Unicode character does not exist in CP932
*/
static int
-my_wc_mb_cp932(const CHARSET_INFO *cs __attribute__((unused)),
+my_wc_mb_cp932(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)),
my_wc_t wc, uchar *s, uchar *e)
{
int code;
static
-size_t my_numcells_cp932(const CHARSET_INFO *cs __attribute__((unused)),
+size_t my_numcells_cp932(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)),
const char *str, const char *str_end)
{
size_t clen= 0;
static
size_t my_well_formed_len_cp932(const CHARSET_INFO *cs
- __attribute__((unused)),
+ MY_ATTRIBUTE((unused)),
const char *b, const char *e,
size_t pos, int *error)
{
-/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2000, 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 length of the strings being specified
*/
-static int my_strnncoll_czech(const CHARSET_INFO *cs __attribute__((unused)),
+static int my_strnncoll_czech(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)),
const uchar *s1, size_t len1,
const uchar *s2, size_t len2,
my_bool s2_is_prefix)
const uchar *s, size_t slen,
const uchar *t, size_t tlen,
my_bool diff_if_only_endspace_difference
- __attribute__((unused)))
+ MY_ATTRIBUTE((unused)))
{
for ( ; slen && s[slen-1] == ' ' ; slen--);
for ( ; tlen && t[tlen-1] == ' ' ; tlen--);
*/
static size_t
my_strnxfrmlen_czech(const CHARSET_INFO *cs
- __attribute__((unused)), size_t len)
+ MY_ATTRIBUTE((unused)), size_t len)
{
return len * 4 + 4;
}
*/
static size_t
-my_strnxfrm_czech(const CHARSET_INFO *cs __attribute__((unused)),
+my_strnxfrm_czech(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)),
uchar *dest, size_t len,
- uint nweights_arg __attribute__((unused)),
+ uint nweights_arg MY_ATTRIBUTE((unused)),
const uchar *src, size_t srclen, uint flags)
{
int value;
static my_bool my_like_range_czech(const CHARSET_INFO *cs
- __attribute__((unused)),
+ MY_ATTRIBUTE((unused)),
const char *ptr,size_t ptr_length,
pbool escape, pbool w_one, pbool w_many,
size_t res_length, char *min_str,
-/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2000, 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
iseuc_kr_tail3(c))
-static uint ismbchar_euc_kr(const CHARSET_INFO *cs __attribute__((unused)),
+static uint ismbchar_euc_kr(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)),
const char* p, const char *e)
{
return ((*(uchar*)(p)<0x80)? 0:\
0);
}
-static uint mbcharlen_euc_kr(const CHARSET_INFO *cs __attribute__((unused)),
+static uint mbcharlen_euc_kr(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)),
uint c)
{
return (iseuc_kr_head(c) ? 2 : 1);
static int
-my_wc_mb_euc_kr(const CHARSET_INFO *cs __attribute__((unused)),
+my_wc_mb_euc_kr(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)),
my_wc_t wc, uchar *s, uchar *e)
{
int code;
static int
-my_mb_wc_euc_kr(const CHARSET_INFO *cs __attribute__((unused)),
+my_mb_wc_euc_kr(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)),
my_wc_t *pwc, const uchar *s, const uchar *e)
{
Returns well formed length of a EUC-KR string.
*/
static size_t
-my_well_formed_len_euckr(const CHARSET_INFO *cs __attribute__((unused)),
+my_well_formed_len_euckr(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)),
const char *b, const char *e,
size_t pos, int *error)
{
/* Copyright (c) 2002 MySQL AB & tommy@valley.ne.jp
- Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved.
+ Copyright (c) 2005, 2016, Oracle and/or its affiliates. All rights reserved.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
#define iseucjpms_ss3(c) (((c)&0xff) == 0x8f)
-static uint ismbchar_eucjpms(const CHARSET_INFO *cs __attribute__((unused)),
+static uint ismbchar_eucjpms(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)),
const char* p, const char *e)
{
return ((*(uchar*)(p)<0x80)? 0:\
0);
}
-static uint mbcharlen_eucjpms(const CHARSET_INFO *cs __attribute__((unused)),
+static uint mbcharlen_eucjpms(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)),
uint c)
{
return (iseucjpms(c)? 2: iseucjpms_ss2(c)? 2: iseucjpms_ss3(c)? 3: 1);
@retval MY_CS_ILSEQ If a wrong byte sequence was found
*/
static int
-my_mb_wc_eucjpms(const CHARSET_INFO *cs __attribute__((unused)),
+my_mb_wc_eucjpms(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)),
my_wc_t *pwc, const uchar *s, const uchar *e)
{
int hi;
@retval MY_CS_ILUNI If the Unicode character does not exist in EUCJPMS
*/
static int
-my_wc_mb_eucjpms(const CHARSET_INFO *cs __attribute__((unused)),
+my_wc_mb_eucjpms(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)),
my_wc_t wc, uchar *s, uchar *e)
{
int jp;
static
size_t my_well_formed_len_eucjpms(const CHARSET_INFO *cs
- __attribute__((unused)),
+ MY_ATTRIBUTE((unused)),
const char *beg, const char *end, size_t pos,
int *error)
{
static
-size_t my_numcells_eucjpms(const CHARSET_INFO *cs __attribute__((unused)),
+size_t my_numcells_eucjpms(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)),
const char *str, const char *str_end)
{
size_t clen;
-/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2000, 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
#define isgb2312tail(c) (0xa1<=(uchar)(c) && (uchar)(c)<=0xfe)
-static uint ismbchar_gb2312(const CHARSET_INFO *cs __attribute__((unused)),
+static uint ismbchar_gb2312(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)),
const char* p, const char *e)
{
return (isgb2312head(*(p)) && (e)-(p)>1 && isgb2312tail(*((p)+1))? 2: 0);
}
-static uint mbcharlen_gb2312(const CHARSET_INFO *cs __attribute__((unused)),
+static uint mbcharlen_gb2312(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)),
uint c)
{
return (isgb2312head(c)? 2 : 1);
static int
-my_wc_mb_gb2312(const CHARSET_INFO *cs __attribute__((unused)),
+my_wc_mb_gb2312(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)),
my_wc_t wc, uchar *s, uchar *e)
{
int code;
static int
-my_mb_wc_gb2312(const CHARSET_INFO *cs __attribute__((unused)),
+my_mb_wc_gb2312(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)),
my_wc_t *pwc, const uchar *s, const uchar *e){
int hi;
Returns well formed length of a EUC-KR string.
*/
static size_t
-my_well_formed_len_gb2312(const CHARSET_INFO *cs __attribute__((unused)),
+my_well_formed_len_gb2312(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)),
const char *b, const char *e,
size_t pos, int *error)
{
-/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2000, 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
-int my_strnncoll_gbk(const CHARSET_INFO *cs __attribute__((unused)),
+int my_strnncoll_gbk(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)),
const uchar *a, size_t a_length,
const uchar *b, size_t b_length,
my_bool b_is_prefix)
}
-static int my_strnncollsp_gbk(const CHARSET_INFO * cs __attribute__((unused)),
+static int my_strnncollsp_gbk(const CHARSET_INFO * cs MY_ATTRIBUTE((unused)),
const uchar *a, size_t a_length,
const uchar *b, size_t b_length,
my_bool diff_if_only_endspace_difference)
}
-static uint ismbchar_gbk(const CHARSET_INFO *cs __attribute__((unused)),
+static uint ismbchar_gbk(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)),
const char* p, const char *e)
{
return (isgbkhead(*(p)) && (e)-(p)>1 && isgbktail(*((p)+1))? 2: 0);
}
-static uint mbcharlen_gbk(const CHARSET_INFO *cs __attribute__((unused)),
+static uint mbcharlen_gbk(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)),
uint c)
{
return (isgbkhead(c)? 2 : 1);
}
static int
-my_wc_mb_gbk(const CHARSET_INFO *cs __attribute__((unused)),
+my_wc_mb_gbk(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)),
my_wc_t wc, uchar *s, uchar *e)
{
int code;
}
static int
-my_mb_wc_gbk(const CHARSET_INFO *cs __attribute__((unused)),
+my_mb_wc_gbk(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)),
my_wc_t *pwc, const uchar *s, const uchar *e)
{
int hi;
Returns well formed length of a GBK string.
*/
static
-size_t my_well_formed_len_gbk(const CHARSET_INFO *cs __attribute__((unused)),
+size_t my_well_formed_len_gbk(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)),
const char *b, const char *e,
size_t pos, int *error)
{
-/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2000, 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
};
static
-int my_mb_wc_latin1(const CHARSET_INFO *cs __attribute__((unused)),
+int my_mb_wc_latin1(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)),
my_wc_t *wc,
const uchar *str,
- const uchar *end __attribute__((unused)))
+ const uchar *end MY_ATTRIBUTE((unused)))
{
if (str >= end)
return MY_CS_TOOSMALL;
}
static
-int my_wc_mb_latin1(const CHARSET_INFO *cs __attribute__((unused)),
+int my_wc_mb_latin1(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)),
my_wc_t wc,
uchar *str,
- uchar *end __attribute__((unused)))
+ uchar *end MY_ATTRIBUTE((unused)))
{
uchar *pl;
static int my_strnncoll_latin1_de(const CHARSET_INFO *cs
- __attribute__((unused)),
+ MY_ATTRIBUTE((unused)),
const uchar *a, size_t a_length,
const uchar *b, size_t b_length,
my_bool b_is_prefix)
static int my_strnncollsp_latin1_de(const CHARSET_INFO *cs
- __attribute__((unused)),
+ MY_ATTRIBUTE((unused)),
const uchar *a, size_t a_length,
const uchar *b, size_t b_length,
my_bool diff_if_only_endspace_difference)
}
-void my_hash_sort_latin1_de(const CHARSET_INFO *cs __attribute__((unused)),
+void my_hash_sort_latin1_de(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)),
const uchar *key, size_t len,
ulong *nr1, ulong *nr2)
{
-/* Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2002, 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
For character sets which don't change octet length in case conversion.
*/
size_t my_caseup_mb(const CHARSET_INFO *cs, char *src, size_t srclen,
- char *dst __attribute__((unused)),
- size_t dstlen __attribute__((unused)))
+ char *dst MY_ATTRIBUTE((unused)),
+ size_t dstlen MY_ATTRIBUTE((unused)))
{
register uint32 l;
register char *srcend= src + srclen;
size_t my_casedn_mb(const CHARSET_INFO *cs, char *src, size_t srclen,
- char *dst __attribute__((unused)),
- size_t dstlen __attribute__((unused)))
+ char *dst MY_ATTRIBUTE((unused)),
+ size_t dstlen MY_ATTRIBUTE((unused)))
{
register uint32 l;
register char *srcend= src + srclen;
static size_t
my_casefold_mb_varlen(const CHARSET_INFO *cs,
char *src, size_t srclen,
- char *dst, size_t dstlen __attribute__((unused)),
+ char *dst, size_t dstlen MY_ATTRIBUTE((unused)),
uchar *map,
size_t is_upper)
{
}
-size_t my_numchars_mb(const CHARSET_INFO *cs __attribute__((unused)),
+size_t my_numchars_mb(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)),
const char *pos, const char *end)
{
register size_t count= 0;
}
-size_t my_charpos_mb(const CHARSET_INFO *cs __attribute__((unused)),
+size_t my_charpos_mb(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)),
const char *pos, const char *end, size_t length)
{
const char *start= pos;
/* BINARY collations handlers for MB charsets */
int
-my_strnncoll_mb_bin(const CHARSET_INFO *cs __attribute__((unused)),
+my_strnncoll_mb_bin(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)),
const uchar *s, size_t slen,
const uchar *t, size_t tlen,
my_bool t_is_prefix)
*/
int
-my_strnncollsp_mb_bin(const CHARSET_INFO *cs __attribute__((unused)),
+my_strnncollsp_mb_bin(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)),
const uchar *a, size_t a_length,
const uchar *b, size_t b_length,
my_bool diff_if_only_endspace_difference)
int
-my_strcasecmp_mb_bin(const CHARSET_INFO *cs __attribute__((unused)),
+my_strcasecmp_mb_bin(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)),
const char *s, const char *t)
{
return strcmp(s,t);
void
-my_hash_sort_mb_bin(const CHARSET_INFO *cs __attribute__((unused)),
+my_hash_sort_mb_bin(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)),
const uchar *key, size_t len,ulong *nr1, ulong *nr2)
{
const uchar *pos = key;
-/* Copyright (c) 2002, 2011, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2002, 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
size_t my_caseup_8bit(const CHARSET_INFO *cs, char *src, size_t srclen,
- char *dst __attribute__((unused)),
- size_t dstlen __attribute__((unused)))
+ char *dst MY_ATTRIBUTE((unused)),
+ size_t dstlen MY_ATTRIBUTE((unused)))
{
char *end= src + srclen;
register uchar *map= cs->to_upper;
size_t my_casedn_8bit(const CHARSET_INFO *cs, char *src, size_t srclen,
- char *dst __attribute__((unused)),
- size_t dstlen __attribute__((unused)))
+ char *dst MY_ATTRIBUTE((unused)),
+ size_t dstlen MY_ATTRIBUTE((unused)))
{
char *end= src + srclen;
register uchar *map=cs->to_lower;
int my_mb_wc_8bit(const CHARSET_INFO *cs,my_wc_t *wc,
const uchar *str,
- const uchar *end __attribute__((unused)))
+ const uchar *end MY_ATTRIBUTE((unused)))
{
if (str >= end)
return MY_CS_TOOSMALL;
end buffer must be checked.
*/
-size_t my_snprintf_8bit(const CHARSET_INFO *cs __attribute__((unused)),
- char* to, size_t n __attribute__((unused)),
+size_t my_snprintf_8bit(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)),
+ char* to, size_t n MY_ATTRIBUTE((unused)),
const char* fmt, ...)
{
va_list args;
}
-longlong my_strntoll_8bit(const CHARSET_INFO *cs __attribute__((unused)),
+longlong my_strntoll_8bit(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)),
const char *nptr, size_t l, int base,
char **endptr,int *err)
{
*/
-double my_strntod_8bit(const CHARSET_INFO *cs __attribute__((unused)),
+double my_strntod_8bit(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)),
char *str, size_t length,
char **end, int *err)
{
Assume len >= 1
*/
-size_t my_long10_to_str_8bit(const CHARSET_INFO *cs __attribute__((unused)),
+size_t my_long10_to_str_8bit(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)),
char *dst, size_t len, int radix, long int val)
{
char buffer[66];
size_t my_longlong10_to_str_8bit(const CHARSET_INFO *cs
- __attribute__((unused)),
+ MY_ATTRIBUTE((unused)),
char *dst, size_t len, int radix,
longlong val)
{
}
-void my_fill_8bit(const CHARSET_INFO *cs __attribute__((unused)),
+void my_fill_8bit(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)),
char *s, size_t l, int fill)
{
memset(s, fill, l);
}
-size_t my_numchars_8bit(const CHARSET_INFO *cs __attribute__((unused)),
+size_t my_numchars_8bit(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)),
const char *b, const char *e)
{
return (size_t) (e - b);
}
-size_t my_numcells_8bit(const CHARSET_INFO *cs __attribute__((unused)),
+size_t my_numcells_8bit(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)),
const char *b, const char *e)
{
return (size_t) (e - b);
}
-size_t my_charpos_8bit(const CHARSET_INFO *cs __attribute__((unused)),
- const char *b __attribute__((unused)),
- const char *e __attribute__((unused)),
+size_t my_charpos_8bit(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)),
+ const char *b MY_ATTRIBUTE((unused)),
+ const char *e MY_ATTRIBUTE((unused)),
size_t pos)
{
return pos;
}
-size_t my_well_formed_len_8bit(const CHARSET_INFO *cs __attribute__((unused)),
+size_t my_well_formed_len_8bit(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)),
const char *start, const char *end,
size_t nchars, int *error)
{
}
-size_t my_lengthsp_8bit(const CHARSET_INFO *cs __attribute__((unused)),
+size_t my_lengthsp_8bit(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)),
const char *ptr, size_t length)
{
const char *end;
static my_bool
my_coll_init_simple(CHARSET_INFO *cs,
- MY_CHARSET_LOADER *loader __attribute__((unused)))
+ MY_CHARSET_LOADER *loader MY_ATTRIBUTE((unused)))
{
set_max_sort_char(cs);
return FALSE;
}
-longlong my_strtoll10_8bit(const CHARSET_INFO *cs __attribute__((unused)),
+longlong my_strtoll10_8bit(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)),
const char *nptr, char **endptr, int *error)
{
return my_strtoll10(nptr, endptr, error);
*/
ulonglong
-my_strntoull10rnd_8bit(const CHARSET_INFO *cs __attribute__((unused)),
+my_strntoull10rnd_8bit(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)),
const char *str, size_t length, int unsigned_flag,
char **endptr, int *error)
{
-my_bool my_propagate_simple(const CHARSET_INFO *cs __attribute__((unused)),
- const uchar *str __attribute__((unused)),
- size_t length __attribute__((unused)))
+my_bool my_propagate_simple(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)),
+ const uchar *str MY_ATTRIBUTE((unused)),
+ size_t length MY_ATTRIBUTE((unused)))
{
return 1;
}
-my_bool my_propagate_complex(const CHARSET_INFO *cs __attribute__((unused)),
- const uchar *str __attribute__((unused)),
- size_t length __attribute__((unused)))
+my_bool my_propagate_complex(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)),
+ const uchar *str MY_ATTRIBUTE((unused)),
+ size_t length MY_ATTRIBUTE((unused)))
{
return 0;
}
-/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2000, 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
(0x80<=(c) && (c)<=0xfc))
-static uint ismbchar_sjis(const CHARSET_INFO *cs __attribute__((unused)),
+static uint ismbchar_sjis(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)),
const char* p, const char *e)
{
return (issjishead((uchar) *p) && (e-p)>1 && issjistail((uchar)p[1]) ? 2: 0);
}
-static uint mbcharlen_sjis(const CHARSET_INFO *cs __attribute__((unused)),
+static uint mbcharlen_sjis(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)),
uint c)
{
return (issjishead((uchar) c) ? 2 : 1);
}
-static int my_strnncoll_sjis(const CHARSET_INFO *cs __attribute__((unused)),
+static int my_strnncoll_sjis(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)),
const uchar *a, size_t a_length,
const uchar *b, size_t b_length,
my_bool b_is_prefix)
}
-static int my_strnncollsp_sjis(const CHARSET_INFO *cs __attribute__((unused)),
+static int my_strnncollsp_sjis(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)),
const uchar *a, size_t a_length,
const uchar *b, size_t b_length,
my_bool diff_if_only_endspace_difference)
@retval MY_CS_ILSEQ If a wrong byte sequence was found
*/
static int
-my_mb_wc_sjis(const CHARSET_INFO *cs __attribute__((unused)),
+my_mb_wc_sjis(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)),
my_wc_t *pwc, const uchar *s, const uchar *e){
int hi;
@retval MY_CS_ILUNI If the Unicode character does not exist in SJIS
*/
static int
-my_wc_mb_sjis(const CHARSET_INFO *cs __attribute__((unused)),
+my_wc_mb_sjis(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)),
my_wc_t wc, uchar *s, uchar *e)
{
int code;
static
-size_t my_numcells_sjis(const CHARSET_INFO *cs __attribute__((unused)),
+size_t my_numcells_sjis(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)),
const char *str, const char *str_end)
{
size_t clen;
CP932 additional characters are also accepted.
*/
static
-size_t my_well_formed_len_sjis(const CHARSET_INFO *cs __attribute__((unused)),
+size_t my_well_formed_len_sjis(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)),
const char *b, const char *e,
size_t pos, int *error)
{
-/* Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2000, 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
*/
static
-int my_strnncoll_tis620(const CHARSET_INFO *cs __attribute__((unused)),
+int my_strnncoll_tis620(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)),
const uchar *s1, size_t len1,
const uchar *s2, size_t len2,
my_bool s2_is_prefix)
static
-int my_strnncollsp_tis620(const CHARSET_INFO * cs __attribute__((unused)),
+int my_strnncollsp_tis620(const CHARSET_INFO * cs MY_ATTRIBUTE((unused)),
const uchar *a0, size_t a_length,
const uchar *b0, size_t b_length,
my_bool diff_if_only_endspace_difference)
static
-int my_mb_wc_tis620(const CHARSET_INFO *cs __attribute__((unused)),
+int my_mb_wc_tis620(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)),
my_wc_t *wc,
const uchar *str,
- const uchar *end __attribute__((unused)))
+ const uchar *end MY_ATTRIBUTE((unused)))
{
if (str >= end)
return MY_CS_TOOSMALL;
}
static
-int my_wc_mb_tis620(const CHARSET_INFO *cs __attribute__((unused)),
+int my_wc_mb_tis620(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)),
my_wc_t wc,
uchar *str,
- uchar *end __attribute__((unused)))
+ uchar *end MY_ATTRIBUTE((unused)))
{
uchar *pl;
-/* Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
static size_t
-my_caseup_str_mb2_or_mb4(const CHARSET_INFO * cs __attribute__((unused)),
- char * s __attribute__((unused)))
+my_caseup_str_mb2_or_mb4(const CHARSET_INFO * cs MY_ATTRIBUTE((unused)),
+ char * s MY_ATTRIBUTE((unused)))
{
DBUG_ASSERT(0);
return 0;
static size_t
-my_casedn_str_mb2_or_mb4(const CHARSET_INFO *cs __attribute__((unused)),
- char * s __attribute__((unused)))
+my_casedn_str_mb2_or_mb4(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)),
+ char * s MY_ATTRIBUTE((unused)))
{
DBUG_ASSERT(0);
return 0;
static int
-my_strcasecmp_mb2_or_mb4(const CHARSET_INFO *cs __attribute__((unused)),
- const char *s __attribute__((unused)),
- const char *t __attribute__((unused)))
+my_strcasecmp_mb2_or_mb4(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)),
+ const char *s MY_ATTRIBUTE((unused)),
+ const char *t MY_ATTRIBUTE((unused)))
{
DBUG_ASSERT(0);
return 0;
static size_t
-my_snprintf_mb2(const CHARSET_INFO *cs __attribute__((unused)),
+my_snprintf_mb2(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)),
char* to, size_t n, const char* fmt, ...)
{
size_t retval;
static size_t
-my_lengthsp_mb2(const CHARSET_INFO *cs __attribute__((unused)),
+my_lengthsp_mb2(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)),
const char *ptr, size_t length)
{
const char *end= ptr + length;
((c & 3) << 8) + d + 0x10000)
static int
-my_utf16_uni(const CHARSET_INFO *cs __attribute__((unused)),
+my_utf16_uni(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)),
my_wc_t *pwc, const uchar *s, const uchar *e)
{
if (s + 2 > e)
static int
-my_uni_utf16(const CHARSET_INFO *cs __attribute__((unused)),
+my_uni_utf16(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)),
my_wc_t wc, uchar *s, uchar *e)
{
if (wc <= 0xFFFF)
static size_t
my_caseup_utf16(const CHARSET_INFO *cs, char *src, size_t srclen,
- char *dst __attribute__((unused)),
- size_t dstlen __attribute__((unused)))
+ char *dst MY_ATTRIBUTE((unused)),
+ size_t dstlen MY_ATTRIBUTE((unused)))
{
my_wc_t wc;
int res;
static size_t
my_casedn_utf16(const CHARSET_INFO *cs, char *src, size_t srclen,
- char *dst __attribute__((unused)),
- size_t dstlen __attribute__((unused)))
+ char *dst MY_ATTRIBUTE((unused)),
+ size_t dstlen MY_ATTRIBUTE((unused)))
{
my_wc_t wc;
int res;
static uint
-my_mbcharlen_utf16(const CHARSET_INFO *cs __attribute__((unused)),
- uint c __attribute__((unused)))
+my_mbcharlen_utf16(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)),
+ uint c MY_ATTRIBUTE((unused)))
{
DBUG_ASSERT(0);
return MY_UTF16_HIGH_HEAD(c) ? 4 : 2;
static int
-my_utf16le_uni(const CHARSET_INFO *cs __attribute__((unused)),
+my_utf16le_uni(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)),
my_wc_t *pwc, const uchar *s, const uchar *e)
{
my_wc_t lo;
static int
-my_uni_utf16le(const CHARSET_INFO *cs __attribute__((unused)),
+my_uni_utf16le(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)),
my_wc_t wc, uchar *s, uchar *e)
{
if (wc < MY_UTF16_SURROGATE_HIGH_FIRST ||
static size_t
-my_lengthsp_utf16le(const CHARSET_INFO *cs __attribute__((unused)),
+my_lengthsp_utf16le(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)),
const char *ptr, size_t length)
{
const char *end= ptr + length;
#ifdef HAVE_CHARSET_utf32
static int
-my_utf32_uni(const CHARSET_INFO *cs __attribute__((unused)),
+my_utf32_uni(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)),
my_wc_t *pwc, const uchar *s, const uchar *e)
{
if (s + 4 > e)
static int
-my_uni_utf32(const CHARSET_INFO *cs __attribute__((unused)),
+my_uni_utf32(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)),
my_wc_t wc, uchar *s, uchar *e)
{
if (s + 4 > e)
static size_t
my_caseup_utf32(const CHARSET_INFO *cs, char *src, size_t srclen,
- char *dst __attribute__((unused)),
- size_t dstlen __attribute__((unused)))
+ char *dst MY_ATTRIBUTE((unused)),
+ size_t dstlen MY_ATTRIBUTE((unused)))
{
my_wc_t wc;
int res;
static size_t
my_casedn_utf32(const CHARSET_INFO *cs, char *src, size_t srclen,
- char *dst __attribute__((unused)),
- size_t dstlen __attribute__((unused)))
+ char *dst MY_ATTRIBUTE((unused)),
+ size_t dstlen MY_ATTRIBUTE((unused)))
{
my_wc_t wc;
int res;
static size_t
-my_strnxfrmlen_utf32(const CHARSET_INFO *cs __attribute__((unused)),
+my_strnxfrmlen_utf32(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)),
size_t len)
{
return len / 2;
static uint
-my_ismbchar_utf32(const CHARSET_INFO *cs __attribute__((unused)),
- const char *b __attribute__((unused)),
- const char *e __attribute__((unused)))
+my_ismbchar_utf32(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)),
+ const char *b MY_ATTRIBUTE((unused)),
+ const char *e MY_ATTRIBUTE((unused)))
{
return 4;
}
static uint
-my_mbcharlen_utf32(const CHARSET_INFO *cs __attribute__((unused)) ,
- uint c __attribute__((unused)))
+my_mbcharlen_utf32(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)) ,
+ uint c MY_ATTRIBUTE((unused)))
{
return 4;
}
static size_t
-my_snprintf_utf32(const CHARSET_INFO *cs __attribute__((unused)),
+my_snprintf_utf32(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)),
char* to, size_t n, const char* fmt, ...)
{
size_t retval;
static longlong
-my_strtoll10_utf32(const CHARSET_INFO *cs __attribute__((unused)),
+my_strtoll10_utf32(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)),
const char *nptr, char **endptr, int *error)
{
const char *s, *end, *start, *n_end, *true_end;
static size_t
-my_numchars_utf32(const CHARSET_INFO *cs __attribute__((unused)),
+my_numchars_utf32(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)),
const char *b, const char *e)
{
return (size_t) (e - b) / 4;
static size_t
-my_charpos_utf32(const CHARSET_INFO *cs __attribute__((unused)),
+my_charpos_utf32(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)),
const char *b, const char *e, size_t pos)
{
size_t string_length= (size_t) (e - b);
static size_t
-my_well_formed_len_utf32(const CHARSET_INFO *cs __attribute__((unused)),
+my_well_formed_len_utf32(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)),
const char *b, const char *e,
size_t nchars, int *error)
{
static size_t
-my_lengthsp_utf32(const CHARSET_INFO *cs __attribute__((unused)),
+my_lengthsp_utf32(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)),
const char *ptr, size_t length)
{
const char *end= ptr + length;
static int
-my_strnncollsp_utf32_bin(const CHARSET_INFO *cs __attribute__((unused)),
+my_strnncollsp_utf32_bin(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)),
const uchar *s, size_t slen,
const uchar *t, size_t tlen,
my_bool diff_if_only_endspace_difference
- __attribute__((unused)))
+ MY_ATTRIBUTE((unused)))
{
const uchar *se, *te;
size_t minlen;
};
-static int my_ucs2_uni(const CHARSET_INFO *cs __attribute__((unused)),
+static int my_ucs2_uni(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)),
my_wc_t * pwc, const uchar *s, const uchar *e)
{
if (s+2 > e) /* Need 2 characters */
return 2;
}
-static int my_uni_ucs2(const CHARSET_INFO *cs __attribute__((unused)) ,
+static int my_uni_ucs2(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)) ,
my_wc_t wc, uchar *r, uchar *e)
{
if ( r+2 > e )
static size_t my_caseup_ucs2(const CHARSET_INFO *cs, char *src, size_t srclen,
- char *dst __attribute__((unused)),
- size_t dstlen __attribute__((unused)))
+ char *dst MY_ATTRIBUTE((unused)),
+ size_t dstlen MY_ATTRIBUTE((unused)))
{
my_wc_t wc;
int res;
static size_t my_casedn_ucs2(const CHARSET_INFO *cs, char *src, size_t srclen,
- char *dst __attribute__((unused)),
- size_t dstlen __attribute__((unused)))
+ char *dst MY_ATTRIBUTE((unused)),
+ size_t dstlen MY_ATTRIBUTE((unused)))
{
my_wc_t wc;
int res;
static void
-my_fill_ucs2(const CHARSET_INFO *cs __attribute__((unused)),
+my_fill_ucs2(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)),
char *s, size_t l, int fill)
{
DBUG_ASSERT(fill <= 0xFFFF);
> 0 a > b
*/
-static int my_strnncollsp_ucs2(const CHARSET_INFO *cs __attribute__((unused)),
+static int my_strnncollsp_ucs2(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)),
const uchar *s, size_t slen,
const uchar *t, size_t tlen,
my_bool diff_if_only_endspace_difference
- __attribute__((unused)))
+ MY_ATTRIBUTE((unused)))
{
const uchar *se, *te;
size_t minlen;
}
-static uint my_ismbchar_ucs2(const CHARSET_INFO *cs __attribute__((unused)),
- const char *b __attribute__((unused)),
- const char *e __attribute__((unused)))
+static uint my_ismbchar_ucs2(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)),
+ const char *b MY_ATTRIBUTE((unused)),
+ const char *e MY_ATTRIBUTE((unused)))
{
return 2;
}
-static uint my_mbcharlen_ucs2(const CHARSET_INFO *cs __attribute__((unused)) ,
- uint c __attribute__((unused)))
+static uint my_mbcharlen_ucs2(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)) ,
+ uint c MY_ATTRIBUTE((unused)))
{
return 2;
}
static
-size_t my_numchars_ucs2(const CHARSET_INFO *cs __attribute__((unused)),
+size_t my_numchars_ucs2(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)),
const char *b, const char *e)
{
return (size_t) (e-b)/2;
static
-size_t my_charpos_ucs2(const CHARSET_INFO *cs __attribute__((unused)),
- const char *b __attribute__((unused)),
- const char *e __attribute__((unused)),
+size_t my_charpos_ucs2(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)),
+ const char *b MY_ATTRIBUTE((unused)),
+ const char *e MY_ATTRIBUTE((unused)),
size_t pos)
{
size_t string_length= (size_t) (e - b);
static
-size_t my_well_formed_len_ucs2(const CHARSET_INFO *cs __attribute__((unused)),
+size_t my_well_formed_len_ucs2(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)),
const char *b, const char *e,
size_t nchars, int *error)
{
}
static int my_strnncollsp_ucs2_bin(const CHARSET_INFO *cs
- __attribute__((unused)),
+ MY_ATTRIBUTE((unused)),
const uchar *s, size_t slen,
const uchar *t, size_t tlen,
my_bool diff_if_only_endspace_difference
- __attribute__((unused)))
+ MY_ATTRIBUTE((unused)))
{
const uchar *se, *te;
size_t minlen;
static
-void my_hash_sort_ucs2_bin(const CHARSET_INFO *cs __attribute__((unused)),
+void my_hash_sort_ucs2_bin(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)),
const uchar *key, size_t len,ulong *nr1, ulong *nr2)
{
const uchar *pos = key;
/* Copyright (c) 2002 MySQL AB & tommy@valley.ne.jp
- Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved.
+ Copyright (c) 2002, 2016, Oracle and/or its affiliates. All rights reserved.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
#define isujis_ss3(c) (((c)&0xff) == 0x8f)
-static uint ismbchar_ujis(const CHARSET_INFO *cs __attribute__((unused)),
+static uint ismbchar_ujis(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)),
const char* p, const char *e)
{
return ((*(uchar*)(p)<0x80)? 0:\
0);
}
-static uint mbcharlen_ujis(const CHARSET_INFO *cs __attribute__((unused)),
+static uint mbcharlen_ujis(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)),
uint c)
{
return (isujis(c)? 2: isujis_ss2(c)? 2: isujis_ss3(c)? 3: 1);
*/
static
-size_t my_well_formed_len_ujis(const CHARSET_INFO *cs __attribute__((unused)),
+size_t my_well_formed_len_ujis(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)),
const char *beg, const char *end,
size_t pos, int *error)
{
static
-size_t my_numcells_eucjp(const CHARSET_INFO *cs __attribute__((unused)),
+size_t my_numcells_eucjp(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)),
const char *str, const char *str_end)
{
size_t clen;
@retval MY_CS_ILSEQ If a wrong byte sequence was found
*/
static int
-my_mb_wc_euc_jp(const CHARSET_INFO *cs __attribute__((unused)),
+my_mb_wc_euc_jp(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)),
my_wc_t *pwc, const uchar *s, const uchar *e)
{
int hi;
@retval MY_CS_ILUNI If the Unicode character does not exist in UJIS
*/
static int
-my_wc_mb_euc_jp(const CHARSET_INFO *cs __attribute__((unused)),
+my_wc_mb_euc_jp(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)),
my_wc_t wc, uchar *s, uchar *e)
{
int jp;
static size_t
my_casefold_ujis(const CHARSET_INFO *cs,
char *src, size_t srclen,
- char *dst, size_t dstlen __attribute__((unused)),
+ char *dst, size_t dstlen MY_ATTRIBUTE((unused)),
uchar *map,
size_t is_upper)
{
-/* Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
}
-static int my_utf8_uni(const CHARSET_INFO *cs __attribute__((unused)),
+static int my_utf8_uni(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)),
my_wc_t * pwc, const uchar *s, const uchar *e)
{
uchar c;
for example, for a null-terminated string
*/
static int my_utf8_uni_no_range(const CHARSET_INFO *cs
- __attribute__((unused)),
+ MY_ATTRIBUTE((unused)),
my_wc_t * pwc, const uchar *s)
{
uchar c;
}
-static int my_uni_utf8 (const CHARSET_INFO *cs __attribute__((unused)),
+static int my_uni_utf8 (const CHARSET_INFO *cs MY_ATTRIBUTE((unused)),
my_wc_t wc, uchar *r, uchar *e)
{
int count;
The same as above, but without range check.
*/
static int my_uni_utf8_no_range(const CHARSET_INFO *cs
- __attribute__((unused)),
+ MY_ATTRIBUTE((unused)),
my_wc_t wc, uchar *r)
{
int count;
static
-size_t my_strnxfrmlen_utf8(const CHARSET_INFO *cs __attribute__((unused)),
+size_t my_strnxfrmlen_utf8(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)),
size_t len)
{
return (len * 2 + 2) / 3;
static
-int my_valid_mbcharlen_utf8(const CHARSET_INFO *cs __attribute__((unused)),
+int my_valid_mbcharlen_utf8(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)),
const uchar *s, const uchar *e)
{
uchar c;
return (res>1) ? res : 0;
}
-static uint my_mbcharlen_utf8(const CHARSET_INFO *cs __attribute__((unused)),
+static uint my_mbcharlen_utf8(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)),
uint c)
{
if (c < 0x80)
#define MY_FILENAME_ESCAPE '@'
static int
-my_mb_wc_filename(const CHARSET_INFO *cs __attribute__((unused)),
+my_mb_wc_filename(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)),
my_wc_t *pwc, const uchar *s, const uchar *e)
{
int byte1, byte2;
static int
-my_wc_mb_filename(const CHARSET_INFO *cs __attribute__((unused)),
+my_wc_mb_filename(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)),
my_wc_t wc, uchar *s, uchar *e)
{
int code;
static int
-my_mb_wc_utf8mb4(const CHARSET_INFO *cs __attribute__((unused)),
+my_mb_wc_utf8mb4(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)),
my_wc_t * pwc, const uchar *s, const uchar *e)
{
uchar c;
for example, for a null-terminated string
*/
static int
-my_mb_wc_utf8mb4_no_range(const CHARSET_INFO *cs __attribute__((unused)),
+my_mb_wc_utf8mb4_no_range(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)),
my_wc_t *pwc, const uchar *s)
{
uchar c;
static int
-my_wc_mb_utf8mb4(const CHARSET_INFO *cs __attribute__((unused)),
+my_wc_mb_utf8mb4(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)),
my_wc_t wc, uchar *r, uchar *e)
{
int count;
The same as above, but without range check.
*/
static int
-my_wc_mb_utf8mb4_no_range(const CHARSET_INFO *cs __attribute__((unused)),
+my_wc_mb_utf8mb4_no_range(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)),
my_wc_t wc, uchar *r)
{
int count;
static size_t
-my_strnxfrmlen_utf8mb4(const CHARSET_INFO *cs __attribute__((unused)),
+my_strnxfrmlen_utf8mb4(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)),
size_t len)
{
/* TODO: fix when working on WL "Unicode new version" */
static int
-my_valid_mbcharlen_utf8mb4(const CHARSET_INFO *cs __attribute__((unused)),
+my_valid_mbcharlen_utf8mb4(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)),
const uchar *s, const uchar *e)
{
uchar c;
static uint
-my_mbcharlen_utf8mb4(const CHARSET_INFO *cs __attribute__((unused)), uint c)
+my_mbcharlen_utf8mb4(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)), uint c)
{
if (c < 0x80)
return 1;
-/* Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2002, 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
#define IS_END(p, src, len) (((char *)p - (char *)src) >= (len))
static int my_strnncoll_win1250ch(const CHARSET_INFO *cs
- __attribute__((unused)),
+ MY_ATTRIBUTE((unused)),
const uchar *s1, size_t len1,
const uchar *s2, size_t len2,
my_bool s2_is_prefix)
const uchar *s, size_t slen,
const uchar *t, size_t tlen,
my_bool diff_if_only_endspace_difference
- __attribute__((unused)))
+ MY_ATTRIBUTE((unused)))
{
for ( ; slen && s[slen-1] == ' ' ; slen--);
for ( ; tlen && t[tlen-1] == ' ' ; tlen--);
static size_t
-my_strnxfrm_win1250ch(const CHARSET_INFO *cs __attribute__((unused)),
+my_strnxfrm_win1250ch(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)),
uchar *dest, size_t len,
- uint nweights_arg __attribute__((unused)),
+ uint nweights_arg MY_ATTRIBUTE((unused)),
const uchar *src, size_t srclen, uint flags)
{
int value;
*/
static my_bool
-my_like_range_win1250ch(const CHARSET_INFO *cs __attribute__((unused)),
+my_like_range_win1250ch(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)),
const char *ptr, size_t ptr_length,
pbool escape, pbool w_one, pbool w_many,
size_t res_length,
+++ /dev/null
-
-You can find information about how to install on Mac OS X at
-
- http://dev.mysql.com/doc/refman/5.1/en/mac-os-x-installation.html
-
-The MySQL Reference Manual is also available in various formats on
-http://dev.mysql.com/doc.
then
# Give extra arguments to mysqld with the my.cnf file. This script
# may be overwritten at next upgrade.
- $bindir/mysqld_safe --datadir="$datadir" --pid-file="$mysqld_pid_file_path" $other_args >/dev/null 2>&1 &
+ $bindir/mysqld_safe --datadir="$datadir" --pid-file="$mysqld_pid_file_path" $other_args >/dev/null &
wait_for_pid created "$!" "$mysqld_pid_file_path"; return_value=$?
# Make lock for RedHat / SuSE
-# Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2000, 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
%global compatch mysql-5173-charset-dir.patch
%endif
-# mysql-wsrep-5.5 has libmysqlclient.so.18, as have 5.6 and 5.7;
+# mysql-wsrep-5.5 has libmysqlclient.so.18, as has 5.6;
# same as preinstalled mariadb-libs, so we currently need no libs-compat on RHEL 7.
-# This becomes relevant with a MySQL 5.8 (or higher) that has a libmysqlclient.so.19 or higher.
+# This becomes relevant with a MySQL 5.7 (or higher) that has a libmysqlclient.so.20 or higher.
#
# %%if 0%%{?rhel} == 7
# %%global compatver 5.5.45
Obsoletes: MySQL-server-advanced
%endif
Obsoletes: mysql-server < %{version}-%{release}
-Obsoletes: mysql-server-advanced
+Obsoletes: mysql-server-advanced mysql-community-server
Obsoletes: MySQL-server-classic MySQL-server-community MySQL-server-enterprise
Obsoletes: MySQL-server-advanced-gpl MySQL-server-enterprise-gpl
%if 0%{?rhel}
# RedHat has /usr/share/mysql/* in a separate package
-Obsoletes: mysql-common
+Obsoletes: mysql-common mysql-community-common
%endif
Provides: mysql-server = %{version}-%{release}
Provides: mysql-server%{?_isa} = %{version}-%{release}
%endif
Obsoletes: mysql < %{version}-%{release}
Obsoletes: mysql-advanced < %{version}-%{release}
+Obsoletes: mysql-community-client
Obsoletes: MySQL-client-classic MySQL-client-community MySQL-client-enterprise
Obsoletes: MySQL-client-advanced-gpl MySQL-client-enterprise-gpl
Provides: mysql = %{version}-%{release}
Obsoletes: MySQL-test-advanced
%endif
Obsoletes: mysql-test < %{version}-%{release}
-Obsoletes: mysql-test-advanced
+Obsoletes: mysql-test-advanced mysql-community-test
Obsoletes: MySQL-test-classic MySQL-test-community MySQL-test-enterprise
Obsoletes: MySQL-test-advanced-gpl MySQL-test-enterprise-gpl
-Obsoletes: mysql-bench
+Obsoletes: mysql-bench mysql-community-bench
Obsoletes: MySQL-bench
Provides: mysql-test = %{version}-%{release}
Provides: mysql-test%{?_isa} = %{version}-%{release}
%endif
Obsoletes: mysql-devel < %{version}-%{release}
Obsoletes: mysql-embedded-devel mysql-devel-advanced mysql-embedded-devel-advanced
+Obsoletes: mysql-community-devel
Obsoletes: MySQL-devel-classic MySQL-devel-community MySQL-devel-enterprise
Obsoletes: MySQL-devel-advanced-gpl MySQL-devel-enterprise-gpl
Provides: mysql-devel = %{version}-%{release}
Obsoletes: MySQL-shared-classic MySQL-shared-community MySQL-shared-enterprise
Obsoletes: MySQL-shared-advanced-gpl MySQL-shared-enterprise-gpl
# RHEL uses other names:
-Obsoletes: mysql-libs
+Obsoletes: mysql-libs mysql-community-libs
# Necessary on RHEL 7, no harm on other platforms:
Obsoletes: mariadb-libs
Provides: mysql-libs-compat = %{version}
Provides: mysql-libs-compat%{?_isa} = %{version}
Obsoletes: mysql-libs-compat < %{version}
+Obsoletes: mysql-community-libs-compat
Provides: MySQL-shared-compat%{?_isa} = %{version}
Obsoletes: MySQL-shared-compat < %{version}
# Directly, we replace "libs" only; but RedHat "client" and "server" need files from "libs"
Provides: mysql-libs = %{compatver}
Obsoletes: mysql-libs < %{version}
+Obsoletes: mysql-community-libs
%if 0%{?rhel} > 6
# Dealing with RHEL 7 and upwards (and compatible ...)
Obsoletes: MySQL-embedded-advanced
%endif
Obsoletes: mysql-embedded < %{version}-%{release}
-Obsoletes: mysql-embedded-advanced
+Obsoletes: mysql-embedded-advanced mysql-community-embedded
Obsoletes: MySQL-embedded-pro
Obsoletes: MySQL-embedded-classic MySQL-embedded-community MySQL-embedded-enterprise
Obsoletes: MySQL-embedded-advanced-gpl MySQL-embedded-enterprise-gpl
# merging BK trees)
##############################################################################
%changelog
+* Fri Jun 10 2016 Joerg Bruehe <joerg.bruehe@fromdual.com>
+- Add missing "obsoletes" directives to handle Oracle's yum repository.
+- Fix comment about SO version of libmysqlclient.so.
+- Modify some changelog dates to match Oracle's (reduce differences).
+
* Fri Oct 30 2015 Joerg Bruehe <joerg.bruehe@fromdual.com>
- Combine "plugins.files" and "datadir.files" into one, it seems rpmbuild 4.4
(used on SLES 11) cannot handle two "-f" directives for one "%%files" section.
not in an RPM upgrade.
This affects both the "mkdir" and the call of "mysql_install_db".
-* Thu Feb 10 2011 Joerg Bruehe <joerg.bruehe@oracle.com>
+* Wed Feb 09 2011 Joerg Bruehe <joerg.bruehe@oracle.com>
- Fix bug#56581: If an installation deviates from the default file locations
("datadir" and "pid-file"), the mechanism to detect a running server (on upgrade)
- Fix some problems with the directives around "tcmalloc" (experimental),
remove erroneous traces of the InnoDB plugin (that is 5.1 only).
-* Fri Oct 09 2009 Magnus Blaudd <mvensson@mysql.com>
+* Tue Oct 06 2009 Magnus Blaudd <mvensson@mysql.com>
- Removed mysql_fix_privilege_tables
- Set $LDFLAGS from $MYSQL_BUILD_LDFLAGS
-* Wed Mar 08 2006 Kent Boortz <kent@mysql.com>
+* Tue Mar 07 2006 Kent Boortz <kent@mysql.com>
- Changed product name from "Community Edition" to "Community Server"
- marked /etc/logrotate.d/mysql as a config file (BUG 2156)
-* Fri Dec 12 2003 Lenz Grimmer <lenz@mysql.com>
+* Sat Dec 13 2003 Lenz Grimmer <lenz@mysql.com>
- fixed file permissions (BUG 1672)
- Added separate libmysql_r directory; now both a threaded
and non-threaded library is shipped.
-* Wed Sep 29 1999 David Axmark <davida@mysql.com>
+* Tue Sep 28 1999 David Axmark <davida@mysql.com>
- Added the support-files/my-example.cnf to the docs directory.
-/* Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights
+/* Copyright (c) 2002, 2016, Oracle and/or its affiliates. All rights
* reserved.
This program is free software; you can redistribute it and/or modify
static struct my_tests_st *my_testlist= 0;
static my_bool
-get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
+get_one_option(int optid, const struct my_option *opt MY_ATTRIBUTE((unused)),
char *argument)
{
switch (optid) {
}
+/*
+ Bug#22559575: "the statement (1) has no open cursor" pops
+ sometimes with prepared+query_cache
+*/
+
+static void bug22559575_base(unsigned long type)
+{
+ MYSQL_STMT *stmt;
+ int rc;
+ const char stmt_text[] ="SELECT a FROM t22559575";
+ MYSQL_RES *prepare_meta = NULL;
+ MYSQL_BIND bind[1];
+ short data;
+ unsigned long length;
+
+ stmt = mysql_stmt_init(mysql);
+ check_stmt(stmt);
+ if (type == CURSOR_TYPE_READ_ONLY)
+ {
+ rc = mysql_stmt_attr_set(stmt, STMT_ATTR_CURSOR_TYPE, (const void*)&type);
+ check_execute(stmt, rc);
+ }
+ rc = mysql_stmt_prepare(stmt, stmt_text, strlen(stmt_text));
+ check_execute(stmt, rc);
+ prepare_meta = mysql_stmt_result_metadata(stmt);
+ DIE_UNLESS(prepare_meta != NULL);
+ rc= mysql_stmt_execute(stmt);
+ check_execute(stmt, rc);
+
+ memset(bind, 0, sizeof(bind));
+ bind[0].buffer_type= MYSQL_TYPE_SHORT;
+ bind[0].buffer= (void *)&data;
+ bind[0].length= &length;
+ rc= mysql_stmt_bind_result(stmt, bind);
+ check_execute(stmt, rc);
+
+ rc= mysql_stmt_store_result(stmt);
+ check_execute(stmt, rc);
+
+ rc= mysql_stmt_fetch(stmt);
+ check_execute(stmt, rc);
+ DIE_UNLESS(data == 1);
+
+ mysql_free_result(prepare_meta);
+ rc= mysql_stmt_close(stmt);
+ check_execute(stmt, rc);
+}
+
+static void test_bug22559575()
+{
+ int rc;
+
+ rc= mysql_query(mysql, "CREATE TABLE t22559575(a SMALLINT)");
+ myquery(rc);
+ rc= mysql_query(mysql, "INSERT INTO t22559575 VALUES (1)");
+ myquery(rc);
+
+ /* Should not cache */
+ bug22559575_base(CURSOR_TYPE_READ_ONLY);
+ bug22559575_base(CURSOR_TYPE_READ_ONLY);
+ /* Should save to cache */
+ bug22559575_base(CURSOR_TYPE_NO_CURSOR);
+ /* Should use cache */
+ bug22559575_base(CURSOR_TYPE_NO_CURSOR);
+ /* should not use cache */
+ bug22559575_base(CURSOR_TYPE_READ_ONLY);
+
+ rc= mysql_query(mysql, "DROP TABLE t22559575");
+ myquery(rc);
+}
+
static struct my_tests_st my_tests[]= {
{ "disable_query_logs", disable_query_logs },
{ "test_view_sp_list_fields", test_view_sp_list_fields },
{ "test_bug17512527", test_bug17512527},
{ "test_bug20810928", test_bug20810928 },
{ "test_bug17883203", test_bug17883203 },
+ { "test_bug22559575", test_bug22559575 },
{ 0, 0 }
};
-/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2000, 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
uint tcp_port;
#ifndef __WIN__
-void *test_thread(void *arg __attribute__((unused)))
+void *test_thread(void *arg MY_ATTRIBUTE((unused)))
#else
-unsigned __stdcall test_thread(void *arg __attribute__((unused)))
+unsigned __stdcall test_thread(void *arg MY_ATTRIBUTE((unused)))
#endif
{
MYSQL *mysql;
static my_bool
-get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
+get_one_option(int optid, const struct my_option *opt MY_ATTRIBUTE((unused)),
char *argument)
{
switch (optid) {
-# Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+# 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
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ADD_SUBDIRECTORY(gunit)
+
ADD_CUSTOM_TARGET(
test-unit
- COMMAND perl ${CMAKE_CURRENT_SOURCE_DIR}/unit.pl run .
+ COMMAND ctest
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
)
+++ /dev/null
-
-Unit tests directory structure
-------------------------------
-
-This is the current structure of the unit tests. More directories
-will be added over time.
-
-mytap Source for the MyTAP library
-mysys Tests for mysys components
- base64-t.c Unit test for base64 encoding functions
-examples Example unit tests.
- core-t.c Example of raising a signal in the middle of the test
- THIS TEST WILL STOP ALL FURTHER TESTING!
- simple-t.c Example of a standard TAP unit test
- skip-t.c Example where some test points are skipped
- skip_all-t.c Example of a test where the entire test is skipped
- todo-t.c Example where test contain test points that are TODO
- no_plan-t.c Example of a test with no plan (avoid this)
-
-
-Executing unit tests
---------------------
-
-To make and execute all unit tests in the directory:
-
- make test
-
-Observe that the tests in the examples/ directory are just various
-examples of tests and are not expected to pass.
-
-
-Adding unit tests
------------------
-
-Add a file with a name of the format "foo-t.c" to the appropriate
-directory and add the following to the Makefile.am in that directory
-(where ... denotes stuff already there):
-
- noinst_PROGRAMS = ... foo-t
-
-Note, it's important to have "-t" at the end of the filename, otherwise the
-test won't be executed by 'make test' !
-
-
-Documentation
--------------
-
-The generated documentation is temporarily placed at:
-
- http://www.kindahl.net/mytap/doc/
-
-I will move it to a better place once I figure out where and how.
-/* Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2011, 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
push_errtext(); \
for (int method_i= 0, combination_i= 0; method_i < MAX_METHOD; method_i++) { \
for (int sid_map_i= 0; sid_map_i < MAX_SID_MAP; sid_map_i++, combination_i++) { \
- Gtid_set >id_set __attribute__((unused))= \
+ Gtid_set >id_set MY_ATTRIBUTE((unused))= \
containers[combination_i]->gtid_set; \
- Sid_map *&sid_map __attribute__((unused))= \
+ Sid_map *&sid_map MY_ATTRIBUTE((unused))= \
sid_maps[sid_map_i]; \
append_errtext(__LINE__, \
"sid_map_i=%d method_i=%d combination_i=%d", \
for (int end_i= 0; end_i < MAX_END; end_i++) { \
for (int empty_i= 0; empty_i < MAX_EMPTY; empty_i++) { \
for (int anon_i= 0; anon_i < MAX_ANON; anon_i++, combination_i++) { \
- Gtid_set >id_set __attribute__((unused))= \
+ Gtid_set >id_set MY_ATTRIBUTE((unused))= \
containers[combination_i]->gtid_set; \
- Group_cache &stmt_cache __attribute__((unused))= \
+ Group_cache &stmt_cache MY_ATTRIBUTE((unused))= \
containers[combination_i]->stmt_cache; \
- Group_cache &trx_cache __attribute__((unused))= \
+ Group_cache &trx_cache MY_ATTRIBUTE((unused))= \
containers[combination_i]->trx_cache; \
- Group_log_state &group_log_state __attribute__((unused))= \
+ Group_log_state &group_log_state MY_ATTRIBUTE((unused))= \
containers[combination_i]->group_log_state; \
append_errtext(__LINE__, \
"type_i=%d end_i=%d empty_i=%d " \
-# Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2012, 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
ADD_EXECUTABLE(yassl-t yassl-t.cc)
TARGET_LINK_LIBRARIES(yassl-t gunit_small sqlgunitlib strings dbug regex)
TARGET_LINK_LIBRARIES(yassl-t ${LIBSOCKET})
+ADD_TEST(yassl yassl-t)
-/* Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2006, 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
*/
void ok(int const pass, char const *fmt, ...)
- __attribute__((format(printf,2,3)));
+ MY_ATTRIBUTE((format(printf,2,3)));
/**
*/
void skip(int how_many, char const *reason, ...)
- __attribute__((format(printf,2,3)));
+ MY_ATTRIBUTE((format(printf,2,3)));
/**
*/
void diag(char const *fmt, ...)
- __attribute__((format(printf,1,2)));
+ MY_ATTRIBUTE((format(printf,1,2)));
/**
*/
void BAIL_OUT(char const *fmt, ...)
- __attribute__((noreturn, format(printf,1,2)));
+ MY_ATTRIBUTE((noreturn, format(printf,1,2)));
/**
*/
void skip_all(char const *reason, ...)
- __attribute__((noreturn, format(printf, 1, 2)));
+ MY_ATTRIBUTE((noreturn, format(printf, 1, 2)));
/**
*/
void todo_start(char const *message, ...)
- __attribute__((format(printf, 1, 2)));
+ MY_ATTRIBUTE((format(printf, 1, 2)));
/**
+++ /dev/null
-#!/usr/bin/perl
-# Copyright (c) 2006, 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
-
-use File::Find;
-use Getopt::Long;
-
-use strict;
-
-sub run_cmd (@);
-
-my %dispatch = (
- "run" => \&run_cmd,
-);
-
-=head1 NAME
-
-unit - Run unit tests in directory
-
-=head1 SYNOPSIS
-
- unit [--[no]big] [--[no]verbose] run [tests to run]
-
-=cut
-
-my $big= $ENV{'MYTAP_CONFIG'} eq 'big';
-
-my $opt_verbose;
-my $result = GetOptions (
- "big!" => \$big,
- "verbose!" => \$opt_verbose,
-);
-
-$ENV{'MYTAP_CONFIG'} = $big ? 'big' : '';
-
-my $cmd = shift;
-
-if (defined $cmd && exists $dispatch{$cmd}) {
- $dispatch{$cmd}->(@ARGV);
-} else {
- print "Unknown command", (defined $cmd ? " $cmd" : ""), ".\n";
- print "Available commands are: ", join(", ", keys %dispatch), "\n";
-}
-
-=head2 run
-
-Run all unit tests in the current directory and all subdirectories.
-
-=cut
-
-BEGIN {
- # Test::Harness have been extensively rewritten in newer perl
- # versions and is now just a backward compatibility wrapper
- # (with a bug causing the HARNESS_PERL_SWITCHES to be mangled)
- # Prefer to use TAP::Harness directly if available
- if (eval "use TAP::Harness; 1") {
- eval 'sub NEW_HARNESS { 1 }';
- warn "using TAP::Harness";
- } else {
- eval "use Test::Harness; 1" or die "couldn't find Test::Harness!";
- eval 'sub NEW_HARNESS { 0 }';
- }
-}
-
-sub _find_test_files (@) {
- my @dirs = @_;
- my @files;
- find sub {
- $File::Find::prune = 1 if /^SCCS$/;
- $File::Find::prune = 1 if /^.libs$/;
- push(@files, $File::Find::name) if -x _ && (/-t\z/ || /-t\.exe\z/);
- }, @dirs;
- return @files;
-}
-
-sub run_cmd (@) {
- my @files;
-
- # If no directories were supplied, we add all directories in the
- # current directory except 'mytap' since it is not part of the
- # test suite.
- if (@_ == 0) {
- # Ignore these directories
- my @ignore = qw(mytap SCCS);
-
- # Build an expression from the directories above that tests if a
- # directory should be included in the list or not.
- my $ignore = join(' && ', map { '$_ ne ' . "'$_'"} @ignore);
-
- # Open and read the directory. Filter out all files, hidden
- # directories, and directories named above.
- opendir(DIR, ".") or die "Cannot open '.': $!\n";
- @_ = grep { -d $_ && $_ !~ /^\..*/ && eval $ignore } readdir(DIR);
- closedir(DIR);
- }
-
- print "Running tests: @_\n";
-
- foreach my $name (@_) {
- push(@files, _find_test_files $name) if -d $name;
- push(@files, $name) if -f $name;
- }
-
- if (@files > 0) {
- # Removing the first './' from the file names
- foreach (@files) { s!^\./!! }
-
- if (NEW_HARNESS())
- {
- my %args = ( exec => [ ], verbosity => $opt_verbose );
- my $harness = TAP::Harness->new( \%args );
- my $aggreg= $harness->runtests(@files);
- # Signal failure to calling scripts
- exit(1) if $aggreg->get_status() ne 'PASS';
- }
- else
- {
- $ENV{'HARNESS_VERBOSE'} = $opt_verbose;
- $ENV{'HARNESS_PERL_SWITCHES'} .= ' -e "exec @ARGV"';
- runtests(@files);
- }
- }
-}
-
-/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2000, 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
}
int
-main( int argc __attribute__((unused)),
+main( int argc MY_ATTRIBUTE((unused)),
char** argv)
{
char client_key[] = "../SSL/client-key.pem", client_cert[] = "../SSL/client-cert.pem";
-/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2000, 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
}
int
-main(int argc __attribute__((unused)), char** argv)
+main(int argc MY_ATTRIBUTE((unused)), char** argv)
{
char server_key[] = "../SSL/server-key.pem",
server_cert[] = "../SSL/server-cert.pem";
-/* Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2000, 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
@retval 1 The requested I/O event has occurred.
*/
-static int no_io_wait(Vio *vio __attribute__((unused)),
- enum enum_vio_io_event event __attribute__((unused)),
- int timeout __attribute__((unused)))
+static int no_io_wait(Vio *vio MY_ATTRIBUTE((unused)),
+ enum enum_vio_io_event event MY_ATTRIBUTE((unused)),
+ int timeout MY_ATTRIBUTE((unused)))
{
return 1;
}
#endif
-static my_bool has_no_data(Vio *vio __attribute__((unused)))
+static my_bool has_no_data(Vio *vio MY_ATTRIBUTE((unused)))
{
return FALSE;
}
*/
my_bool vio_reset(Vio* vio, enum enum_vio_type type,
- my_socket sd, void *ssl __attribute__((unused)), uint flags)
+ my_socket sd, void *ssl MY_ATTRIBUTE((unused)), uint flags)
{
int ret= FALSE;
Vio new_vio;
/*
- Copyright (c) 2001, 2015, Oracle and/or its affiliates. All rights reserved.
+ Copyright (c) 2001, 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
# include <sys/filio.h>
#endif
-int vio_errno(Vio *vio __attribute__((unused)))
+int vio_errno(Vio *vio MY_ATTRIBUTE((unused)))
{
/* These transport types are not Winsock based. */
#ifdef _WIN32
int vio_socket_timeout(Vio *vio,
- uint which __attribute__((unused)),
- my_bool old_mode __attribute__((unused)))
+ uint which MY_ATTRIBUTE((unused)),
+ my_bool old_mode MY_ATTRIBUTE((unused)))
{
int ret= 0;
DBUG_ENTER("vio_socket_timeout");
}
-int vio_fastsend(Vio * vio __attribute__((unused)))
+int vio_fastsend(Vio * vio MY_ATTRIBUTE((unused)))
{
int r=0;
DBUG_ENTER("vio_fastsend");
int vio_io_wait(Vio *vio, enum enum_vio_io_event event, int timeout)
{
int ret;
- short revents __attribute__((unused)) = 0;
+ short revents MY_ATTRIBUTE((unused)) = 0;
struct pollfd pfd;
my_socket sd= mysql_socket_getfd(vio->mysql_socket);
MYSQL_SOCKET_WAIT_VARIABLES(locker, state) /* no ';' */
-/* Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2000, 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
}
/* Load certs from the trusted ca */
- if (SSL_CTX_load_verify_locations(ssl_fd->ssl_context, ca_file, ca_path) == 0)
+ if (SSL_CTX_load_verify_locations(ssl_fd->ssl_context, ca_file, ca_path) <= 0)
{
DBUG_PRINT("warning", ("SSL_CTX_load_verify_locations failed"));
if (ca_file || ca_path)
static char* dummy_options_get (wsrep_t* w)
{
WSREP_DBUG_ENTER(w);
- return WSREP_DUMMY(w)->options;
+ return strdup(WSREP_DUMMY(w)->options);
}
static wsrep_status_t dummy_connect(
* Library loader
**************************************************************************/
+static int wsrep_check_iface_version(const char* found, const char* iface_ver)
+{
+ const size_t msg_len = 128;
+ char msg[128];
+
+ if (strcmp(found, iface_ver)) {
+ snprintf (msg, msg_len,
+ "provider interface version mismatch: need '%s', found '%s'",
+ iface_ver, found);
+ logger (WSREP_LOG_ERROR, msg);
+ return EINVAL;
+ }
+
+ return 0;
+}
+
static int verify(const wsrep_t *wh, const char *iface_ver)
{
const size_t msg_len = 128;
VERIFY(wh);
VERIFY(wh->version);
- if (strcmp(wh->version, iface_ver)) {
- snprintf (msg, msg_len,
- "provider interface version mismatch: need '%s', found '%s'",
- iface_ver, wh->version);
- logger (WSREP_LOG_ERROR, msg);
+ if (wsrep_check_iface_version(wh->version, iface_ver))
return EINVAL;
- }
VERIFY(wh->init);
VERIFY(wh->options_set);
return alias.dlfun;
}
+static int wsrep_check_version_symbol(void *dlh)
+{
+ char** dlversion = NULL;
+ dlversion = (char**) dlsym(dlh, "wsrep_interface_version");
+ if (dlversion == NULL)
+ return 0;
+ return wsrep_check_iface_version(*dlversion, WSREP_INTERFACE_VERSION);
+}
+
extern int wsrep_dummy_loader(wsrep_t *w);
int wsrep_load(const char *spec, wsrep_t **hptr, wsrep_log_cb_t log_cb)
goto out;
}
+ if (wsrep_check_version_symbol(dlh) != 0) {
+ ret = EINVAL;
+ goto out;
+ }
+
if ((ret = (*dlfun)(*hptr)) != 0) {
snprintf(msg, msg_len, "wsrep_load(): loader failed: %s",
strerror(ret));